Skip to content

Commit

Permalink
Use the new ISharedImages.get() to not require a running platform
Browse files Browse the repository at this point in the history
Currently some actions require a running platform, but with the new
ISharedImages.get() method this is no longer required making the classes
less coupled.
  • Loading branch information
laeubi committed Jan 20, 2025
1 parent 7e83160 commit b62b694
Show file tree
Hide file tree
Showing 23 changed files with 43 additions and 53 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void setAutoRepeatOnFailure(boolean autorepeatOnFailure){
}

private static ISharedImages getWorkbenchSharedImages() {
return PlatformUI.getWorkbench().getSharedImages();
return ISharedImages.get();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public CutAction(IWorkbenchSite site) {
setText(ReorgMessages.CutAction_text);
fCopyToClipboardAction= new CopyToClipboardAction(site);

ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages workbenchImages= ISharedImages.get();
setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT_DISABLED));
setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_CUT));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public DeleteAction(IWorkbenchSite site) {
super(site);
setText(ReorgMessages.DeleteAction_3);
setDescription(ReorgMessages.DeleteAction_4);
ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages workbenchImages= ISharedImages.get();
setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public PasteAction(IWorkbenchSite site, Clipboard clipboard) {
setText(ReorgMessages.PasteAction_4);
setDescription(ReorgMessages.PasteAction_5);

ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages workbenchImages= ISharedImages.get();
setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public RemoveFromViewAction(CallHierarchyViewPart part, CallHierarchyViewer view
setToolTipText(CallHierarchyMessages.RemoveFromViewAction_removeFromView_tooltip);
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.CALL_HIERARCHY_REMOVE_FROM_VIEW_ACTION);

ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages workbenchImages= ISharedImages.get();
setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE_DISABLED));
setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));
setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public CopyToClipboardAction(IWorkbenchSite site) {
setToolTipText(InfoViewMessages.CopyAction_tooltip);
setDescription(InfoViewMessages.CopyAction_description);

ISharedImages workbenchImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages workbenchImages= ISharedImages.get();
setDisabledImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
setImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
setHoverImageDescriptor(workbenchImages.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ private final class ForthAction extends Action {

public ForthAction() {
setText(InfoViewMessages.JavadocView_action_forward_name);
ISharedImages images= PlatformUI.getWorkbench().getSharedImages();
ISharedImages images= ISharedImages.get();
setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));

Expand Down Expand Up @@ -266,7 +266,7 @@ private final class BackAction extends Action {

public BackAction() {
setText(InfoViewMessages.JavadocView_action_back_name);
ISharedImages images= PlatformUI.getWorkbench().getSharedImages();
ISharedImages images= ISharedImages.get();
setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IURIEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE.SharedImages;

import org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel;
Expand Down Expand Up @@ -277,7 +276,7 @@ private void initializeImages() {
fgQuickFixErrorImage= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_FIXABLE_ERROR);
fgQuickFixInfoImage= JavaPluginImages.get(JavaPluginImages.IMG_OBJS_FIXABLE_INFO);

ISharedImages sharedImages= PlatformUI.getWorkbench().getSharedImages();
ISharedImages sharedImages= ISharedImages.get();
fgTaskImage= sharedImages.getImage(SharedImages.IMG_OBJS_TASK_TSK);
fgInfoImage= sharedImages.getImage(ISharedImages.IMG_OBJS_INFO_TSK);
fgWarningImage= sharedImages.getImage(ISharedImages.IMG_OBJS_WARN_TSK);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

import org.eclipse.jface.resource.ImageDescriptor;

import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.IWorkbenchAdapter;

Expand All @@ -40,13 +40,13 @@
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;

import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels;
import org.eclipse.jdt.internal.corext.util.Messages;

import org.eclipse.jdt.ui.PreferenceConstants;

import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.core.manipulation.util.BasicElementLabels;

/**
* Representation of class path containers in Java UI.
Expand Down Expand Up @@ -99,7 +99,7 @@ public ImageDescriptor getImageDescriptor(Object object) {
if (fClasspathEntry.isTest())
return JavaPluginImages.DESC_OBJS_PROJECT_TEST;
else
return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
return ISharedImages.get().getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
import org.eclipse.jface.window.Window;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
import org.eclipse.ui.dialogs.ISelectionStatusValidator;
import org.eclipse.ui.model.WorkbenchContentProvider;
Expand Down Expand Up @@ -894,7 +893,7 @@ private static class ZipDialogLabelProvider extends LabelProvider {
private final Image IMG_JAR=
JavaUI.getSharedImages().getImage(org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_JAR);
private final Image IMG_FOLDER=
PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FOLDER);
ISharedImages.get().getImage(ISharedImages.IMG_OBJ_FOLDER);

private ZipFileStructureProvider fProvider;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import org.eclipse.core.runtime.CoreException;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.ASTNode;
Expand Down Expand Up @@ -174,15 +173,15 @@ protected ICommandAccess addJavadocCommentProposal(String label, ICompilationUni

@Override
protected ICommandAccess createRemoveJavadocTagProposals(String label, ICompilationUnit compilationUnit, ASTRewrite rewrite, int removeTag) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
return new ASTRewriteCorrectionProposal(label, compilationUnit, rewrite, IProposalRelevance.REMOVE_TAG, image);
}

@Override
protected ICommandAccess createRemoveDuplicateModuleJavadocTagProposal(String label, ICompilationUnit compilationUnit, int start, int length, String string, int removeTag) {
ReplaceCorrectionProposal proposal= new ReplaceCorrectionProposal(label, compilationUnit, start, length,
"", IProposalRelevance.REMOVE_TAG); //$NON-NLS-1$
proposal.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE));
proposal.setImage(ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE));
return proposal;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;

import org.eclipse.jdt.core.ICompilationUnit;
Expand Down Expand Up @@ -247,7 +246,7 @@ public Object getAdditionalProposalInfo(IProgressMonitor monitor) {
public static void getUnnecessaryNLSTagProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) throws CoreException {
IProposableFix fix= StringFixCore.createFix(context.getASTRoot(), problem, true, false);
if (fix != null) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
Map<String, String> options= new Hashtable<>();
options.put(CleanUpConstants.REMOVE_UNNECESSARY_NLS_TAGS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new StringCleanUp(options), IProposalRelevance.UNNECESSARY_NLS_TAG, image, context);
Expand Down Expand Up @@ -389,7 +388,7 @@ public static void addRedundantSuperInterfaceProposal(IInvocationContext context

private static void addProposal(IInvocationContext context, Collection<ICommandAccess> proposals, final UnusedCodeFixCore fix) {
if (fix != null) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, fix.getCleanUp(), IProposalRelevance.UNUSED_MEMBER, image, context);
proposals.add(proposal);
}
Expand Down Expand Up @@ -810,7 +809,7 @@ private static void addRemoveProposal(IInvocationContext context, ASTNode select
}

private static void addRemoveIncludingConditionProposal(IInvocationContext context, ASTNode toRemove, ASTNode replacement, Collection<ICommandAccess> proposals) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
String label= CorrectionMessages.LocalCorrectionsSubProcessor_removeunreachablecode_including_condition_description;
AST ast= toRemove.getAST();
ASTRewrite rewrite= ASTRewrite.create(ast);
Expand Down Expand Up @@ -864,7 +863,7 @@ private static void addRemoveIncludingConditionProposal(IInvocationContext conte
}

private static void addRemoveProposal(IInvocationContext context, ASTRewrite rewrite, String label, Collection<ICommandAccess> proposals) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, 10, image);
proposals.add(proposal);
}
Expand Down Expand Up @@ -934,7 +933,7 @@ public static void getUnusedObjectAllocationProposals(IInvocationContext context
rewrite.remove(parent, null);

String label= CorrectionMessages.LocalCorrectionsSubProcessor_remove_allocated_description;
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, context.getCompilationUnit(), rewrite, IProposalRelevance.REMOVE_UNUSED_ALLOCATED_OBJECT, image);
proposals.add(proposal);
}
Expand Down Expand Up @@ -1123,7 +1122,7 @@ private static void addTypeArgumentsFromContext(IInvocationContext context, IPro
public static void addRemoveRedundantTypeArgumentsProposals(IInvocationContext context, IProblemLocation problem, Collection<ICommandAccess> proposals) {
IProposableFix fix= TypeParametersFixCore.createRemoveRedundantTypeArgumentsFix(context.getASTRoot(), problem);
if (fix != null) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
Map<String, String> options= new HashMap<>();
options.put(CleanUpConstants.REMOVE_REDUNDANT_TYPE_ARGUMENTS, CleanUpOptions.TRUE);
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, new TypeParametersCleanUp(options), IProposalRelevance.REMOVE_REDUNDANT_TYPE_ARGUMENTS, image, context);
Expand Down Expand Up @@ -1352,7 +1351,7 @@ protected ICommandAccess fixCorrectionProposalToT(FixCorrectionProposalCore core
image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
}
case UNUSED_CODE -> {
image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
}
case RENAME_CODE -> {
image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LINKED_RENAME);
Expand Down Expand Up @@ -1383,10 +1382,10 @@ protected ICommandAccess createVariableReferenceProposalToT(CreateVariableRefere

@Override
protected ICommandAccess astRewriteCorrectionProposalToT(ASTRewriteCorrectionProposalCore core, int uid) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
switch (uid) {
case REMOVE_REDUNDANT_SUPERINTERFACE, REMOVE_PROPOSAL -> {
image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
}
case REMOVE_UNNECESSARY_INSTANCEOF, UNQUALIFY_ENUM_CONSTANT,
MOVE_ELSE_CLAUSE, CHANGE_EXTENDS_TO_IMPLEMENTS, CHANGE_TO_INTERFACE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.swt.graphics.Image;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.ASTNode;
Expand Down Expand Up @@ -75,7 +74,7 @@ protected ICommandAccess createASTRewriteCorrectionProposal(String name, ICompil
if(relevance == IProposalRelevance.FIX_SUPPRESS_TOKEN) {
image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
} else if (relevance == IProposalRelevance.REMOVE_ANNOTATION) {
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
image = ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
}
return new ASTRewriteCorrectionProposal(name, cu, rewrite, relevance, image);
}
Expand All @@ -85,7 +84,7 @@ protected ICommandAccess createFixCorrectionProposal(IProposableFix fix, ICleanU
// Initialize as default image, though it should always trigger one of the two if statements below
Image image = JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
if (relevance == IProposalRelevance.REMOVE_ANNOTATION) {
image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
image = ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
}
FixCorrectionProposal proposal= new FixCorrectionProposal(fix, cleanUp, relevance, image, context);
proposal.setCommandId(ADD_SUPPRESSWARNINGS_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.core.runtime.CoreException;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import org.eclipse.ltk.core.refactoring.Change;

Expand Down Expand Up @@ -88,7 +87,7 @@ private static Image findImage(int id) {
case EnhancedForWithoutTypeProposal1:
return JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_LOCAL);
case NewVariableProposal3:
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
return ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
case NewFieldForTypeProposal1:
case NewFieldForTypeProposal3:
case NewFieldForTypeProposal5:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.eclipse.swt.graphics.Image;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.IMethodBinding;
Expand Down Expand Up @@ -70,7 +69,7 @@ protected ICommandAccess createAddSafeVarargsToDeclarationProposal1(String label

@Override
protected ICommandAccess createRemoveSafeVarargsProposal1(String label, ICompilationUnit compilationUnit, ASTRewrite rewrite, int relevance) {
Image image= PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE);
Image image= ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE);
return new ASTRewriteCorrectionProposal(label, compilationUnit, rewrite, relevance, image);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.util.ArrayList;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.ASTVisitor;
Expand Down Expand Up @@ -85,7 +84,7 @@ public boolean visit(SuperMethodInvocation node) {


public RemoveDeclarationCorrectionProposal(ICompilationUnit cu, SimpleName name, int relevance) {
super("", cu, null, relevance, PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE), new RemoveDeclarationCorrectionProposalCore(cu, name, relevance)); //$NON-NLS-1$
super("", cu, null, relevance, ISharedImages.get().getImage(ISharedImages.IMG_TOOL_DELETE), new RemoveDeclarationCorrectionProposalCore(cu, name, relevance)); //$NON-NLS-1$
super.getDisplayString();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
import org.eclipse.ui.IWorkbenchPreferenceConstants;
import org.eclipse.ui.IWorkbenchSite;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import org.eclipse.ui.editors.text.EditorsUI;

Expand Down Expand Up @@ -173,7 +172,7 @@ private static final class BackAction extends Action {
public BackAction(BrowserInformationControl infoControl) {
fInfoControl= infoControl;
setText(JavaHoverMessages.JavadocHover_back);
ISharedImages images= PlatformUI.getWorkbench().getSharedImages();
ISharedImages images= ISharedImages.get();
setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK));
setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_BACK_DISABLED));

Expand Down Expand Up @@ -213,7 +212,7 @@ private static final class ForwardAction extends Action {
public ForwardAction(BrowserInformationControl infoControl) {
fInfoControl= infoControl;
setText(JavaHoverMessages.JavadocHover_forward);
ISharedImages images= PlatformUI.getWorkbench().getSharedImages();
ISharedImages images= ISharedImages.get();
setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD));
setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_FORWARD_DISABLED));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.eclipse.jface.resource.ImageDescriptor;

import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.model.IWorkbenchAdapter;

Expand Down Expand Up @@ -81,7 +80,7 @@ public class JavaElementImageProvider {
private static ImageDescriptor DESC_OBJ_PROJECT_CLOSED;
private static ImageDescriptor DESC_OBJ_PROJECT;
{
ISharedImages images= PlatformUI.getWorkbench().getSharedImages();
ISharedImages images= ISharedImages.get();
DESC_OBJ_PROJECT_CLOSED= images.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED);
DESC_OBJ_PROJECT= images.getImageDescriptor(IDE.SharedImages.IMG_OBJ_PROJECT);
}
Expand Down
Loading

0 comments on commit b62b694

Please sign in to comment.