本文整理汇总了Java中org.eclipse.e4.ui.di.UISynchronize.syncExec方法的典型用法代码示例。如果您正苦于以下问题:Java UISynchronize.syncExec方法的具体用法?Java UISynchronize.syncExec怎么用?Java UISynchronize.syncExec使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.e4.ui.di.UISynchronize
的用法示例。
在下文中一共展示了UISynchronize.syncExec方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
/**
* Static method that opens a new dialog or switches the existing dialog to
* another block id. The dialog shows back and forward buttons to navigate
* between accounts inspected.
*
* @param blockId
* @return
*/
public static void show(final Long blockId, final INxtService nxt,
final IStylingEngine engine, final IUserService userService,
final UISynchronize sync, final IContactsService contactsService) {
sync.syncExec(new Runnable() {
@Override
public void run() {
Shell shell = Display.getCurrent().getActiveShell();
if (shell != null) {
while (shell.getParent() != null) {
shell = shell.getParent().getShell();
}
}
if (INSTANCE == null) {
INSTANCE = new InspectBlockDialog(shell, blockId, nxt, engine,
userService, sync, contactsService);
INSTANCE.history.add(blockId);
INSTANCE.historyCursor = 0;
INSTANCE.open();
}
else {
INSTANCE.history.add(blockId);
INSTANCE.historyCursor = INSTANCE.history.size() - 1;
INSTANCE.setBlockId(blockId);
INSTANCE.getShell().forceActive();
}
}
});
}
示例2: show
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
/**
* Static method that opens a new dialog or switches the existing dialog to
* another account id. The dialog shows back and forward buttons to navigate
* between accounts inspected.
*
* @param accountId
* @return
*/
public static void show(final Long accountId, final INxtService nxt,
final IStylingEngine engine, final IUserService userService,
final UISynchronize sync, final IContactsService contactsService) {
sync.syncExec(new Runnable() {
@Override
public void run() {
Shell shell = Display.getCurrent().getActiveShell();
if (shell != null) {
while (shell.getParent() != null) {
shell = shell.getParent().getShell();
}
}
if (INSTANCE == null) {
INSTANCE = new InspectAccountDialog(shell, accountId, nxt, engine,
userService, sync, contactsService);
INSTANCE.history.add(accountId);
INSTANCE.historyCursor = 0;
INSTANCE.open();
}
else {
INSTANCE.history.add(accountId);
INSTANCE.historyCursor = INSTANCE.history.size() - 1;
INSTANCE.setAccountId(accountId);
INSTANCE.getShell().forceActive();
}
}
});
}
示例3: show
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
/**
* Static method that opens a new dialog or switches the existing dialog to
* another account id. The dialog shows back and forward buttons to navigate
* between accounts inspected.
*
* @param transactionId
* @return
*/
public static void show(final Long transactionId, final INxtService nxt,
final IStylingEngine engine, final IUserService userService,
final UISynchronize sync, final IContactsService contactsService) {
sync.syncExec(new Runnable() {
@Override
public void run() {
Shell shell = Display.getCurrent().getActiveShell();
if (shell != null) {
while (shell.getParent() != null) {
shell = shell.getParent().getShell();
}
}
if (INSTANCE == null) {
INSTANCE = new InspectTransactionDialog(shell, transactionId, nxt,
engine, userService, sync, contactsService);
INSTANCE.history.add(transactionId);
INSTANCE.historyCursor = 0;
INSTANCE.open();
}
else {
INSTANCE.history.add(transactionId);
INSTANCE.historyCursor = INSTANCE.history.size() - 1;
INSTANCE.setTransactionId(transactionId);
INSTANCE.getShell().forceActive();
}
}
});
}
示例4: showMessage
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
private void showMessage(UISynchronize sync, final String message) {
// as the provision needs to be executed in a background thread
// we need to ensure that the message dialog is executed in
// the UI thread
sync.syncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openInformation(null, RelationsMessages.getString("UpdateHandler.feedback.title.info"), message); //$NON-NLS-1$
}
});
}
示例5: showError
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
private void showError(UISynchronize sync, final String message) {
// as the provision needs to be executed in a background thread
// we need to ensure that the message dialog is executed in
// the UI thread
sync.syncExec(new Runnable() {
@Override
public void run() {
MessageDialog.openError(null, RelationsMessages.getString("UpdateHandler.feedback.title.err"), message); //$NON-NLS-1$
}
});
}
示例6: initialize
import org.eclipse.e4.ui.di.UISynchronize; //导入方法依赖的package包/类
@Override
public void initialize(IEventBroker _broker, final UISynchronize sync) {
this.broker = _broker;
logger.info("Initialize START");
listeners = new NXTListeners(broker, this);
H2ListenerHelper.getInstance().initialize(broker);
initializing = true;
/* Start the initialization process */
broker.post(INxtService.TOPIC_INITIALIZATION_START, 1);
/* The first block scanned signals reading of database is complete */
broker.subscribe(INxtService.TOPIC_BLOCK_SCANNED, new EventHandler() {
@Override
public void handleEvent(Event event) {
broker.unsubscribe(this);
setScanning(true);
broker.post(INxtService.TOPIC_BLOCK_SCANNER_START, 1);
}
});
logger.info("NXT init START");
try {
/* Read the database file AND iterate over all records in database */
Nxt.init(Config.properties);
}
catch (final Throwable t) {
sync.syncExec(new Runnable() {
@Override
public void run() {
MessageDialog
.openError(
Display.getDefault().getActiveShell(),
"NXT initialization Error",
"A fatal error occured initializing NXT.\n"
+ "If this keeps occuring consider to delete NXT database folder.\n\n"
+ t.toString());
}
});
System.exit(-1);
return;
}
logger.info("NXT init END");
broker.post(INxtService.TOPIC_BLOCK_SCANNER_FINISHED, getBlockCount());
broker.post(INxtService.TOPIC_INITIALIZATION_FINISHED, 1);
setScanning(false);
initializing = false;
logger.info("Initialization COMPLETE");
/* Nxt initialized and ready turn on forging for all accounts */
sync.asyncExec(new Runnable() {
@Override
public void run() {
for (IAccount account : unlockedAccounts) {
account.startForging();
}
}
});
}