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:eu.geclipse.ui.internal.actions.ViewModeToggleAction.java

License:Open Source License

/**
 * Construct a new <code>ViewModeToggleAction</code> for the specified
 * {@link ConfigurableContentProvider}.//from   w w  w.  ja  v  a 2 s.  co  m
 * 
 * @param provider The {@link ConfigurableContentProvider} this action
 * is dediacted to.
 */
public ViewModeToggleAction(final ConfigurableContentProvider provider) {

    super(Messages.getString("ViewModeToggleAction.title"), IAction.AS_CHECK_BOX); //$NON-NLS-1$

    this.provider = provider;

    URL hierarchicalUrl = Activator.getDefault().getBundle().getEntry(ViewModeAction.VIEW_HIERARCHICAL_IMAGE);
    ImageDescriptor hierarchicalDescriptor = ImageDescriptor.createFromURL(hierarchicalUrl);
    setImageDescriptor(hierarchicalDescriptor);

}

From source file:eu.geclipse.ui.internal.dialogs.ProblemReportDialog.java

License:Open Source License

/**
 * Create a new problem report dialog for the specified problem.
 * /*from   ww w . j av a 2 s  .  co  m*/
 * @param parentShell The dialog's parent {@link Shell}.
 * @param throwable The {@link Throwable} to be reported.
 */
public ProblemReportDialog(final Shell parentShell, final Throwable throwable) {
    super(parentShell);
    this.exc = throwable;

    if (this.exc instanceof ProblemException) {
        this.problem = ((ProblemException) this.exc).getProblem();
    } else {
        this.problem = null;
    }

    setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.RESIZE);
    URL imgURL = Activator.getDefault().getBundle().getResource("icons/extras/problem_report_dlg.gif"); //$NON-NLS-1$
    ImageDescriptor imgDesc = ImageDescriptor.createFromURL(imgURL);
    setTitleImage(imgDesc.createImage());
}

From source file:eu.geclipse.ui.internal.ImageLoader.java

License:Open Source License

/**
 * Creates an image and adds it to this plug-in's image register.
 * // w w w  . ja  v  a  2s  .c  om
 * @param name the relative path of the image file, also used as identifier.
 */
private static void createManaged(final String name) {

    URL url = null;
    try {
        url = new URL(iconPathURL, name);
    } catch (MalformedURLException e) {
        Activator.logException(e);
    }

    ImageDescriptor result = ImageDescriptor.createFromURL(url);
    imageRegistry.put(name, result);
}

From source file:eu.geclipse.ui.internal.preference.VoPreferencePage.java

License:Open Source License

/**
 * Trigger the new VO wizard to pop up in order to create a new VO if vo
 * parameter is null or edit existing vo if vo parameter is specified.
 * /*from   w  w  w .j a  va  2  s  .c o m*/
 * @param vo To {@link IVirtualOrganization} to be edited. 
 */
protected void editVO(final IVirtualOrganization vo) {
    URL imgUrl = Activator.getDefault().getBundle().getEntry("icons/wizban/vo_wiz.gif"); //$NON-NLS-1$
    Wizard wizard = new Wizard() {
        @Override
        public void addPages() {
            ExtPointWizardSelectionListPage page = new ExtPointWizardSelectionListPage("pagename", //$NON-NLS-1$
                    "eu.geclipse.ui.newVoWizards", //$NON-NLS-1$
                    Messages.getString("VoPreferencePage.create_new_vo"), //$NON-NLS-1$
                    Messages.getString("VoPreferencePage.create_new_vo_long"), //$NON-NLS-1$
                    Messages.getString("VoPreferencePage.no_vo_providers")); //$NON-NLS-1$
            page.setInitData(vo);
            if (vo != null) {
                page.setPreselectedId(vo.getWizardId(), true);
            }
            addPage(page);
        }

        @Override
        public boolean performFinish() {
            return false;
        }
    };
    wizard.setForcePreviousAndNextButtons(true);
    wizard.setNeedsProgressMonitor(true);
    wizard.setWindowTitle(Messages.getString("VoPreferencePage.create_new_vo")); //$NON-NLS-1$
    wizard.setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(imgUrl));
    WizardDialog dialog = new WizardDialog(this.getShell(), wizard);
    dialog.open();

    /*
     * If no VOs were present before calling the wizard, there is now a default
     * VO to mark as checked.
     */
    checkDefaultVo();

}

