Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSopot Cela2012-09-20 04:55:51 -0400
committerSopot Cela2012-09-20 04:55:51 -0400
commit95b8cf1c987011f6a1b63a524999e57c1c164cd8 (patch)
treeb583440a4cd83c31355a6cff4525fbf91f485603
parentc56ed1a80947662eade5040499b75e1e81723261 (diff)
downloadorg.eclipse.e4.tools-95b8cf1c987011f6a1b63a524999e57c1c164cd8.tar.gz
org.eclipse.e4.tools-95b8cf1c987011f6a1b63a524999e57c1c164cd8.tar.xz
org.eclipse.e4.tools-95b8cf1c987011f6a1b63a524999e57c1c164cd8.zip
ASSIGNED - bug 389047: [Tooling] Model editor improvements round 1
(second commit) https://bugs.eclipse.org/bugs/show_bug.cgi?id=389047
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/HandlerContributionEditor.java22
-rw-r--r--bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/PartContributionEditor.java10
2 files changed, 24 insertions, 8 deletions
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/HandlerContributionEditor.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/HandlerContributionEditor.java
index e6aed7c9..1d9ae41d 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/HandlerContributionEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/HandlerContributionEditor.java
@@ -95,13 +95,21 @@ public class HandlerContributionEditor implements IContributionClassCreator {
// TODO If this is not a WS-Resource we need to open differently
if (p != null) {
IJavaProject jp = JavaCore.create(p);
- try {
- IType t = jp.findType(fullyQualified);
- if( t != null ) {
- JavaUI.openInEditor(t);
- } else {
- createOpen(contribution, domain, project, shell, true);
- }
+ IType t = null;
+ try {
+ if (p.exists()){
+ t = jp.findType(fullyQualified);
+ }
+ else
+ {
+ IJavaProject pprim = JavaCore.create(project);
+ t = pprim.findType(fullyQualified);
+ }
+ if( t != null ) {
+ JavaUI.openInEditor(t);
+ } else {
+ createOpen(contribution, domain, project, shell, true);
+ }
} catch (JavaModelException e) {
createOpen(contribution, domain, project, shell, true);
} catch (PartInitException e) {
diff --git a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/PartContributionEditor.java b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/PartContributionEditor.java
index cd15cfa9..c3d1b600 100644
--- a/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/PartContributionEditor.java
+++ b/bundles/org.eclipse.e4.tools.emf.editor3x/src/org/eclipse/e4/tools/emf/editor3x/extension/PartContributionEditor.java
@@ -97,8 +97,16 @@ public class PartContributionEditor implements IContributionClassCreator {
// TODO If this is not a WS-Resource we need to open differently
if (p != null) {
IJavaProject jp = JavaCore.create(p);
+ IType t = null;
try {
- IType t = jp.findType(fullyQualified);
+ if (p.exists()){
+ t = jp.findType(fullyQualified);
+ }
+ else
+ {
+ IJavaProject pprim = JavaCore.create(project);
+ t = pprim.findType(fullyQualified);
+ }
if( t != null ) {
JavaUI.openInEditor(t);
} else {

Back to the top