在开发eclipse rcp应用程序时,我需要在更改代码后重新启动应用程序.
我的问题显然应该是:
我如何在RCP applition开发中使用JRebel,所以我不需要一次又一次地重启我的整个大型应用程序?
码:
Job job = new Job("Connect to Database") {
@Override
protected IStatus run(IProgressMonitor monitor) {
// ????????????????DB2??????????????
monitor.beginTask("??????????? ...", 100);
try {
Thread.sleep(3000);
database = new Database(cp.getName(), cp.getConnection());
} catch (Exception e) {
e.printStackTrace();
IStatus sqlErrorStatus = new Status(IStatus.ERROR, "amarsoft.dbmp", e.getMessage(), null);
StatusManager.getManager().handle(sqlErrorStatus, StatusManager.SHOW);
}
monitor.done();
return Status.OK_STATUS;
}
};
Run Code Online (Sandbox Code Playgroud)

当用户单击"详细信息"按钮时,如何使其显示异常的堆栈跟踪?
这是我的代码:
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
try {
Event e1 = new Event();
e1.type = EVT_CONNECTING;
for (Listener listener : listeners) {
listener.handleEvent(e1);
}
database = new Database(cp.getName(), cp.getConnection());
Event e2 = new Event();
e2.type = EVT_CONNECT_SUCCESS;
for (Listener listener : listeners) {
listener.handleEvent(e2);
}
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
Event e = new Event();
e.text = ex.getMessage();
e.type = EVT_CONNECT_FAILD;
for (Listener listener : listeners) {
listener.handleEvent(e);
}
}
}
});
Run Code Online (Sandbox Code Playgroud)
在上面的代码中,我尝试连接到数据库.有时这需要很长时间才能给出响应(例如网络连接超时),但是当Runnable开始运行时,用户界面会丢失响应.为什么?
我需要在运行时生成类,每个类都映射到一个数据库表.这样的类是ORM中使用的模型类.
当客户端指定要使用的数据库表时,我的应用程序检查是否存在相应的模型类,如果它不存在,则生成它并加载它以供使用并保存,所以下次我们不需要再次生成这个类
我的问题是:
一些示例代码说明如何生成简单的POJO类是受欢迎的!
最好的祝福!
可能重复:
字符串对象和字符串文字之间的差异
初始化String对象时,至少有两种方法,例如:
String s = "some string";
String s = new String("some string");
Run Code Online (Sandbox Code Playgroud)
有什么不同?
我的代码:
private AtomicBoolean fetched1 = new AtomicBoolean(false);
private int rowCount;
public int getRowCount() {
data.getRealm().exec(new Runnable(){
@Override
public void run() {
rowCount = data.size();
fetched1.set(true);
}
});
while(!fetched1.get()){
}
fetched1.set(false);
return rowCount;
}
Run Code Online (Sandbox Code Playgroud)
它现在似乎对我有用,但我不熟悉线程(它总是让我困惑),我应该像上面的代码那样做吗?
我使用HTML5画布绘制心形:
<!DOCTYPE HTML>
<html>
<head>
<style>
body {
margin: 0px;
padding: 0px;
}
</style>
</head>
<body>
<canvas id="myCanvas" width="1366" height="600"></canvas>
<script>
var heart = [
[707,359],[707,359],[707,359],[707,359],[708,358],[711,354],[713,352],[714,348],[716,345],[720,335],
[721,334],[722,333],[724,332],[725,330],[727,327],[731,322],[734,320],[737,318],[740,314],[743,312],
[745,311],[749,309],[753,308],[757,306],[761,303],[764,302],[767,302],[771,301],[774,301],[778,301],
[783,301],[786,301],[790,300],[796,300],[801,300],[805,300],[809,300],[811,300],[815,302],[817,303],
[820,305],[822,306],[824,307],[827,309],[830,311],[834,313],[836,314],[838,316],[841,318],[844,321],
[845,324],[847,326],[849,328],[852,332],[853,334],[855,336],[857,337],[858,339],[860,341],[862,345],
[863,349],[863,352],[864,356],[864,359],[865,362],[866,364],[868,368],[869,372],[870,377],[871,381],
[872,384],[872,388],[872,392],[872,395],[872,399],[872,401],[872,405],[872,409],[871,412],[870,417],
[869,419],[869,422],[867,427],[866,429],[865,434],[863,438],[862,442],[861,443],[860,445],[857,448],
[854,451],[852,454],[849,456],[846,459],[843,460],[836,466],[835,466],[833,467],[821,475],[820,477],
[819,478],[817,481],[815,483],[811,486],[808,487],[803,491],[802,491],[800,492],[795,493],[791,497],
[789,498],[786,498],[780,502],[772,507],[770,510],[767,511],[762,516],[758,520],[756,524],[753,527],
[750,529],[746,532],[741,534],[736,537],[732,538],[731,539],[735,537],[735,537],[735,537],[730,543],
[729,546],[727,551],[726,553],[723,555],[721,558],[715,568],[714,570],[714,572],[713,575],[708,585],
[708,586],[707,586],[704,583],[704,359],[704,359],[700,356],[698,352],[697,350],[696,345],[694,343],
[693,340],[690,335],[688,335],[687,334],[683,332],[681,329],[677,326],[675,323],[672,319],[669,314],
[668,312],[663,310],[660,310],[656,310],[653,309],[647,309],[644,308],[642,308],[637,307],[632,303],
[628,301],[624,297],[621,297],[619,297],[616,297],[616,298],[616,299],[614,300],[620,302],[620,302],
[620,302],[618,302],[612,302],[605,302],[598,302],[596,303],[594,305],[592,307],[590,309],[586,310],
[583,313],[582,315],[579,319],[576,320],[573,323],[571,325],[569,327],[563,329],[560,333],[558,336],
[557,338],[556,341],[555,343],[551,346],[549,349],[549,354],[549,357],[547,361],[546,367],[543,372],
[542,375],[541,380],[540,381],[540,382],[540,382],[540,382],[540,382],[540,384],[540,386],[540,389],
[539,391],[539,394],[539,398],[539,404],[539,408],[539,412],[539,416],[540,423],[542,428],[544,433],
[549,436],[552,439],[555,442],[557,445],[560,448],[562,452],[564,459],[565,461],[560,449],[560,449],
[561,450],[571,458],[580,466],[584,469],[587,473],[589,476],[591,477],[575,466],[575,466],[575,466],
[576,466],[582,471],[587,475],[590,477],[594,481],[598,484],[601,489],[604,491],[607,495],[611,496],
[617,498],[622,500],[626,501],[629,504],[633,508],[636,510],[642,515],[650,522],[651,525],[655,528],
[657,529],[660,530],[663,530],[667,533],[671,534],[676,536],[679,537],[681,539],[683,540],[676,536],
[676,536],[676,536],[679,539],[684,546],[687,548],[689,551],[692,554],[696,558],[698,563],[701,567],
[702,571],[704,574],[705,577],[706,579],[707,580],[708,582],[709,586]
];
var canvas = document.getElementById('myCanvas');
var context = canvas.getContext('2d');
context.beginPath();
context.moveTo(707, 359);
for(var i = 1; i < (heart.length - 1) ; i++){
context.lineTo(heart[i][0], heart[i][1]) …Run Code Online (Sandbox Code Playgroud) 我正在使用FileZilla FTP Server Windows版.我写了一个java程序来连接我的FTP服务器,并通过socket将FTP原始命令发送到服务器.当我发送"LIST"时,我收到503错误:
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> Connected, sending welcome message...
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220-FileZilla Server version 0.9.37 beta
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> USER ggfan
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> 331 Password required for ggfan
(000002)2011/6/1 10:46:56 - (not logged in) (127.0.0.1)> PASS ***** …Run Code Online (Sandbox Code Playgroud) 我使用JFace TableViewer和数据绑定来显示数据库表的数据,有些列有很长的文本,我发现文本被剪掉了.如果我激活与该单元格关联的文本编辑器,我可以看到全文.
swt表是否限制单元格中的文本长度?或OS有这样的限制?(我使用的是eclipse 3.6和windows 7 32位)
/*******************************************************************************
* Copyright (c) 2006 Tom Schindl and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Tom Schindl - initial API and implementation
*******************************************************************************/
package org.eclipse.jface.snippets.viewers;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
/**
* A …Run Code Online (Sandbox Code Playgroud) 模型类有一个属性可见,它的字符串可以有两个值"1"表示是,"0"表示不,我怎么能将它绑定到一个复选框?
java ×5
eclipse-rcp ×4
jface ×2
swt ×2
canvas ×1
data-binding ×1
eclipse ×1
ftp ×1
html5-canvas ×1
javascript ×1
jrebel ×1