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

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

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

ToolBar.addDisposeListener介绍

暂无

代码示例

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

private void addCleanupDisposeListener(final MToolBar toolbarModel, ToolBar control) {
  final Map<String, Object> transientData = toolbarModel.getTransientData();
  if (!transientData.containsKey(DISPOSE_ADDED)) {
    transientData.put(DISPOSE_ADDED, Boolean.TRUE);
    control.addDisposeListener(e -> {
      cleanUp(toolbarModel);
      Object dispose = transientData.get(POST_PROCESSING_DISPOSE);
      if (dispose instanceof Runnable) {
        ((Runnable) dispose).run();
      }
      transientData.remove(POST_PROCESSING_DISPOSE);
      transientData.remove(DISPOSE_ADDED);
    });
  }
}

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

public ToolBarNavigator ( final Composite parent, final int style, final ViewManager viewManager )
{
  this.viewManager = viewManager;
  this.toolbar = new ToolBar ( parent, style );
  this.resourceManager = new LocalResourceManager ( JFaceResources.getResources ( parent.getDisplay () ) );
  this.toolbar.addDisposeListener ( new DisposeListener () {
    @Override
    public void widgetDisposed ( final DisposeEvent e )
    {
      handleDispose ();
    }
  } );
  viewManager.addViewManagerListener ( this );
}

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

/**
 * Adds standard actions to the given <code>ToolBarManager</code>.
 * <p>
 * Subclasses may override to add their own actions.
 * </p>
 *
 * @param toolBarManager the <code>ToolBarManager</code> to which to contribute
 */
public void contributeToToolBar(ToolBarManager toolBarManager) {
  ResourceBundle bundle= CompareUI.getResourceBundle();
  ChangePropertyAction ignoreWhitespace= ChangePropertyAction.createIgnoreWhiteSpaceAction(bundle, getCompareConfiguration());
  toolBarManager.getControl().addDisposeListener(ignoreWhitespace);
  ChangePropertyAction showPseudoConflicts= ChangePropertyAction.createShowPseudoConflictsAction(bundle, getCompareConfiguration());
  toolBarManager.getControl().addDisposeListener(showPseudoConflicts);
  toolBarManager.add(new Separator());
  toolBarManager.add(ignoreWhitespace);
  toolBarManager.add(showPseudoConflicts);
}

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

/**
 * Adds standard actions to the given <code>ToolBarManager</code>.
 * <p>
 * Subclasses may override to add their own actions.
 * </p>
 *
 * @param toolBarManager the <code>ToolBarManager</code> to which to contribute
 */
public void contributeToToolBar(ToolBarManager toolBarManager) {
  ResourceBundle bundle= CompareUI.getResourceBundle();
  ChangePropertyAction ignoreWhitespace= ChangePropertyAction.createIgnoreWhiteSpaceAction(bundle, getCompareConfiguration());
  toolBarManager.getControl().addDisposeListener(ignoreWhitespace);
  ChangePropertyAction showPseudoConflicts= ChangePropertyAction.createShowPseudoConflictsAction(bundle, getCompareConfiguration());
  toolBarManager.getControl().addDisposeListener(showPseudoConflicts);
  toolBarManager.add(new Separator());
  toolBarManager.add(ignoreWhitespace);
  toolBarManager.add(showPseudoConflicts);
}

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

public Object createWidget(final MUIElement element, Object parent) {
  if (!(element instanceof MRenderedToolBar)
      || !(parent instanceof Composite))
    return null;
  final MRenderedToolBar toolBar = (MRenderedToolBar) element;
  if (!(toolBar.getContributionManager() instanceof ToolBarManager)) {
    return null;
  }
  ToolBarManager tbm = (ToolBarManager) toolBar.getContributionManager();
  ToolBar tb = tbm.createControl((Composite) parent);
  if (tb.getParent() != parent) {
    tb.setParent((Composite) parent);
    tb.setVisible(true);
  }
  tbm.update(true);
  tb.setData(ToolBarManager.class.getName(), tbm);
  tb.addDisposeListener(new DisposeListener() {
    public void widgetDisposed(DisposeEvent e) {
      cleanUp(toolBar);
    }
  });
  tb.getParent().layout(true);
  return tb;
}

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

private ToolBar createHelpImageButton(Composite parent, Image image) {
  ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
  ((GridLayout) parent.getLayout()).numColumns++;
  toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
  final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
  toolBar.setCursor(cursor);
  toolBar.addDisposeListener(new DisposeListener() {
    public void widgetDisposed(DisposeEvent e) {
      cursor.dispose();
    }
  });        
  fHelpButton = new ToolItem(toolBar, SWT.CHECK);
  fHelpButton.setImage(image);
  fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
  fHelpButton.addSelectionListener(new SelectionAdapter() {
    public void widgetSelected(SelectionEvent e) {
      helpPressed();
    }
  });
  return toolBar;
}

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

private ToolBar createHelpImageButton(Composite parent, Image image) {
  ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
  ((GridLayout) parent.getLayout()).numColumns++;
  toolBar.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
  final Cursor cursor = new Cursor(parent.getDisplay(), SWT.CURSOR_HAND);
  toolBar.setCursor(cursor);
  toolBar.addDisposeListener(e -> cursor.dispose());
  fHelpButton = new ToolItem(toolBar, SWT.CHECK);
  fHelpButton.setImage(image);
  fHelpButton.setToolTipText(JFaceResources.getString("helpToolTip")); //$NON-NLS-1$
  fHelpButton.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      helpPressed();
    }
  });
  return toolBar;
}

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

bar.setData(AbstractPartRenderer.OWNING_ME, element);
bar.getShell().layout(new Control[] { bar }, SWT.DEFER);
bar.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent e) {
    cleanUp((MToolBar) element);

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

@Override
public void fill(final ToolBar parent, int index) {
  if (toolItem == null && parent != null) {
    parent.addDisposeListener(e -> {

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

trimStackTB.addDisposeListener(new DisposeListener() {
  public void widgetDisposed(DisposeEvent e) {
    trimStackTB = null;

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

trimStackTB.addDisposeListener(e -> {
  showStack(false);

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

perspSwitcherToolbar.addDisposeListener(e -> disposeTBImages());

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

fAncestorItem.setVisible(false);
tbm.appendToGroup("modes", fAncestorItem); //$NON-NLS-1$
tbm.getControl().addDisposeListener(a);

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

fAncestorItem.setVisible(false);
tbm.appendToGroup("modes", fAncestorItem); //$NON-NLS-1$
tbm.getControl().addDisposeListener(a);

相关文章

ToolBar类方法