本文整理汇总了Java中it.albertus.jface.DisplayThreadExecutor类的典型用法代码示例。如果您正苦于以下问题:Java DisplayThreadExecutor类的具体用法?Java DisplayThreadExecutor怎么用?Java DisplayThreadExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DisplayThreadExecutor类属于it.albertus.jface包,在下文中一共展示了DisplayThreadExecutor类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: print
import it.albertus.jface.DisplayThreadExecutor; //导入依赖的package包/类
protected void print(final String value) {
// Dealing with null argument...
final String toPrint;
if (value == null) {
toPrint = String.valueOf(value);
}
else {
toPrint = value;
}
final int capacity = getLimit();
// Actual print... (async avoids deadlocks)
new DisplayThreadExecutor(scrollable, true) {
@Override
protected void onError(final Exception exception) {
failSafePrint(toPrint);
}
}.execute(new Runnable() {
@Override
public void run() {
doPrint(toPrint, capacity);
}
});
}
示例2: restart
import it.albertus.jface.DisplayThreadExecutor; //导入依赖的package包/类
@Override
public void restart() {
disconnect(true);
new Thread(new Runnable() {
@Override
public void run() {
try {
httpServer.stop();
scheduleShutdown(-1);
joinPollingThread();
configuration.reload();
mqttClient.disconnect();
setIteration(FIRST_ITERATION);
new DisplayThreadExecutor(shell).execute(new Runnable() {
@Override
public void run() {
if (!logger.isLoggable(Level.FINE)) {
console.clear();
}
dataTable.reset();
beforeConnect();
connect();
}
});
}
catch (final Exception e) {
logger.log(Level.SEVERE, e.toString(), e);
}
}
}, "resetThread").start();
}
示例3: close
import it.albertus.jface.DisplayThreadExecutor; //导入依赖的package包/类
@Override
public void close() {
new DisplayThreadExecutor(shell).execute(new Runnable() {
@Override
public void run() {
shell.dispose();
}
});
}