Skip to content

Commit d9fff94

Browse files
author
Chris
committed
Merge branch 'node.orientation'
2 parents 5562e6b + 6e105e4 commit d9fff94

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

dataTool/src/dataTool/AnnotationManager.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package dataTool;
2-
32
import java.util.ArrayList;
43
import java.util.HashSet;
54
import java.util.Set;
65
import java.util.TreeSet;
7-
86
import org.eclipse.jdt.core.IMethod;
97
import org.eclipse.jdt.core.JavaModelException;
108
import org.eclipse.jdt.core.dom.AST;
@@ -28,11 +26,9 @@
2826
import org.eclipse.ui.PlatformUI;
2927
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
3028
import org.eclipse.ui.texteditor.AbstractTextEditor;
31-
3229
import dataTool.annotations.LinkAnnotation;
3330
import dataTool.annotations.ProgramNavigationPainter;
3431
import dataTool.annotations.SuggestedSelectionAnnotation;
35-
import dataTool.ui.ShowDataInBreadcrumbAction;
3632
import edu.pdx.cs.multiview.jdt.util.JDTUtils;
3733
import edu.pdx.cs.multiview.jface.annotation.AnnTransaction;
3834
import edu.pdx.cs.multiview.jface.annotation.AnnotationPainter;
@@ -49,10 +45,8 @@ public class AnnotationManager implements ISelectionChangedListener {
4945
private boolean isEnabled;
5046
private IBreadcrumb upBreadcrumb;
5147
private IBreadcrumb downBreadcrumb;
48+
private Visitor visitor; // the visitor for the editor
5249

53-
// the visitor for the editor
54-
private Visitor visitor;
55-
5650
public static String currentSearch = null;
5751

5852
/**
@@ -205,7 +199,7 @@ private DataNode getNode(int position) {
205199
private void parseCU(AbstractTextEditor editor) {
206200
try {
207201
visitor = parse(JDTUtils.getCUSource(editor));
208-
} catch (JavaModelException e) {
202+
} catch (JavaModelException | ClassCastException e) {
209203
Activator.logError(e);
210204
}
211205
}
@@ -240,10 +234,9 @@ public void removeAnnotations() {
240234
try {
241235
if (highlightAnnotation != null) {
242236
painter.removeAllAnnotations();
243-
painter.dispose();
237+
//painter.dispose();
244238
}
245239
} catch (Exception ignore) {
246-
System.out.println("ignore");
247240
}
248241
}
249242

dataTool/src/dataTool/EnableNavigationAction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.eclipse.ui.PlatformUI;
2929
import org.eclipse.ui.commands.ICommandService;
3030
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
31-
3231
import dataTool.ui.ShowDataInBreadcrumbAction;
3332

3433
/**
@@ -73,9 +72,11 @@ private void enable(IEditorPart activeEditor) {
7372
* Disables the plugin
7473
*/
7574
private void disable() {
76-
if(annotationManager!=null)
75+
if(annotationManager!=null) {
7776
annotationManager.setEnabled(false);
7877
annotationManager.deactivate();
78+
annotationManager.dispose();
79+
}
7980
}
8081

8182
public void init(IWorkbenchWindow window) {

0 commit comments

Comments
 (0)