org.eclipse.swt.widgets.ToolBar.dispose()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(9.4k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.eclipse.swt.widgets.ToolBar.dispose()方法的一些代码示例,展示了ToolBar.dispose()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ToolBar.dispose()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ToolBar
类名称:ToolBar
方法名:dispose

ToolBar.dispose介绍

暂无

代码示例

代码示例来源:origin: de.dentrassi.eclipse.neoscada.hmi/org.eclipse.scada.vi.ui.user

public void dispose ()
{
  this.toolbar.dispose ();
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

/**
 * 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();
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

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();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.examples

/**
 * 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();
}
/**

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

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 ();
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

/**
 * 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();
    }
  }
}

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

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();
    }
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

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;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

@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;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

@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;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

@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;
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

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;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

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 ();
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

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 ();
}
/**

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface

/**
 * 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);
  }
}

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

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 ();
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

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 ();
}
/**

代码示例来源:origin: org.eclipse.e4.ui.workbench.renderers/swt

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);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface

/**
 * 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);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.jface

/**
 * 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);
}

相关文章

ToolBar类方法