/** * 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); }
/** * 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(); } }
/** * 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(); } }
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 } ); }
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; }
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"} ); } }
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); }
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 ); } }
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; }
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; }
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;
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) {
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; }
boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0; if (rightStyle || !ti.getText().equals(textToSet)) {
boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0; if (rightStyle || !ti.getText().equals(textToSet)) {
boolean rightStyle = (ti.getParent().getStyle() & SWT.RIGHT) != 0; if (rightStyle || !ti.getText().equals(textToSet)) {
if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) { selectRadio ();
if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) { selectRadio ();
if ((parent.getStyle () & SWT.NO_RADIO_GROUP) == 0) { selectRadio ();
if (child instanceof ToolBar && (((ToolBar)child).getStyle() & SWT.VERTICAL) != 0) flipXY = true; else if (child instanceof CoolBar && (((CoolBar)child).getStyle() & SWT.VERTICAL) != 0)