private void setHoverIcon(ImageDescriptor desc) { hoverIcon = desc; updateIcons(); }
private void setIcon(ImageDescriptor desc) { icon = desc; updateIcons(); }
private void setDisabledIcon(ImageDescriptor desc) { disabledIcon = desc; updateIcons(); }
@Override public void fill(Composite parent) { if (command == null) { return; } if (widget != null || parent == null) { return; } // Buttons don't support the pulldown style int tmpStyle = style; if (tmpStyle == STYLE_PULLDOWN) tmpStyle = STYLE_PUSH; Button item = new Button(parent, tmpStyle); item.setData(this); if (workbenchHelpSystem != null) { workbenchHelpSystem.setHelp(item, helpContextId); } item.addListener(SWT.Dispose, getItemListener()); item.addListener(SWT.Selection, getItemListener()); widget = item; update(null); updateIcons(); establishReferences(); }
@Override public void fill(ToolBar parent, int index) { if (command == null) { return; } if (widget != null || parent == null) { return; } ToolItem item = null; if (index >= 0) { item = new ToolItem(parent, style, index); } else { item = new ToolItem(parent, style); } item.setData(this); item.addListener(SWT.Selection, getItemListener()); item.addListener(SWT.Dispose, getItemListener()); widget = item; update(null); updateIcons(); establishReferences(); }
@Override public void fill(Menu parent, int index) { if (command == null) { return; } if (widget != null || parent == null) { return; } // Menus don't support the pulldown style int tmpStyle = style; if (tmpStyle == STYLE_PULLDOWN) tmpStyle = STYLE_PUSH; MenuItem item = null; if (index >= 0) { item = new MenuItem(parent, tmpStyle, index); } else { item = new MenuItem(parent, tmpStyle); } item.setData(this); if (workbenchHelpSystem != null) { workbenchHelpSystem.setHelp(item, helpContextId); } item.addListener(SWT.Dispose, getItemListener()); item.addListener(SWT.Selection, getItemListener()); widget = item; update(null); updateIcons(); establishReferences(); }