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

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

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

ToolBar.getStyle介绍

暂无

代码示例

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

/**
 * Sets the state of the "Example" widgets.
 */
@Override
void setExampleWidgetState () {
  super.setExampleWidgetState ();
  horizontalButton.setSelection ((imageToolBar.getStyle () & SWT.HORIZONTAL) != 0);
  verticalButton.setSelection ((imageToolBar.getStyle () & SWT.VERTICAL) != 0);
  flatButton.setSelection ((imageToolBar.getStyle () & SWT.FLAT) != 0);
  wrapButton.setSelection ((imageToolBar.getStyle () & SWT.WRAP) != 0);
  shadowOutButton.setSelection ((imageToolBar.getStyle () & SWT.SHADOW_OUT) != 0);
  rightButton.setSelection ((imageToolBar.getStyle () & SWT.RIGHT) != 0);
  borderButton.setSelection ((imageToolBar.getStyle () & SWT.BORDER) != 0);
}

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

/**
 * Creates a tool bar manager for an existing tool bar control. This manager
 * becomes responsible for the control, and will dispose of it when the
 * manager is disposed. <strong>NOTE</strong> When creating a ToolBarManager
 * from an existing {@link ToolBar} you will not get the accessible listener
 * provided by JFace.
 *
 * @see #ToolBarManager()
 * @see #ToolBarManager(int)
 *
 * @param toolbar
 *            the tool bar control
 */
public ToolBarManager(ToolBar toolbar) {
  this();
  this.toolBar = toolbar;
  if (toolBarExist()) {
    this.itemStyle = toolBar.getStyle();
  }
}

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

/**
 * Creates a tool bar manager for an existing tool bar control. This manager
 * becomes responsible for the control, and will dispose of it when the
 * manager is disposed. <strong>NOTE</strong> When creating a ToolBarManager
 * from an existing {@link ToolBar} you will not get the accessible listener
 * provided by JFace.
 *
 * @see #ToolBarManager()
 * @see #ToolBarManager(int)
 *
 * @param toolbar
 *            the tool bar control
 */
public ToolBarManager(ToolBar toolbar) {
  this();
  this.toolBar = toolbar;
  if (toolBarExist()) {
    this.itemStyle = toolBar.getStyle();
  }
}

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

void renderInitialization( final ToolItem toolItem ) throws IOException {
 JSWriter writer = JSWriter.getWriterFor( toolItem );
 ToolBar toolBar = toolItem.getParent();
 Boolean flat = Boolean.valueOf( ( toolBar.getStyle() & SWT.FLAT  ) != 0 );
 Boolean vertical
  = Boolean.valueOf( ( toolBar.getStyle() & SWT.VERTICAL  ) != 0 );
 writer.newWidget( QX_TYPE, new Object[]{ flat, vertical } );
 writer.call( toolBar, "add", new Object[]{ toolItem } );
}

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

LRESULT wmCommandChild (int /*long*/ wParam, int /*long*/ lParam) {
  if ((style & SWT.RADIO) != 0) {
    if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
      selectRadio ();
    }
  }
  sendSelectionEvent (SWT.Selection);
  return null;
}

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

static void renderInitialization( final ToolItem toolItem,
                 final String param )
 throws IOException
{
 JSWriter writer = JSWriter.getWriterFor( toolItem );
 ToolBar toolBar = toolItem.getParent();
 Integer index = new Integer( toolBar.indexOf( toolItem ) );
 // TODO [tb] For the index, it is currently ignored that controls
 //           attached to a ToolItem use an index-slot of their own on
 //           the client, while they don't on the server. In theory,
 //           this could lead to an incorrect order of the items on the
 //           client, which is problematic with the keyboard-control
 //           and radio-groups.
 Boolean flat = Boolean.valueOf( ( toolBar.getStyle() & SWT.FLAT ) != 0 );
 writer.newWidget( QX_TYPE, new Object[]{ param, flat } );
 writer.call( toolBar, "addAt", new Object[]{ toolItem, index } );
 WidgetLCAUtil.writeStyleFlag( toolItem, SWT.FLAT, "FLAT" );
 if( ( toolBar.getStyle() & SWT.VERTICAL ) != 0 ) {
  writer.call( JSConst.QX_FUNC_ADD_STATE, new Object[] { "rwt_VERTICAL"} );
 }
}

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

