Skip to content

Commit

Permalink
Ensure image loading supports locale and resolution variants
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed Jun 10, 2017
1 parent 594e91b commit bf6d6d3
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 34 deletions.
2 changes: 1 addition & 1 deletion ide/org.codehaus.groovy.eclipse.astviews/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<view
category="org.codehaus.groovy.eclipse.Groovy"
class="org.codehaus.groovy.eclipse.astviews.ASTView"
icon="platform:/plugin/org.codehaus.groovy.eclipse/groovy16.png"
icon="platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy16.png"
id="org.codehaus.groovy.eclipse.astviews.ASTView"
name="Groovy AST Viewer">
</view>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,13 @@
id="org.codehaus.groovy.eclipse.codeassist.category"
name="Groovy Proposals">
<proposalCategory
icon="icons/groovy_file.gif">
</proposalCategory>
icon="$nl$/icons/groovy_file.gif" />
</extension>
<extension point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
id="org.codehaus.groovy.eclipse.codeassist.templates.category"
name="Groovy Template Proposals">
<proposalCategory
icon="icons/template.gif">
</proposalCategory>
icon="$nl$/icons/template.gif" />
</extension>
<extension point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
id="org.codehaus.groovy.eclipse.codeassist.completion.groovy"
Expand Down
8 changes: 4 additions & 4 deletions ide/org.codehaus.groovy.eclipse.dsl/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
contributesToHeader="true"
highlightPreferenceKey="typeCheckIndicationHighlighting"
highlightPreferenceValue="false"
icon="icons/warn_type_check.gif"
icon="$nl$/icons/warn_type_check.gif"
isGoToNextNavigationTarget="true"
isGoToNextNavigationTargetKey="istypeCheckGoToNextNavigationTarget"
isGoToPreviousNavigationTarget="true"
Expand All @@ -186,12 +186,12 @@
category="org.codehaus.groovy.eclipse"
class="org.codehaus.groovy.eclipse.dsl.ui.NewDSLDWizard"
finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
icon="platform:/plugin/org.codehaus.groovy.eclipse/groovy16.png"
icon="platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy16.png"
id="org.codehaus.groovy.eclipse.dsld.newDsldWizard"
name="Groovy DSL Descriptor"
preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective,com.springsource.sts.grails.perspective,org.grails.ide.eclipse.perspective">
<description>
Create a new DSL descriptor file.
Create a new DSL descriptor file
</description>
<keywordReference
id="org.codehaus.groovy.eclipse.dsl.keywords"/>
Expand Down Expand Up @@ -244,7 +244,7 @@
<extension point="org.eclipse.core.runtime.applications" id="staticCheck">
<application
cardinality="singleton-global"
icon="platform:/plugin/org.codehaus.groovy.eclipse/groovy.png"
icon="platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy32.png"
thread="main"
visible="true">
<run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
public class AddInferencingSuggestionDialogue extends AbstractDialogue {

public static final DialogueDescriptor DIALOGUE_DESCRIPTOR = new DialogueDescriptor(
"Add a Groovy inferencing suggestion", "Inferencing Suggestion", "platform:/plugin/org.codehaus.groovy.eclipse/groovy.png");
"Add a Groovy inferencing suggestion", "Inferencing Suggestion", "platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy.png");

private Point labelControlOffset;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
public class EditInferencingSuggestionDialogue extends AddInferencingSuggestionDialogue {

public static final DialogueDescriptor EDIT_DIALOGUE_DESCRIPTOR = new DialogueDescriptor(
"Edit a Groovy inferencing suggestion", "Inferencing Suggestion", "platform:/plugin/org.codehaus.groovy.eclipse/groovy.png");
"Edit a Groovy inferencing suggestion", "Inferencing Suggestion", "platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy.png");

