public void dispose () { this.toolbar.dispose (); }
/** * Disposes of the view menu associated with the given tab folder. * * @param ctf * the tab folder to clear of its view menu */ public void disposeViewMenu(CTabFolder ctf) { ToolBar vmTB = getViewMenuTB(ctf); if (vmTB != null && !vmTB.isDisposed()) vmTB.dispose(); }
public ProfilePreferenceTree(Composite parentComposite) { super(parentComposite, FormatterMessages.ModifyDialog_filter_label, FormatterMessages.ModifyDialog_filter_hint); // calculate rigth margin width ToolBar modifyAllToolbar= ModifyAll.createToolItem(parentComposite, fImages).getParent(); fRightMargin= modifyAllToolbar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x - 12; modifyAllToolbar.dispose(); }
/** * Sets the top right control to a toolbar */ void setTopRight () { if (topRightButton.getSelection ()) { topRightControl = new ToolBar(tabFolder1, SWT.FLAT); ToolItem item = new ToolItem(topRightControl, SWT.PUSH); item.setImage(instance.images[ControlExample.ciClosedFolder]); item = new ToolItem(topRightControl, SWT.PUSH); item.setImage(instance.images[ControlExample.ciOpenFolder]); int topRightStyle = 0; if (rightButton.getSelection ()) topRightStyle |= SWT.RIGHT; if (fillButton.getSelection ()) topRightStyle |= SWT.FILL; if (wrapButton.getSelection ()) topRightStyle |= SWT.RIGHT | SWT.WRAP; tabFolder1.setTopRight(topRightControl, topRightStyle); } else { if (topRightControl != null) { tabFolder1.setTopRight(null); topRightControl.dispose(); } } setExampleWidgetSize(); } /**
void calculateChevronTrim() { ToolBar tb = new ToolBar( parent, SWT.FLAT ); ToolItem ti = new ToolItem( tb, SWT.PUSH ); // Image image = new Image (display, 1, 1); // ti.setImage (image); Point size = tb.computeSize( SWT.DEFAULT, SWT.DEFAULT ); size = parent.fixPoint( size.x, size.y ); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose(); ti.dispose(); // image.dispose (); }
/** * Creates a view menu for the given part in the contained tab folder. * * @param part * the part that should have its view menu created * @param ctf * the containing tab folder */ public void setupMenuButton(MPart part, CTabFolder ctf) { MMenu viewMenu = getViewMenu(part); // View menu (if any) if (viewMenu != null && hasVisibleMenuItems(viewMenu, part)) { showMenuButton(part, ctf, viewMenu); } else { // hide the menu's TB ToolBar menuTB = getViewMenuTB(ctf); if (menuTB != null) { menuTB.dispose(); } } }
private void disposeToolbarIfNecessary(MUIElement element) { Composite composite = (Composite) element.getWidget(); ToolBar toolbar = findToolbar(composite); if (toolbar != null && hasOnlySeparators(toolbar)) { toolbar.dispose(); if (composite.getChildren().length > 0) { composite.getChildren()[0].dispose(); } } }
public void dispose () { if (isDisposed()) return; /* * Must call parent.destroyItem() before super.dispose(), since it needs to * query the bounds to properly remove the item. */ parent.destroyItem(this); super.dispose (); parent = null; control = null; /* * Although the parent for the chevron is the CoolBar (CoolItem can not be the parent) * it has to be disposed with the item */ if (chevron != null && !chevron.isDisposed()) chevron.dispose(); chevron = null; if (arrowImage != null && !arrowImage.isDisposed()) arrowImage.dispose(); arrowImage = null; }
@Override public void dispose () { if (isDisposed()) return; /* * Must call parent.destroyItem() before super.dispose(), since it needs to * query the bounds to properly remove the item. */ parent.destroyItem(this); super.dispose (); parent = null; control = null; /* * Although the parent for the chevron is the CoolBar (CoolItem can not be the parent) * it has to be disposed with the item */ if (chevron != null && !chevron.isDisposed()) chevron.dispose(); chevron = null; if (arrowImage != null && !arrowImage.isDisposed()) arrowImage.dispose(); arrowImage = null; }
@Override public void dispose () { if (isDisposed()) return; /* * Must call parent.destroyItem() before super.dispose(), since it needs to * query the bounds to properly remove the item. */ parent.destroyItem(this); super.dispose (); parent = null; control = null; /* * Although the parent for the chevron is the CoolBar (CoolItem can not be the parent) * it has to be disposed with the item */ if (chevron != null && !chevron.isDisposed()) chevron.dispose(); chevron = null; if (arrowImage != null && !arrowImage.isDisposed()) arrowImage.dispose(); arrowImage = null; }
@Override public void dispose () { if (isDisposed()) return; /* * Must call parent.destroyItem() before super.dispose(), since it needs to * query the bounds to properly remove the item. */ parent.destroyItem(this); super.dispose (); parent = null; control = null; /* * Although the parent for the chevron is the CoolBar (CoolItem can not be the parent) * it has to be disposed with the item */ if (chevron != null && !chevron.isDisposed()) chevron.dispose(); chevron = null; if (arrowImage != null && !arrowImage.isDisposed()) arrowImage.dispose(); arrowImage = null; }
void releaseWidget () { super.releaseWidget (); if (toolBar != null) { toolBar.dispose(); toolBar = null; } if (tooltipTag != 0) { view.window().contentView().removeToolTip(tooltipTag); tooltipTag = 0; } display.clearModal (this); updateParent (false); display.updateQuitMenu(); lastActive = null; }
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
/** * Disposes of this tool bar manager and frees all allocated SWT resources. * Notifies all contribution items of the dispose. Note that this method * does not clean up references between this tool bar manager and its * associated contribution items. Use <code>removeAll</code> for that * purpose. */ public void dispose() { if (toolBarExist()) { toolBar.dispose(); } toolBar = null; IContributionItem[] items = getItems(); for (int i = 0; i < items.length; i++) { items[i].dispose(); } if (getContextMenuManager() != null) { getContextMenuManager().dispose(); setContextMenuManager(null); } }
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
void calculateChevronTrim () { ToolBar tb = new ToolBar (parent, SWT.FLAT); ToolItem ti = new ToolItem (tb, SWT.PUSH); Image image = new Image (display, 1, 1); ti.setImage (image); Point size = tb.computeSize (SWT.DEFAULT, SWT.DEFAULT); size = parent.fixPoint(size.x, size.y); CHEVRON_HORIZONTAL_TRIM = size.x - 1; CHEVRON_VERTICAL_TRIM = size.y - 1; tb.dispose (); ti.dispose (); image.dispose (); } /**
public void clearTR(CTabFolder ctf) { disposeViewMenu(ctf); ToolBar vmTB = getViewMenuTB(ctf); if (vmTB != null && !vmTB.isDisposed()) vmTB.dispose(); MToolBar viewTBModel = getViewTB(ctf); if (viewTBModel != null && viewTBModel.getWidget() != null) viewTBModel.setVisible(false); ctf.setTopRight(null); getTRComposite(ctf).setVisible(false); }
/** * Disposes of this tool bar manager and frees all allocated SWT resources. * Notifies all contribution items of the dispose. Note that this method * does not clean up references between this tool bar manager and its * associated contribution items. Use <code>removeAll</code> for that * purpose. */ public void dispose() { if (toolBarExist()) { toolBar.dispose(); } toolBar = null; IContributionItem[] items = getItems(); for (IContributionItem item : items) { item.dispose(); } if (getContextMenuManager() != null) { getContextMenuManager().dispose(); setContextMenuManager(null); } }
/** * Disposes of this tool bar manager and frees all allocated SWT resources. * Notifies all contribution items of the dispose. Note that this method * does not clean up references between this tool bar manager and its * associated contribution items. Use <code>removeAll</code> for that * purpose. */ public void dispose() { if (toolBarExist()) { toolBar.dispose(); } toolBar = null; IContributionItem[] items = getItems(); for (IContributionItem item : items) { item.dispose(); } if (getContextMenuManager() != null) { getContextMenuManager().dispose(); setContextMenuManager(null); } super.setOverrides(null); }