use of org.eclipse.e4.ui.di.UIEventTopic in project ACS by ACS-Community.
the class MyStatusBar method getNotified.
@Inject
@Optional
private void getNotified(@UIEventTopic(STATUS_BAR_TOPIC_ID) MessageWithTime msgWithTime) {
if (slm != null) {
String flashMsg = msgWithTime.msg;
int timeSeconds = msgWithTime.timeSeconds;
slm.setMessage(flashMsg);
// TODO fix truncation of larger strings, e.g.
// slm.getControl().pack(true); ??
clearFlashJob();
msgRestoreJob = new Job(MyStatusBar.class.getSimpleName() + "RemoveFlashMessage") {
@Override
protected IStatus run(IProgressMonitor monitor) {
// restore the previous message
uiSync.syncExec(new Runnable() {
@Override
public void run() {
slm.setMessage(permanentMessage);
}
});
return Status.OK_STATUS;
}
};
msgRestoreJob.schedule(timeSeconds * 1000);
}
}
use of org.eclipse.e4.ui.di.UIEventTopic in project AGREE by loonwerks.
the class VariablesView method beforeCreateStepArguments.
@Inject
@Optional
void beforeCreateStepArguments(@UIEventTopic(SimulatorUIEvents.BEFORE_STEP_FORWARD) final BeforeStepForwardEvent event) {
// Take the focus away from cell editors widgets
if (treeViewer != null) {
final Control focusControl = Display.getCurrent().getFocusControl();
final Tree tree = treeViewer.getTree();
for (Control c = focusControl; c != null; c = c.getParent()) {
if (c == tree) {
treeViewer.getTree().forceFocus();
break;
}
}
}
// Cancel the step
if (elementToConstraintErrorMap.size() > 0) {
event.cancelStep(new Throwable("One or more user constraints is invalid."));
}
}
use of org.eclipse.e4.ui.di.UIEventTopic in project portfolio by buchen.
the class ThemeAddon method onThemeChanged.
@Inject
@Optional
public void onThemeChanged(@UIEventTopic(IThemeEngine.Events.THEME_CHANGED) Event event) {
IThemeEngine engine = (IThemeEngine) event.getProperty(IThemeEngine.Events.THEME_ENGINE);
engine.applyStyles(Colors.theme(), false);
}
use of org.eclipse.e4.ui.di.UIEventTopic in project portfolio by buchen.
the class CopyMenuToNewWindowAddon method onEvent.
@Inject
@Optional
public void onEvent(@UIEventTopic(UIEvents.Window.TOPIC_ALL) Event event) {
if (UIEvents.isADD(event)) {
MTrimmedWindow origin = (MTrimmedWindow) event.getProperty(EventTags.ELEMENT);
MTrimmedWindow window = (MTrimmedWindow) event.getProperty(EventTags.NEW_VALUE);
MMenu mainMenu = (MMenu) EcoreUtil.copy((EObject) origin.getMainMenu());
mainMenu.setVisible(true);
window.setMainMenu(mainMenu);
}
}
use of org.eclipse.e4.ui.di.UIEventTopic in project aero.minova.rcp by minova-afis.
the class WFCIndexPart method load.
/**
* Diese Methode ließt die Index-Spalten aus und erstellet daraus eine Table, diese wird dann an den CAS als Anfrage übergeben.
*/
@Inject
@Optional
public void load(@UIEventTopic(Constants.BROKER_LOADINDEXTABLE) Table resultTable) {
MPerspective activePerspective = modelService.getActivePerspective(context.get(MWindow.class));
if (!activePerspective.equals(mPerspective)) {
return;
}
// clear the group by summary cache so the new summary calculation gets triggered
bodyLayerStack.getBodyDataLayer().clearCache();
// Daten in Nattable schreiben. Wenn Page != 1 werden die Zeilen nur angehängt
updateData(resultTable.getRows(), resultTable.getMetaData().getPage() != 1);
if (resultTable.getRows().isEmpty()) {
MessageDialog.openInformation(Display.getDefault().getActiveShell(), translationService.translate("@Information", null), translationService.translate("@msg.NoRecordsLoaded", null));
}
}
Aggregations