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

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

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

ToolBar.getShell介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

final Shell shell = swtToolbar.getShell();
final ToolItem perspectiveButton = new ToolItem( swtToolbar, SWT.DROP_DOWN, 7 );

代码示例来源:origin: pentaho/pentaho-kettle

@Override
public void widgetSelected( SelectionEvent event ) {
 final Menu connectionMenu = new Menu( toolBar.getShell() );
 if ( repositoriesMeta != null ) {
  for ( int i = 0; i < repositoriesMeta.nrRepositories(); i++ ) {

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

Composite getShellClientComposite() {
  if (trimStackTB == null || trimStackTB.isDisposed()) {
    return null;
  }
  Shell theShell = trimStackTB.getShell();
  if (!(theShell.getLayout() instanceof TrimmedPartLayout))
    return null;
  TrimmedPartLayout tpl = (TrimmedPartLayout) theShell.getLayout();
  return tpl.clientArea;
}

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

@Override
  public void widgetDisposed(DisposeEvent e) {
    if (JavaPlugin.DEBUG_BREADCRUMB_ITEM_DROP_DOWN)
      System.out.println("==> shell disposed"); //$NON-NLS-1$
    display.removeFilter(SWT.FocusIn, focusListener);
    display.removeFilter(SWT.FocusOut, focusListener);
    if (!fToolBar.isDisposed()) {
      fToolBar.getShell().removeControlListener(controlListener);
    }
  }
});

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

private Composite getHostPane() {
  // Create one
  hostPane = new Composite(trimStackTB.getShell(), SWT.NONE);
  hostPane.setData(ShellActivationListener.DIALOG_IGNORE_KEY, Boolean.TRUE);
  hostPane.addDisposeListener(e -> hostPane = null);
  setHostSize();
  // Set a special layout that allows resizing
  fixedSides = getFixedSides();
  hostPane.setLayout(new TrimPaneLayout(toolControl, fixedSides));
  return hostPane;
}

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

@Override
  public void widgetDisposed(DisposeEvent e) {
    if (JavaPlugin.DEBUG_BREADCRUMB_ITEM_DROP_DOWN)
      System.out.println("==> shell disposed"); //$NON-NLS-1$
    display.removeFilter(SWT.FocusIn, focusListener);
    display.removeFilter(SWT.FocusOut, focusListener);
    if (!fToolBar.isDisposed()) {
      fToolBar.getShell().removeControlListener(controlListener);
    }
  }
});

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

private static boolean isAccessible( ToolItem toolItem ) {
 return toolItem.getEnabled() && isShellAccessible( toolItem.getParent().getShell() );
}

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

private Composite getCAComposite() {
  if (trimStackTB == null) {
    return null;
  }
  // Get the shell's client area composite
  Shell theShell = trimStackTB.getShell();
  if (theShell.getLayout() instanceof TrimmedPartLayout) {
    TrimmedPartLayout tpl = (TrimmedPartLayout) theShell.getLayout();
    if (!tpl.clientArea.isDisposed()) {
      return tpl.clientArea;
    }
  }
  return null;
}

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

private void fixSize() {
  perspSwitcherToolbar.pack();
  perspSwitcherToolbar.getParent().pack();
  perspSwitcherToolbar.getShell().layout(new Control[] { perspSwitcherToolbar }, SWT.DEFER);
}

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

@Override
public void childRendered(MElementContainer<MUIElement> parentElement,
    MUIElement element) {
  super.childRendered(parentElement, element);
  ToolBar toolbar = (ToolBar) getUIContainer(element);
  if (toolbar != null && !toolbar.isDisposed()) {
    toolbar.getShell().layout(new Control[] { toolbar }, SWT.DEFER);
  }
}

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

private Composite getHostPane() {
  if (hostPane != null) {
    setHostSize(); // Always start with the persisted size
    return hostPane;
  }
  // Create one
  hostPane = new Composite(trimStackTB.getShell(), SWT.NONE);
  hostPane.setData(ShellActivationListener.DIALOG_IGNORE_KEY, Boolean.TRUE);
  setHostSize();
  hostPane.addListener(SWT.Traverse, escapeListener);
  // Set a special layout that allows resizing
  fixedSides = getFixedSides();
  hostPane.setLayout(new TrimPaneLayout(toolControl, fixedSides));
  return hostPane;
}

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

@Override
  public void widgetDisposed(DisposeEvent e) {
    if (DebugUIPlugin.DEBUG_BREADCRUMB) {
      DebugUIPlugin.trace("==> shell disposed"); //$NON-NLS-1$
    }
    display.removeFilter(SWT.FocusIn, focusListener);
    display.removeFilter(SWT.FocusOut, focusListener);
    if (!fToolBar.isDisposed()) {
      fToolBar.getShell().removeControlListener(controlListener);
    }
  }
});

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

@Override
public void childRendered(MElementContainer<MUIElement> parentElement,
    MUIElement element) {
  super.childRendered(parentElement, element);
  processContents(parentElement);
  ToolBar toolbar = (ToolBar) getUIContainer(element);
  if (toolbar != null && !toolbar.isDisposed()) {
    toolbar.pack(true);
    toolbar.getShell().layout(new Control[] { toolbar }, SWT.DEFER);
  }
}

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

