Skip to content

Commit b9e2125

Browse files
author
Chris
committed
Removing extra files accidentally pushed
2 parents 6ab021d + 9e7430d commit b9e2125

16 files changed

Lines changed: 335 additions & 194 deletions

.classpath

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="ui"/>
4+
<classpathentry kind="src" path="ui refactoring"/>
5+
<classpathentry kind="src" path="core refactoring"/>
6+
<classpathentry kind="src" path="core extension"/>
7+
<classpathentry kind="src" output="bin-jar-in-jar-loader" path="jar in jar loader"/>
8+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
9+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
10+
<classpathentry kind="output" path="bin"/>
11+
</classpath>

.cvsignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bin
2+
serialsupport.jar

.gitignore

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/bin/
2+
/bin-jar-in-jar-loader/
3+
/bin/
4+
/bin/
5+
/bin/
6+
/bin/
7+
/bin/
8+
/bin/
9+
/bin/
10+
/bin/
11+
/bin/
12+
/bin/
13+
/bin/
14+
/bin/
15+
/bin/
16+
/bin/
17+
/bin/
18+
/bin/
19+
/bin/
20+
/bin/
21+
/bin/
22+
/bin/
23+
/bin/
24+
/bin/
25+
/bin/
26+
/bin/
27+
/bin/
28+
/bin/
29+
/bin/
30+
/bin/
31+
/bin/
32+
/bin/
33+
/bin/
34+
/bin/
35+
/bin/
36+
/bin/
37+
/bin/
38+
/bin/
39+
/bin/
40+
/bin/
41+
/bin/
42+
/bin/
43+
/bin/
44+
/bin/
45+
/bin/
46+
/bin/
47+
/bin/
48+
/bin/
49+
/bin/
50+
/bin/
51+
/bin/
52+
/bin/
53+
/bin/
54+
/bin/
55+
/bin/
56+
/bin/
57+
/bin/
58+
/bin/
59+
/bin/
60+
/bin/
61+
/bin/
62+
/bin/
63+
/bin/
64+
/bin/
65+
/bin/
66+
/bin/
67+
/bin/
68+
/bin/
69+
/bin/
70+
/bin/
71+
/bin/
72+
/bin/
73+
/bin/
74+
/bin/
75+
/bin/
76+
/bin-jar-in-jar-loader/
77+
/bin/
78+
/bin/
79+
/bin/
80+
/bin/
81+
/bin/
82+
/bin/
83+
/bin/
84+
/bin-jar-in-jar-loader/
85+
/bin/
86+
/bin/
87+
/bin/
88+
/bin/
89+
/bin/
90+
/bin/
91+
/bin/
92+
/bin/
93+
/bin/
94+
/bin/
95+
/bin/
96+
/bin/
97+
/bin/
98+
/bin/
99+
/bin/
100+
/bin/
101+
/bin/
102+
/bin/
103+
/bin/
104+
/bin/
105+
/bin/
106+
/bin/
107+
/bin/
108+
/bin/
109+
/bin/
110+
/bin/
111+
/bin/
112+
/bin/
113+
/bin/

.options

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Prints debug information
2+
org.eclipse.jdt.ui/debug=true
3+
4+
# Prints debug information related to the AST provider
5+
org.eclipse.jdt.ui/debug/ASTProvider=false
6+
7+
# Prints debug information related to BreadcrumbItemDropDown
8+
org.eclipse.jdt.ui/debug/BreadcrumbItemDropDown=false
9+
10+
# trace generation of type constraints and create toString info for debugging
11+
org.eclipse.jdt.ui/debug/TypeConstraints=false
12+
13+
# timing output for code assist
14+
org.eclipse.jdt.ui/debug/ResultCollector=false
15+
16+
#Reports the time to create the refactor action group
17+
org.eclipse.jdt.ui/perf/explorer/RefactorActionGroup=150
18+
19+
#Reports the time to make the package explorer actions
20+
org.eclipse.jdt.ui/perf/explorer/makeActions=1000
21+
22+
#Reports the time to create the package explorer view
23+
org.eclipse.jdt.ui/perf/explorer/createPartControl=1300
24+
25+
#Reports the time for a single search participant
26+
org.eclipse.jdt.ui/perf/search/participants=300
27+
28+
#Reports the time for a single completion proposal computer
29+
org.eclipse.jdt.ui/perf/content_assist/extensions=1000
30+
31+
#Reports the time for a single completion proposal sorter
32+
org.eclipse.jdt.ui/perf/content_assist_sorters/extensions

.project

Lines changed: 0 additions & 11 deletions
This file was deleted.