From source file:eu.geclipse.ui.internal.wizards.VoImportWizard.java

License:Open Source License

/**
 * Standard constructor.//from w w w  . j av  a 2s . c  om
 * @throws ProblemException thrown in case the wizard can not be opened
 */
public VoImportWizard() throws ProblemException {
    super();
    setNeedsProgressMonitor(true);
    this.selectionPage = new VoLoaderSelectionPage();
    if (this.selectionPage.getAvailableLoaders().size() == 0) {
        throw new ProblemException("eu.geclipse.problem.canNotFindVoLoaders", Activator.PLUGIN_ID); //$NON-NLS-1$
    }
    URL imgUrl = Activator.getDefault().getBundle().getEntry("icons/wizban/vo_wiz.gif"); //$NON-NLS-1$
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(imgUrl));
}

From source file:eu.geclipse.ui.providers.FileStoreLabelProvider.java

License:Open Source License

/**
 * Load the image from the specified path.
 * /*from   w ww . j  ava2s.c om*/
 * @param path The path of the image.
 * @return The image or <code>null</code> if no image could be found
 * at the specified path.
 */
protected static Image loadImage(final String path) {
    URL url = Activator.getDefault().getBundle().getEntry(path);
    ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
    return descriptor.createImage();
}

From source file:eu.geclipse.ui.providers.GridModelLabelProvider.java

License:Open Source License

private static Image loadImage(final String path) {
    URL url = Activator.getDefault().getBundle().getEntry(path);
    ImageDescriptor descriptor = ImageDescriptor.createFromURL(url);
    return descriptor.createImage();
}

From source file:eu.geclipse.ui.wizards.ConnectionWizard.java

License:Open Source License

public ConnectionWizard(final URI initialURI, final String initialName, final boolean createGlobalConnection) {
    URL imgURL = Activator.getDefault().getBundle().getResource("icons/wizban/newconn_wiz.gif"); //$NON-NLS-1$
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(imgURL));
    setNeedsProgressMonitor(true);/*from   w ww.  ja va  2 s. c  o m*/
    this.createGlobalConnection = createGlobalConnection;
    this.initialURI = initialURI;
    this.initialName = initialName;
}

From source file:eu.geclipse.ui.wizards.GenericVoWizardPage.java

License:Open Source License

/**
 * Standard constructor./*from w w w  .ja  va2 s  .c  o m*/
 */
public GenericVoWizardPage() {
    super("genericVOPage", //$NON-NLS-1$
            "Generic VO", null);
    setDescription("Specify the attributes of your VO");
    URL imgUrl = Activator.getDefault().getBundle().getEntry("icons/wizban/vo_wiz.gif"); //$NON-NLS-1$
    setImageDescriptor(ImageDescriptor.createFromURL(imgUrl));
}

From source file:eu.geclipse.ui.wizards.jobsubmission.JobCreatorSelectionWizard.java

License:Open Source License

public JobCreatorSelectionWizard(final List<IGridJobDescription> jobDescriptions) {
    this.jobDescriptions = new ArrayList<IGridJobDescription>(jobDescriptions);
    setNeedsProgressMonitor(true);// w  w w  .  ja va 2  s.c om
    setForcePreviousAndNextButtons(true);
    setWindowTitle(Messages.getString("JobCreatorSelectionWizard.title")); //$NON-NLS-1$
    URL imgUrl = Activator.getDefault().getBundle().getEntry("icons/wizban/jobsubmit_wiz.gif"); //$NON-NLS-1$
    setDefaultPageImageDescriptor(ImageDescriptor.createFromURL(imgUrl));
}