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

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

Introduction

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

Prototype

public static ImageDescriptor createFromFile(Class<?> location, String filename) 

Source Link

Document

Creates and returns a new image descriptor from a file.

Usage

From source file:org.fedoraproject.eclipse.packager.local.internal.ui.LocalFedoraPackagerPageTwo.java

License:Open Source License

/**
 * Create the wizard./*from  w  w  w .j  ava2s  . c  o m*/
 */
public LocalFedoraPackagerPageTwo(String pageName) {
    super(pageName);
    setTitle(LocalFedoraPackagerText.LocalFedoraPackagerWizardPage_title);
    setDescription(LocalFedoraPackagerText.LocalFedoraPackagerWizardPage_description);
    setImageDescriptor(ImageDescriptor.createFromFile(getClass(),
            LocalFedoraPackagerText.LocalFedoraPackagerWizardPage_image));
}

From source file:org.fusesource.ide.branding.wizards.NewCamelTestWizard.java

License:Open Source License

public NewCamelTestWizard() {
    super();//ww w .ja v  a 2 s.co m
    setWindowTitle(WizardMessages.Wizard_title_new_testcase);
    setDefaultPageImageDescriptor(
            ImageDescriptor.createFromFile(this.getClass(), "/icons/new_camel_test_case_wizard.png"));
    initDialogSettings();
}

From source file:org.fusesource.ide.branding.wizards.NewCamelXmlWizard.java

License:Open Source License

/**
 * Constructor for NewCamelXmlWizard./*from w ww  . j a v a2s  .c om*/
 */
public NewCamelXmlWizard() {
    super();
    setWindowTitle(WizardMessages.NewCamelXMLWizard_wizardTitle);
    setDefaultPageImageDescriptor(
            ImageDescriptor.createFromFile(this.getClass(), "/icons/new_camel_context_wizard.png"));
    setNeedsProgressMonitor(true);
}

From source file:org.fusesource.ide.branding.wizards.NewMessageWizard.java

License:Open Source License

public NewMessageWizard() {
    super();// www  . j  a  va2  s. co  m
    setWindowTitle(WizardMessages.NewMessageWizard_Title);
    setDefaultPageImageDescriptor(
            ImageDescriptor.createFromFile(this.getClass(), "/icons/new_message_wizard.png"));
    setNeedsProgressMonitor(true);
}

From source file:org.fusesource.ide.branding.wizards.project.FuseProjectWizard.java

License:Open Source License

/**
 * Default constructor. Sets the title and image of the wizard.
 *///  ww  w . java 2 s. c  o  m
public FuseProjectWizard() {
    super();
    setWindowTitle(WizardMessages.wizardProjectTitle);
    setDefaultPageImageDescriptor(
            ImageDescriptor.createFromFile(this.getClass(), "/icons/new_fuse_project_wizard.png"));
    setNeedsProgressMonitor(true);
}

From source file:org.fusesource.tools.core.ui.url.util.ImagesUtil.java

License:Open Source License

public static ImageDescriptor loadImageFromPlugin(String imagePath) {
    ImageDescriptor imageDescriptor = null;

    URL url = null;/*from  w  ww  .ja  va2 s. c o  m*/
    try {
        imageDescriptor = ImageDescriptor.createFromFile(getInstance().getClass(), imagePath);
    } catch (Exception e) {
        e.printStackTrace();
    }
    return imageDescriptor;
}

From source file:org.integratedmodelling.thinkscape.gedit.ModelEditorPaletteFactory.java

License:Open Source License

/** Create the "Shapes" drawer. */
private static PaletteContainer createShapesDrawer() {
    PaletteDrawer componentsDrawer = new PaletteDrawer("Shapes");

    CombinedTemplateCreationEntry component = new CombinedTemplateCreationEntry("Ellipse",
            "Create an elliptical shape", EllipticalShape.class, new SimpleFactory(EllipticalShape.class),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/ellipse16.gif"),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/ellipse24.gif"));
    componentsDrawer.add(component);// w w  w.java 2 s  . co  m

    component = new CombinedTemplateCreationEntry("Rectangle", "Create a rectangular shape",
            RectangularShape.class, new SimpleFactory(RectangularShape.class),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/rectangle16.gif"),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/rectangle24.gif"));
    componentsDrawer.add(component);

    return componentsDrawer;
}

From source file:org.integratedmodelling.thinkscape.gedit.ModelEditorPaletteFactory.java

License:Open Source License

/** Create the "Tools" group. */
private static PaletteContainer createToolsGroup(PaletteRoot palette) {
    PaletteToolbar toolbar = new PaletteToolbar("Tools");

    // Add a selection tool to the group
    ToolEntry tool = new PanningSelectionToolEntry();
    toolbar.add(tool);/*from  w ww. j  a  v a2  s.  c  o  m*/
    palette.setDefaultEntry(tool);

    // Add a marquee tool to the group
    toolbar.add(new MarqueeToolEntry());

    // Add (solid-line) connection tool 
    tool = new ConnectionCreationToolEntry("Solid connection", "Create a solid-line connection",
            new CreationFactory() {
                public Object getNewObject() {
                    return null;
                }

                // see ShapeEditPart#createEditPolicies() 
                // this is abused to transmit the desired line style 
                public Object getObjectType() {
                    return Connection.SOLID_CONNECTION;
                }
            }, ImageDescriptor.createFromFile(ModelManager.class, "icons/connection_s16.gif"),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/connection_s24.gif"));
    toolbar.add(tool);

    // Add (dashed-line) connection tool
    tool = new ConnectionCreationToolEntry("Dashed connection", "Create a dashed-line connection",
            new CreationFactory() {
                public Object getNewObject() {
                    return null;
                }

                // see ShapeEditPart#createEditPolicies()
                // this is abused to transmit the desired line style 
                public Object getObjectType() {
                    return Connection.DASHED_CONNECTION;
                }
            }, ImageDescriptor.createFromFile(ModelManager.class, "icons/connection_d16.gif"),
            ImageDescriptor.createFromFile(ModelManager.class, "icons/connection_d24.gif"));
    toolbar.add(tool);

    return toolbar;
}

From source file:org.jboss.tools.batch.ui.JobImages.java

License:Open Source License

public static ImageDescriptor getImageDescriptor(String key) {
    ImageDescriptor descriptor = getImageRegistry().getDescriptor(key);
    if (descriptor == null) {
        descriptor = ImageDescriptor.createFromFile(Job.class, key);
        getImageRegistry().put(key, descriptor);
    }//from ww  w. j  a v  a 2 s  .  co  m
    return descriptor;
}

From source file:org.jboss.tools.common.gef.action.PrintRetargetAction.java

License:Open Source License

public PrintRetargetAction() {
    super(ACTION_ID, Messages.PrintRetargetAction_Name);
    setToolTipText(Messages.PrintRetargetAction_Name);
    setImageDescriptor(ImageDescriptor.createFromFile(getClass(), "icons/print.gif")); //$NON-NLS-1$
}