dataTool/src/dataTool/AnnotationManager.java

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
import org.eclipse.jdt.core.dom.MethodDeclaration;
1515
import org.eclipse.jdt.core.dom.SimpleName;
1616
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
17-
import org.eclipse.jdt.internal.ui.javaeditor.ShowDataInBreadcrumbAction;
17+
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditorBreadcrumb;
18+
import org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.EditorBreadcrumb;
1819
import org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.IBreadcrumb;
1920
import org.eclipse.jface.action.Action;
2021
import org.eclipse.jface.text.ITextSelection;
@@ -31,6 +32,7 @@
3132
import dataTool.annotations.LinkAnnotation;
3233
import dataTool.annotations.ProgramNavigationPainter;
3334
import dataTool.annotations.SuggestedSelectionAnnotation;
35+
import dataTool.ui.ShowDataInBreadcrumbAction;
3436
import edu.pdx.cs.multiview.jdt.util.JDTUtils;
3537
import edu.pdx.cs.multiview.jface.annotation.AnnTransaction;
3638
import edu.pdx.cs.multiview.jface.annotation.AnnotationPainter;
@@ -44,7 +46,8 @@ public class AnnotationManager implements ISelectionChangedListener {
4446
private SourceViewer sourceViewer;
4547
private ProgramNavigationPainter painter;
4648
private static boolean isActive = false;
47-
private IBreadcrumb dataBreadcrumb;
49+
private IBreadcrumb upBreadcrumb;
50+
private IBreadcrumb downBreadcrumb;
4851

4952
// the visitor for the editor
5053
private Visitor visitor;
@@ -65,59 +68,74 @@ public AnnotationManager(AbstractDecoratedTextEditor anEditor) {
6568
painter = new ProgramNavigationPainter(sourceViewer);
6669
painter.addSelectionChangedListener(this);
6770
sourceViewer.addPainter(painter);
68-
//isActive = false;
6971
selectionChanged((ITextSelection) painter.getSelection());
7072
}
7173

7274
public void selectionChanged(ITextSelection selection) {
75+
System.out.println("selectionChanged");
7376
painter.removeAllAnnotations();
7477
try {
7578
DataNode one = getNode(selection.getOffset());
76-
System.out.println(one);
7779
Finder finder = Finder.getInstance();
7880
if(one != null) {
7981
addAnnotation(one);
80-
currentSearch = one.getValue();
81-
System.out.println(isActive+" isActive");
82+
currentSearch = one.getBinding();
8283
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
8384
IEditorPart activeEditor = activePage.getActiveEditor();
84-
System.out.println(activeEditor.getTitle()+" tidal");
8585
JavaEditor j = (JavaEditor) activeEditor;
86-
dataBreadcrumb = j.getBreadcrumb();
86+
upBreadcrumb = j.getBreadcrumb();
87+
downBreadcrumb = j.getBreadcrumb2();
88+
System.out.println(isActive+ " is active");
89+
System.out.println(upBreadcrumb.isActive());
90+
System.out.println(downBreadcrumb.isActive());
91+
System.out.println(j.areBreadcrumbsActive());
8792
if(!isActive) {
8893
isActive = true;
8994
ShowDataInBreadcrumbAction crumbs = new ShowDataInBreadcrumbAction(j, activePage);
9095
crumbs.run();
9196
}
97+
upBreadcrumb.setText(null);
98+
downBreadcrumb.setText(null);
9299
DataCallHierarchy call = new DataCallHierarchy();
93100
Set<IMethod> searchUp = null;
94-
//Set<IMethod> searchDown = null;
95-
//System.out.println(one.getBinding()+" "+one.getDeclarationMethod() +" "+one.getInvocationMethod());
96-
if((finder.upSearch(one) != null || finder.downSearch(one) != null) && currentSearch != null) {
101+
Set<IMethod> searchDown = null;
102+
if((finder.upSearch(one) != null || finder.downSearch(one) != null || one.getInvocationMethod() != null) && currentSearch != null) {
97103
searchUp = call.searchProject(one, Finder.UP);
98-
//searchDown = call.searchProject(one, Finder.DOWN);
99-
//System.out.println("search "+one.getValue()+" "+searchUp+" "+one.getDeclarationMethod());
104+
searchDown = call.searchProject(one, Finder.DOWN);
100105
if(one.isParameterSelected(selection.getOffset())) {
101-
//linkAnnotation.searchResultsDown = searchDown;
106+
linkAnnotation.searchResultsDown = searchDown;
102107
linkAnnotation.searchResultsUp = searchUp;
103108
linkAnnotation.setDataNode(one);
104109
addLinkAnnotation(one);
105110
}
106111
}
107112
Set<String> test = new HashSet<String>();
108113
test.add(one.getValue());
109-
dataBreadcrumb.setText(searchUp);
110114
//Adds all occurrences of data node off screen
115+
ArrayList<Object> textUp = new ArrayList<Object>();
116+
ArrayList<Object> textDown = new ArrayList<Object>();
111117
for(DataNode dn: finder.getOccurrences(one.getValue(), new Position(one.getStartPosition(), one.getLength()))) {
118+
int[] offScreen = new int[3];
119+
int line = sourceViewer.widgetLineOfWidgetOffset(dn.getStartPosition())+1;
120+
offScreen[0] = line;
121+
offScreen[1] = dn.getStartPosition();
122+
offScreen[2] = dn.getLength();
112123
if(dn.getStartPosition() < sourceViewer.getTopIndexStartOffset()) {
113-
int line = sourceViewer.widgetLineOfWidgetOffset(dn.getStartPosition())+1;
114-
//NavigationUpBox.getInstance().addOffScreen(dn, line);
124+
textUp.add(offScreen);
115125
}
116126
else if(dn.getStartPosition() > sourceViewer.getBottomIndexEndOffset()) {
117-
int line = sourceViewer.widgetLineOfWidgetOffset(dn.getStartPosition())+1;
118-
//NavigationDownBox.getInstance().addOffScreen(dn, line);
127+
textDown.add(offScreen);
119128
}
120129
}
130+
if(searchUp != null) {
131+
textUp.addAll(searchUp);
132+
((EditorBreadcrumb)upBreadcrumb).setSearchMethod(call.getCurrentMethod(one.getStartPosition()));
133+
}
134+
if(searchDown != null) {
135+
textDown.addAll(searchDown);
136+
}
137+
upBreadcrumb.setText(textUp);
138+
downBreadcrumb.setText(textDown);
121139
}
122140
else {
123141
removeAnnotations();
@@ -127,30 +145,6 @@ else if(dn.getStartPosition() > sourceViewer.getBottomIndexEndOffset()) {
127145
removeAnnotations();
128146
}
129147
}
130-
131-
/**
132-
* Function that returns the method the current node is located in
133-
* @param node: Current node selected by the user
134-
* @returns String method name
135-
*/
136-
private String getMethod(DataNode one) {
137-
138-
//TODO Function that could come in handy later to get current method mouse is clicked in
139-
/*ASTNode temp = one.;
140-
while(!(temp instanceof MethodDeclaration) && temp != null) {
141-
temp = temp.getParent();
142-
}
143-
if(temp == null) {
144-
return null;
145-
}
146-
return ((MethodDeclaration) temp).getName().getIdentifier();*/
147-
//System.out.println(one.getValue()+" get "+one.getMethod().getName());
148-
//System.out.println(one.getBinding());
149-
//if(one.getMethod() != null) {
150-
//return one.getMethod().getName().toString();
151-
//}
152-
return null;
153-
}
154148

155149
private void addAnnotation(DataNode node) {
156150
int start = node.getStartPosition();
@@ -162,11 +156,11 @@ private void addAnnotation(DataNode node) {
162156

163157
private void addLinkAnnotation(DataNode node) {
164158
SimpleName method;
165-
if(node.getDeclarationMethod() != null) {
166-
method = node.getDeclarationMethod().getName();
159+
if(node.getInvocationMethod() != null) {
160+
method = node.getInvocationMethod().getName();
167161
}
168162
else {
169-
method = node.getInvocationMethod().getName();
163+
method = node.getDeclarationMethod().getName();
170164
}
171165
int start = method.getStartPosition();
172166
int end = method.getStartPosition() + method.getLength();
@@ -242,7 +236,6 @@ private void addAnnotationsAt(int statementStart, int length, boolean isHighligh
242236
public void removeAnnotations() {
243237
try {
244238
if (highlightAnnotation != null) {
245-
// painter.removeAnnotation(highlightAnnotation);
246239
painter.removeAllAnnotations();
247240
}
248241
} catch (Exception ignore) {
@@ -251,13 +244,10 @@ public void removeAnnotations() {
251244

252245
public void dispose() {
253246
painter.dispose();
254-
//dataBreadcrumb.dispose();
255-
//isActive = false;
256247
currentSearch = null;
257248
}
258249

259250
public void selectionChanged(SelectionChangedEvent event) {
260-
painter.removeAllAnnotations();
261251
selectionChanged((ITextSelection) event.getSelection());
262252
}
263253
}

0 commit comments

Comments
 (0)