本文整理匯總了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();
}
});
}