public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) { e.result = chevronItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) { e.result = chevronItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) { e.result = minItem.getToolTipText(); } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) { e.result = maxItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) { e.result = minItem.getToolTipText(); } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) { e.result = maxItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) { e.result = minItem.getToolTipText(); } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) { e.result = maxItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) { e.result = chevronItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) { e.result = chevronItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (minItem != null && e.childID == minMaxTb.indexOf(minItem)) { e.result = minItem.getToolTipText(); } else if (maxItem != null && e.childID == minMaxTb.indexOf(maxItem)) { e.result = maxItem.getToolTipText(); } } } });
@Override public void getName(AccessibleEvent e) { if (e.childID != ACC.CHILDID_SELF) { if (chevronItem != null && e.childID == chevronTb.indexOf(chevronItem)) { e.result = chevronItem.getToolTipText(); } } } });
boolean isTabGroup () { ToolItem [] tabList = parent._getTabItemList (); if (tabList != null) { for (int i=0; i<tabList.length; i++) { if (tabList [i] == this) return true; } } if ((style & SWT.SEPARATOR) != 0) return true; int index = parent.indexOf (this); if (index == 0) return true; ToolItem previous = parent.getItem (index - 1); return (previous.getStyle () & SWT.SEPARATOR) != 0; }
boolean isTabGroup () { ToolItem [] tabList = parent._getTabItemList (); if (tabList != null) { for (int i=0; i<tabList.length; i++) { if (tabList [i] == this) return true; } } if ((style & SWT.SEPARATOR) != 0) return true; int index = parent.indexOf (this); if (index == 0) return true; ToolItem previous = parent.getItem (index - 1); return (previous.getStyle () & SWT.SEPARATOR) != 0; }
boolean isTabGroup () { ToolItem [] tabList = parent._getTabItemList (); if (tabList != null) { for (int i=0; i<tabList.length; i++) { if (tabList [i] == this) return true; } } if ((style & SWT.SEPARATOR) != 0) return true; int index = parent.indexOf (this); if (index == 0) return true; ToolItem previous = parent.getItem (index - 1); return (previous.getStyle () & SWT.SEPARATOR) != 0; }
boolean isTabGroup () { ToolItem [] tabList = parent._getTabItemList (); if (tabList != null) { for (int i=0; i<tabList.length; i++) { if (tabList [i] == this) return true; } } if ((style & SWT.SEPARATOR) != 0) return true; int index = parent.indexOf (this); if (index == 0) return true; ToolItem previous = parent.getItem (index - 1); return (previous.getStyle () & SWT.SEPARATOR) != 0; }
@Override Widget computeTabGroup () { ToolItem [] items = _getItems (); if (tabItemList == null) { int i = 0; while (i < items.length && items [i].control == null) i++; if (i == items.length) return super.computeTabGroup (); } int index = indexOf(currentFocusItem); if (index == -1) index = items.length - 1; while (index >= 0) { ToolItem item = items [index]; if (item.isTabGroup ()) return item; index--; } return super.computeTabGroup (); }
@Override Widget computeTabGroup () { ToolItem [] items = _getItems (); if (tabItemList == null) { int i = 0; while (i < items.length && items [i].control == null) i++; if (i == items.length) return super.computeTabGroup (); } int index = indexOf(currentFocusItem); if (index == -1) index = items.length - 1; while (index >= 0) { ToolItem item = items [index]; if (item.isTabGroup ()) return item; index--; } return super.computeTabGroup (); }
@Override Widget computeTabGroup () { ToolItem [] items = _getItems (); if (tabItemList == null) { int i = 0; while (i < items.length && items [i].control == null) i++; if (i == items.length) return super.computeTabGroup (); } int index = indexOf(currentFocusItem); if (index == -1) index = items.length - 1; while (index >= 0) { ToolItem item = items [index]; if (item.isTabGroup ()) return item; index--; } return super.computeTabGroup (); }
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"} ); } }
/** * Adds a tool item to the toolbar. * Note: Only called by standalone. */ private ToolItem addToolItem(final ToolBar toolbar, final Tool tool) { final String id = tool.group + '.' + tool.name; ToolItem item = new ToolItem (toolbar, tool.type); item.setText (getResourceString(id + ".label")); item.setToolTipText(getResourceString(id + ".tooltip")); item.setImage(tool.image); item.addSelectionListener(widgetSelectedAdapter(e -> tool.action.run())); final int childID = toolbar.indexOf(item); toolbar.getAccessible().addAccessibleListener(new AccessibleAdapter() { @Override public void getName(org.eclipse.swt.accessibility.AccessibleEvent e) { if (e.childID == childID) { e.result = getResourceString(id + ".description"); } } }); return item; }
@Override public void renderInitialization( ToolItem item ) throws IOException { ToolBar toolBar = item.getParent(); // 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. RemoteObject remoteObject = createRemoteObject( item, TYPE ); remoteObject.setHandler( new ToolItemOperationHandler( item ) ); remoteObject.set( "parent", getId( toolBar ) ); remoteObject.set( "style", createJsonArray( getStyles( item, ALLOWED_STYLES ) ) ); remoteObject.set( "index", toolBar.indexOf( item ) ); }