Revision c4a7540a
Added by Patrick Plitzner about 7 years ago
eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/handler/HandlerTools.java | ||
---|---|---|
15 | 15 |
import org.eclipse.core.runtime.Path; |
16 | 16 |
import org.eclipse.jface.resource.ImageDescriptor; |
17 | 17 |
|
18 |
import eu.etaxonomy.taxeditor.molecular.Messages; |
|
18 | 19 |
import eu.etaxonomy.taxeditor.molecular.TaxeditorMolecularPlugin; |
19 | 20 |
|
20 | 21 |
|
... | ... | |
28 | 29 |
public class HandlerTools { //TODO Move this class or method somewhere else? |
29 | 30 |
public static ImageDescriptor createImageDescriptor(String iconName) { |
30 | 31 |
URL url = FileLocator.find(TaxeditorMolecularPlugin.getDefault().getBundle(), |
31 |
new Path("icons/" + iconName), null); |
|
32 |
new Path("icons/" + iconName), null); //$NON-NLS-1$
|
|
32 | 33 |
if (url != null) { |
33 | 34 |
return ImageDescriptor.createFromURL(url); |
34 | 35 |
} |
35 | 36 |
else { |
36 |
throw new InternalError("Icon \"" + iconName + "\" could not be loaded."); //TODO Throw other type of exception?
|
|
37 |
throw new InternalError(String.format(Messages.HandlerTools_COULD_NOT_LOAD_ICON, iconName)); //TODO Throw other type of exception?
|
|
37 | 38 |
} |
38 | 39 |
} |
39 | 40 |
} |
Also available in: Unified diff
ref #4611 i18n for molecular plugin