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

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

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

ToolBar.computeSize介绍

暂无

代码示例

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

/**
 * Return the width of this element.
 *
 * @return the width of this element
 */
public int getWidth() {
  return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
}

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

/**
 * Return the width of this element.
 *
 * @return the width of this element
 */
public int getWidth() {
  return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
}

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

/**
 * Return the width of this element.
 *
 * @return the width of this element
 */
public int getWidth() {
  return fToolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
}

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

public Point computeSize (int wHint, int hHint, boolean changed) {
  Point size = super.computeSize (wHint, hHint, changed);
  if (toolBar != null) {
    if (wHint == SWT.DEFAULT && toolBar.itemCount > 0) {
      Point tbSize = toolBar.computeSize (SWT.DEFAULT, SWT.DEFAULT);
      size.x = Math.max (tbSize.x, size.x);
    }
  }
  return size;
}

代码示例来源: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.ui.intro

@Override
protected Point computeSize(Composite composite, int wHint, int hHint, boolean changed) {
  boolean vertical = (getOrientation() & SWT.VERTICAL) != 0;
  int marginWidth = vertical | isPlain() ? 1 : simple ? 3 : 7;
  int marginHeight = !vertical | isPlain() ? 1 : simple ? 3 : 7;
  int width = 0;
  int height = 0;
  Point tsize = toolBarManager.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
  if (vertical) {
    width = tsize.x;
    height = tsize.y;
  } else {
    height = tsize.y;
    width = tsize.x;
  }
  if (vertical) {
    width += marginWidth;
    height += marginHeight + marginHeight;
  } else {
    width += marginWidth + marginWidth;
    height += marginHeight;
  }
  return new Point(width, height);
}

代码示例来源: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: rherrmann/eclipse-extras

private int computeDefaultTrimHeight() {
 int result;
 Shell shell = new Shell( getDisplay(), SWT.NONE );
 try {
  ToolBar toolBar = new ToolBar( shell, SWT.NONE );
  ToolItem toolItem = new ToolItem( toolBar, SWT.PUSH );
  toolItem.setImage( JFaceResources.getImageRegistry().get( Dialog.DLG_IMG_MESSAGE_INFO ) );
  int toolItemHeight = toolBar.computeSize( SWT.DEFAULT, SWT.DEFAULT ).y;
  result = Math.max( toolItemHeight, measureText( "Wg" ).y );
 } finally {
  shell.dispose();
 }
 return result;
}

代码示例来源: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.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.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.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.platform/org.eclipse.ui.intro

@Override
  protected void layout(Composite composite, boolean changed) {
    boolean vertical = (getOrientation() & SWT.VERTICAL) != 0;
    int marginWidth = vertical | isPlain() ? 1 : simple ? 4 : 7;
    int marginHeight = !vertical | isPlain() ? 1 : simple ? 4 : 7;
    Point tsize = toolBarManager.getControl().computeSize(SWT.DEFAULT, SWT.DEFAULT, changed);
    Rectangle carea = composite.getClientArea();
    int x = carea.x + (getLocation() == SideValue.LEFT ? 0 : marginWidth);
    int y = carea.y + marginHeight;
    if (vertical) {
      toolBarManager.getControl().setBounds(x, y, carea.width - marginWidth, tsize.y);
    } else {
      toolBarManager.getControl().setBounds(x, y, tsize.x, carea.height - marginHeight);
    }
  }
}

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

tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
chevron.setVisible(true);

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
chevron.setVisible(true);

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

tabAreaWidth -= chevron.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
chevron.setVisible(true);

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

CoolItem coolItem2 = new CoolItem (coolBar, 0);
coolItem2.setControl (toolBar);
Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
coolItem1.setSize(coolItem1.computeSize (size.x, size.y));
coolItem2.setSize(coolItem2.computeSize (size.x, size.y));

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

Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
    SWT.DEFAULT);

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

Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
    SWT.DEFAULT);

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

Point toolBarSize = toolBar.computeSize(SWT.DEFAULT,
    SWT.DEFAULT);

相关文章

ToolBar类方法