summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjkohnlein2009-02-11 11:16:42 (EST)
committerjkohnlein2009-02-11 11:16:42 (EST)
commiteef5b428421faae7faf13b9b7da5045a736d4fc7 (patch)
tree47e0071ef75dc13a6cfa2992aee57023f3e21236
parent3d955c36bd6bcc188ce58dc698404916b2e106d8 (diff)
downloadorg.eclipse.xpand-eef5b428421faae7faf13b9b7da5045a736d4fc7.zip
org.eclipse.xpand-eef5b428421faae7faf13b9b7da5045a736d4fc7.tar.gz
org.eclipse.xpand-eef5b428421faae7faf13b9b7da5045a736d4fc7.tar.bz2
Removed dependencies to oAW.
-rw-r--r--doc/org.eclipse.xpand.doc/build-docbook.properties4
-rw-r--r--doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml12
-rw-r--r--plugins/org.eclipse.xpand/src/org/eclipse/internal/xpand2/GeneratorAdvice.java8
-rw-r--r--plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandBuilder.java8
-rw-r--r--plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/JDTUtil.java4
-rw-r--r--plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/XtendXpandProject.java121
-rw-r--r--plugins/org.eclipse.xtend.tests/.settings/org.eclipse.xtend.shared.ui.prefs4
-rw-r--r--plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/cache/CachedExtension.chk2
-rw-r--r--plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/EmfToolsPlugin.java30
-rw-r--r--plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/ProjectAnalyzer.java58
-rw-r--r--plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiReader.java6
-rw-r--r--plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiWriter.java6
-rw-r--r--plugins/org.eclipse.xtend.typesystem.uml2/.project4
-rw-r--r--plugins/org.eclipse.xtend.typesystem.uml2/.settings/org.eclipse.xtend.shared.ui.prefs4
-rw-r--r--plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext2
-rw-r--r--tests/org.eclipse.xpand.tests/.project6
-rw-r--r--tests/org.eclipse.xtend.shared.ui.test/.project6
-rw-r--r--tests/org.eclipse.xtend.shared.ui.test/src/org/eclipse/xtend/shared/ui/test/xpand2/core/Bug155018Test.java4
18 files changed, 170 insertions, 119 deletions
diff --git a/doc/org.eclipse.xpand.doc/build-docbook.properties b/doc/org.eclipse.xpand.doc/build-docbook.properties
index 4dfa62b..00d8496 100644
--- a/doc/org.eclipse.xpand.doc/build-docbook.properties
+++ b/doc/org.eclipse.xpand.doc/build-docbook.properties
@@ -7,7 +7,7 @@ product.provider=openarchitectureware.org
product.version=5.0
# Directories
-tools.basedir=${basedir}/../org.openarchitectureware.documentation
+tools.basedir=${basedir}/../org.eclipse.xpand.doc
# Style files
custom-css.file=book.css
@@ -70,7 +70,7 @@ html.stylesheet.path=${xsl.style.dir}/${custom.html-xsl.file}
html.stylesheet=${custom.html-xsl.file}
# Eclipse help
-eclipse.plugin.id=org.openarchitectureware.help.userguide
+eclipse.plugin.id=org.eclipse.xpand.doc.help.userguide
eclipse.output.dir=../${eclipse.plugin.id}
eclipse.plugin.name=$[product.name} User Guide
eclipse.plugin.provider=$[product.provider}
diff --git a/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml b/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
index 0fae307..1662ed6 100644
--- a/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
+++ b/doc/org.eclipse.xpand.doc/src/5.0/content/xpand_reference.xml
@@ -39,7 +39,7 @@
concrete syntax for executable expressions, using the type system.</para>
<para>The Java API described here is located in the
- <package>org.openarchitectureware.type</package> package and is a part of the
+ <package>org.eclipse.xtend.type</package> package and is a part of the
subproject
<package>core-expressions</package>.</para>
@@ -2449,9 +2449,7 @@
<title>Main configuration</title>
<para>The first thing to note is that the qualified Java name of the component is
- <varname>org.openarchitectureware.xpand2.Generator2</varname>. One can
- use the shortcut <varname>oaw</varname> instead of a preceding
- <varname>org.openarchitectureware</varname>. The workflow engine will
+ <varname>org.eclipse.xpand2.Generator</varname>. The workflow engine will
resolve it.</para>
</section>
@@ -2566,15 +2564,15 @@
<programlisting>&lt;beautifier
- class="org.openarchitectureware.xpand2.output.JavaBeautifier"/&gt;
+ class="org.eclipse.xpand2.output.JavaBeautifier"/&gt;
&lt;beautifier
- class="org.openarchitectureware.xpand2.output.XmlBeautifier"/&gt;</programlisting>
+ class="org.eclipse.xpand2.output.XmlBeautifier"/&gt;</programlisting>
These are the two beautifiers delivered with <emphasis>Xpand</emphasis>. If
you want to use your own beautifier, you would just need to implement the
following Java interface:
- <programlisting>package org.openarchitectureware.xpand2.output;
+ <programlisting>package org.eclipse.xpand2.output;
public interface PostProcessor { public void
beforeWriteAndClose(FileHandle handle); public void
afterClose(FileHandle handle); }</programlisting>The
diff --git a/plugins/org.eclipse.xpand/src/org/eclipse/internal/xpand2/GeneratorAdvice.java b/plugins/org.eclipse.xpand/src/org/eclipse/internal/xpand2/GeneratorAdvice.java
index 0683cf3..6e5c2a4 100644
--- a/plugins/org.eclipse.xpand/src/org/eclipse/internal/xpand2/GeneratorAdvice.java
+++ b/plugins/org.eclipse.xpand/src/org/eclipse/internal/xpand2/GeneratorAdvice.java
@@ -62,7 +62,7 @@ import org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowAdvice;
* <tr>
* <td>metaModel</td>
* <td>0..n</td>
- * <td>org.openarchitectureware.type.MetaModel</td>
+ * <td>org.eclipse.extend.typesystem.MetaModel</td>
* <td>Additional metamodels needed for the advices.</td>
* </tr>
*
@@ -118,7 +118,7 @@ public class GeneratorAdvice extends AbstractExpressionsUsingWorkflowAdvice {
}
/**
- * @see org.openarchitectureware.workflow.ao.AbstractWorkflowAdvice#checkConfiguration(org.openarchitectureware.workflow.issues.Issues)
+ * @see org.eclipse.emf.mwe.core.ao.AbstractWorkflowAdvice#checkConfiguration(org.openarchitectureware.workflow.issues.Issues)
*/
@Override
public void checkConfiguration(Issues issues) {
@@ -129,8 +129,8 @@ public class GeneratorAdvice extends AbstractExpressionsUsingWorkflowAdvice {
}
/**
- * @see org.openarchitectureware.expression.AbstractExpressionsUsingWorkflowAdvice#weave(org.openarchitectureware.workflow.WorkflowComponent,
- * org.openarchitectureware.workflow.issues.Issues)
+ * @see org.eclipse.xtend.expression.AbstractExpressionsUsingWorkflowAdvice#weave(org.openarchitectureware.workflow.WorkflowComponent,
+ * org.eclipse.emf.mwe.core.issues.Issues)
*/
@Override
public void weave(WorkflowComponent c, Issues issues) {
diff --git a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandBuilder.java b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandBuilder.java
index 0a8baee..5a5d73d 100644
--- a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandBuilder.java
+++ b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/builder/XtendXpandBuilder.java
@@ -137,6 +137,14 @@ public class XtendXpandBuilder extends IncrementalProjectBuilder {
}
for (final Iterator<?> iter = toAnalyze.iterator(); iter.hasNext();) {
final IXtendXpandResource res = (IXtendXpandResource) iter.next();
+ IStorage underlyingStorage = res.getUnderlyingStorage();
+ if(underlyingStorage instanceof IResource) {
+ IResource resource = (IResource) underlyingStorage;
+ IProject project = resource.getProject();
+ if(project.isLinked()) {
+ continue;
+ }
+ }
res.analyze();
}
IXtendXpandProject p = Activator.getExtXptModelManager().findProject(getProject());
diff --git a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/JDTUtil.java b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/JDTUtil.java
index f59dafd..116d9d2 100644
--- a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/JDTUtil.java
+++ b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/JDTUtil.java
@@ -68,6 +68,10 @@ public class JDTUtil {
.resource();
if (resource instanceof IFolder) {
rootFolder = (IFolder) resource;
+ IStorage member = (IStorage) rootFolder.findMember(p);
+ if(member != null) {
+ return member;
+ }
}
}
if (rootFolder != null) {
diff --git a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/XtendXpandProject.java b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/XtendXpandProject.java
index 1151e1a..e6208f9 100644
--- a/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/XtendXpandProject.java
+++ b/plugins/org.eclipse.xtend.shared.ui/src/org/eclipse/xtend/shared/ui/core/internal/XtendXpandProject.java
@@ -33,6 +33,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jdt.core.ElementChangedEvent;
import org.eclipse.jdt.core.IElementChangedListener;
+import org.eclipse.jdt.core.IJarEntryResource;
import org.eclipse.jdt.core.IJavaElementDelta;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
@@ -59,12 +60,14 @@ public class XtendXpandProject implements IXtendXpandProject {
if (initializing.add(project)) {
try {
Activator.getExtXptModelManager().findProject(ps[i]);
- } finally {
+ }
+ finally {
initializing.remove(project);
}
}
}
- } catch (final CoreException e) {
+ }
+ catch (final CoreException e) {
XtendLog.logError(e);
}
JavaCore.addElementChangedListener(new IElementChangedListener() {
@@ -72,8 +75,7 @@ public class XtendXpandProject implements IXtendXpandProject {
public void elementChanged(ElementChangedEvent event) {
if (fromJar.isEmpty())
return;
- if (containsRemovedClassPathEntry(event.getDelta()
- .getAffectedChildren()))
+ if (containsRemovedClassPathEntry(event.getDelta().getAffectedChildren()))
removeResourcesFromJar();
}
}, ElementChangedEvent.POST_CHANGE);
@@ -83,25 +85,22 @@ public class XtendXpandProject implements IXtendXpandProject {
protected IStatus run(final IProgressMonitor monitor) {
try {
final IProject p = project.getProject();
- if (p.isAccessible()
- && p.isNatureEnabled(XtendXpandNature.NATURE_ID)) {
- p.build(IncrementalProjectBuilder.CLEAN_BUILD,
- XtendXpandBuilder.getBUILDER_ID(),
+ if (p.isAccessible() && p.isNatureEnabled(XtendXpandNature.NATURE_ID)) {
+ p.build(IncrementalProjectBuilder.CLEAN_BUILD, XtendXpandBuilder.getBUILDER_ID(),
new HashMap<Object, Object>(), monitor);
}
- } catch (final CoreException e) {
+ }
+ catch (final CoreException e) {
XtendLog.logError(e);
}
return Status.OK_STATUS;
}
};
- j.setRule(project.getResource().getWorkspace().getRuleFactory()
- .buildRule());
+ j.setRule(project.getResource().getWorkspace().getRuleFactory().buildRule());
j.schedule();
}
- protected boolean containsRemovedClassPathEntry(
- IJavaElementDelta[] affectedChildren) {
+ protected boolean containsRemovedClassPathEntry(IJavaElementDelta[] affectedChildren) {
for (int i = 0; i < affectedChildren.length; i++) {
IJavaElementDelta delta = affectedChildren[i];
if ((delta.getFlags() & IJavaElementDelta.F_REMOVED_FROM_CLASSPATH) != 0) {
@@ -149,20 +148,19 @@ public class XtendXpandProject implements IXtendXpandProject {
public IXtendXpandProject[] getReferencedProjects() {
Set<IXtendXpandProject> result = new HashSet<IXtendXpandProject>();
try {
- IProject[] projects = getProject().getProject()
- .getReferencedProjects();
+ IProject[] projects = getProject().getProject().getReferencedProjects();
for (IProject project : projects) {
- IXtendXpandProject p = Activator.getExtXptModelManager().findProject(
- project);
+ IXtendXpandProject p = Activator.getExtXptModelManager().findProject(project);
if (p != null)
result.add(p);
}
- } catch (CoreException e) {
+ }
+ catch (CoreException e) {
XtendLog.logError(e);
}
return result.toArray(new IXtendXpandProject[result.size()]);
}
-
+
/**
* @see IXtendXpandProject#getAllReferencedProjects()
*/
@@ -186,10 +184,8 @@ public class XtendXpandProject implements IXtendXpandProject {
public void unregisterOawResource(final IXtendXpandResource res) {
if (res != null) {
if (res.getUnderlyingStorage() instanceof IFile)
- XtendXpandMarkerManager.deleteMarkers((IFile) res
- .getUnderlyingStorage());
- resources.remove(new ResourceID(res.getFullyQualifiedName(), res
- .getFileExtension()));
+ XtendXpandMarkerManager.deleteMarkers((IFile) res.getUnderlyingStorage());
+ resources.remove(new ResourceID(res.getFullyQualifiedName(), res.getFileExtension()));
}
}
@@ -199,7 +195,7 @@ public class XtendXpandProject implements IXtendXpandProject {
public IXtendXpandResource findExtXptResource(final String fqn, final String extension) {
assert (fqn != null);
assert (extension != null);
- if (Activator.getRegisteredResourceContributorFor(extension)==null)
+ if (Activator.getRegisteredResourceContributorFor(extension) == null)
return null;
// for performance reasons ask the cache first
IXtendXpandResource res = findCachedOawResource(fqn, extension);
@@ -227,12 +223,13 @@ public class XtendXpandProject implements IXtendXpandProject {
IXtendXpandResource res = resources.get(new ResourceID(fqn, extension));
if (res == null)
return null;
-
+
// eliminate stale resources
- IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember((res.getUnderlyingStorage().getFullPath()));
+ IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(
+ (res.getUnderlyingStorage().getFullPath()));
if (workspaceResource != null && workspaceResource.exists())
return res;
- else {
+ else {
resources.remove(new ResourceID(fqn, extension));
return null;
}
@@ -240,30 +237,32 @@ public class XtendXpandProject implements IXtendXpandProject {
/**
* Loads an oAW Resource. Searches the project and all referenced projects.
- * @param fqn Qualified name of the resource, e.g. '<tt>org::eclipse::xtend::util::stdlib::io.ext'
- * @param extension The resource's file extension
- * @param searchJars <tt>true</tt> search also in referenced Jar files on the classpath
+ *
+ * @param fqn
+ * Qualified name of the resource, e.g. '<tt>org::eclipse::xtend::util::stdlib::io.ext'
+ * @param extension
+ * The resource's file extension
+ * @param searchJars
+ * <tt>true</tt> search also in referenced Jar files on the
+ * classpath
* @return The resource or <code>null</code> if not found
*/
- private IXtendXpandResource loadOawResource(final String fqn,
- final String extension, boolean searchJars) {
+ private IXtendXpandResource loadOawResource(final String fqn, final String extension, boolean searchJars) {
assert (fqn != null);
assert (extension != null);
-
+
// search the resource using JDT
- IStorage storage = JDTUtil.findStorage(project, new ResourceID(fqn,
- extension), searchJars);
-
+ IStorage storage = JDTUtil.findStorage(project, new ResourceID(fqn, extension), searchJars);
+
// Found in this project?
if (storage != null && (searchJars || (storage instanceof IFile))) {
IXtendXpandResource result = null;
- // get the file extension and find the appropriate ResourceContributor for this
+ // get the file extension and find the appropriate
+ // ResourceContributor for this
// kind of resource (Xpand/Xtend)
- String fileExtension = storage.getName().substring(
- storage.getName().lastIndexOf(".") + 1);
- final ResourceContributor contr = Activator
- .getRegisteredResourceContributorFor(fileExtension);
-
+ String fileExtension = storage.getName().substring(storage.getName().lastIndexOf(".") + 1);
+ final ResourceContributor contr = Activator.getRegisteredResourceContributorFor(fileExtension);
+
// we have a registered contributor for this resource
if (contr != null) {
// load the resource using the ResourceContributor
@@ -280,23 +279,24 @@ public class XtendXpandProject implements IXtendXpandProject {
}
}
}
-
- // if reached here then the resource was not found in the current project.
+
+ // if reached here then the resource was not found in the current
+ // project.
// Now we perform the same search on all referenced projects.
try {
final IProject[] p = project.getProject().getReferencedProjects();
for (int i = 0; i < p.length; i++) {
IProject project = p[i];
- final XtendXpandProject oawp = (XtendXpandProject) Activator
- .getExtXptModelManager().findProject(project);
+ final XtendXpandProject oawp = (XtendXpandProject) Activator.getExtXptModelManager().findProject(
+ project);
if (oawp != null) {
- IXtendXpandResource result = oawp.loadOawResource(fqn, extension,
- searchJars);
+ IXtendXpandResource result = oawp.loadOawResource(fqn, extension, searchJars);
if (result != null)
return result;
}
}
- } catch (final CoreException e) {
+ }
+ catch (final CoreException e) {
XtendLog.logError(e);
}
return null;
@@ -319,23 +319,38 @@ public class XtendXpandProject implements IXtendXpandProject {
* @see IXtendXpandProject#analyze(IProgressMonitor)
*/
public void analyze(final IProgressMonitor monitor) {
- for (final Iterator<IXtendXpandResource> iter = new ArrayList<IXtendXpandResource>(resources.values()).iterator(); iter
- .hasNext();) {
+ for (final Iterator<IXtendXpandResource> iter = new ArrayList<IXtendXpandResource>(resources.values())
+ .iterator(); iter.hasNext();) {
if (monitor.isCanceled())
return;
IXtendXpandResource resource = iter.next();
synchronized (resource) {
- resource.analyze();
+ if (!isInExternalPackageFragmentRoot(resource)) {
+ resource.analyze();
+ }
}
monitor.worked(1);
}
}
+ private boolean isInExternalPackageFragmentRoot(IXtendXpandResource resource) {
+ IStorage underlyingStorage = resource.getUnderlyingStorage();
+ IProject containerProject = null;
+ if (underlyingStorage instanceof IJarEntryResource) {
+ containerProject = ((IJarEntryResource) underlyingStorage).getPackageFragmentRoot().getJavaProject()
+ .getProject();
+ }
+ if (underlyingStorage instanceof IFile) {
+ containerProject = ((IFile) underlyingStorage).getProject();
+ }
+ return (containerProject != null) && containerProject.isHidden();
+ }
+
/**
* Returns the name of the underlying project.
*/
@Override
- public String toString() {
+ public String toString() {
return project.getPath().toString();
}
diff --git a/plugins/org.eclipse.xtend.tests/.settings/org.eclipse.xtend.shared.ui.prefs b/plugins/org.eclipse.xtend.tests/.settings/org.eclipse.xtend.shared.ui.prefs
new file mode 100644
index 0000000..64159a9
--- /dev/null
+++ b/plugins/org.eclipse.xtend.tests/.settings/org.eclipse.xtend.shared.ui.prefs
@@ -0,0 +1,4 @@
+#Wed Feb 11 11:36:37 CET 2009
+eclipse.preferences.version=1
+metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor,org.eclipse.xtend.shared.ui.core.metamodel.jdt.javabean.JavaBeanMetamodelContributor
+project.specific.metamodel=true
diff --git a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/cache/CachedExtension.chk b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/cache/CachedExtension.chk
index 5ac8aaa..d7aee5d 100644
--- a/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/cache/CachedExtension.chk
+++ b/plugins/org.eclipse.xtend.tests/src/org/eclipse/xtend/typesystem/emf/check/cache/CachedExtension.chk
@@ -1,6 +1,6 @@
import test;
-extension org::openarchitectureware::adapter::emf::check::cache::Cached;
+extension org::eclipse::xtend::typesystem::emf::check::cache::Cached;
context MyMetaClass ERROR "Name not set":
nameIsSet();
diff --git a/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/EmfToolsPlugin.java b/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/EmfToolsPlugin.java
index f181f1c..e7a1823 100644
--- a/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/EmfToolsPlugin.java
+++ b/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/EmfToolsPlugin.java
@@ -182,20 +182,22 @@ public class EmfToolsPlugin extends AbstractUIPlugin {
return getMetamodelsForProjectInternal(project, visited);
}
- /**
- * Retrieves the list of EPackages that are accessible for the given
- * project, i.e. that are in the project's classpath. The referenced projects are searched
- * recursively, but loops are detected.
- *
- * @param project The project to retrieve the metamodels for. Must not be null.
- * @param visited The names of the projects that have already been visited.
- * @return The metamodels for the given project. An empty array if none
- * are accessible.
- */
- private EPackage[] getMetamodelsForProjectInternal(IJavaProject project, Set<String> visited) {
- if (visited.contains(project.getProject().getName()))
- return new EPackage[0];
- visited.add(project.getProject().getName());
+ /**
+ * Retrieves the list of EPackages that are accessible for the given
+ * project, i.e. that are in the project's classpath. The referenced
+ * projects are searched recursively, but loops are detected.
+ *
+ * @param project
+ * The project to retrieve the metamodels for. Must not be null.
+ * @param visited
+ * The names of the projects that have already been visited.
+ * @return The metamodels for the given project. An empty array if none are
+ * accessible.
+ */
+ private EPackage[] getMetamodelsForProjectInternal(IJavaProject project, Set<String> visited) {
+ if (visited.contains(project.getProject().getName()))
+ return new EPackage[0];
+ visited.add(project.getProject().getName());
ProjectAnalyzer projectAnalyzer = getProjectAnalyzer(project.getProject());
if (projectAnalyzer == null) {
diff --git a/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/ProjectAnalyzer.java b/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/ProjectAnalyzer.java
index 7e931b2..4f978f4 100644
--- a/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/ProjectAnalyzer.java
+++ b/plugins/org.eclipse.xtend.typesystem.emf.ui/src/org/eclipse/xtend/typesystem/emf/ui/ProjectAnalyzer.java
@@ -39,6 +39,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.core.ExternalPackageFragmentRoot;
import org.eclipse.jdt.internal.core.JarPackageFragmentRoot;
import org.eclipse.xtend.shared.ui.Activator;
import org.eclipse.xtend.shared.ui.core.internal.JDTUtil;
@@ -75,20 +76,21 @@ final class ProjectAnalyzer extends Job {
protected IStatus run(IProgressMonitor monitor) {
if (EmfToolsPlugin.trace)
System.out.println("Analyzing EMF metamodels for project " + project.getProject().getProject().getName());
-
+
// load models
rs = new ResourceSetImpl();
mapping = new HashMap<IStorage, Resource>();
packages = new HashMap<String, EPackage>();
loadMetamodelsForProject(project, rs, monitor);
-
+
// done. now trigger build for the project.
// only do this if it is an oaw project
- // do not build referencing projects. the EmfToolsPlugin will take care of this
+ // do not build referencing projects. the EmfToolsPlugin will take care
+ // of this
if (Activator.getExtXptModelManager().findProject(project.getProject()) != null) {
new BuildJob(project.getProject()).schedule();
}
-
+
return Status.OK_STATUS;
}
@@ -98,30 +100,37 @@ final class ProjectAnalyzer extends Job {
final String ext = "ecore";
for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) {
if (!root.isArchive()) {
- final IResource rootResource = root.getUnderlyingResource();
+ IResource rootResource = null;
+ if (root instanceof ExternalPackageFragmentRoot) {
+ rootResource = ((ExternalPackageFragmentRoot) root).resource();
+ }
+ else {
+ rootResource = root.getUnderlyingResource();
+ }
if (rootResource != null) {
try {
rootResource.accept(new IResourceVisitor() {
public boolean visit(IResource resource) throws CoreException {
- if (resource instanceof IFile
- && ext.equals(((IFile) resource).getFileExtension())) {
+ if (resource instanceof IFile && ext.equals(((IFile) resource).getFileExtension())) {
loadModelFromStorage(rs, (IFile) resource);
}
return true;
}
});
- } catch (CoreException e) {
+ }
+ catch (CoreException e) {
EmfToolsLog.logError(e);
}
}
- } else {
+ }
+ else {
// skip JRE jars
- if (((JarPackageFragmentRoot)root).getPath().toString().contains("jre/lib")) {
+ if (((JarPackageFragmentRoot) root).getPath().toString().contains("jre/lib")) {
if (EmfToolsPlugin.trace)
- System.out.println("Skipping " + ((JarPackageFragmentRoot)root).getPath().toString());
+ System.out.println("Skipping " + ((JarPackageFragmentRoot) root).getPath().toString());
continue;
}
-
+
root.open(monitor);
try {
ZipFile zip = ((JarPackageFragmentRoot) root).getJar();
@@ -138,14 +147,17 @@ final class ProjectAnalyzer extends Job {
loadModelFromStorage(rs, findStorage);
}
}
- } catch (CoreException e) {
+ }
+ catch (CoreException e) {
EmfToolsLog.logError(e);
- } finally {
+ }
+ finally {
root.close();
}
}
}
- } catch (JavaModelException e) {
+ }
+ catch (JavaModelException e) {
EmfToolsLog.logError(e);
}
}
@@ -154,7 +166,7 @@ final class ProjectAnalyzer extends Job {
URI uri = URI.createPlatformResourceURI(storage.getFullPath().toString(), true);
if (EmfToolsPlugin.trace)
System.out.println("Loading EMF metamodel " + storage.getFullPath().toString());
-
+
final Resource r = rs.createResource(uri);
if (r.isLoaded() && !r.isModified())
return;
@@ -165,20 +177,24 @@ final class ProjectAnalyzer extends Job {
for (EPackage pack : packages) {
registerPackage(storage, pack);
}
- } catch (IOException e) {
+ }
+ catch (IOException e) {
EmfToolsLog.logError(e);
- } catch (CoreException e) {
+ }
+ catch (CoreException e) {
EmfToolsLog.logError(e);
}
}
private void registerPackage(IStorage storage, EPackage pack) {
- // finding duplicates by nsURI is better than by name since package names may be used across MMs
+ // finding duplicates by nsURI is better than by name since package
+ // names may be used across MMs
if (this.packages.containsKey(pack.getNsURI())) {
if (EmfToolsPlugin.trace)
System.out.println("Did not register '" + pack.getName() + "' from " + storage.getFullPath()
- + " because an EPackage with the same nsURI has already been registered.");
- } else {
+ + " because an EPackage with the same nsURI has already been registered.");
+ }
+ else {
this.packages.put(pack.getNsURI(), pack);
}
// recurse into subpackages
diff --git a/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiReader.java b/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiReader.java
index bcac3c3..910fbe3 100644
--- a/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiReader.java
+++ b/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiReader.java
@@ -47,7 +47,7 @@ public class XmiReader extends AbstractWorkflowComponent {
protected boolean firstElementOnly = true;
/**
- * @see org.openarchitectureware.workflow.lib.AbstractWorkflowComponent#getLogMessage()
+ * @see org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent#getLogMessage()
*/
@Override
public String getLogMessage() {
@@ -116,7 +116,7 @@ public class XmiReader extends AbstractWorkflowComponent {
}
/**
- * @see org.openarchitectureware.workflow.WorkflowComponent#checkConfiguration(org.openarchitectureware.workflow.issues.Issues)
+ * @see org.eclipse.emf.mwe.core.WorkflowComponent#checkConfiguration(org.openarchitectureware.workflow.issues.Issues)
*/
public void checkConfiguration(final Issues issues) {
loadFile(issues);
@@ -169,7 +169,7 @@ public class XmiReader extends AbstractWorkflowComponent {
}
/**
- * @see org.openarchitectureware.workflow.WorkflowComponent#getComponentName()
+ * @see org.eclipse.emf.mwe.core.WorkflowComponent#getComponentName()
*/
@Override
public String getComponentName() {
diff --git a/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiWriter.java b/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiWriter.java
index b0b844f..a580a00 100644
--- a/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiWriter.java
+++ b/plugins/org.eclipse.xtend.typesystem.emf/src/org/eclipse/xtend/typesystem/emf/XmiWriter.java
@@ -106,7 +106,7 @@ public class XmiWriter extends AbstractWorkflowComponent {
}
/**
- * @see org.openarchitectureware.workflow.lib.AbstractWorkflowComponent#getLogMessage()
+ * @see org.eclipse.emf.mwe.core.lib.AbstractWorkflowComponent#getLogMessage()
*/
@Override
public String getLogMessage() {
@@ -114,7 +114,7 @@ public class XmiWriter extends AbstractWorkflowComponent {
}
/**
- * @see org.openarchitectureware.workflow.WorkflowComponent#checkConfiguration(org.openarchitectureware.workflow.issues.Issues)
+ * @see org.eclipse.emf.mwe.core.WorkflowComponent#checkConfiguration(org.eclipse.emf.mwe.core.issues.Issues)
*/
public void checkConfiguration(final Issues issues) {
modelFile = modelFile.replace('\\', '/');
@@ -209,7 +209,7 @@ public class XmiWriter extends AbstractWorkflowComponent {
}
/**
- * @see org.openarchitectureware.workflow.WorkflowComponent#getComponentName()
+ * @see org.eclipse.emf.mwe.core.WorkflowComponent#getComponentName()
*/
@Override
public String getComponentName() {
diff --git a/plugins/org.eclipse.xtend.typesystem.uml2/.project b/plugins/org.eclipse.xtend.typesystem.uml2/.project
index b329ebc..5f95b64 100644
--- a/plugins/org.eclipse.xtend.typesystem.uml2/.project
+++ b/plugins/org.eclipse.xtend.typesystem.uml2/.project
@@ -21,7 +21,7 @@
</arguments>
</buildCommand>
<buildCommand>
- <name>org.openarchitectureware.base.oawBuilder</name>
+ <name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
<arguments>
</arguments>
</buildCommand>
@@ -29,6 +29,6 @@
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.openarchitectureware.base.oawNature</nature>
+ <nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
</natures>
</projectDescription>
diff --git a/plugins/org.eclipse.xtend.typesystem.uml2/.settings/org.eclipse.xtend.shared.ui.prefs b/plugins/org.eclipse.xtend.typesystem.uml2/.settings/org.eclipse.xtend.shared.ui.prefs
new file mode 100644
index 0000000..6b98525
--- /dev/null
+++ b/plugins/org.eclipse.xtend.typesystem.uml2/.settings/org.eclipse.xtend.shared.ui.prefs
@@ -0,0 +1,4 @@
+#Wed Feb 11 16:27:21 CET 2009
+eclipse.preferences.version=1
+metamodelContributor=org.eclipse.xtend.typesystem.emf.ui.EmfMetamodelContributor,org.eclipse.xtend.typesystem.uml2.ui.Uml2MetamodelContributor
+project.specific.metamodel=true
diff --git a/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext b/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext
index 72ea5e3..f7932e6 100644
--- a/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext
+++ b/plugins/org.eclipse.xtend.typesystem.uml2/src/org/eclipse/xtend/typesystem/uml2/profile/profiling.ext
@@ -10,7 +10,7 @@ Profile applyProfile (Model model, String uri) :
cached Stereotype getStereotype (Model m, String stereotype) :
m.getAppliedProfiles().allOwnedElements().typeSelect(Stereotype).select(st|st.qualifiedName==stereotype).first();
-
+
// allOwnedElements().getApplicableStereotypes()
Void setTaggedValue (Element elem, String stereotypeName, String taggedValueName, Object value) :
JAVA org.eclipse.xtend.typesystem.uml2.profile.ProfilingExtensions.setTaggedValue(
diff --git a/tests/org.eclipse.xpand.tests/.project b/tests/org.eclipse.xpand.tests/.project
index 0d3d494..bbc3caa 100644
--- a/tests/org.eclipse.xpand.tests/.project
+++ b/tests/org.eclipse.xpand.tests/.project
@@ -20,9 +20,15 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.xtend.shared.ui.xtendBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.xtend.shared.ui.xtendXPandNature</nature>
</natures>
</projectDescription>
diff --git a/tests/org.eclipse.xtend.shared.ui.test/.project b/tests/org.eclipse.xtend.shared.ui.test/.project
index 3cbdd24..a682996 100644
--- a/tests/org.eclipse.xtend.shared.ui.test/.project
+++ b/tests/org.eclipse.xtend.shared.ui.test/.project
@@ -20,15 +20,9 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.openarchitectureware.base.oawBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.openarchitectureware.base.oawNature</nature>
</natures>
</projectDescription>
diff --git a/tests/org.eclipse.xtend.shared.ui.test/src/org/eclipse/xtend/shared/ui/test/xpand2/core/Bug155018Test.java b/tests/org.eclipse.xtend.shared.ui.test/src/org/eclipse/xtend/shared/ui/test/xpand2/core/Bug155018Test.java
index 57c3fc6..59d52cd 100644
--- a/tests/org.eclipse.xtend.shared.ui.test/src/org/eclipse/xtend/shared/ui/test/xpand2/core/Bug155018Test.java
+++ b/tests/org.eclipse.xtend.shared.ui.test/src/org/eclipse/xtend/shared/ui/test/xpand2/core/Bug155018Test.java
@@ -39,8 +39,8 @@ public class Bug155018Test extends XpandCoreTestBase {
env.addInternalJar(proj.getFullPath(), "ExtensionInJar.jar", readJar(), false);
env.fullBuild();
IXtendXpandProject project = Activator.getExtXptModelManager().findProject(proj.getFullPath());
- assertNotNull(JavaCore.create(proj).findType("org.openarchitectureware.expression.Analyzable"));
- IXtendXpandResource res = project.findExtXptResource("org::openarchitectureware::util::IO","ext");
+ assertNotNull(JavaCore.create(proj).findType("org.eclipse.xtend.expression.Analyzable"));
+ IXtendXpandResource res = project.findExtXptResource("org::eclipse::xtend::util::stdlib::io","ext");
assertNotNull(res);
assertNotNull(res.getFullyQualifiedName());
assertNotNull("AbstractExtension from Jar not found (Bug155018)", res);