List of usage examples for org.eclipse.jface.resource ImageDescriptor createFromURL
public static ImageDescriptor createFromURL(URL url)
From source file:com.ibm.xsp.extlib.designer.tooling.ExtLibToolingPlugin.java
License:Open Source License
public static ImageDescriptor getImageDescriptor(String location) { String iconPath = "images/"; //$NON-NLS-1$ URL imageUrl = getDefault().getBundle().getEntry(iconPath + location); if (imageUrl != null) { return ImageDescriptor.createFromURL(imageUrl); }/*from ww w . j a va 2s . c om*/ return null; }
From source file:com.ibm.xsp.extlib.designer.tooling.palette.applicationlayout.AlwStartPage.java
License:Open Source License
private void populateConfigurationList() { // Find all the app layout configurations List<FacesDefinition> list = ExtLibRegistryUtil .getConfigNodes(StandardRegistryMaintainer.getStandardRegistry()); for (FacesDefinition def : list) { // Create a new LayoutConfig LayoutConfig lc = new LayoutConfig(); lc.tagName = def.getTagName();// w ww.j av a 2s.co m lc.facesDef = def; DesignerExtension de = DesignerExtensionUtil.getExtension(def); if (de != null) { // There's a <designer-extension> lc.title = de.getDisplayName(); lc.description = de.getDescription(); } ExtLibLayoutExtension le = (ExtLibLayoutExtension) def.getExtension(LAYOUT_EXTENSION); if (le != null) { // There is a <layout-extension> lc.responsive = le.isResponsive(); lc.sampleURL = le.getSampleURL(); if (le.getImage() != null) { // Get the image if any ImageDescriptor id = ImageDescriptor.createFromURL(le.getImage()); lc.image = id.createImage(); } } if (lc.image == null) { // If there's no image add a default one lc.image = _defImage; } if (StringUtil.isEmpty(lc.title)) { // Use the tagName if there's no title lc.title = lc.facesDef.getFirstDefaultPrefix() + ":" + lc.tagName; } // Add this configuration to the list _configList.add(lc); } // Sort the list Collections.sort(_configList, new Comparator<LayoutConfig>() { @Override public int compare(LayoutConfig lc1, LayoutConfig lc2) { return lc1.title.compareToIgnoreCase(lc2.title); } }); }
From source file:com.ibm.xsp.extlib.designer.xspprops.Activator.java
License:Open Source License
public static ImageDescriptor getImageDescriptor(String location) { String iconPath = "icons/"; //$NON-NLS-1$ URL imageUrl = getDefault().getBundle().getEntry(iconPath + location); if (imageUrl != null) { return ImageDescriptor.createFromURL(imageUrl); }/*from www. java2 s .c o m*/ return null; }
From source file:com.intel.audioviz.widgets.AudioVizWidgetResources.java
License:Open Source License
private static ImageRegistry getNewLocalImageRegistry() { final Bundle b = FrameworkUtil.getBundle(AudioVizWidgetResources.class); final ImageRegistry reg = new ImageRegistry(); reg.put(IMG_LOCKED, ImageDescriptor.createFromURL(b.getEntry(IMG_LOCKED))); reg.put(IMG_UNLOCKED, ImageDescriptor.createFromURL(b.getEntry(IMG_UNLOCKED))); reg.put(IMG_DISABLED_LOCK, ImageDescriptor.createFromURL(b.getEntry(IMG_DISABLED_LOCK))); reg.put(IMG_XFULLRANGE, ImageDescriptor.createFromURL(b.getEntry(IMG_XFULLRANGE))); reg.put(IMG_XZOOMIN, ImageDescriptor.createFromURL(b.getEntry(IMG_XZOOMIN))); reg.put(IMG_XZOOMOUT, ImageDescriptor.createFromURL(b.getEntry(IMG_XZOOMOUT))); return reg;// w w w . j ava 2s. com }
From source file:com.intel.tools.utils.about.AboutDialog.java
/** * Create contents of the dialog./*from www.j av a2 s .c o m*/ * * @param parent */ @Override protected Control createDialogArea(Composite parent) { if (product != null) { URL url = getUrl(product.getProperty("aboutImage"), product.getDefiningBundle()); ImageDescriptor imageDescriptor = ImageDescriptor.createFromURL(url); if (imageDescriptor != null && url != null) { aboutImage = imageDescriptor.createImage(); } } Composite container = (Composite) super.createDialogArea(parent); container.setBackgroundMode(SWT.INHERIT_DEFAULT); container.setBackground(IntelPalette.WHITE); GridLayout gl_container = new GridLayout(2, false); gl_container.marginLeft = 16; gl_container.marginHeight = 0; gl_container.verticalSpacing = 0; gl_container.marginWidth = 0; container.setLayout(gl_container); Label lblNewLabel_1 = new Label(container, SWT.NONE); lblNewLabel_1.setFont(SWTResourceManager.getFont("Segoe UI", 13, SWT.BOLD)); if (aboutImage != null) { lblNewLabel_1.setImage(aboutImage); } else { lblNewLabel_1.setText(productName); lblNewLabel_1.setForeground(IntelPalette.LIGHT_BLUE); } GridData gd_lblNewLabel_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1); gd_lblNewLabel_1.verticalIndent = 16; lblNewLabel_1.setLayoutData(gd_lblNewLabel_1); Label lblNewLabel = new Label(container, SWT.NONE); lblNewLabel.setImage(ResourceManager.getPluginImage("com.intel.tools.utils", "images/vertical_banner.png")); GridData gd_lblNewLabel = new GridData(SWT.LEFT, SWT.TOP, false, true, 1, 2 + urlList.size()); gd_lblNewLabel.widthHint = 150; lblNewLabel.setLayoutData(gd_lblNewLabel); StyledText styledText = new StyledText(container, SWT.WRAP); styledText.setEnabled(false); styledText.setEditable(false); GridData gd_styledText = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1); gd_styledText.verticalIndent = 16; styledText.setLayoutData(gd_styledText); if (product != null) { styledText.setText(getAboutText(product)); } for (LabelUrl labelUrl : urlList) { Label licenseLink = new Label(container, SWT.NONE); licenseLink.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1)); licenseLink.setForeground(IntelPalette.LIGHT_BLUE); licenseLink.setText(labelUrl.getLabel()); licenseLink.setCursor(Display.getCurrent().getSystemCursor(SWT.CURSOR_HAND)); licenseLink.addMouseListener(new LabelURLMouseListener(labelUrl)); } new Label(container, SWT.NONE); new Label(container, SWT.NONE); new Label(container, SWT.NONE); new Label(container, SWT.NONE); return container; }
From source file:com.iw.plugins.spindle.Images.java
License:Mozilla Public License
public static Image getSharedImage(String name) { ImageRegistry registry = getImageRegistry(); URL imageURL = getImageURL(name); String urlString = null;// ww w .j av a 2s . c o m if (imageURL != null) { urlString = imageURL.toString(); } else { return getSharedImage("missing.gif"); } Image result = registry.get(urlString); if (result == null) { ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL); Registry.put(urlString, descriptor.createImage()); result = registry.get(urlString); } return result; }
From source file:com.iw.plugins.spindle.Images.java
License:Mozilla Public License
/** * Utility method to create an <code>ImageDescriptor</code> from a path to a * file./*from w w w. ja v a2s . com*/ */ public static ImageDescriptor createImageDescriptor(URL imageURL) { if (imageURL == null) { return ImageDescriptor.getMissingImageDescriptor(); } return ImageDescriptor.createFromURL(imageURL); }
From source file:com.iw.plugins.spindle.refactor.components.RefactorAliasScopePage.java
License:Mozilla Public License
/** * Constructor for ConversionWelcomePage. * @param name//from w w w. j a v a2s . c o m */ public RefactorAliasScopePage(String name, List affectedComponents) { super(name); this.setImageDescriptor(ImageDescriptor.createFromURL(TapestryImages.getImageURL("componentDialog.gif"))); this.setDescription("Preview of Component Alias refactoring"); this.affectedComponents = affectedComponents; }
From source file:com.iw.plugins.spindle.refactor.components.RefactorComponentAliasPage.java
License:Mozilla Public License
/** * Constructor for RefactorCompontentNamePage. * @param pageName//from w ww . jav a2 s. c om */ public RefactorComponentAliasPage(String pageName, String oldName, boolean showButtons, List existingComponentAliases) { super(pageName); setTitle("Change Component Alias"); setDescription("Specify a new alias for the selected Component"); this.oldName = oldName; this.showButtons = showButtons; this.existingComponentAliases = existingComponentAliases; existingComponentAliases.remove(oldName); this.setImageDescriptor(ImageDescriptor.createFromURL(TapestryImages.getImageURL("componentDialog.gif"))); }
From source file:com.iw.plugins.spindle.TapestryImages.java
License:Mozilla Public License
public static Image getSharedImage(String name) { ImageRegistry registry = getImageRegistry(); URL imageURL = getImageURL(name); String urlString = null;/* w w w . j a v a 2 s . co m*/ if (imageURL != null) { urlString = imageURL.toString(); } else { return registry.get("missing"); } Image result = registry.get(urlString); if (result == null) { ImageDescriptor descriptor = ImageDescriptor.createFromURL(imageURL); Registry.put(urlString, descriptor.createImage()); result = registry.get(urlString); } return result; }