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

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

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

ToolBar.requestLayout介绍

暂无

代码示例

代码示例来源:origin: org.eclipse.platform/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.requestLayout();
  }
}

代码示例来源:origin: org.eclipse.platform/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 (MUIElement childME : plist) {
      modelProcessSwitch(parentManager, (MToolBarElement) childME);
    }
  }
  parentManager.update(true);
  ToolBar toolbar = getToolbarFrom(container.getWidget());
  if (toolbar != null) {
    toolbar.requestLayout();
  }
}

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

/**
 * @param force
 */
public void updateAll(boolean force) {
  final List<MToolBar> children = modelService.findElements(window, null, MToolBar.class, null);
  for (MToolBar mToolbar : children) {
    if (mToolbar == null) {
      continue;
    }
    ToolBarManagerRenderer renderer = (ToolBarManagerRenderer) rendererFactory.getRenderer(mToolbar, null);
    final ToolBarManager manager = renderer.getManager(mToolbar);
    if (manager != null) {
      manager.update(true);
      // TODO: Hack to work around Bug 370961
      ToolBar toolbar = manager.getControl();
      if (toolbar != null && !toolbar.isDisposed()) {
        toolbar.requestLayout();
      }
    }
  }
}

代码示例来源:origin: org.eclipse.platform/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.requestLayout();
    }
  }
}

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

private ToolBar createToolbar(final MUIElement element, Composite parent) {
  int orientation = getOrientation(element);
  int style = orientation | SWT.WRAP | SWT.FLAT | SWT.RIGHT;
  ToolBarManager manager = getManager((MToolBar) element);
  if (manager == null) {
    manager = new ToolBarManager(style);
    IContributionManagerOverrides overrides = null;
    MApplicationElement parentElement = element.getParent();
    if (parentElement == null) {
      parentElement = modelService.getContainer(element);
    }
    if (parentElement != null) {
      overrides = (IContributionManagerOverrides) parentElement.getTransientData().get(
          IContributionManagerOverrides.class.getName());
    }
    manager.setOverrides(overrides);
    linkModelToManager((MToolBar) element, manager);
  } else {
    ToolBar toolBar = manager.getControl();
    if (toolBar != null && !toolBar.isDisposed() && (toolBar.getStyle() & orientation) == 0) {
      toolBar.dispose();
    }
    manager.setStyle(style);
  }
  ToolBar btoolbar = manager.createControl(parent);
  btoolbar.setData(manager);
  btoolbar.setData(AbstractPartRenderer.OWNING_ME, element);
  btoolbar.requestLayout();
  return btoolbar;
}

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

ToolBar toolbar = parent.getControl();
    if (toolbar != null && !toolbar.isDisposed()) {
      toolbar.requestLayout();
ToolBar toolbar = parent.getControl();
if (toolbar != null && !toolbar.isDisposed()) {
  toolbar.requestLayout();

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

toolbar.requestLayout();

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

trimStackTB.requestLayout();

相关文章

ToolBar类方法