Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug that prevented the Tree/Graph views from updating when the

perspective was changed on a View.
  • Loading branch information...
commit 6e93032d18be0dd64aa437d203e18a32d78590ad 1 parent 2d9d5bd
@cderoove authored
View
2  ExapusRAP/src/exapus/gui/editors/forest/tree/ForestTreeEditor.java
@@ -396,8 +396,8 @@ private View getView() {
}
public void setFocus() {
- viewer.getControl().setFocus();
updateControls();
+ viewer.getControl().setFocus();
}
@Override
View
6 ExapusRAP/src/exapus/gui/views/store/StoreView.java
@@ -25,7 +25,6 @@
import exapus.gui.editors.view.ViewEditorInput;
import exapus.model.store.Store;
import exapus.model.view.Perspective;
-import exapus.model.view.ProjectCentricView;
import exapus.model.view.View;
public class StoreView extends ViewPart implements IDoubleClickListener {
@@ -64,8 +63,9 @@ public void createPartControl(final Composite parent) {
@Override
public void run() {
String name = promptForUniqueViewName("Create new view");
- if(name != null)
- Store.getCurrent().registerView(new ProjectCentricView(name));
+ if(name != null)
+ Store.getCurrent().registerView(new View(name,Perspective.PROJECT_CENTRIC));
+
}
};
newViewAction.setText("Create new view");
View
20 ExapusRAP/src/exapus/model/view/APICentricView.java
@@ -1,20 +0,0 @@
-package exapus.model.view;
-
-public class APICentricView extends View {
-
- public APICentricView(String name) {
- super(name, Perspective.API_CENTRIC);
- }
-
- @Override
- public boolean isAPICentric() {
- return true;
- }
-
- @Override
- public boolean isProjectCentric() {
- return false;
- }
-
-
-}
View
19 ExapusRAP/src/exapus/model/view/ProjectCentricView.java
@@ -1,19 +0,0 @@
-package exapus.model.view;
-
-public class ProjectCentricView extends View {
-
- public ProjectCentricView(String name) {
- super(name, Perspective.PROJECT_CENTRIC);
- }
-
- @Override
- public boolean isAPICentric() {
- return false;
- }
-
- @Override
- public boolean isProjectCentric() {
- return true;
- }
-
-}
View
17 ExapusRAP/src/exapus/model/view/View.java
@@ -12,7 +12,7 @@
import exapus.model.view.graphbuilder.GraphBuilder;
import exapus.model.view.graphdrawer.GraphDrawer;
-public abstract class View {
+public class View {
public View(String n, Perspective p) {
name = n;
@@ -120,9 +120,13 @@ public String toString() {
return name;
}
- public abstract boolean isAPICentric();
+ public boolean isAPICentric() {
+ return perspective == Perspective.API_CENTRIC;
+ }
- public abstract boolean isProjectCentric();
+ public boolean isProjectCentric() {
+ return perspective == Perspective.PROJECT_CENTRIC;
+ }
private FactForest lazyEvaluate() {
@@ -153,12 +157,7 @@ private File lazyDraw() {
}
public static View fromView(View original) {
- View duplicate;
- String name = "Copy of " + original.getName();
- if(original.isAPICentric())
- duplicate = new APICentricView(name);
- else
- duplicate = new ProjectCentricView(name);
+ View duplicate = new View("Copy of " + original.getName(), original.getPerspective());
duplicate.setRenderable(original.getRenderable());
for(Selection sel : original.getAPISelections())
duplicate.addAPISelection(Selection.fromSelection(sel));
View
10 ExapusRAP/src/exapus/model/view/ViewFactory.java
@@ -34,12 +34,12 @@ public static ViewFactory getCurrent() {
private ViewFactory() {
Selection universal = UniversalSelection.getCurrent();
- completePackageView = new APICentricView("All Packages");
+ completePackageView = new View("All Packages", Perspective.API_CENTRIC);
completePackageView.addAPISelection(universal);
completePackageView.addProjectSelection(universal);
completePackageView.setRenderable(false);
- completeProjectView = new ProjectCentricView("All Projects");
+ completeProjectView = new View("All Projects", Perspective.PROJECT_CENTRIC);
completeProjectView.addAPISelection(universal);
completeProjectView.addProjectSelection(universal);
completeProjectView.setRenderable(false);
@@ -56,7 +56,7 @@ public View completeProjectView() {
}
public View testAPICentricSelectionView() {
- View view = new APICentricView("API-centric selection test");
+ View view = new View("API-centric selection test", Perspective.API_CENTRIC);
view.addAPISelection(new ScopedSelection(new QName("java.lang.Integer"), Scope.TYPE_SCOPE));
view.addAPISelection(new ScopedSelection(new QName("java.util.Iterator.hasNext()"), Scope.METHOD_SCOPE));
view.addAPISelection(new ScopedSelection(new QName("javax"), Scope.PREFIX_SCOPE));
@@ -78,7 +78,7 @@ public View testAPICentricSelectionView2() {
}
public View testProjectCentricSelectionView() {
- View view = new ProjectCentricView("Project-centric selection test");
+ View view = new View("Project-centric selection test", Perspective.PROJECT_CENTRIC);
view.addProjectSelection(new ScopedSelection(new QName("sunflow"), Scope.ROOT_SCOPE));
view.addAPISelection(new ScopedSelection(new QName("java.lang.String"), Scope.TYPE_SCOPE));
view.setRenderable(false);
@@ -120,7 +120,7 @@ else if(subsincluded == 1)
}
});
- View view = new APICentricView("Tagged APIs");
+ View view = new View("Tagged APIs", Perspective.API_CENTRIC);
for(Selection selection : selections) {
view.addAPISelection(selection);
}

0 comments on commit 6e93032

Please sign in to comment.
Something went wrong with that request. Please try again.