/**
* This constructor is used to edit an existing suggestion. Editing a declaring type is not yet supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class MethodParameterDialogue extends AbstractDialogue {

public static final DialogueDescriptor DIALOGUE_DESCRIPTOR = new DialogueDescriptor(
"Add parameter", "Suggestion Parameter", "platform:/plugin/org.codehaus.groovy.eclipse/groovy.png");
"Add parameter", "Suggestion Parameter", "platform:/plugin/org.codehaus.groovy.eclipse/$nl$/groovy.png");

private Point labelOffset;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
* Method declared on BasicNewResourceWizard.
*/
protected void initializeDefaultPageImageDescriptor() {
setDefaultPageImageDescriptor(imageDescriptorFromPlugin("org.codehaus.groovy.eclipse", "groovy.png"));
setDefaultPageImageDescriptor(imageDescriptorFromPlugin("org.codehaus.groovy.eclipse", "$nl$/groovy.png"));
}

/* (non-Javadoc)
Expand All @@ -225,8 +225,7 @@ public boolean performFinish() {
}
}
} catch (PartInitException e) {
DialogUtil.openError(dw.getShell(), ResourceMessages.FileResource_errorMessage,
e.getMessage(), e);
DialogUtil.openError(dw.getShell(), ResourceMessages.FileResource_errorMessage, e.getMessage(), e);
}

return true;
Expand Down
28 changes: 14 additions & 14 deletions ide/org.codehaus.groovy.eclipse.ui/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
<extension point="org.eclipse.debug.ui.launchConfigurationTypeImages">
<launchConfigurationTypeImage
configTypeID="org.codehaus.groovy.eclipse.groovyShellLaunchConfiguration"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.groovyLaunchConfigurationImage.groovyShell">
</launchConfigurationTypeImage>
<launchConfigurationTypeImage
configTypeID="org.codehaus.groovy.eclipse.groovyScriptLaunchConfiguration"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.groovyLaunchConfigurationImage.groovyScript">
</launchConfigurationTypeImage>
<launchConfigurationTypeImage
configTypeID="org.codehaus.groovy.eclipse.groovyConsoleLaunchConfiguration"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.groovyLaunchConfigurationImage.groovyConsole">
</launchConfigurationTypeImage>
</extension>
Expand Down Expand Up @@ -55,7 +55,7 @@
<shortcut
class="org.codehaus.groovy.eclipse.launchers.GroovyShellLaunchShortcut"
description="Launch an interactive Groovy Shell in the given project"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.debug.ui.groovyShellLaunchShortcut"
label="Groovy Shell"
modes="run,debug">
Expand Down Expand Up @@ -86,7 +86,7 @@
<shortcut
class="org.codehaus.groovy.eclipse.launchers.GroovyScriptLaunchShortcut"
description="Run a Groovy script"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.groovyScriptLaunchShortcut"
label="Groovy Script"
modes="run,debug">
Expand Down Expand Up @@ -117,7 +117,7 @@
<shortcut
class="org.codehaus.groovy.eclipse.launchers.GroovyConsoleLaunchShortcut"
description="Run a Groovy Console"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
id="org.codehaus.groovy.eclipse.groovyConsoleLaunchShortcut"
label="Groovy Console"
modes="run,debug">
Expand Down Expand Up @@ -157,7 +157,7 @@
class="org.codehaus.groovy.eclipse.editor.GroovyEditor"
contributorClass="org.eclipse.jdt.internal.ui.javaeditor.CompilationUnitEditorActionContributor"
default="true"
icon="icons/groovy_file.gif"
icon="$nl$/icons/groovy_file.gif"
id="org.codehaus.groovy.eclipse.editor.GroovyEditor"
name="Groovy Editor"
symbolicFontName="org.eclipse.jdt.ui.editors.textfont">
Expand All @@ -184,7 +184,7 @@
<wizard
category="org.codehaus.groovy.eclipse"
finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
icon="icons/newgroovyclass_wiz.gif"
icon="$nl$/icons/newgroovyclass_wiz.gif"
id="org.codehaus.groovy.eclipse.ui.groovyClassWizard"
name="Groovy Class"
preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective,com.springsource.sts.grails.perspective,org.grails.ide.eclipse.perspective">
Expand All @@ -201,9 +201,9 @@
<wizard
category="org.codehaus.groovy.eclipse"
class="org.codehaus.groovy.eclipse.wizards.GroovyProjectWizard"
descriptionImage="icons/full/newgroovyprj_wiz.gif"
descriptionImage="$nl$/icons/full/newgroovyprj_wiz.gif"
finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
icon="icons/newgroovyprj_wiz.gif"
icon="$nl$/icons/newgroovyprj_wiz.gif"
id="org.codehaus.groovy.eclipse.ui.groovyProjectWizard"
name="Groovy Project"
preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective,com.springsource.sts.grails.perspective,org.grails.ide.eclipse.perspective"
Expand All @@ -215,7 +215,7 @@
<wizard
category="org.codehaus.groovy.eclipse"
finalPerspective="org.eclipse.jdt.ui.JavaPerspective"
icon="icons/newgroovytestsuite_wiz.gif"
icon="$nl$/icons/newgroovytestsuite_wiz.gif"
id="org.codehaus.groovy.eclipse.ui.groovyJUnitWizard"
name="Groovy Test Case"
preferredPerspectives="org.eclipse.jdt.ui.JavaPerspective,com.springsource.sts.grails.perspective,org.grails.ide.eclipse.perspective">
Expand Down Expand Up @@ -468,7 +468,7 @@
visible="true">
<action
class="org.codehaus.groovy.eclipse.wizards.OpenGroovyProjectWizardAction"
icon="icons/newgroovyprj_wiz.gif"
icon="$nl$/icons/newgroovyprj_wiz.gif"
id="opengroovyprojectwizard"
label="Groovy Project..."
toolbarPath="org.eclipse.jdt.ui.JavaElementCreationActionSet/JavaWizards"
Expand Down Expand Up @@ -795,7 +795,7 @@

<extension point="org.eclipse.ui.ide.projectNatureImages">
<image
icon="icons/groovy-project-overlay.gif"
icon="$nl$/icons/groovy-project-overlay.gif"
id="org.codehaus.groovy.eclipse.groovyNatureImage"
natureId="org.eclipse.jdt.groovy.core.groovyNature">
</image>
Expand Down Expand Up @@ -903,7 +903,7 @@
<extension point="org.eclipse.ui.console.consoleFactories">
<consoleFactory
class="org.codehaus.groovy.eclipse.ui.console.GroovyConsoleFactory"
icon="icons/run_groovy_class.gif"
icon="$nl$/icons/run_groovy_class.gif"
label="Groovy Event Console">
</consoleFactory>
</extension>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@
*/
package org.codehaus.groovy.eclipse.ui.decorators;

