Author: scabanovich
Date: 2009-11-10 10:05:58 -0500 (Tue, 10 Nov 2009)
New Revision: 18570
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5175
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2009-11-10
14:51:52 UTC (rev 18569)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/plugin.xml 2009-11-10
15:05:58 UTC (rev 18570)
@@ -96,6 +96,8 @@
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigComplexPropertyImpl"/>
<xclass
id="org.jboss.tools.hibernate.xml.model.impl.HibConfigSimplePropertyImpl"
class="org.jboss.tools.hibernate.xml.model.impl.HibConfigSimplePropertyImpl"/>
+ <xclass id="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"
+ class="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"/>
<xclass
id="org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"
class="org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"/>
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta 2009-11-10
14:51:52 UTC (rev 18569)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/meta/hibernate3.meta 2009-11-10
15:05:58 UTC (rev 18570)
@@ -437,6 +437,7 @@
kind="action" name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem
@@ -446,6 +447,7 @@
WizardClassName="%Default%" displayName="Subclass..."
kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem
@@ -456,6 +458,7 @@
kind="action" name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -824,7 +827,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -833,7 +837,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -1678,7 +1683,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -1687,7 +1693,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -1803,7 +1810,7 @@
</XModelEntity>
<XModelEntity
AdoptManagerClass="org.jboss.tools.hibernate.xml.model.handlers.FolderOwnerAdopt"
- ImplementingClass="%Ordered2%"
+ ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibClassImpl"
PROPERTIES="loaderKind=class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
XMLSUBPATH="class" name="Hibernate3Class">
<XChildrenEntities>
@@ -1835,7 +1842,7 @@
<XModelAttribute default="class" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced"
name="entity-name" xmlname="entity-name"/>
+ <XModelAttribute PROPERTIES="category=general"
name="entity-name" xmlname="entity-name"/>
<XModelAttribute
PROPERTIES="save=always;id=true;category=general;contextPackageProvider=org.jboss.tools.hibernate.xml.model.impl.ContextPackageProvider"
name="name" xmlname="name">
@@ -2222,6 +2229,7 @@
WizardClassName="%Default%" displayName="Class..."
kind="action" name="AddClass">
<EntityData EntityName="Hibernate3Class">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Create%"
@@ -2230,6 +2238,7 @@
displayName="Joined-Subclass..." kind="action"
name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -2238,6 +2247,7 @@
WizardClassName="%Default%" displayName="Subclass..."
kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -2247,6 +2257,7 @@
displayName="Union-Subclass..." kind="action"
name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
<AttributeData AttributeName="extends"/>
</EntityData>
</XActionItem>
@@ -4131,7 +4142,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -4140,7 +4152,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -4903,6 +4916,7 @@
displayName="Joined-Subclass..." kind="action"
name="AddJoinedSubclass">
<EntityData EntityName="Hibernate3JoinedSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -5410,7 +5424,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -5419,7 +5434,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -5704,7 +5720,7 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibernateElementImpl"
-
PROPERTIES="presentationAttribute=class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
+
PROPERTIES="presentationAttribute=entity-name|class;formFactory=%Default%;formLayout=org.jboss.tools.hibernate.ui.xml.form.Hibernate3FormLayoutData"
XMLSUBPATH="many-to-many" name="Hibernate3ManyToMany">
<XChildrenEntities>
<XChildEntity maxCount="1" name="Hibernate3MetaFolder"
required="yes"/>
@@ -5721,8 +5737,7 @@
<XModelAttribute default="many-to-many" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="save=always;category=general"
- name="class" xmlname="class"/>
+ <XModelAttribute PROPERTIES="category=general" name="class"
xmlname="class"/>
<XModelAttribute PROPERTIES="category=advanced" name="node"
xmlname="node"/>
<XModelAttribute PROPERTIES="category=advanced" default="true"
name="embed-xml" xmlname="embed-xml">
@@ -6302,7 +6317,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -6311,7 +6327,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -6835,7 +6852,8 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.hibernate.xml.model.impl.HibernateElementImpl"
- PROPERTIES="presentationAttribute=class" XMLSUBPATH="one-to-many"
name="Hibernate3OneToMany">
+ PROPERTIES="presentationAttribute=entity-name|class"
+ XMLSUBPATH="one-to-many" name="Hibernate3OneToMany">
<XChildrenEntities/>
<XEntityRenderer>
<ICONS>
@@ -6846,7 +6864,7 @@
<XModelAttribute default="one-to-many" loader="ElementType"
name="element type">
<Editor name="Uneditable"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="save=always" name="class"
xmlname="class">
+ <XModelAttribute name="class" xmlname="class">
<Editor name="AccessibleJava"/>
</XModelAttribute>
<XModelAttribute default="exception" name="not-found"
xmlname="not-found">
@@ -8927,7 +8945,8 @@
WizardClassName="%Default%" displayName="Many-to-Many..."
kind="action" name="AddManyToMany">
<EntityData EntityName="Hibernate3ManyToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem HandlerClassName="%Hibernate3Replace%"
@@ -8936,7 +8955,8 @@
WizardClassName="%Default%" displayName="One-to-Many..."
kind="action" name="AddOneToMany">
<EntityData EntityName="Hibernate3OneToMany">
- <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="class" Mandatory="no"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
<XActionItem kind="list" name="SQL">
@@ -9021,7 +9041,7 @@
<Constraint loader="QClassName"/>
<Editor name="AccessibleJava"/>
</XModelAttribute>
- <XModelAttribute name="entity-name" xmlname="entity-name"/>
+ <XModelAttribute PROPERTIES="category=general"
name="entity-name" xmlname="entity-name"/>
<XModelAttribute PROPERTIES="category=general" name="proxy"
xmlname="proxy">
<Editor name="AccessibleJava"/>
</XModelAttribute>
@@ -9262,6 +9282,7 @@
WizardClassName="%Default%" displayName="Subclass..."
kind="action" name="AddSubclass">
<EntityData EntityName="Hibernate3Subclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
@@ -10008,6 +10029,7 @@
displayName="Union-Subclass..." kind="action"
name="AddUnionSubclass">
<EntityData EntityName="Hibernate3UnionSubclass">
<AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="entity-name"
Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
(rev 0)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java 2009-11-10
15:05:58 UTC (rev 18570)
@@ -0,0 +1,22 @@
+package org.jboss.tools.hibernate.xml.model.impl;
+
+public class HibClassImpl extends OrderedObject2Impl {
+ private static final long serialVersionUID = 1L;
+
+ public String getPresentationString() {
+ String en = getAttributeValue("entity-name"); //$NON-NLS-1$
+ if(en == null || en.length() == 0) {
+ return super.getPresentationString();
+ }
+ return en;
+ }
+
+ public String getPathPart() {
+ String en = getAttributeValue("entity-name"); //$NON-NLS-1$
+ if(en == null || en.length() == 0) {
+ return super.getPathPart();
+ }
+
+ return super.getPathPart() + ':' + en.replace('/', '#');
+ }
+}
Property changes on:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibClassImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java 2009-11-10
14:51:52 UTC (rev 18569)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateClassImpl.java 2009-11-10
15:05:58 UTC (rev 18570)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.hibernate.xml.model.impl;
-public class HibernateClassImpl extends OrderedObject2Impl {
+public class HibernateClassImpl extends HibClassImpl {
private static final long serialVersionUID = 3382417320218706443L;
public String get(String s) {
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java
===================================================================
---
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java 2009-11-10
14:51:52 UTC (rev 18569)
+++
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/src/org/jboss/tools/hibernate/xml/model/impl/HibernateElementImpl.java 2009-11-10
15:05:58 UTC (rev 18570)
@@ -10,15 +10,25 @@
******************************************************************************/
package org.jboss.tools.hibernate.xml.model.impl;
+import java.util.StringTokenizer;
+
import org.jboss.tools.common.model.impl.OrderedObjectImpl;
public class HibernateElementImpl extends OrderedObjectImpl {
private static final long serialVersionUID = 220538596631608391L;
public String getPresentationString() {
+ String suff = "[" + getAttributeValue("element type") +
"]"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String presentationAttr =
getModelEntity().getProperty("presentationAttribute"); //$NON-NLS-1$
- return ((presentationAttr != null) ? getAttributeValue(presentationAttr) :
"") + //$NON-NLS-1$
- "[" + getAttributeValue("element type") + "]";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ if(presentationAttr != null) {
+ StringTokenizer st = new StringTokenizer(presentationAttr, "|");
//$NON-NLS-1$
+ while(st.hasMoreTokens()) {
+ String att = st.nextToken();
+ String v = getAttributeValue(att);
+ if(v != null && v.length() > 0) return v + suff;
+ }
+ }
+ return suff;
}
public String name() {