Example usage for org.eclipse.jface.resource ImageDescriptor createFromURL

List of usage examples for org.eclipse.jface.resource ImageDescriptor createFromURL

Introduction

In this page you can find the example usage for org.eclipse.jface.resource ImageDescriptor createFromURL.

Prototype

public static ImageDescriptor createFromURL(URL url) 

Source Link

Document

Creates and returns a new image descriptor from a URL.

Usage

From source file:com.liferay.ide.server.ui.LiferayServerUI.java

License:Open Source License

/**
 * Register an image with the registry.//from w  w  w. j av  a  2  s  . c  o  m
 *
 * @param key
 *            java.lang.String
 * @param partialURL
 *            java.lang.String
 */
private void registerImage(ImageRegistry registry, String key, String partialURL) {
    if (ICON_BASE_URL == null) {
        String pathSuffix = "icons/"; //$NON-NLS-1$

        ICON_BASE_URL = plugin.getBundle().getEntry(pathSuffix);
    }

    try {
        ImageDescriptor id = ImageDescriptor.createFromURL(new URL(ICON_BASE_URL, partialURL));

        registry.put(key, id);

        imageDescriptors.put(key, id);
    } catch (Exception e) {
        plugin.getLog().log(new Status(IStatus.ERROR, PLUGIN_ID, e.getMessage()));
    }
}

From source file:com.liferay.ide.server.ui.wizard.LiferayRuntimeStubWizardFragment.java

License:Open Source License

@Override
public Composite createComposite(Composite parent, IWizardHandle wizard) {
    wizard.setTitle(Msgs.liferayRuntimeStub);
    wizard.setDescription(Msgs.specifyDirectoryLocation);
    wizard.setImageDescriptor(ImageDescriptor
            .createFromURL(LiferayServerUI.getDefault().getBundle().getEntry("/icons/wizban/server_wiz.png"))); //$NON-NLS-1$

    composite = new LiferayRuntimeStubComposite(parent, wizard);

    return composite;
}

From source file:com.liferay.ide.server.ui.wizard.RemoteServerWizardFragment.java

License:Open Source License

@Override
public Composite createComposite(Composite parent, IWizardHandle wizard) {
    this.wizard = wizard;

    composite = new RemoteServerComposite(parent, this, wizard);

    wizard.setTitle(Msgs.remoteLiferayServer);
    wizard.setDescription(Msgs.configureRemoteLiferayServerInstance);
    wizard.setImageDescriptor(ImageDescriptor
            .createFromURL(LiferayServerUI.getDefault().getBundle().getEntry("/icons/wizban/server_wiz.png"))); //$NON-NLS-1$

    return composite;
}

From source file:com.liferay.ide.service.ui.wizard.NewServiceBuilderWizardPage.java

License:Open Source License

protected void setShellImage() {
    URL url = ServiceUI.getDefault().getBundle().getEntry("/icons/e16/service.png"); //$NON-NLS-1$

    Image shellImage = ImageDescriptor.createFromURL(url).createImage();

    getShell().setImage(shellImage);// w w w  .  ja  va  2  s  . c om

}

From source file:com.liferay.ide.ui.LiferayUIPlugin.java

License:Open Source License

protected void registerImage(ImageRegistry registry, String key, String path) {
    try {//from  w w w .  j ava  2s . c  o  m
        ImageDescriptor id = ImageDescriptor.createFromURL(getBundle().getEntry(path));

        imageDescriptors.put(key, id);

        registry.put(key, id);
    } catch (Exception e) {
    }
}

From source file:com.liferay.ide.ui.util.UIUtil.java

License:Open Source License

public static ImageDescriptor getPluginImageDescriptor(String symbolicName, String imagePath) {
    Bundle bundle = Platform.getBundle(symbolicName);

    if (bundle != null) {
        URL entry = bundle.getEntry(imagePath);

        if (entry != null) {
            return ImageDescriptor.createFromURL(entry);
        }//from   www  .j av a 2 s .  com
    }

    return null;
}

From source file:com.liferay.ide.xml.search.ui.AddResourceBundleFileMarkerResolution.java

License:Open Source License

public Image getImage() {
    final URL url = LiferayXMLSearchUI.getDefault().getBundle().getEntry("/icons/resource-bundle-new.png");

    return ImageDescriptor.createFromURL(url).createImage();
}

From source file:com.liferay.ide.xml.search.ui.AddResourceKeyMarkerResolution.java

License:Open Source License

public Image getImage() {
    final URL url = LiferayXMLSearchUI.getDefault().getBundle().getEntry("/icons/resource-bundle.png");

    return ImageDescriptor.createFromURL(url).createImage();
}

From source file:com.liferay.ide.xml.search.ui.editor.ServiceXmlTemplateCompletinoProcessor.java

License:Open Source License

@Override
protected Image getImage(Template template) {
    final URL url = LiferayXMLSearchUI.getDefault().getBundle().getEntry("/icons/service_template.gif");
    return ImageDescriptor.createFromURL(url).createImage();
}

From source file:com.liferay.ide.xml.search.ui.LiferayXMLSearchUI.java

License:Open Source License

public void start(BundleContext context) throws Exception {
    super.start(context);
    plugin = this;

    final URL baseIconsURL = getBundle().getEntry("icons/");
    final ImageDescriptor portletImage = ImageDescriptor.createFromURL(new URL(baseIconsURL, "portlet.png"));

    getImageRegistry().put(PORTLET_IMG, portletImage);
}