List of usage examples for org.eclipse.jface.action StatusLineManager add
@Override
public void add(IAction action)
From source file:com.carrotgarden.m2e.config.ConfigStartup.java
License:BSD License
private void addStatusLineContribution() { final IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); final WorkbenchWindow window = (WorkbenchWindow) windows[0]; final StatusLineManager statusLineManager = window.getStatusLineManager(); label = new ConfigLabel("config"); statusLineManager.add(new Separator("carrot")); statusLineManager.appendToGroup("carrot", label); statusLineManager.update(true);//from w ww . j av a 2 s . c o m }
From source file:com.toubassi.filebunker.ui.FileBunker.java
License:Open Source License
protected StatusLineManager createStatusLineManager() { StatusLineManager statusLineManager = new StatusLineManager(); availableBytesStatusItem = new AvailableBytesStatusItem(vault, "Available"); statusLineManager.add(availableBytesStatusItem); return statusLineManager; }
From source file:org.geotools.swt.SwtMapFrame.java
License:Open Source License
protected Control createContents(Composite parent) { String title = content.getTitle(); content.layers();/*from w ww. j ava2s . c o m*/ if (title != null) { getShell().setText(title); } Composite mainComposite = null; if (showLayerTable) { SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL | SWT.NULL); mainComposite = sashForm; MapLayerComposite mapLayerTable = new MapLayerComposite(mainComposite, SWT.BORDER); mapPane = new SwtMapPane(mainComposite, SWT.BORDER | SWT.NO_BACKGROUND); mapPane.setMapContent(content); mapLayerTable.setMapPane(mapPane); sashForm.setWeights(new int[] { 1, 3 }); } else { mainComposite = parent; mapPane = new SwtMapPane(mainComposite, SWT.BORDER | SWT.NO_BACKGROUND); mapPane.setMapContent(content); } // the map pane is the one element that is always displayed mapPane.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE)); mapPane.setRenderer(renderer); // drawAction.setMapPane(mapPane); infoAction.setMapPane(mapPane); panAction.setMapPane(mapPane); resetAction.setMapPane(mapPane); zoominAction.setMapPane(mapPane); zoomoutAction.setMapPane(mapPane); openShapeAction.setMapPane(mapPane); openCoverageAction.setMapPane(mapPane); StatusLineManager statusLineManager = getStatusLineManager(); if (statusLineManager != null) { IContributionItem filler = new ControlContribution("org.geotools.swt.SwtMapFrame.ID") { protected Control createControl(Composite parent) { Label almostParent = new Label(parent, SWT.NONE); StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData(); statusLineLayoutData.widthHint = 1; statusLineLayoutData.heightHint = 45; almostParent.setLayoutData(statusLineLayoutData); return almostParent; } }; CrsStatusBarButton crsButton = new CrsStatusBarButton(mapPane); statusLineManager.add(filler); statusLineManager.add(crsButton); statusLineManager.update(true); new StatusBarNotifier(this, mapPane); } return mainComposite; }
From source file:ummisco.gama.ui.viewers.gis.geotools.SwtMapFrame.java
@Override @SuppressWarnings("unused") protected Control createContents(final Composite parent) { final String title = content.getTitle(); content.layers();// ww w . j ava 2 s .c o m if (title != null) { getShell().setText(title); } Composite mainComposite = null; if (showLayerTable) { final SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL | SWT.NULL); mainComposite = sashForm; final MapLayerComposite mapLayerTable = new MapLayerComposite(mainComposite, SWT.BORDER); mapPane = new SwtMapPane(mainComposite, SWT.BORDER | SWT.NO_BACKGROUND); mapPane.setMapContent(content); mapLayerTable.setMapPane(mapPane); sashForm.setWeights(new int[] { 1, 3 }); } else { mainComposite = parent; mapPane = new SwtMapPane(mainComposite, SWT.BORDER | SWT.NO_BACKGROUND); mapPane.setMapContent(content); } // the map pane is the one element that is always displayed mapPane.setBackground(WorkbenchHelper.getDisplay().getSystemColor(SWT.COLOR_WHITE)); mapPane.setRenderer(renderer); // drawAction.setMapPane(mapPane); infoAction.setMapPane(mapPane); panAction.setMapPane(mapPane); resetAction.setMapPane(mapPane); zoominAction.setMapPane(mapPane); zoomoutAction.setMapPane(mapPane); openShapeAction.setMapPane(mapPane); openCoverageAction.setMapPane(mapPane); final StatusLineManager statusLineManager = getStatusLineManager(); if (statusLineManager != null) { final IContributionItem filler = new ControlContribution( "ummisco.gama.ui.viewers.gis.geotools.SwtMapFrame.ID") { @Override protected Control createControl(final Composite parent) { final Label almostParent = new Label(parent, SWT.NONE); final StatusLineLayoutData statusLineLayoutData = new StatusLineLayoutData(); statusLineLayoutData.widthHint = 1; statusLineLayoutData.heightHint = 45; almostParent.setLayoutData(statusLineLayoutData); return almostParent; } }; final CrsStatusBarButton crsButton = new CrsStatusBarButton(mapPane); statusLineManager.add(filler); statusLineManager.add(crsButton); statusLineManager.update(true); new StatusBarNotifier(this, mapPane); } return mainComposite; }