Skip to content

Commit a9c419b

Browse files
(v2) Remove dependencies on WST problem markers.
1 parent 38f4172 commit a9c419b

File tree

4 files changed

+13
-50
lines changed

4 files changed

+13
-50
lines changed

source/v2/phasereditor/phasereditor.project.core/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
value="true">
3636
</persistent>
3737
<super
38-
type="org.eclipse.wst.jsdt.core.problem">
38+
type="org.eclipse.core.resources.problemmarker">
3939
</super>
4040
</extension>
4141
</plugin>

source/v2/phasereditor/phasereditor.project.core/src/phasereditor/project/core/PhaserProjectNature.java

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,49 +53,13 @@ public static void addPhaserNature(IProject project, SourceLang lang, IProgressM
5353
description.setNatureIds(newNatures);
5454
project.setDescription(description, monitor);
5555

56-
//TODO: #RemovingWST
57-
// resetProjectLibraries(project, lang, monitor);
58-
5956
} else {
6057
if (monitor != null) {
6158
monitor.worked(1);
6259
}
6360
}
6461
}
6562

66-
//TODO: #RemovingWST
67-
// public static void resetProjectLibraries(IProject project, SourceLang lang, IProgressMonitor monitor)
68-
// throws JavaScriptModelException {
69-
//
70-
// if (lang != SourceLang.JAVA_SCRIPT) {
71-
// return;
72-
// }
73-
//
74-
// IJavaScriptProject jsProject = JavaScriptCore.create(project);
75-
//
76-
// // add libs
77-
//
78-
// List<IIncludePathEntry> list = new ArrayList<>();
79-
// for (String id : new String[] { ProjectCore.ECMA5_SCOPE_INITIALIZER_ID,
80-
// ProjectCore.BROWSER_SCOPE_INITIALIZER_ID, ProjectCore.GLOBAL_SCOPE_INITIALIZER_ID }) {
81-
// list.add(JavaScriptCore.newContainerEntry(new Path(id)));
82-
// }
83-
//
84-
// // add source
85-
//
86-
// IPath[] exclude = { new Path("**/lib"), new Path("**/phaser.js"), new Path("**/*.min.js"),
87-
// new Path("**/node_modules") };
88-
// IIncludePathEntry srcEntry = JavaScriptCore.newSourceEntry(project.getFullPath(), exclude);
89-
// list.add(srcEntry);
90-
//
91-
// IIncludePathEntry[] newIncludeEntries = new IIncludePathEntry[list.size()];
92-
// list.toArray(newIncludeEntries);
93-
//
94-
// out.println("Include entries: " + Arrays.toString(newIncludeEntries));
95-
//
96-
// jsProject.setRawIncludepath(newIncludeEntries, monitor);
97-
// }
98-
9963
public static void removePhaserNature(IProject project, IProgressMonitor monitor) throws CoreException {
10064
if (monitor != null && monitor.isCanceled()) {
10165
throw new OperationCanceledException();

source/v2/phasereditor/phasereditor.project.ui/plugin.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
point="org.eclipse.ui.decorators">
187187
<decorator
188188
class="phasereditor.project.ui.PhaserProblemLabelDecorator"
189-
icon="platform:/plugin/org.eclipse.wst.jsdt.ui/icons/full/obj16/error_obj.gif #RemovingWST"
189+
icon="platform:/plugin/org.eclipse.ui/icons/full/ovr16/error_ovr.png"
190190
id="phasereditor.project.ui.problemsDecorator"
191191
label="Phaser Problems Decorator"
192192
lightweight="true"

source/v2/phasereditor/phasereditor.project.ui/src/phasereditor/project/ui/PhaserProblemLabelDecorator.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
package phasereditor.project.ui;
22

3+
import java.net.URL;
4+
35
import org.eclipse.core.resources.IFile;
6+
import org.eclipse.core.resources.IMarker;
47
import org.eclipse.core.resources.IResource;
5-
import org.eclipse.core.runtime.CoreException;
68
import org.eclipse.core.runtime.ListenerList;
79
import org.eclipse.jface.resource.ImageDescriptor;
810
import org.eclipse.jface.viewers.IDecoration;
@@ -11,7 +13,6 @@
1113

1214
import phasereditor.project.core.ProjectCore;
1315

14-
@SuppressWarnings("restriction")
1516
public class PhaserProblemLabelDecorator implements ILightweightLabelDecorator {
1617
private ListenerList<ILabelProviderListener> _listeners;
1718

@@ -31,8 +32,7 @@ public void removeListener(ILabelProviderListener listener) {
3132

3233
@Override
3334
public void dispose() {
34-
// TODO Auto-generated method stub
35-
35+
//
3636
}
3737

3838
@Override
@@ -52,13 +52,12 @@ public void decorate(Object element, IDecoration decoration) {
5252
ImageDescriptor img;
5353

5454
switch (severity) {
55-
//TODO: #RemovingWST
56-
// case IMarker.SEVERITY_ERROR:
57-
// img = JavaPluginImages.DESC_OVR_ERROR;
58-
// break;
59-
// case IMarker.SEVERITY_WARNING:
60-
// img = JavaPluginImages.DESC_OVR_WARNING;
61-
// break;
55+
case IMarker.SEVERITY_ERROR:
56+
img = ImageDescriptor.createFromURL(new URL("platform:/plugin/org.eclipse.ui/icons/full/ovr16/error_ovr.png"));
57+
break;
58+
case IMarker.SEVERITY_WARNING:
59+
img = ImageDescriptor.createFromURL(new URL("platform:/plugin/org.eclipse.ui/icons/full/ovr16/warning_ovr.png"));
60+
break;
6261
default:
6362
img = null;
6463
break;
@@ -68,7 +67,7 @@ public void decorate(Object element, IDecoration decoration) {
6867
decoration.addOverlay(img);
6968
}
7069
}
71-
} catch (CoreException e) {
70+
} catch (Exception e) {
7271
ProjectUI.logError(e);
7372
}
7473
}

0 commit comments

Comments
 (0)