@Override
public void processContents(MElementContainer<MUIElement> container) {
  // I can either simply stop processing, or we can walk the model
  // ourselves like the "old" days
  // EMF gives us null lists if empty
  if (container == null)
    return;
  Object obj = container;
  ToolBarManager parentManager = getManager((MToolBar) obj);
  if (parentManager == null) {
    return;
  }
  // Process any contents of the newly created ME
  List<MUIElement> parts = container.getChildren();
  if (parts != null) {
    MUIElement[] plist = parts.toArray(new MUIElement[parts.size()]);
    for (int i = 0; i < plist.length; i++) {
      MUIElement childME = plist[i];
      modelProcessSwitch(parentManager, (MToolBarElement) childME);
    }
  }
  parentManager.update(true);
  ToolBar tb = getToolbarFrom(container.getWidget());
  if (tb != null) {
    tb.pack(true);
    tb.getShell().layout(new Control[] { tb }, SWT.DEFER);
  }
}

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

@Override
public void hideChild(MElementContainer<MUIElement> parentElement,
    MUIElement child) {
  super.hideChild(parentElement, child);
  // Since there's no place to 'store' a child that's not in a menu
  // we'll blow it away and re-create on an add
  Widget widget = (Widget) child.getWidget();
  if (widget != null && !widget.isDisposed()) {
    widget.dispose();
  }
  ToolBar toolbar = (ToolBar) getUIContainer(child);
  if (toolbar != null && !toolbar.isDisposed()) {
    toolbar.getShell().layout(new Control[] { toolbar }, SWT.DEFER);
  }
  disposeToolbarIfNecessary(parentElement);
}

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

private ToolItem createDropDown(ToolBar toolBar, Object[][] menuItemsData, List<MenuItem> outItems, Images images) {
  final ToolItem dropDown= new ToolItem(toolBar, SWT.DROP_DOWN);
  final Menu menu= new Menu(toolBar.getShell());
  dropDown.addSelectionListener(new SelectionAdapter() {
    @Override
    public void widgetSelected(SelectionEvent e) {
      fControl.setFocus();
      Rectangle rect= dropDown.getBounds();
      Point pt= dropDown.getParent().toDisplay(new Point(rect.x, rect.y));
      menu.setLocation(pt.x, pt.y + rect.height);
      menu.setVisible(true);
    }
  });
  for (Object[] itemData : menuItemsData) {
    MenuItem menuItem= new MenuItem(menu, SWT.RADIO);
    menuItem.setText((String) itemData[0]);
    menuItem.setImage(images.get((ImageDescriptor) itemData[1]));
    menuItem.setData(DATA_IMAGE_DISABLED, images.get((ImageDescriptor) itemData[2]));
    menuItem.setData(itemData[3]);
    outItems.add(menuItem);
  }
  return dropDown;
}

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

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

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

@Override
public void hideChild(MElementContainer<MUIElement> parentElement,
    MUIElement child) {
  super.hideChild(parentElement, child);
  // only handle the disposal of this element if it was actually rendered
  // by the engine
  if (child.getRenderer() != null) {
    // Since there's no place to 'store' a child that's not in a menu
    // we'll blow it away and re-create on an add
    Widget widget = (Widget) child.getWidget();
    if (widget != null && !widget.isDisposed()) {
      widget.dispose();
    }
    ToolBar toolbar = (ToolBar) getUIContainer(child);
    if (toolbar != null && !toolbar.isDisposed()) {
      toolbar.pack(true);
      toolbar.getShell().layout(new Control[] { toolbar }, SWT.DEFER);
    }
    // disposeToolbarIfNecessary(parentElement);
  }
}

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

private void setItemInfo() {
  if (curElement == null)
    return;
  Control ctrl = (Control) curElement.getWidget();
  // KLUDGE!! Should delegate to curElement's renderer
  if (ctrl instanceof CTabFolder) {
    CTabFolder ctf = (CTabFolder) ctrl;
    Point localPos = display.map(null, ctf, cursorPos);
    curItem = ctf.getItem(localPos);
    if (curItem != null) {
      itemElement = (MUIElement) curItem.getData(AbstractPartRenderer.OWNING_ME);
      if (itemElement != null) {
        itemIndex = ctf.indexOf((CTabItem) curItem);
        itemRect = display.map(ctf, ctf.getShell(), ((CTabItem) curItem).getBounds());
      }
    }
  } else if (ctrl instanceof ToolBar) {
    ToolBar tb = (ToolBar) ctrl;
    Point localPos = display.map(null, tb, cursorPos);
    ToolItem curItem = tb.getItem(localPos);
    if (curItem != null) {
      itemElement = (MUIElement) curItem.getData(AbstractPartRenderer.OWNING_ME);
      if (itemElement != null) {
        itemIndex = tb.indexOf(curItem);
        itemRect = display.map(tb, tb.getShell(), curItem.getBounds());
      }
    }
  }
}

代码示例来源:origin: org.xworker/xworker_swt

public static void tpl_openQueryWindow(ActionContext actionContext){
  ToolBar toolBar = actionContext.getObject("toolBar");
  ToolItem searchToolItem = actionContext.getObject("searchToolItem");
  Shell shell = toolBar.getShell();
  Thing dataStore = actionContext.getObject("dataStore");
  World world = World.getInstance();

相关文章

ToolBar类方法