import org.codehaus.groovy.eclipse.GroovyPlugin;
import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.FrameworkUtil;
import org.eclipse.ui.plugin.AbstractUIPlugin;

public final class GroovyPluginImages {

public static final ImageDescriptor DESC_GRADLE_FILE = createDescriptor2(
"platform:/plugin/org.eclipse.buildship.ui/icons/full/obj16/gradle_file.png");
public static final ImageDescriptor DESC_GROOVY_FILE = createDescriptor("icons/groovy_file.gif");
public static final ImageDescriptor DESC_NEW_GROOVY_PROJECT = createDescriptor("icons/full/newgroovyprj_wiz.gif");
public static final ImageDescriptor DESC_GROOVY_FILE = createDescriptor("$nl$/icons/groovy_file.gif");
public static final ImageDescriptor DESC_NEW_GROOVY_PROJECT = createDescriptor("$nl$/icons/full/newgroovyprj_wiz.gif");

private static ImageDescriptor createDescriptor(String path) {
// create the image descriptor without causing this bundle to be activated
return ImageDescriptor.createFromURL(FrameworkUtil.getBundle(GroovyPluginImages.class).getEntry(path));
return AbstractUIPlugin.imageDescriptorFromPlugin(GroovyPlugin.PLUGIN_ID, path);
}

private static ImageDescriptor createDescriptor2(String path) {
Expand Down
2 changes: 1 addition & 1 deletion ide/org.codehaus.groovy.eclipse/about.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aboutText=%blurb
# needed for primary features only

# Property "featureImage" contains path to feature image (32x32)
featureImage=groovy32.png
featureImage=$nl$/groovy32.png

# Property "aboutImage" contains path to product image (500x330 or 115x164)
# needed for primary features only
Expand Down

0 comments on commit bf6d6d3

Please sign in to comment.