本文整理匯總了Java中org.eclipse.swt.widgets.ToolItem.setDisabledImage方法的典型用法代碼示例。如果您正苦於以下問題:Java ToolItem.setDisabledImage方法的具體用法?Java ToolItem.setDisabledImage怎麽用?Java ToolItem.setDisabledImage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.ToolItem
的用法示例。
在下文中一共展示了ToolItem.setDisabledImage方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ParamsAttachManager
import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
ParamsAttachManager( final ItemModel model, final StyledText styledText, final ToolBar toolbar) {
// this.swtText = swtText;
this.toolBar = toolbar;
ParamsOpen open = new ParamsOpen(this, model, styledText);
i_open = new ToolItem(toolBar, SWT.PUSH);
i_open.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN));
i_open.setDisabledImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN_DIS));
i_open.setToolTipText("Add File");
i_open.addSelectionListener(open);
}
示例2: createDisabledImage
import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
/**
* Registers an image for a tool item. Generates a version of the image
* that renders well on windows toolbars, when disabled.
*
* @param item
* @param image
*/
public static void createDisabledImage(ToolItem item) {
final Image image = new Image(item.getDisplay(), item.getImage(), SWT.IMAGE_GRAY);
item.setDisabledImage(image);
item.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent arg0) {
if (image != null && !image.isDisposed()) {
image.dispose();
}
}
});
}
示例3: AttachManager
import org.eclipse.swt.widgets.ToolItem; //導入方法依賴的package包/類
AttachManager( final ItemModel model, final StyledText swtText, final ToolBar toolbar) {
// this.swtText = swtText;
this.toolBar = toolbar;
Open open = new Open(model, swtText);
i_open = new ToolItem(toolBar, SWT.PUSH);
i_open.setImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN));
i_open.setDisabledImage(ResourceUtils.getImage(CoreConstants.PLUGIN_CORE, CoreImages.FILE_OPEN_DIS));
i_open.setToolTipText("Add File");
i_open.addSelectionListener(open);
// i_open.addSelectionListener(new SelectionAdapter() {
// public void widgetSelected( SelectionEvent e){
// }
// });
// // Menu(bar)
// menu = new Menu(toolBar.getShell(), SWT.POP_UP);
//
// MenuItem m_addBody = new MenuItem(menu, SWT.PUSH);
// m_addBody.setText("Add File");
// m_addBody.addSelectionListener(open);
// m_attachPart = new MenuItem(menu, SWT.PUSH);
// m_attachPart.setText("Attach File");
// m_attachPart.addSelectionListener(open);
//
// addBody = new ToolItem(toolBar, SWT.DROP_DOWN);
// addBody.setImage(ResourceUtils.getImage(CoreImages.ATTACH));
// addBody.setToolTipText("Add Body");
// addBody.addListener(SWT.Selection, new Listener() {
// public void handleEvent( Event event){
// if (event.detail == SWT.ARROW) {
// Rectangle rect = addBody.getBounds();
// menu.setLocation(toolBar.toDisplay(rect.x, rect.y + rect.height));
// menu.setVisible(true);
// } else {
// FileDialog fd = new FileDialog(toolBar.getShell(), SWT.OPEN);
// fd.setText("Open");
// // fd.setFilterPath("C:/");
// fd.setFilterExtensions(CoreConstants.FILE_FILTER_EXT);
// String file = fd.open();
// if (file != null) {
// fileReadAction(file);
// }
// }
// }
// });
}