Firstly, adding a status bar to application.e4xmi (application> Windows and dialogs> cropped window> TrimBars> WindowTrim (bottom)> toolbar> tool management)
Create a .java class and specify the address in the toolbar (uri class).
e4 the implementation of the status bar is different from the implementation of e3. In e4, you can use eventbroker to send text (info) to the status bar.
@Inject private IEventBroker eventBroker; private static final String STATUSBAR ="statusbar"; @Inject @Optional public void getEvent(@UIEventTopic(STATUSBAR) String message) { updateInterface(message); } @PostConstruct public void createControls(Composite parent) { .... \\ swt definitions eg label } public void updateInterface(String message) { try{ Display.getDefault().asyncExec(new Runnable() { @Override public void run() { try{ label.setText(message); } catch(Exception exc){ System.out.println(exc); } } }); } catch(Exception exception){ System.out.println(exception); } }
Also, be sure to add eventbrokersender to another java class.
@Inject private IEventBroker eventBroker; private static final String STATUSBAR ="statusbar"; eventBroker.send(STATUSBAR, "status bar test message..");
OSezer
source share