List of usage examples for org.eclipse.jface.resource ImageDescriptor createFromURL
public static ImageDescriptor createFromURL(URL url)
From source file:com.sap.dirigible.ide.common.image.ImageUtils.java
License:Open Source License
public static Image createImage(URL imageURL) { final ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL); return resourceManager.createImage(imageDescriptor); }
From source file:com.sap.dirigible.ide.db.viewer.views.AbstractSQLConsole.java
License:Open Source License
@SuppressWarnings("unused") @Override/* w w w . j a v a 2s .c o m*/ public void createPartControl(Composite parent) { parent.setLayout(new GridLayout()); ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.WRAP | SWT.RIGHT | SWT.BORDER | SWT.SHADOW_OUT); SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.BORDER); sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scriptArea = createSQLEditorWidget(sashForm); scriptArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scriptArea.setText(EMPTY, getMode(), false, false, 0); outputArea = new Text(sashForm, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY); outputArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); outputArea.setText(EMPTY); outputArea.setFont(new Font(null, "Courier New", 12, SWT.NORMAL)); //$NON-NLS-1$ ToolItem itemQuery = new ToolItem(toolBar, SWT.PUSH | SWT.SEPARATOR); itemQuery.setText(EXECUTE_QUERY); Image iconQuery = ImageDescriptor .createFromURL(AbstractSQLConsole.class.getResource(ICONS_SEGMENT + ICON_EXECUTE_QUERY_PNG)) .createImage(); //$NON-NLS-1$ itemQuery.setImage(iconQuery); itemQuery.addSelectionListener(new SelectionListener() { private static final long serialVersionUID = 1281159157504712273L; @Override public void widgetSelected(SelectionEvent e) { actionExecuteQuery.run(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // } }); boolean isOperator = CommonParameters.isUserInRole(CommonParameters.ROLE_OPERATOR); if (isOperator) { new ToolItem(toolBar, SWT.SEPARATOR); ToolItem itemUpdate = new ToolItem(toolBar, SWT.PUSH); itemUpdate.setText(EXECUTE_UPDATE); Image iconUpdate = ImageDescriptor .createFromURL(AbstractSQLConsole.class.getResource(ICONS_SEGMENT + ICON_EXECUTE_UPDATE_PNG)) .createImage(); //$NON-NLS-1$ itemUpdate.setImage(iconUpdate); itemUpdate.addSelectionListener(new SelectionListener() { private static final long serialVersionUID = 1281159157504712273L; @Override public void widgetSelected(SelectionEvent e) { actionExecuteUpdate.run(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // } }); } // Create the help context id for the viewer's control // PlatformUI.getWorkbench().getHelpSystem().setHelp(scriptArea, // "com.sap.dirigible.ide.db.viewer.views.SQLConsole"); makeActions(); hookContextMenu(); // hookDoubleClickAction(); // contributeToActionBars(); }
From source file:com.sap.dirigible.ide.db.viewer.views.DatabaseViewLabelProvider.java
License:Open Source License
private Image createImage(URL imageURL) { ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL); return resourceManager.createImage(imageDescriptor); }
From source file:com.sap.dirigible.ide.db.viewer.views.SQLConsole.java
License:Open Source License
@SuppressWarnings("unused") @Override/*from ww w . j a v a 2 s . c o m*/ public void createPartControl(Composite parent) { parent.setLayout(new GridLayout()); ToolBar toolBar = new ToolBar(parent, SWT.FLAT | SWT.WRAP | SWT.RIGHT | SWT.BORDER | SWT.SHADOW_OUT); SashForm sashForm = new SashForm(parent, SWT.VERTICAL | SWT.BORDER); sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scriptArea = new EditorWidget(sashForm); scriptArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); scriptArea.setText(EMPTY, getMode(), false, false, 0); outputArea = new Text(sashForm, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.READ_ONLY); outputArea.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); outputArea.setText(EMPTY); outputArea.setFont(new Font(null, "Courier New", 12, SWT.NORMAL)); //$NON-NLS-1$ ToolItem itemQuery = new ToolItem(toolBar, SWT.PUSH | SWT.SEPARATOR); itemQuery.setText(EXECUTE_QUERY); Image iconQuery = ImageDescriptor .createFromURL(SQLConsole.class.getResource(ICONS_SEGMENT + ICON_EXECUTE_QUERY_PNG)).createImage(); //$NON-NLS-1$ itemQuery.setImage(iconQuery); itemQuery.addSelectionListener(new SelectionListener() { private static final long serialVersionUID = 1281159157504712273L; @Override public void widgetSelected(SelectionEvent e) { actionExecuteQuery.run(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // } }); boolean isOperator = CommonParameters.isUserInRole(CommonParameters.ROLE_OPERATOR); if (isOperator) { new ToolItem(toolBar, SWT.SEPARATOR); ToolItem itemUpdate = new ToolItem(toolBar, SWT.PUSH); itemUpdate.setText(EXECUTE_UPDATE); Image iconUpdate = ImageDescriptor .createFromURL(SQLConsole.class.getResource(ICONS_SEGMENT + ICON_EXECUTE_UPDATE_PNG)) .createImage(); //$NON-NLS-1$ itemUpdate.setImage(iconUpdate); itemUpdate.addSelectionListener(new SelectionListener() { private static final long serialVersionUID = 1281159157504712273L; @Override public void widgetSelected(SelectionEvent e) { actionExecuteUpdate.run(); } @Override public void widgetDefaultSelected(SelectionEvent e) { // } }); } // Create the help context id for the viewer's control // PlatformUI.getWorkbench().getHelpSystem().setHelp(scriptArea, // "com.sap.dirigible.ide.db.viewer.views.SQLConsole"); makeActions(); hookContextMenu(); // hookDoubleClickAction(); // contributeToActionBars(); }
From source file:com.sap.dirigible.ide.designer.ui.DesignerView.java
License:Open Source License
private Image createImage(URL imageURL) { // TODO - cached? ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL); return resourceManager.createImage(imageDescriptor); }
From source file:com.sap.dirigible.ide.template.ui.common.TemplateType.java
License:Open Source License
private static Image createImage(URL imageURL) { ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(imageURL); return resourceManager.createImage(imageDescriptor); }
From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.wizard.SapNWRuntimeComposite.java
License:Open Source License
protected SapNWRuntimeComposite(Composite parent, IWizardHandle wizard) { super(parent, SWT.NONE); this.wizard = wizard; wizard.setTitle("New Runtime for SAP NetWeaver"); wizard.setDescription("Specify the location of a Java instance. Use the Browse... button. "); // TODO wizard icon try {/*from w w w . j av a2s.c om*/ wizard.setImageDescriptor(ImageDescriptor.createFromURL( new URL(SapNWPlugin.getDefault().getBundle().getEntry("icons/"), "wizban/sap_wiz.png"))); } catch (MalformedURLException e) { SapNWPlugin.logError("Cannot load wizard icon for the SAP NetWeaver runtime", e); } createControl(); }
From source file:com.sap.netweaver.porta.ide.eclipse.server.ui.wizard.SapNWServerComposite.java
License:Open Source License
protected SapNWServerComposite(Composite parent, IWizardHandle wizard) { super(parent, SWT.NONE); this.wizard = wizard; wizard.setTitle("New Server for SAP NetWeaver"); wizard.setDescription("Specify the host name and the instance number of a Java instance. "); // TODO wizard icon try {/*from w ww . j av a 2 s . com*/ wizard.setImageDescriptor(ImageDescriptor.createFromURL( new URL(SapNWPlugin.getDefault().getBundle().getEntry("icons/"), "wizban/sap_wiz.png"))); } catch (MalformedURLException e) { SapNWPlugin.logError("Cannot load wizard icon for the SAP NetWeaver server", e); } createControl(); }
From source file:com.se.simplicity.editor.internal.EditorPlugin.java
License:Open Source License
/** * <p>/*from w ww.ja va 2s.c o m*/ * Creates an instance of <code>SceneManager</code>. Hidden because only one instance of the <code>SceneManager</code> should exist. * </p> */ private EditorPlugin() { fLogger = Logger.getLogger(getClass().getName()); fPropertyChangeListeners = new ArrayList<IPropertyChangeListener>(); try { fImageRegistry = new ImageRegistry(); fImageRegistry.put("sceneComponentEmpty", ImageDescriptor.createFromURL( new URL("file:///home/simple/workspace/com.se.simplicity.editor/images/simple_eddy.gif"))); } catch (Exception e) { fLogger.error("Failed to load image(s).", e); } }
From source file:com.siteview.mde.internal.runtime.PDERuntimePluginImages.java
License:Open Source License
private static ImageDescriptor create(String prefix, String name) { return ImageDescriptor.createFromURL(makeIconURL(prefix, name)); }