summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Butzke2013-01-31 15:15:41 (EST)
committerKaren Butzke2013-01-31 15:15:41 (EST)
commit50c2b78ef67686c8c5fb8375ecf7b382615e0a84 (patch)
tree99053c0fc761d6bd8d39038148c21ea97d5f4da3
parenta7e6d978f1407b2ebaee516c13111f0e6f64100a (diff)
downloadwebtools.dali-50c2b78ef67686c8c5fb8375ecf7b382615e0a84.zip
webtools.dali-50c2b78ef67686c8c5fb8375ecf7b382615e0a84.tar.gz
webtools.dali-50c2b78ef67686c8c5fb8375ecf7b382615e0a84.tar.bz2
added JpaStructureNode children API
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaStructureNode.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/XmlFile.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JarFile.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/VirtualOrmPersistentAttribute.java11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractJarFileRef.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractMappingFileRef.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmXml.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistence.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistenceXml.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java10
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkPersistenceUnitItemContentProvider.java (renamed from jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java)27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_4UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_5UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractPersistenceResourceUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/persistence/PersistenceXml2_1UiDefinition.java12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceXmlUiDefinition.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractNavigatorItemContentProviderFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileStructureItemContentProviderFactory.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaStructureNodeItemContentProvider.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java176
48 files changed, 595 insertions, 1004 deletions
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaStructureNode.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaStructureNode.java
index 00959e1..8aa8ab3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaStructureNode.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/JpaStructureNode.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -10,7 +10,6 @@
package org.eclipse.jpt.jpa.core;
import java.util.Collection;
-
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.jpa.core.context.JpaContextNode;
@@ -64,6 +63,26 @@ public interface JpaStructureNode
*/
Class<? extends JpaStructureNode> getType();
+
+ // ********** children **********
+
+ /**
+ * String constant associated with changes to the structure
+ * node's children.
+ */
+ String CHILDREN_COLLECTION = "children"; //$NON-NLS-1$
+
+ /**
+ * Return the children structure nodes, to be displayed in the JpaStructureView
+ */
+ Iterable<? extends JpaStructureNode> getChildren();
+
+ /**
+ * Return the size of the children structure node collection
+ */
+ int getChildrenSize();
+
+
/**
* Add the appropriate root structure nodes to the collection that
* correspond to the given JPA file.
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
index e42d76e..69a7332 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/MappingFile.java
@@ -9,7 +9,9 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context;
+import java.util.Collection;
import org.eclipse.core.resources.IFolder;
+import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.orm.MappingFileDefinition;
import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
@@ -28,7 +30,7 @@ import org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer;
* @since 2.1
*/
public interface MappingFile
- extends JpaStructureNode, PersistentTypeContainer, DeleteTypeRefactoringParticipant, TypeRefactoringParticipant
+ extends JpaContextNode, PersistentTypeContainer, DeleteTypeRefactoringParticipant, TypeRefactoringParticipant
{
MappingFileRef getParent();
@@ -61,6 +63,20 @@ public interface MappingFile
*/
Object getResourceMappingFile();
+ /**
+ * Add the appropriate root structure nodes to the collection that
+ * correspond to the given JPA file.
+ * @see JpaFile#getRootStructureNodes()
+ */
+ void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes);
+
+ /**
+ * Dispose the structure node and its children.
+ * Typically this would be used to update the structure node's
+ * JPA file's root structure nodes.
+ */
+ void dispose();
+
// ********** queries/generators **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/XmlFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/XmlFile.java
index edac5da..3dfd87e 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/XmlFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/XmlFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,9 +9,11 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context;
+import java.util.Collection;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.jpt.common.core.resource.xml.JptXmlResource;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
+import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
@@ -28,7 +30,7 @@ import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
* @since 2.3
*/
public interface XmlFile
- extends JpaStructureNode
+ extends JpaContextNode
{
/**
* Return the XML file's root element.
@@ -58,6 +60,20 @@ public interface XmlFile
boolean isGenericMappingFile();
+ /**
+ * Add the appropriate root structure nodes to the collection that
+ * correspond to the given JPA file.
+ * @see JpaFile#getRootStructureNodes()
+ */
+ void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes);
+
+ /**
+ * Dispose the structure node and its children.
+ * Typically this would be used to update the structure node's
+ * JPA file's root structure nodes.
+ */
+ void dispose();
+
// ********** XML file root element **********
/**
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JarFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JarFile.java
index 8886174..6ba6bfa 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JarFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/context/java/JarFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -9,8 +9,10 @@
******************************************************************************/
package org.eclipse.jpt.jpa.core.context.java;
+import java.util.Collection;
import org.eclipse.core.resources.IFolder;
import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageFragmentRoot;
+import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.JpaContextNode;
import org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer;
@@ -30,7 +32,7 @@ import org.eclipse.jpt.jpa.core.context.persistence.PersistentTypeContainer;
* @since 2.2
*/
public interface JarFile
- extends JpaContextNode, JpaStructureNode, PersistentTypeContainer
+ extends JpaContextNode, PersistentTypeContainer
{
JavaResourcePackageFragmentRoot getJarResourcePackageFragmentRoot();
@@ -53,6 +55,20 @@ public interface JarFile
// ********** misc **********
/**
+ * Add the appropriate root structure nodes to the collection that
+ * correspond to the given JPA file.
+ * @see JpaFile#getRootStructureNodes()
+ */
+ void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes);
+
+ /**
+ * Dispose the structure node and its children.
+ * Typically this would be used to update the structure node's
+ * JPA file's root structure nodes.
+ */
+ void dispose();
+
+ /**
* Return true if this jar file exists in the given folder
*/
boolean isIn(IFolder folder);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
index 6bd9a9f..0295be5 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2006, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -453,6 +453,14 @@ public abstract class AbstractJavaPersistentAttribute
return JavaPersistentAttribute.class;
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
public JpaStructureNode getStructureNode(int textOffset) {
return this;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
index fd8ac6e..8e9329c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/java/AbstractJavaPersistentType.java
@@ -80,6 +80,8 @@ public abstract class AbstractJavaPersistentType
protected final Vector<JavaPersistentAttribute> attributes = new Vector<JavaPersistentAttribute>();
+ protected final Vector<JavaPersistentAttribute> children = new Vector<JavaPersistentAttribute>();
+
protected AbstractJavaPersistentType(PersistentType.Owner parent, JavaResourceType resourceType) {
super(parent);
@@ -92,7 +94,7 @@ public abstract class AbstractJavaPersistentType
this.mapping = this.buildMapping();
this.initializeAttributes();
-
+ this.initializeChildren();
}
@@ -114,6 +116,7 @@ public abstract class AbstractJavaPersistentType
this.setDefaultAccess(this.buildDefaultAccess());
this.mapping.update();
this.updateAttributes();
+ this.updateChildren();
}
@@ -979,6 +982,22 @@ public abstract class AbstractJavaPersistentType
//nothing
}
+ protected void initializeChildren() {
+ this.children.addAll(this.attributes);
+ }
+
+ protected void updateChildren() {
+ this.synchronizeCollection(this.attributes, this.children, CHILDREN_COLLECTION);
+ }
+
+ public Iterable<JavaPersistentAttribute> getChildren() {
+ return IterableTools.cloneLive(this.children);
+ }
+
+ public int getChildrenSize() {
+ return this.children.size();
+ }
+
// ********** Java completion proposals **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
index d503fd1..682350d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/AbstractEntityMappings.java
@@ -115,6 +115,8 @@ public abstract class AbstractEntityMappings
// Lookup of short class name to fully qualified class name for primitives, wrappers, array primitives
protected static Map<String, String> PRIMITIVE_CLASSES = null;
+ protected final Vector<OrmPersistentType> children = new Vector<OrmPersistentType>();
+
protected AbstractEntityMappings(OrmXml parent, XmlEntityMappings xmlEntityMappings) {
super(parent);
@@ -132,8 +134,9 @@ public abstract class AbstractEntityMappings
this.initializePersistentTypes();
this.sequenceGeneratorContainer = this.buildSequenceGeneratorContainer();
this.tableGeneratorContainer = this.buildTableGeneratorContainer();
-
this.queryContainer = this.buildQueryContainer();
+
+ this.initializeChildren();
}
@@ -174,6 +177,7 @@ public abstract class AbstractEntityMappings
this.updateNodes(this.getTableGenerators());
this.queryContainer.update();
+ this.updateChildren();
}
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -232,6 +236,24 @@ public abstract class AbstractEntityMappings
}
}
+ //TODO I think children needs to include all managed types,
+ //thus JPA 2.1 converters are going to appear in the structure and project explorer views??
+ protected void initializeChildren() {
+ this.children.addAll(this.persistentTypes);
+ }
+
+ protected void updateChildren() {
+ this.synchronizeCollection(this.persistentTypes, this.children, CHILDREN_COLLECTION);
+ }
+
+ public Iterable<OrmPersistentType> getChildren() {
+ return IterableTools.cloneLive(this.children);
+ }
+
+ public int getChildrenSize() {
+ return this.children.size();
+ }
+
// ********** PersistentType.Owner implementation **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java
index 1534210..7122be0 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentAttribute.java
@@ -22,6 +22,7 @@ import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.core.utility.jdt.TypeBinding;
import org.eclipse.jpt.common.utility.filter.Filter;
import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
@@ -445,6 +446,14 @@ public abstract class SpecifiedOrmPersistentAttribute
return OrmPersistentAttribute.class;
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
public JpaStructureNode getStructureNode(int offset) {
return this;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
index 90b848d..68dc2b7 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/SpecifiedOrmPersistentType.java
@@ -104,6 +104,8 @@ public abstract class SpecifiedOrmPersistentType
protected final MetamodelSourceType.Synchronizer metamodelSynchronizer;
+ protected final Vector<OrmReadOnlyPersistentAttribute> children = new Vector<OrmReadOnlyPersistentAttribute>();
+
protected SpecifiedOrmPersistentType(EntityMappings parent, XmlTypeMapping xmlTypeMapping) {
super(parent);
@@ -114,6 +116,7 @@ public abstract class SpecifiedOrmPersistentType
this.defaultAccess = AccessType.FIELD; // keep this non-null
this.initializeSpecifiedAttributes();
this.metamodelSynchronizer = this.buildMetamodelSynchronizer();
+ this.initializeChildren();
}
@@ -140,6 +143,7 @@ public abstract class SpecifiedOrmPersistentType
this.updateDefaultAttributes();
this.setSuperPersistentType(this.buildSuperPersistentType());
this.setDeclaringTypeName(this.buildDeclaringTypeName());
+ this.updateChildren();
}
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -1109,6 +1113,25 @@ public abstract class SpecifiedOrmPersistentType
return OrmPersistentType.class;
}
+ protected void initializeChildren() {
+ this.children.addAll(this.specifiedAttributes); //defaultAttributes haven't been built yet
+ }
+
+ protected void updateChildren() {
+ Vector<OrmReadOnlyPersistentAttribute> newChildren = new Vector<OrmReadOnlyPersistentAttribute>();
+ newChildren.addAll(this.specifiedAttributes);
+ newChildren.addAll(this.defaultAttributes);
+ this.synchronizeCollection(newChildren, this.children, CHILDREN_COLLECTION);
+ }
+
+ public Iterable<OrmReadOnlyPersistentAttribute> getChildren() {
+ return IterableTools.cloneLive(this.children);
+ }
+
+ public int getChildrenSize() {
+ return this.children.size();
+ }
+
public JpaStructureNode getStructureNode(int textOffset) {
for (OrmPersistentAttribute attribute : this.getSpecifiedAttributes()) {
if (attribute.contains(textOffset)) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/VirtualOrmPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/VirtualOrmPersistentAttribute.java
index a253357..371f655 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/VirtualOrmPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/orm/VirtualOrmPersistentAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2010, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -16,6 +16,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.core.utility.jdt.TypeBinding;
+import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
import org.eclipse.jpt.jpa.core.JpaFile;
@@ -299,6 +300,14 @@ public class VirtualOrmPersistentAttribute
return OrmPersistentAttribute.class;
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
public JpaStructureNode getStructureNode(int offset) {
return this;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractJarFileRef.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractJarFileRef.java
index f98e032..02ab666 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractJarFileRef.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractJarFileRef.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -99,6 +99,14 @@ public abstract class AbstractJarFileRef
return JarFileRef.class;
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
public JpaStructureNode getStructureNode(int textOffset) {
return this;
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractMappingFileRef.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractMappingFileRef.java
index 05cf230..755f9ee 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractMappingFileRef.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractMappingFileRef.java
@@ -194,6 +194,14 @@ public abstract class AbstractMappingFileRef<MF extends MappingFile>
}
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
// ********** queries/generators **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
index c7e1ce3..bc46995 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/context/persistence/AbstractPersistenceUnit.java
@@ -196,6 +196,8 @@ public abstract class AbstractPersistenceUnit
protected final Set<IFile> metamodelFiles = Collections.synchronizedSet(new HashSet<IFile>());
+ protected final Vector<JpaStructureNode> children = new Vector<JpaStructureNode>();
+
// ********** construction/initialization **********
@@ -228,6 +230,7 @@ public abstract class AbstractPersistenceUnit
this.specifiedValidationMode = this.buildSpecifiedValidationMode();
this.initializeMetamodelFiles();
+ this.initializeChildren();
}
@@ -292,6 +295,8 @@ public abstract class AbstractPersistenceUnit
this.setDefaultSharedCacheMode(this.buildDefaultSharedCacheMode());
this.setDefaultValidationMode(this.buildDefaultValidationMode());
+
+ this.updateChildren();
}
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -354,6 +359,33 @@ public abstract class AbstractPersistenceUnit
}
}
+ protected void initializeChildren() {
+ CollectionTools.addAll(this.children, this.getMappingFileRefs());
+ CollectionTools.addAll(this.children, this.getSpecifiedClassRefs());
+
+ //TODO why are we not displaying these in the JPA Structure View for a persistence.xml?
+ //CollectionTools.addAll(this.children, this.getImpliedClassRefs());
+ CollectionTools.addAll(this.children, this.getJarFileRefs());
+ }
+
+ protected void updateChildren() {
+ Vector<JpaStructureNode> newChildren = new Vector<JpaStructureNode>();
+ CollectionTools.addAll(newChildren, this.getMappingFileRefs());
+ CollectionTools.addAll(newChildren, this.getSpecifiedClassRefs());
+ //CollectionTools.addAll(children, this.getImpliedClassRefs());
+ CollectionTools.addAll(newChildren, this.getJarFileRefs());
+
+ this.synchronizeCollection(newChildren, this.children, CHILDREN_COLLECTION);
+ }
+
+ public Iterable<JpaStructureNode> getChildren() {
+ return IterableTools.cloneLive(this.children);
+ }
+
+ public int getChildrenSize() {
+ return this.children.size();
+ }
+
// ********** name **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
index 122f91a..e6fddce 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/java/GenericJarFile.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -73,23 +73,7 @@ public class GenericJarFile
}
- // ********** JpaStructureNode implementation **********
-
- public ContextType getContextType() {
- return new ContextType(this);
- }
-
- public Class<JarFile> getType() {
- return JarFile.class;
- }
-
- public TextRange getSelectionTextRange() {
- return null;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- return null;
- }
+ // ********** JarFile implementation **********
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
for (JavaPersistentType persistentType : this.getJavaPersistentTypes()) {
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmXml.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmXml.java
index bc99e09..9ad7080 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmXml.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/orm/GenericOrmXml.java
@@ -261,26 +261,15 @@ public class GenericOrmXml
return XmlFile_.isGenericMappingFile(this);
}
- // ********** JpaStructureNode implementation **********
- public ContextType getContextType() {
- return new ContextType(this);
- }
-
- public Class<OrmXml> getType() {
- return OrmXml.class;
- }
+ // ********** MappingFile implementation **********
- public JpaStructureNode getStructureNode(int textOffset) {
- if ((this.root != null) && this.root.containsOffset(textOffset)) {
- return this.root.getStructureNode(textOffset);
- }
- return this;
+ public Object getResourceMappingFile() {
+ return this.xmlResource;
}
- // never actually selected
- public TextRange getSelectionTextRange() {
- return TextRange.Empty.instance();
+ public OrmPersistentType getPersistentType(String name) {
+ return (this.root == null) ? null : this.root.getPersistentType(name);
}
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -300,16 +289,6 @@ public class GenericOrmXml
}
}
- // ********** MappingFile implementation **********
-
- public Object getResourceMappingFile() {
- return this.xmlResource;
- }
-
- public OrmPersistentType getPersistentType(String name) {
- return (this.root == null) ? null : this.root.getPersistentType(name);
- }
-
// ********** PersistentTypeContainer implementation **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
index f74bf6c..4fd02b9 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericClassRef.java
@@ -19,6 +19,7 @@ import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.ObjectTools;
import org.eclipse.jpt.common.utility.internal.StringTools;
+import org.eclipse.jpt.common.utility.internal.iterable.EmptyIterable;
import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
@@ -126,6 +127,15 @@ public class GenericClassRef
}
}
+ public Iterable<JpaStructureNode> getChildren() {
+ return EmptyIterable.instance();
+ }
+
+ public int getChildrenSize() {
+ return 0;
+ }
+
+
// ********** class name **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistence.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistence.java
index d0108c7..4f896e6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistence.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistence.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,11 +11,13 @@ package org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence;
import java.util.Collection;
import java.util.List;
+import java.util.Vector;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jpt.common.core.utility.TextRange;
import org.eclipse.jpt.common.utility.internal.iterable.EmptyListIterable;
+import org.eclipse.jpt.common.utility.internal.iterable.IterableTools;
import org.eclipse.jpt.common.utility.internal.iterable.SingleElementListIterable;
import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.jpa.core.JpaFile;
@@ -49,11 +51,13 @@ public class GenericPersistence
// is for a list. We want to support multiple persistence units someday....
protected PersistenceUnit persistenceUnit;
+ protected final Vector<PersistenceUnit> children = new Vector<PersistenceUnit>();
public GenericPersistence(PersistenceXml parent, XmlPersistence xmlPersistence) {
super(parent);
this.xmlPersistence = xmlPersistence;
this.initializePersistenceUnits();
+ this.initializeChildren();
}
@@ -69,6 +73,7 @@ public class GenericPersistence
public void update() {
super.update();
this.updateNodes(this.getPersistenceUnits());
+ this.updateChildren();
}
public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
@@ -268,6 +273,22 @@ public class GenericPersistence
}
}
+ protected void initializeChildren() {
+ this.children.add(this.persistenceUnit);
+ }
+
+ protected void updateChildren() {
+ this.synchronizeCollection(this.getPersistenceUnits(), this.children, CHILDREN_COLLECTION);
+ }
+
+ public Iterable<PersistenceUnit> getChildren() {
+ return IterableTools.cloneLive(this.children);
+ }
+
+ public int getChildrenSize() {
+ return this.children.size();
+ }
+
// ********** validation **********
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistenceXml.java b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistenceXml.java
index bfb4cf4..8e57761 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistenceXml.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.core/src/org/eclipse/jpt/jpa/core/internal/jpa1/context/persistence/GenericPersistenceXml.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2007, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -22,7 +22,6 @@ import org.eclipse.jpt.jpa.core.JpaFile;
import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNode;
import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
@@ -198,6 +197,23 @@ public class GenericPersistenceXml
return false;
}
+ public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
+ if (this.root == null) {
+ return;
+ }
+ if (this.getResource().equals(jpaFile.getFile())) {
+ rootStructureNodes.add(this.root);
+ return;
+ }
+ this.root.gatherRootStructureNodes(jpaFile, rootStructureNodes);
+ }
+
+ public void dispose() {
+ if (this.root != null) {
+ this.root.dispose();
+ }
+ }
+
// ********** metamodel **********
public void initializeMetamodel() {
@@ -219,46 +235,6 @@ public class GenericPersistenceXml
}
- // ********** JpaStructureNode implementation **********
-
- public ContextType getContextType() {
- return new ContextType(this);
- }
-
- public Class<PersistenceXml> getType() {
- return PersistenceXml.class;
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- if (this.root.containsOffset(textOffset)) {
- return this.root.getStructureNode(textOffset);
- }
- return this;
- }
-
- // never actually selected
- public TextRange getSelectionTextRange() {
- return TextRange.Empty.instance();
- }
-
- public void gatherRootStructureNodes(JpaFile jpaFile, Collection<JpaStructureNode> rootStructureNodes) {
- if (this.root == null) {
- return;
- }
- if (this.getResource().equals(jpaFile.getFile())) {
- rootStructureNodes.add(this.root);
- return;
- }
- this.root.gatherRootStructureNodes(jpaFile, rootStructureNodes);
- }
-
- public void dispose() {
- if (this.root != null) {
- this.root.dispose();
- }
- }
-
-
// ********** validation **********
@Override
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java
index 4fffa3a..0cf0552 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -165,6 +165,14 @@ public class VirtualJavaPersistentAttribute
throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
}
+ public Iterable<JpaStructureNode> getChildren() {
+ throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
+ }
+
+ public int getChildrenSize() {
+ throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
+ }
+
public void dispose() {
throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java
index 23a3adf..69a4979 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java
@@ -270,6 +270,14 @@ public class VirtualJavaPersistentType
throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
}
+ public ListIterable<JpaStructureNode> getChildren() {
+ throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
+ }
+
+ public int getChildrenSize() {
+ throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
+ }
+
public JpaStructureNode getStructureNode(int textOffset) {
throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF
index 40322d1..61c6c5a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF
@@ -55,10 +55,8 @@ Export-Package: org.eclipse.jpt.jpa.eclipselink.ui.internal;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.plugin;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.weave;x-internal:=true,
org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards;x-internal:=true,
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
index efa6c6f..36e9e8c 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,23 +11,19 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.EclipseLinkPersistenceUnitCachingEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection.EclipseLinkPersistenceUnitConnectionEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization.EclipseLinkPersistenceUnitCustomizationEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.EclipseLinkPersistenceUnitOptionsEditorPageDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.structure.EclipseLinkPersistenceStructureItemContentProviderFactory;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemLabelProviderFactory;
public class EclipseLinkPersistenceXmlUiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXmlUiDefinition();
@@ -62,14 +58,4 @@ public class EclipseLinkPersistenceXmlUiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXmlDefinition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- EclipseLinkPersistenceStructureItemContentProviderFactory.instance(),
- PersistenceStructureItemLabelProviderFactory.instance()
- );
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java
index 99eefe4..6294d05 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java
@@ -12,7 +12,6 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details.EclipseLinkPersistenceUnitItemContentProvider;
import org.eclipse.jpt.jpa.ui.internal.platform.base.AbstractNavigatorItemContentProviderFactory;
public class EclipseLinkNavigatorItemContentProviderFactory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkPersistenceUnitItemContentProvider.java
index 1163e50..69aa81b 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkPersistenceUnitItemContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -7,7 +7,7 @@
* Contributors:
* Oracle - initial API and implementation
*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details;
+package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
import java.util.ArrayList;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
@@ -18,7 +18,6 @@ import org.eclipse.jpt.jpa.core.context.JpaContextNode;
import org.eclipse.jpt.jpa.core.context.MappingFile;
import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.structure.EclipseLinkPersistenceUnitItemContentProvider.ImpliedEclipseLinkMappingFileRefModel;
import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceUnitItemContentProvider;
/**
@@ -50,22 +49,22 @@ public class EclipseLinkPersistenceUnitItemContentProvider
}
protected PropertyValueModel<MappingFile> buildImpliedEclipseLinkMappingFileModel() {
- return new ImpliedEclipseLinkMappingFileModel(this.buildImpliedEclipseLinkMappingFileRefModel());
+ return new ImpliedMappingFileModel(this.buildImpliedEclipseLinkMappingFileRefModel());
}
- public static class ImpliedEclipseLinkMappingFileModel
- extends PropertyAspectAdapter<MappingFileRef, MappingFile>
+ protected PropertyValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefModel() {
+ return new ImpliedEclipseLinkMappingFileRefModel((EclipseLinkPersistenceUnit) this.item);
+ }
+
+ public static class ImpliedEclipseLinkMappingFileRefModel
+ extends PropertyAspectAdapter<EclipseLinkPersistenceUnit, MappingFileRef>
{
- public ImpliedEclipseLinkMappingFileModel(PropertyValueModel<MappingFileRef> refModel) {
- super(refModel, MappingFileRef.MAPPING_FILE_PROPERTY);
+ public ImpliedEclipseLinkMappingFileRefModel(EclipseLinkPersistenceUnit persistenceUnit) {
+ super(EclipseLinkPersistenceUnit.IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
}
@Override
- protected MappingFile buildValue_() {
- return this.subject.getMappingFile();
+ protected MappingFileRef buildValue_() {
+ return this.subject.getImpliedEclipseLinkMappingFileRef();
}
}
-
- protected PropertyValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefModel() {
- return new ImpliedEclipseLinkMappingFileRefModel((EclipseLinkPersistenceUnit) this.item);
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java
deleted file mode 100644
index 8d6ce18..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemContentProviderFactory;
-
-public class EclipseLinkPersistenceStructureItemContentProviderFactory
- extends PersistenceStructureItemContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new EclipseLinkPersistenceStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected EclipseLinkPersistenceStructureItemContentProviderFactory() {
- super();
- }
-
- @Override
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof EclipseLinkPersistenceUnit) {
- return new EclipseLinkPersistenceUnitItemContentProvider((EclipseLinkPersistenceUnit) item, manager);
- }
- return super.buildProvider(item, manager);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java
deleted file mode 100644
index ea9cbd8..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider;
-
-/**
- * Item content provider for structure view.
- */
-public class EclipseLinkPersistenceUnitItemContentProvider
- extends PersistenceUnitItemContentProvider
-{
- public EclipseLinkPersistenceUnitItemContentProvider(EclipseLinkPersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
- @Override
- protected void addChildrenModelsTo(ArrayList<ListValueModel<? extends JpaStructureNode>> list) {
- super.addChildrenModelsTo(list);
- // add after the implied mapping file
- list.add(3, this.buildImpliedEclipseLinkMappingFileRefsModel());
- }
-
- protected ListValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefsModel() {
- return new PropertyListValueModelAdapter<MappingFileRef>(this.buildImpliedEclipseLinkMappingFileRefModel());
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefModel() {
- return new ImpliedEclipseLinkMappingFileRefModel((EclipseLinkPersistenceUnit) this.item);
- }
-
- public static class ImpliedEclipseLinkMappingFileRefModel
- extends PropertyAspectAdapter<EclipseLinkPersistenceUnit, MappingFileRef>
- {
- public ImpliedEclipseLinkMappingFileRefModel(EclipseLinkPersistenceUnit persistenceUnit) {
- super(EclipseLinkPersistenceUnit.IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
- }
- @Override
- protected MappingFileRef buildValue_() {
- return this.subject.getImpliedEclipseLinkMappingFileRef();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
index d36bae1..2eb30e8 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,18 +11,16 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection.EclipseLinkPersistenceUnitConnectionEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
public class EclipseLinkPersistenceXml2_0UiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXml2_0UiDefinition();
@@ -55,8 +53,4 @@ public class EclipseLinkPersistenceXml2_0UiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXml2_0Definition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return EclipseLinkPersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_4UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_4UiDefinition.java
index 34d8aea..8b39d68 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_4UiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_4UiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,18 +11,16 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection.EclipseLinkPersistenceUnitConnectionEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
public class EclipseLinkPersistenceXml2_4UiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXml2_4UiDefinition();
@@ -56,8 +54,4 @@ public class EclipseLinkPersistenceXml2_4UiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXml2_0Definition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return EclipseLinkPersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_5UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_5UiDefinition.java
index 5dc5b7c..adae75d 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_5UiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_5UiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,18 +11,16 @@ package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection.EclipseLinkPersistenceUnitConnectionEditorPageDefinition;
import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
public class EclipseLinkPersistenceXml2_5UiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXml2_5UiDefinition();
@@ -55,8 +53,4 @@ public class EclipseLinkPersistenceXml2_5UiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXml2_1Definition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return EclipseLinkPersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
index ae4dabd..e2431b3 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
@@ -67,6 +67,7 @@ Export-Package: org.eclipse.jpt.jpa.ui,
org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;x-internal:=true,
org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;x-internal:=true,
org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic;x-internal:=true,
+ org.eclipse.jpt.jpa.ui.internal.jpa2_1.persistence;x-internal:=true,
org.eclipse.jpt.jpa.ui.internal.jpql;x-internal:=true,
org.eclipse.jpt.jpa.ui.internal.listeners;x-internal:=true,
org.eclipse.jpt.jpa.ui.internal.menus;x-internal:=true,
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractPersistenceResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractPersistenceResourceUiDefinition.java
new file mode 100644
index 0000000..abbb0da
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractPersistenceResourceUiDefinition.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.ui.internal;
+
+import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
+import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
+import org.eclipse.jpt.jpa.ui.internal.structure.JpaFileStructureItemContentProviderFactory;
+import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemLabelProviderFactory;
+
+/**
+ * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
+ */
+public abstract class AbstractPersistenceResourceUiDefinition
+ extends AbstractResourceUiDefinition
+{
+
+
+ /**
+ * zero-argument constructor
+ */
+ protected AbstractPersistenceResourceUiDefinition() {
+ super();
+ }
+
+
+ public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
+ return STRUCTURE_VIEW_FACTORY_PROVIDER;
+ }
+
+ public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
+ new SimpleItemTreeStateProviderFactoryProvider(
+ JpaFileStructureItemContentProviderFactory.instance(),
+ PersistenceStructureItemLabelProviderFactory.instance()
+ );
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java
index 3870d51..880081a 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -20,8 +20,8 @@ import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.JavaStructureItemContentProviderFactory;
import org.eclipse.jpt.jpa.ui.internal.structure.JavaStructureItemLabelProviderFactory;
+import org.eclipse.jpt.jpa.ui.internal.structure.JpaFileStructureItemContentProviderFactory;
/**
* All the state in the definition should be "static"
@@ -63,7 +63,7 @@ public abstract class AbstractJavaResourceUiDefinition
private static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
new SimpleItemTreeStateProviderFactoryProvider(
- JavaStructureItemContentProviderFactory.instance(),
+ JpaFileStructureItemContentProviderFactory.instance(),
JavaStructureItemLabelProviderFactory.instance()
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java
index 9f74309..6f91d28 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -28,7 +28,7 @@ import org.eclipse.jpt.jpa.ui.internal.details.OneToManyMappingUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.details.OneToOneMappingUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.details.VersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemContentProviderFactory;
+import org.eclipse.jpt.jpa.ui.internal.structure.JpaFileStructureItemContentProviderFactory;
import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemLabelProviderFactory;
public class OrmXmlUiDefinition
@@ -82,7 +82,7 @@ public class OrmXmlUiDefinition
public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
new SimpleItemTreeStateProviderFactoryProvider(
- OrmStructureItemContentProviderFactory.instance(),
+ JpaFileStructureItemContentProviderFactory.instance(),
OrmStructureItemLabelProviderFactory.instance()
);
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java
index 013de29..9adc2e6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,17 +11,15 @@ package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_0Definition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceXmlUiDefinition;
public class PersistenceXml2_0UiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new PersistenceXml2_0UiDefinition();
@@ -52,8 +50,4 @@ public class PersistenceXml2_0UiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXml2_0Definition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return PersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/persistence/PersistenceXml2_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/persistence/PersistenceXml2_1UiDefinition.java
index cd6f0c6..d1536b6 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/persistence/PersistenceXml2_1UiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2_1/persistence/PersistenceXml2_1UiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
+ * Copyright (c) 2012, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,19 +11,17 @@ package org.eclipse.jpt.jpa.ui.internal.jpa2_1.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa2.context.persistence.GenericPersistenceXml2_1Definition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceUnitConnection2_0EditorPageDefinition;
import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceUnitOptions2_0EditorPageDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitGeneralEditorPageDefinition;
import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceUnitPropertiesEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.PersistenceXmlUiDefinition;
public class PersistenceXml2_1UiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new PersistenceXml2_1UiDefinition();
@@ -54,8 +52,4 @@ public class PersistenceXml2_1UiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXml2_1Definition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return PersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceXmlUiDefinition.java
index d36d36e..d68eadd 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceXmlUiDefinition.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/PersistenceXmlUiDefinition.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2009, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -11,17 +11,13 @@ package org.eclipse.jpt.jpa.ui.internal.persistence;
import java.util.List;
import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
import org.eclipse.jpt.jpa.ui.editors.JpaEditorPageDefinition;
-import org.eclipse.jpt.jpa.ui.internal.AbstractResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemLabelProviderFactory;
+import org.eclipse.jpt.jpa.ui.internal.AbstractPersistenceResourceUiDefinition;
public class PersistenceXmlUiDefinition
- extends AbstractResourceUiDefinition
+ extends AbstractPersistenceResourceUiDefinition
{
// singleton
private static final ResourceUiDefinition INSTANCE = new PersistenceXmlUiDefinition();
@@ -52,14 +48,4 @@ public class PersistenceXmlUiDefinition
public boolean providesUi(JptResourceType resourceType) {
return resourceType.equals(GenericPersistenceXmlDefinition.instance().getResourceType());
}
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- PersistenceStructureItemContentProviderFactory.instance(),
- PersistenceStructureItemLabelProviderFactory.instance()
- );
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractNavigatorItemContentProviderFactory.java
index 03ded60..0a47296 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractNavigatorItemContentProviderFactory.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractNavigatorItemContentProviderFactory.java
@@ -9,21 +9,17 @@
******************************************************************************/
package org.eclipse.jpt.jpa.ui.internal.platform.base;
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
+import org.eclipse.jpt.jpa.core.JpaStructureNode;
import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.JavaPersistentTypeItemContentProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.OrmPersistentTypeItemContentProvider;
import org.eclipse.jpt.jpa.ui.internal.platform.generic.OrmXmlItemContentProvider;
import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceUnitItemContentProvider;
import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceXmlItemContentProvider;
+import org.eclipse.jpt.jpa.ui.internal.structure.JpaStructureNodeItemContentProvider;
/**
* This factory builds item content providers for the JPA content in the
@@ -38,22 +34,18 @@ public abstract class AbstractNavigatorItemContentProviderFactory
public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
if (item instanceof PersistenceXml) {
+ //this skips the PersistenceXml.Persistence child and uses PersistenceUnits as children
return this.buildPersistenceXmlProvider((PersistenceXml) item, manager);
}
if (item instanceof PersistenceUnit) {
return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
}
if (item instanceof OrmXml) {
+ //this skips the OrmXml.EntityMappings child and uses PersistenceUnits as children
return this.buildOrmXmlProvider((OrmXml) item, manager);
}
- if (item instanceof OrmPersistentType) {
- return this.buildOrmPersistentTypeProvider((OrmPersistentType) item, manager);
- }
- if (item instanceof JavaPersistentType) {
- return this.buildJavaPersistentTypeProvider((JavaPersistentType) item, manager);
- }
- if (item instanceof PersistentAttribute) {
- return this.buildPersistentAttributeProvider((PersistentAttribute) item, manager);
+ if (item instanceof JpaStructureNode) {
+ return this.buildJpaStructureNodeProvider((JpaStructureNode) item, manager);
}
return null;
}
@@ -70,15 +62,8 @@ public abstract class AbstractNavigatorItemContentProviderFactory
return new OrmXmlItemContentProvider(item, manager);
}
- protected ItemTreeContentProvider buildOrmPersistentTypeProvider(OrmPersistentType item, Manager manager) {
- return new OrmPersistentTypeItemContentProvider(item, manager);
+ protected ItemTreeContentProvider buildJpaStructureNodeProvider(JpaStructureNode item, Manager manager) {
+ return new JpaStructureNodeItemContentProvider(item, manager);
}
- protected ItemTreeContentProvider buildJavaPersistentTypeProvider(JavaPersistentType item, Manager manager) {
- return new JavaPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistentAttributeProvider(PersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java
deleted file mode 100644
index bb05a30..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.iterable.ListIterable;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-public class JavaPersistentTypeItemContentProvider
- extends AbstractItemTreeContentProvider<JavaPersistentType, JavaPersistentAttribute>
-{
- public JavaPersistentTypeItemContentProvider(JavaPersistentType persistentType, Manager manager) {
- super(persistentType, manager);
- }
-
- public Object getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JavaPersistentAttribute> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<JavaPersistentAttribute>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<JavaPersistentType, JavaPersistentAttribute>
- {
- ChildrenModel(JavaPersistentType javaPersistentType) {
- super(JavaPersistentType.ATTRIBUTES_LIST, javaPersistentType);
- }
-
- @Override
- protected ListIterable<JavaPersistentAttribute> getListIterable() {
- return this.subject.getAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getAttributesSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java
deleted file mode 100644
index e7edf8f..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterable.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.iterable.ListIterable;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-
-public class OrmPersistentTypeItemContentProvider
- extends AbstractItemTreeContentProvider<OrmPersistentType, OrmReadOnlyPersistentAttribute>
-{
- public OrmPersistentTypeItemContentProvider(OrmPersistentType persistentType, Manager manager) {
- super(persistentType, manager);
- }
-
- public Object getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildChildrenModel() {
- List<CollectionValueModel<OrmReadOnlyPersistentAttribute>> list = new ArrayList<CollectionValueModel<OrmReadOnlyPersistentAttribute>>(2);
- list.add(this.buildSpecifiedPersistentAttributesModel());
- list.add(this.buildDefaultPersistentAttributesModel());
- return CompositeCollectionValueModel.forModels(list);
- }
-
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildSpecifiedPersistentAttributesModel() {
- return new ListCollectionValueModelAdapter<OrmReadOnlyPersistentAttribute>(new SpecifiedPersistentAttributesModel(this.item));
- }
-
- protected static class SpecifiedPersistentAttributesModel
- extends ListAspectAdapter<OrmPersistentType, OrmReadOnlyPersistentAttribute>
- {
- SpecifiedPersistentAttributesModel(OrmPersistentType ormPersistentType) {
- super(OrmPersistentType.SPECIFIED_ATTRIBUTES_LIST, ormPersistentType);
- }
-
- @Override
- protected ListIterable<OrmReadOnlyPersistentAttribute> getListIterable() {
- return new SuperListIterableWrapper<OrmReadOnlyPersistentAttribute>(this.getSpecifiedAttributes());
- }
-
- protected ListIterable<OrmPersistentAttribute> getSpecifiedAttributes() {
- return this.subject.getSpecifiedAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedAttributesSize();
- }
- }
-
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildDefaultPersistentAttributesModel() {
- return new ListCollectionValueModelAdapter<OrmReadOnlyPersistentAttribute>(new DefaultPersistentAttributesModel(this.item));
- }
-
- protected static class DefaultPersistentAttributesModel
- extends ListAspectAdapter<OrmPersistentType, OrmReadOnlyPersistentAttribute>
- {
- DefaultPersistentAttributesModel(OrmPersistentType ormPersistentType) {
- super(OrmPersistentType.DEFAULT_ATTRIBUTES_LIST, ormPersistentType);
- }
-
- @Override
- protected ListIterable<OrmReadOnlyPersistentAttribute> getListIterable() {
- return this.subject.getDefaultAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getDefaultAttributesSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java
index 97afff9..d8ce9fe 100644
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
+ * Copyright (c) 2008, 2013 Oracle. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0, which accompanies this distribution
* and is available at http://www.eclipse.org/legal/epl-v10.html.
@@ -12,13 +12,16 @@ package org.eclipse.jpt.jpa.ui.internal.platform.generic;
import java.util.ArrayList;
import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
import org.eclipse.jpt.common.utility.internal.filter.NotNullFilter;
+import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.FilteringCollectionValueModel;
import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
+import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
+import org.eclipse.jpt.common.utility.iterable.ListIterable;
import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
import org.eclipse.jpt.common.utility.model.value.ListValueModel;
import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
@@ -31,11 +34,6 @@ import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.ImpliedClassRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.ImpliedMappingFileRefModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.JarFileRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.SpecifiedClassRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.SpecifiedMappingFileRefsModel;
/**
* Item content provider for project explorer.
@@ -109,18 +107,6 @@ public class PersistenceUnitItemContentProvider
return new ImpliedMappingFileModel(this.buildImpliedMappingFileRefModel());
}
- public static class ImpliedMappingFileModel
- extends PropertyAspectAdapter<MappingFileRef, MappingFile>
- {
- public ImpliedMappingFileModel(PropertyValueModel<MappingFileRef> refModel) {
- super(refModel, MappingFileRef.MAPPING_FILE_PROPERTY);
- }
- @Override
- protected MappingFile buildValue_() {
- return this.subject.getMappingFile();
- }
- }
-
protected PropertyValueModel<MappingFileRef> buildImpliedMappingFileRefModel() {
return new ImpliedMappingFileRefModel(this.item);
}
@@ -195,4 +181,102 @@ public class PersistenceUnitItemContentProvider
protected ListValueModel<JarFileRef> buildJarFileRefsModel_() {
return new JarFileRefsModel(this.item);
}
+
+
+ public static class ImpliedMappingFileModel
+ extends PropertyAspectAdapter<MappingFileRef, MappingFile>
+ {
+ public ImpliedMappingFileModel(PropertyValueModel<MappingFileRef> refModel) {
+ super(refModel, MappingFileRef.MAPPING_FILE_PROPERTY);
+ }
+ @Override
+ protected MappingFile buildValue_() {
+ return this.subject.getMappingFile();
+ }
+ }
+
+ public static class SpecifiedMappingFileRefsModel
+ extends ListAspectAdapter<PersistenceUnit, MappingFileRef>
+ {
+ public SpecifiedMappingFileRefsModel(PersistenceUnit persistenceUnit) {
+ super(PersistenceUnit.SPECIFIED_MAPPING_FILE_REFS_LIST, persistenceUnit);
+ }
+
+ @Override
+ protected ListIterable<MappingFileRef> getListIterable() {
+ return this.subject.getSpecifiedMappingFileRefs();
+ }
+
+ @Override
+ public int size_() {
+ return this.subject.getSpecifiedMappingFileRefsSize();
+ }
+ }
+
+ public static class ImpliedMappingFileRefModel
+ extends PropertyAspectAdapter<PersistenceUnit, MappingFileRef>
+ {
+ public ImpliedMappingFileRefModel(PersistenceUnit persistenceUnit) {
+ super(PersistenceUnit.IMPLIED_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
+ }
+ @Override
+ protected MappingFileRef buildValue_() {
+ return this.subject.getImpliedMappingFileRef();
+ }
+ }
+
+ public static class SpecifiedClassRefsModel
+ extends ListAspectAdapter<PersistenceUnit, ClassRef>
+ {
+ public SpecifiedClassRefsModel(PersistenceUnit persistenceUnit) {
+ super(PersistenceUnit.SPECIFIED_CLASS_REFS_LIST, persistenceUnit);
+ }
+
+ @Override
+ protected ListIterable<ClassRef> getListIterable() {
+ return this.subject.getSpecifiedClassRefs();
+ }
+
+ @Override
+ public int size_() {
+ return this.subject.getSpecifiedClassRefsSize();
+ }
+ }
+
+ public static class ImpliedClassRefsModel
+ extends CollectionAspectAdapter<PersistenceUnit, ClassRef>
+ {
+ public ImpliedClassRefsModel(PersistenceUnit persistenceUnit) {
+ super(PersistenceUnit.IMPLIED_CLASS_REFS_COLLECTION, persistenceUnit);
+ }
+
+ @Override
+ protected Iterable<ClassRef> getIterable() {
+ return this.subject.getImpliedClassRefs();
+ }
+
+ @Override
+ public int size_() {
+ return this.subject.getImpliedClassRefsSize();
+ }
+ }
+
+ public static class JarFileRefsModel
+ extends ListAspectAdapter<PersistenceUnit, JarFileRef>
+ {
+ public JarFileRefsModel(PersistenceUnit persistenceUnit) {
+ super(PersistenceUnit.JAR_FILE_REFS_LIST, persistenceUnit);
+ }
+
+ @Override
+ protected ListIterable<JarFileRef> getListIterable() {
+ return this.subject.getJarFileRefs();
+ }
+
+ @Override
+ public int size_() {
+ return this.subject.getJarFileRefsSize();
+ }
+ }
+
}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java
deleted file mode 100644
index 7821623..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.iterable.ListIterable;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-
-public class EntityMappingsItemContentProvider
- extends AbstractItemTreeContentProvider<EntityMappings, OrmPersistentType>
-{
- public EntityMappingsItemContentProvider(EntityMappings entityMappings, Manager manager) {
- super(entityMappings, manager);
- }
-
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected CollectionValueModel<OrmPersistentType> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<OrmPersistentType>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<EntityMappings, OrmPersistentType>
- {
- ChildrenModel(EntityMappings entityMappings) {
- super(EntityMappings.PERSISTENT_TYPES_LIST, entityMappings);
- }
-
- @Override
- protected ListIterable<OrmPersistentType> getListIterable() {
- return this.subject.getPersistentTypes();
- }
-
- @Override
- public int size_() {
- return this.subject.getPersistentTypesSize();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java
deleted file mode 100644
index 69a03e3..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.JavaPersistentTypeItemContentProvider;
-
-/**
- * This factory builds item content providers for a Java source file
- * JPA Structure View.
- */
-public class JavaStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new JavaStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected JavaStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof JavaPersistentType) {
- return this.buildJavaPersistentTypeProvider((JavaPersistentType) item, manager);
- }
- if (item instanceof JavaPersistentAttribute) {
- return this.buildJavaPersistentAttributeProvider((JavaPersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJavaPersistentTypeProvider(JavaPersistentType item, Manager manager) {
- return new JavaPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJavaPersistentAttributeProvider(JavaPersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileStructureItemContentProviderFactory.java
new file mode 100644
index 0000000..9e2f38e
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileStructureItemContentProviderFactory.java
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.ui.internal.structure;
+
+import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
+import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
+import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
+import org.eclipse.jpt.jpa.core.JpaFile;
+import org.eclipse.jpt.jpa.core.JpaStructureNode;
+
+/**
+ * This factory builds item content providers for a <code>persistence.xml</code>
+ * file JPA Structure View.
+ */
+public class JpaFileStructureItemContentProviderFactory
+ implements ItemTreeContentProviderFactory
+{
+ // singleton
+ private static final ItemTreeContentProviderFactory INSTANCE = new JpaFileStructureItemContentProviderFactory();
+
+ /**
+ * Return the singleton
+ */
+ public static ItemTreeContentProviderFactory instance() {
+ return INSTANCE;
+ }
+
+
+ protected JpaFileStructureItemContentProviderFactory() {
+ super();
+ }
+
+ public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
+ if (item instanceof JpaFile) {
+ return this.buildJpaFileProvider((JpaFile) item, manager);
+ }
+ return this.buildJpaStructureNodeProvider((JpaStructureNode) item, manager);
+ }
+
+ protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
+ return new JpaFileItemContentProvider(item, manager);
+ }
+
+ protected ItemTreeContentProvider buildJpaStructureNodeProvider(JpaStructureNode item, Manager manager) {
+ return new JpaStructureNodeItemContentProvider(item, manager);
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaStructureNodeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaStructureNodeItemContentProvider.java
new file mode 100644
index 0000000..48ae23b
--- /dev/null
+++ b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaStructureNodeItemContentProvider.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Oracle. All rights reserved.
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License v1.0, which accompanies this distribution
+ * and is available at http://www.eclipse.org/legal/epl-v10.html.
+ *
+ * Contributors:
+ * Oracle - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.jpt.jpa.ui.internal.structure;
+
+import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
+import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
+import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
+import org.eclipse.jpt.jpa.core.JpaStructureNode;
+import org.eclipse.jpt.jpa.core.context.XmlFile;
+
+public class JpaStructureNodeItemContentProvider
+ extends AbstractItemTreeContentProvider<JpaStructureNode, JpaStructureNode>
+{
+ public JpaStructureNodeItemContentProvider(JpaStructureNode jpaStructureNode, Manager manager) {
+ super(jpaStructureNode, manager);
+ }
+
+ public Object getParent() {
+ if (this.item instanceof XmlFile.Root) {
+ // I'd like to return the resource model here, but that involves a hefty
+ // API change - we'll see what happens with this code first
+ return null;
+ }
+ return this.item.getParent();
+ }
+
+ @Override
+ protected CollectionValueModel<JpaStructureNode> buildChildrenModel() {
+ return new ChildrenModel<JpaStructureNode>(this.item);
+ }
+
+ public static class ChildrenModel<C extends JpaStructureNode>
+ extends CollectionAspectAdapter<JpaStructureNode, C>
+ {
+ public ChildrenModel(JpaStructureNode jpaStructureNode) {
+ super(JpaStructureNode.CHILDREN_COLLECTION, jpaStructureNode);
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Iterable<C> getIterable() {
+ return (Iterable<C>) this.subject.getChildren();
+ }
+
+ @Override
+ public int size_() {
+ return this.subject.getChildrenSize();
+ }
+ }
+}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java
deleted file mode 100644
index ca79e13..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.OrmPersistentTypeItemContentProvider;
-
-/**
- * This factory builds item content providers for an <code>orm.xml</code> file
- * JPA Structure View.
- */
-public class OrmStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new OrmStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected OrmStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof EntityMappings) {
- return this.buildEntityMappingsProvider((EntityMappings) item, manager);
- }
- if (item instanceof OrmPersistentType) {
- return this.buildOrmPersistentTypeProvider((OrmPersistentType) item, manager);
- }
- if (item instanceof OrmPersistentAttribute) {
- return this.buildOrmPersistentAttributeProvider((OrmPersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildEntityMappingsProvider(EntityMappings item, Manager manager) {
- return new EntityMappingsItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmPersistentTypeProvider(OrmPersistentType item, Manager manager) {
- return new OrmPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmPersistentAttributeProvider(OrmPersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java
deleted file mode 100644
index a6df4d4..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.iterable.ListIterable;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-public class PersistenceItemContentProvider
- extends AbstractItemTreeContentProvider<Persistence, PersistenceUnit>
-{
- public PersistenceItemContentProvider(Persistence persistence, Manager manager) {
- super(persistence, manager);
- }
-
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected CollectionValueModel<PersistenceUnit> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<PersistenceUnit>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<Persistence, PersistenceUnit>
- {
- ChildrenModel(Persistence persistence) {
- super(Persistence.PERSISTENCE_UNITS_LIST, persistence);
- }
-
- @Override
- protected ListIterable<PersistenceUnit> getListIterable() {
- return this.subject.getPersistenceUnits();
- }
-
- @Override
- public int size_() {
- return this.subject.getPersistenceUnitsSize();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java
deleted file mode 100644
index 904c28e..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-/**
- * This factory builds item content providers for a <code>persistence.xml</code>
- * file JPA Structure View.
- */
-public class PersistenceStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new PersistenceStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected PersistenceStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof Persistence) {
- return this.buildPersistenceProvider((Persistence) item, manager);
- }
- if (item instanceof PersistenceUnit) {
- return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
- }
- if (item instanceof MappingFileRef) {
- return this.buildMappingFileRefProvider((MappingFileRef) item, manager);
- }
- if (item instanceof ClassRef) {
- return this.buildClassRefProvider((ClassRef) item, manager);
- }
- if (item instanceof JarFileRef) {
- return this.buildJarFileRefProvider((JarFileRef) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistenceProvider(Persistence item, Manager manager) {
- return new PersistenceItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistenceUnitProvider(PersistenceUnit item, Manager manager) {
- return new PersistenceUnitItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildMappingFileRefProvider(MappingFileRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-
- protected ItemTreeContentProvider buildClassRefProvider(ClassRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-
- protected ItemTreeContentProvider buildJarFileRefProvider(JarFileRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java
deleted file mode 100644
index 53344b2..0000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.iterable.ListIterable;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-/**
- * Item content provider for structure view.
- */
-public class PersistenceUnitItemContentProvider
- extends AbstractItemTreeContentProvider<PersistenceUnit, JpaStructureNode>
-{
- public PersistenceUnitItemContentProvider(PersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
-
- public Persistence getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JpaStructureNode> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<JpaStructureNode>(this.buildChildrenModel_());
- }
-
- protected ListValueModel<JpaStructureNode> buildChildrenModel_() {
- ArrayList<ListValueModel<? extends JpaStructureNode>> list = new ArrayList<ListValueModel<? extends JpaStructureNode>>();
- this.addChildrenModelsTo(list);
- return CompositeListValueModel.forModels(list);
- }
-
- protected void addChildrenModelsTo(ArrayList<ListValueModel<? extends JpaStructureNode>> list) {
- list.add(this.buildSpecifiedMappingFileRefsModel());
- list.add(this.buildImpliedMappingFileRefsModel());
- list.add(this.buildSpecifiedClassRefsModel());
- list.add(this.buildImpliedClassRefsModel());
- list.add(this.buildJarFileRefsModel());
- }
-
- protected ListValueModel<MappingFileRef> buildSpecifiedMappingFileRefsModel() {
- return new SpecifiedMappingFileRefsModel(this.item);
- }
-
- public static class SpecifiedMappingFileRefsModel
- extends ListAspectAdapter<PersistenceUnit, MappingFileRef>
- {
- public SpecifiedMappingFileRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.SPECIFIED_MAPPING_FILE_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<MappingFileRef> getListIterable() {
- return this.subject.getSpecifiedMappingFileRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedMappingFileRefsSize();
- }
- }
-
- protected ListValueModel<MappingFileRef> buildImpliedMappingFileRefsModel() {
- return new PropertyListValueModelAdapter<MappingFileRef>(this.buildImpliedMappingFileRefModel());
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedMappingFileRefModel() {
- return new ImpliedMappingFileRefModel(this.item);
- }
-
- public static class ImpliedMappingFileRefModel
- extends PropertyAspectAdapter<PersistenceUnit, MappingFileRef>
- {
- public ImpliedMappingFileRefModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.IMPLIED_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
- }
- @Override
- protected MappingFileRef buildValue_() {
- return this.subject.getImpliedMappingFileRef();
- }
- }
-
- protected ListValueModel<ClassRef> buildSpecifiedClassRefsModel() {
- return new SpecifiedClassRefsModel(this.item);
- }
-
- public static class SpecifiedClassRefsModel
- extends ListAspectAdapter<PersistenceUnit, ClassRef>
- {
- public SpecifiedClassRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.SPECIFIED_CLASS_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<ClassRef> getListIterable() {
- return this.subject.getSpecifiedClassRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedClassRefsSize();
- }
- }
-
- protected ListValueModel<ClassRef> buildImpliedClassRefsModel() {
- return new CollectionListValueModelAdapter<ClassRef>(this.buildImpliedClassRefsModel_());
- }
-
- protected CollectionValueModel<ClassRef> buildImpliedClassRefsModel_() {
- return new ImpliedClassRefsModel(this.item);
- }
-
- public static class ImpliedClassRefsModel
- extends CollectionAspectAdapter<PersistenceUnit, ClassRef>
- {
- public ImpliedClassRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.IMPLIED_CLASS_REFS_COLLECTION, persistenceUnit);
- }
-
- @Override
- protected Iterable<ClassRef> getIterable() {
- return this.subject.getImpliedClassRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getImpliedClassRefsSize();
- }
- }
-
- protected ListValueModel<JarFileRef> buildJarFileRefsModel() {
- return new JarFileRefsModel(this.item);
- }
-
- public static class JarFileRefsModel
- extends ListAspectAdapter<PersistenceUnit, JarFileRef>
- {
- public JarFileRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.JAR_FILE_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<JarFileRef> getListIterable() {
- return this.subject.getJarFileRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getJarFileRefsSize();
- }
- }
-} \ No newline at end of file