Navigation Menu

Skip to content
This repository has been archived by the owner on Oct 19, 2022. It is now read-only.

Commit

Permalink
Added getImage* methods.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gábor Náray committed Nov 28, 2014
1 parent e970ed9 commit 22d0b36
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions org.embl.cca.utils/src/org/embl/cca/utils/Activator.java
@@ -1,6 +1,8 @@
package org.embl.cca.utils;

import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;

Expand Down Expand Up @@ -54,6 +56,19 @@ public static Activator getDefault() {
return plugin;
}

/**
* Creates the image, this should be disposed later.
* @param path
* @return Image
*/
public static Image getImage(final String path) {
return getImageDescriptor(path).createImage();
}

public static ImageDescriptor getImageDescriptor(final String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}

@Override
protected void initializeImageRegistry(ImageRegistry reg) {
super.initializeImageRegistry(reg);
Expand Down

0 comments on commit 22d0b36

Please sign in to comment.