void sendSelection () {
  if ((style & SWT.RADIO) != 0) {
    if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
      selectRadio ();
    }
  }
  if ((style & SWT.CHECK) != 0) setSelection (!getSelection ());
  sendSelectionEvent (SWT.Selection);
}

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

void renderInitialization( ToolItem toolItem ) throws IOException {
 ToolItemLCAUtil.renderInitialization( toolItem, PARAM_RADIO );
 if( ( toolItem.getParent().getStyle() & SWT.NO_RADIO_GROUP ) != 0 ) {
  JSWriter writer = JSWriter.getWriterFor( toolItem );
  writer.set( "noRadioGroup", true );
 }
}

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

public static Composite wrapTrim(Control trim) {
  int orientation = SWT.HORIZONTAL;
  if (trim instanceof ToolBar)
    orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL
        : SWT.VERTICAL;
  Composite parentComp = trim.getParent();
  Composite wrapper = new Composite(parentComp, SWT.NONE);
  RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false)
      .spacing(0).type(orientation).create();
  layout.marginLeft = 3;
  layout.center = true;
  wrapper.setLayout(layout);
  // Separator (aka 'drag handle')
  ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP
      | SWT.FLAT | SWT.RIGHT);
  new ToolItem(separatorToolBar, SWT.SEPARATOR);
  // Put the trim under the wrapper and ensure it's last
  trim.setParent(wrapper);
  trim.moveBelow(null);
  return wrapper;
}

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

public static Composite wrapTrim(Control trim) {
  int orientation = SWT.HORIZONTAL;
  if (trim instanceof ToolBar)
    orientation = (((ToolBar) trim).getStyle() & SWT.VERTICAL) == 0 ? SWT.HORIZONTAL
        : SWT.VERTICAL;
  Composite parentComp = trim.getParent();
  Composite wrapper = new Composite(parentComp, SWT.NONE);
  RowLayout layout = RowLayoutFactory.fillDefaults().wrap(false)
      .spacing(0).type(orientation).create();
  layout.marginLeft = 3;
  layout.center = true;
  wrapper.setLayout(layout);
  // Separator (aka 'drag handle')
  ToolBar separatorToolBar = new ToolBar(wrapper, orientation | SWT.WRAP
      | SWT.FLAT | SWT.RIGHT);
  new ToolItem(separatorToolBar, SWT.SEPARATOR);
  // Put the trim under the wrapper and ensure it's last
  trim.setParent(wrapper);
  trim.moveBelow(null);
  return wrapper;
}

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

Point center = new Point(bounds.x + (bounds.width / 2), bounds.y
    + (bounds.height / 2));
boolean atStart = (perspSwitcherToolbar.getStyle() & SWT.HORIZONTAL) != 0 ? e.x < center.x
    : e.y < center.y;

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

int style = toolbar.getStyle() & (SWT.RIGHT_TO_LEFT | SWT.LEFT_TO_RIGHT);
menu = new Menu(shell, style | SWT.POP_UP);
for (int i = 0; i < 9; ++i) {

代码示例来源: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.rap/org.eclipse.rap.jface

boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0;
if (rightStyle || !ti.getText().equals(textToSet)) {

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

boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0;
if (rightStyle || !ti.getText().equals(textToSet)) {

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

boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0;
if (rightStyle || !ti.getText().equals(textToSet)) {

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

if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
  selectRadio ();

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

if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
  selectRadio ();

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

if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) {
  selectRadio ();

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

if (child instanceof ToolBar && (((ToolBar)child).getStyle() & SWT.VERTICAL) != 0)
  flipXY = true;
else if (child instanceof CoolBar && (((CoolBar)child).getStyle() & SWT.VERTICAL) != 0)

相关文章

ToolBar类方法