List of usage examples for org.eclipse.jface.action IStatusLineManager removeAll
void removeAll();
From source file:org.eclipse.dirigible.ide.common.status.StatusLineManagerUtil.java
License:Open Source License
public static void clearMessages() { UIJob job = new UIJob(CLEAR_MESSAGES_JOB) { @Override/*from ww w . j ava2 s . co m*/ public IStatus runInUIThread(IProgressMonitor monitor) { final IStatusLineManager statusLineManager = getDefaultStatusLineManager(); statusLineManager.removeAll(); statusLineManager.setMessage(null, null); statusLineManager.setErrorMessage(null, null); return new Status(IStatus.OK, PLUGIN_ID, ""); } }; job.schedule(CLEAR_MESSAGE_JOB_DELAY); }
From source file:org.eclipse.wst.server.ui.internal.editor.ServerEditorActionBarContributor.java
License:Open Source License
/** * Sets the active editor for the contributor. * <p>//w w w . jav a2s. c om * The <code>EditorActionBarContributor</code> implementation of this method does * nothing. Subclasses may reimplement. This generally entails disconnecting * from the old editor, connecting to the new editor, and updating the actions * to reflect the new editor. * </p> * * @param targetEditor the new target editor */ public void setActiveEditor(IEditorPart targetEditor) { super.setActiveEditor(targetEditor); if (targetEditor != null && targetEditor.equals(editor)) return; IActionBars actionBars = getActionBars(); boolean actionBarsUpdated = false; if (editor != null) { editor.setStatus(null, null); IStatusLineManager status = actionBars.getStatusLineManager(); status.removeAll(); IToolBarManager tbm = actionBars.getToolBarManager(); tbm.removeAll(); actionBarsUpdated = true; } if (targetEditor instanceof ServerEditor) { editor = (ServerEditor) targetEditor; if (Trace.FINEST) { Trace.trace(Trace.STRING_FINEST, "Editor action bar contributor for: " + editor); } editor.updateUndoAction(); editor.updateRedoAction(); actionBars.setGlobalActionHandler(ActionFactory.UNDO.getId(), editor.getUndoAction()); actionBars.setGlobalActionHandler(ActionFactory.REDO.getId(), editor.getRedoAction()); actionBars.setGlobalActionHandler(ActionFactory.COPY.getId(), editor.getCopyAction()); actionBars.setGlobalActionHandler(ActionFactory.CUT.getId(), editor.getCutAction()); actionBars.setGlobalActionHandler(ActionFactory.PASTE.getId(), editor.getPasteAction()); IStatusLineManager status = actionBars.getStatusLineManager(); StatusLineContributionItem item = new StatusLineContributionItem("id"); status.add(item); editor.setStatus(status, item); editor.updateStatusLine(); IAction[] actions = editor.getEditorActions(); IToolBarManager tbm = actionBars.getToolBarManager(); tbm.add(new Separator(SERVER_EDITOR_SEPARATOR)); boolean modified = false; if (actions != null) { int size = actions.length; if (Trace.FINEST) { Trace.trace(Trace.STRING_FINEST, "Attempting to add editor actions: " + size); } for (int i = 0; i < size; i++) { if (Trace.FINEST) { Trace.trace(Trace.STRING_FINEST, "action: " + actions[i]); } tbm.appendToGroup(SERVER_EDITOR_SEPARATOR, actions[i]); modified = true; } } if (modified) tbm.update(false); actionBarsUpdated = true; } else editor = null; if (actionBarsUpdated) actionBars.updateActionBars(); }
From source file:uk.ac.stfc.isis.ibex.product.ApplicationActionBarAdvisor.java
License:Open Source License
@Override protected void fillStatusLine(IStatusLineManager statusLine) { statusLine.removeAll(); StatusLineConfigLabel statusItem = new StatusLineConfigLabel("CurrentConfigTitle"); statusLine.add(statusItem);/*w ww . j a v a2 s .c o m*/ statusLine.update(true); }