JBoss Tools SVN: r2472 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-07-17 11:21:33 -0400 (Tue, 17 Jul 2007)
New Revision: 2472
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-17 14:38:55 UTC (rev 2471)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-17 15:21:33 UTC (rev 2472)
@@ -11,6 +11,7 @@
package org.jboss.tools.hibernate.ui.veditor.editors.parts;
import java.beans.PropertyChangeEvent;
+import java.util.ArrayList;
import java.util.List;
import org.eclipse.draw2d.IFigure;
@@ -68,6 +69,7 @@
}
}else if (ExpandeableShape.SHOW_REFERENCES.equals(prop)) {
+ referenceList.add(getCastedModel().getParent());
refreshReference((ExpandeableShape)getCastedModel());
// ((IFigure)getFigure().getChildren().get(0)).setBackgroundColor(getSelectionColor());
// ((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new RGB(255,255,255)));
@@ -76,9 +78,12 @@
}
}
+ private ArrayList referenceList = new ArrayList();
+
protected void refreshReference(ExpandeableShape shape){
OrmShape refShape = shape.getReference();
if(refShape == null) return;
+
OrmEditPart refPart = (OrmEditPart)getViewer().getEditPartRegistry().get(refShape);
if(refPart != null){
refPart.getFigure().setVisible(shape.isReferenceVisible());
@@ -95,13 +100,25 @@
setLinksVisible(tablePart, shape.isReferenceVisible());
}
}
- for(int i=0;i<refShape.getChildren().size();i++){
- if(refShape.getChildren().get(i) instanceof ExpandeableShape){
- refreshReference((ExpandeableShape)refShape.getChildren().get(i));
+ if(isReferencesCorrect(refShape)){
+ referenceList.add(refShape);
+ for(int i=0;i<refShape.getChildren().size();i++){
+ if(refShape.getChildren().get(i) instanceof ExpandeableShape){
+ refreshReference((ExpandeableShape)refShape.getChildren().get(i));
+ }
}
+ referenceList.remove(refShape);
}
}
+ private boolean isReferencesCorrect(OrmShape shape){
+ if(shape == null) return false;
+ for(int i=0;i < referenceList.size();i++){
+ if(shape.equals(referenceList.get(i))) return false;
+ }
+ return true;
+ }
+
private void setLinksVisible(OrmEditPart editPart, boolean flag){
ConnectionEditPart link;
OrmEditPart child;
17 years, 5 months
JBoss Tools SVN: r2471 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-17 10:38:55 -0400 (Tue, 17 Jul 2007)
New Revision: 2471
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
Log:
EXIN-366: Adding elements on the diagram by double-click on fields of classes which have additional information in mapping files
Bug of getting name of subclass fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-07-17 14:34:06 UTC (rev 2470)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.view/src/org/jboss/tools/hibernate/ui/view/views/OrmModelNameVisitor.java 2007-07-17 14:38:55 UTC (rev 2471)
@@ -475,7 +475,7 @@
StringBuffer name = new StringBuffer();
// if (((OrmContentProvider) viewer.getContentProvider()).getTip() == OrmContentProvider.PACKAGE_CLASS_FIELD_CONTENT_PROVIDER) {
- name.append(clazz.getEntityName() != null ? clazz.getEntityName() : clazz.getEntityName());
+ name.append(clazz.getEntityName() != null ? clazz.getEntityName() : clazz.getClassName());
// } else {
// name.append(clazz.getEntityName());
// }
17 years, 5 months
JBoss Tools SVN: r2470 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors: parts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mdryakhlenkov
Date: 2007-07-17 10:34:06 -0400 (Tue, 17 Jul 2007)
New Revision: 2470
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ConnectionEditPart.java
Log:
EXIN-366: Adding elements on the diagram by double-click on fields of classes which have additional information in mapping files
Bugs of adding subclasses fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-17 14:22:31 UTC (rev 2469)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-17 14:34:06 UTC (rev 2470)
@@ -201,6 +201,8 @@
if(!isConnectionExist(subclassShape, shape))
new Connection(subclassShape, shape);
}
+ OrmShape ownerTableShape = getOrCreateDatabaseTable(((Subclass)element).getRootTable());
+ createConnections(subclassShape, ownerTableShape);
}
}
@@ -317,29 +319,29 @@
if (clazz instanceof RootClass) {
RootClass rootClass = (RootClass)clazz;
s = getOrCreatePersistentClass(rootClass, null);
- HashMap targets = new HashMap();
- Iterator iterator = shape.getSourceConnections().iterator();
- while (iterator.hasNext()) {
- Connection connection = (Connection)iterator.next();
- connection.setHiden(shape.getHide());
- Object el = connection.getTarget().getOrmElement();
- if (el instanceof Column) {
- targets.put(((Column)el).getName(), connection.getTarget());
- } else if (el instanceof RootClass) {
- targets.put(((RootClass)el).getEntityName(), connection.getTarget());
- }
- }
- KeyValue id = rootClass.getIdentifier();
- iterator = id.getColumnIterator();
- while (iterator.hasNext()) {
- Column column = (Column)iterator.next();
- if (targets.get(column.getName()) != null && !isConnectionExist(s, (Shape)targets.get(column.getName()))) {
- new Connection(s, (Shape)targets.get(column.getName()));
- }
- }
+// HashMap targets = new HashMap();
+// Iterator iterator = shape.getSourceConnections().iterator();
+// while (iterator.hasNext()) {
+// Connection connection = (Connection)iterator.next();
+// connection.setHiden(shape.getHide());
+// Object el = connection.getTarget().getOrmElement();
+// if (el instanceof Column) {
+// targets.put(((Column)el).getName(), connection.getTarget());
+// } else if (el instanceof RootClass) {
+// targets.put(((RootClass)el).getEntityName(), connection.getTarget());
+// }
+// }
+// KeyValue id = rootClass.getIdentifier();
+// iterator = id.getColumnIterator();
+// while (iterator.hasNext()) {
+// Column column = (Column)iterator.next();
+// if (targets.get(column.getName()) != null && !isConnectionExist(s, (Shape)targets.get(column.getName()))) {
+// new Connection(s, (Shape)targets.get(column.getName()));
+// }
+// }
if(!isConnectionExist(shape, s))
new Connection(shape, s);
- } else if (clazz instanceof SingleTableSubclass) {
+ } else if (clazz instanceof Subclass) {
s = getOrCreatePersistentClass(((SingleTableSubclass)clazz).getRootClass(), null);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-07-17 14:22:31 UTC (rev 2469)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmShape.java 2007-07-17 14:34:06 UTC (rev 2470)
@@ -79,7 +79,9 @@
Iterator iter = component.getPropertyIterator();
while (iter.hasNext()) {
Property property = (Property)iter.next();
- if (property.getValue().getType().isEntityType()) {
+/* if (property.getValue().isSimpleValue()) {
+ bodyOrmShape = new Shape(property);
+ } else */if (property.getValue().getType().isEntityType()) {
bodyOrmShape = new ExpandeableShape(property);
} else if (property.getValue().getType().isCollectionType()) {
bodyOrmShape = new ComponentShape(property);
@@ -111,7 +113,9 @@
while (iterator.hasNext()) {
Property field = (Property)iterator.next();
if (!field.isComposite()) {
- if (field.getValue().getType().isEntityType()) {
+ if (field.getValue().isSimpleValue()) {
+ bodyOrmShape = new Shape(field);
+ } else if (field.getValue().getType().isEntityType()) {
bodyOrmShape = new ExpandeableShape(field);
} else if (field.getValue().getType().isCollectionType()) {
bodyOrmShape = new ComponentShape(field);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ConnectionEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ConnectionEditPart.java 2007-07-17 14:22:31 UTC (rev 2469)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ConnectionEditPart.java 2007-07-17 14:34:06 UTC (rev 2470)
@@ -26,6 +26,7 @@
import org.hibernate.mapping.Property;
import org.hibernate.mapping.RootClass;
import org.hibernate.mapping.SingleTableSubclass;
+import org.hibernate.mapping.Subclass;
import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.RoundPolylineConnection;
import org.jboss.tools.hibernate.ui.veditor.editors.model.Connection;
@@ -78,7 +79,7 @@
private Color getColor() {
Object element = getCastedModel().getTarget().getOrmElement();
- if (element instanceof RootClass || element instanceof SingleTableSubclass)
+ if (element instanceof RootClass || element instanceof Subclass)
return ResourceManager.getInstance().getColor(new RGB(210,155,100));
else if (element instanceof Column || element instanceof Table || element instanceof Property)
return ResourceManager.getInstance().getColor(new RGB(160, 160, 160));
@@ -87,7 +88,8 @@
}
private Color getSelectionColor() {
- if (getCastedModel().getTarget().getOrmElement() instanceof RootClass)
+ if (getCastedModel().getTarget().getOrmElement() instanceof RootClass ||
+ getCastedModel().getTarget().getOrmElement() instanceof Subclass)
return ResourceManager.getInstance().getColor(new RGB(112,161,99));
else if (getCastedModel().getTarget().getOrmElement() instanceof Column ||
getCastedModel().getTarget().getOrmElement() instanceof Table ||
17 years, 5 months
JBoss Tools SVN: r2469 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-17 10:22:31 -0400 (Tue, 17 Jul 2007)
New Revision: 2469
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
Log:
EXIN-217 source path put to factory
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-17 14:08:26 UTC (rev 2468)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ComponentBuilder.java 2007-07-17 14:22:31 UTC (rev 2469)
@@ -67,7 +67,6 @@
component.setId(visitor.type);
component.setClassName(n);
- process();
}
void process() {
@@ -124,7 +123,10 @@
ValueInfo autoCreate = ValueInfo.getValueInfo(a, "autoCreate");
SeamAnnotatedFactory factory = new SeamAnnotatedFactory();
- factory.setSourceMember(findMethod(m));
+ IMethod im = findMethod(m);
+ factory.setSourceMember(im);
+ factory.setId(im);
+ factory.setSourcePath(component.getSourcePath());
factory.setName(factoryName);
if(autoCreate != null) factory.setAutoCreate(true);
if(scope != null) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2007-07-17 14:08:26 UTC (rev 2468)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/JavaScanner.java 2007-07-17 14:22:31 UTC (rev 2469)
@@ -130,6 +130,8 @@
b.component.setSourcePath(sourcePath);
b.component.setResource(resource);
+
+ b.process();
}
}
17 years, 5 months
JBoss Tools SVN: r2468 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-17 10:08:26 -0400 (Tue, 17 Jul 2007)
New Revision: 2468
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
Log:
http://jira.jboss.com/jira/browse/EXIN-327 @Factory validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-17 14:07:05 UTC (rev 2467)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-17 14:08:26 UTC (rev 2468)
@@ -25,7 +25,6 @@
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.wst.validation.internal.core.ValidationException;
import org.eclipse.wst.validation.internal.provisional.core.IReporter;
import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
@@ -64,6 +63,8 @@
private static final String CREATE_METHOD_POSTFIX_MESSAGE_ID = "CREATE";
private static final String STATEFUL_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "STATEFUL_COMPONENT_WRONG_SCOPE";
private static final String ENTITY_COMPONENT_WRONG_SCOPE_MESSAGE_ID = "ENTITY_COMPONENT_WRONG_SCOPE";
+ private static final String UNKNOWN_FACTORY_NAME_MESSAGE_ID = "UNKNOWN_FACTORY_NAME";
+ private static final String DUPLICATE_FACTORY_NAME_MESSAGE_ID = "DUPLICATE_FACTORY_NAME";
private SeamValidationContext validationContext;
private ISeamProject project;
@@ -82,6 +83,7 @@
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IFile currentFile = null;
Set<ISeamComponent> checkedComponents = new HashSet<ISeamComponent>();
+ Set<String> markedDuplicateFactoryNames = new HashSet<String>();
// Collect all resources which we must validate.
Set<IPath> resources = new HashSet<IPath>(); // Resources which we have to validate.
for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
@@ -127,7 +129,7 @@
IFile sourceFile = root.getFile(linkedResource);
reporter.removeMessageSubset(this, sourceFile, MARKED_COMPONENT_MESSAGE_GROUP);
validateComponent(linkedResource, checkedComponents);
- validateFactory(linkedResource);
+ validateFactory(linkedResource, markedDuplicateFactoryNames);
// TODO
}
} else {
@@ -137,16 +139,16 @@
return OK_STATUS;
}
- private void validateFactory(IPath sourceFilePath) {
+ private void validateFactory(IPath sourceFilePath, Set<String> markedDuplicateFactoryNames) {
Set<ISeamFactory> factories = project.getFactoriesByPath(sourceFilePath);
for (ISeamFactory factory : factories) {
if(factory instanceof ISeamAnnotatedFactory) {
- validateFactory((ISeamAnnotatedFactory)factory);
+ validateFactory((ISeamAnnotatedFactory)factory, markedDuplicateFactoryNames);
}
}
}
- private void validateFactory(ISeamAnnotatedFactory factory) {
+ private void validateFactory(ISeamAnnotatedFactory factory, Set<String> markedDuplicateFactoryNames) {
IMember sourceMember = factory.getSourceMember();
if(sourceMember instanceof IMethod) {
IMethod method = (IMethod)sourceMember;
@@ -169,23 +171,43 @@
ScopeType factoryScope = factory.getScope();
Set<ISeamContextVariable> variables = project.getVariablesByName(factoryName);
boolean unknownVariable = true;
+ boolean firstDuplicateNameWasMarked = false;
for (ISeamContextVariable variable : variables) {
- if((factoryScope == variable.getScope() || factoryScope.getPriority()>variable.getScope().getPriority()) && !(variable instanceof ISeamFactory)) {
- // It's OK. We have that variable name
- unknownVariable = false;
- break;
+ if((factoryScope == variable.getScope() || factoryScope.getPriority()>variable.getScope().getPriority())) {
+ if(variable instanceof ISeamFactory) {
+ if(variable!=factory && !markedDuplicateFactoryNames.contains(factoryName)) {
+ // Duplicate factory name. Mark it.
+ // save link to factory resource
+ validationContext.addLinkedResource(factoryName, variable.getSourcePath());
+ this.addError(DUPLICATE_FACTORY_NAME_MESSAGE_ID, new String[]{factoryName}, (ISeamTextSourceReference)variable, variable.getResource(), MARKED_COMPONENT_MESSAGE_GROUP);
+ if(!firstDuplicateNameWasMarked) {
+ firstDuplicateNameWasMarked = true;
+ // mark first factory
+ validationContext.addLinkedResource(factoryName, factory.getSourcePath());
+ this.addError(DUPLICATE_FACTORY_NAME_MESSAGE_ID, new String[]{factoryName}, factory, factory.getResource(), MARKED_COMPONENT_MESSAGE_GROUP);
+ }
+ markedDuplicateFactoryNames.add(factoryName);
+ }
+ } else {
+ // We have that variable name
+ unknownVariable = false;
+ break;
+ }
}
- if(unknownVariable) {
- // TODO
- // mark unknown factory name
- }
}
+ if(unknownVariable) {
+ // mark unknown factory name
+ // save link to factory resource
+ validationContext.addLinkedResource(factoryName, factory.getSourcePath());
+ this.addError(UNKNOWN_FACTORY_NAME_MESSAGE_ID, new String[]{factoryName}, factory, factory.getResource(), MARKED_COMPONENT_MESSAGE_GROUP);
+ }
}
} catch (Exception e) {
SeamCorePlugin.getDefault().logError(e);
}
} else {
// factory must be java method!
+ // JDT should mark it.
}
}
@@ -227,9 +249,10 @@
validateComponent(component);
}
Set<ISeamFactory> factories = project.getFactories();
+ Set<String> markedDuplicateFactoryNames = new HashSet<String>();
for (ISeamFactory factory : factories) {
if(factory instanceof ISeamAnnotatedFactory) {
- validateFactory((ISeamAnnotatedFactory)factory);
+ validateFactory((ISeamAnnotatedFactory)factory, markedDuplicateFactoryNames);
}
}
// TODO
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-17 14:07:05 UTC (rev 2467)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-17 14:08:26 UTC (rev 2468)
@@ -16,4 +16,6 @@
ENTITY_COMPONENT_WRONG_SCOPE=Entity component "{0}" should not have org.jboss.seam.ScopeType.STATELESS
DUPLICATE_REMOVE=Duplicate @Remove method "{0}"
DUPLICATE_DESTROY=Duplicate @Destroy method "{0}"
-DUPLICATE_CREATE=Duplicate @Create method "{0}"
\ No newline at end of file
+DUPLICATE_CREATE=Duplicate @Create method "{0}"
+UNKNOWN_FACTORY_NAME=Factory method "{0}" with a void return type must have an associated @Out/Databinder
+DUPLICATE_FACTORY_NAME=Duplicate @Factory method: "{0}"
\ No newline at end of file
17 years, 5 months
JBoss Tools SVN: r2467 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-07-17 10:07:05 -0400 (Tue, 17 Jul 2007)
New Revision: 2467
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java
Log:
bug in reading message from resource properties
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java 2007-07-17 14:01:31 UTC (rev 2466)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/wizards/query/AbstractQueryWizard.java 2007-07-17 14:07:05 UTC (rev 2467)
@@ -51,7 +51,7 @@
if(subtitle == null) subtitle = "Subtitle is not found for key \"" + key + "\"";
view.setTitle(subtitle);
String message = p.getProperty("message");
- if(message == null) WizardKeys.getString(key + ".Message");
+ if(message == null) message = WizardKeys.getString(key + ".Message");
if(message != null) view.setMessage(message);
}
}
17 years, 5 months
JBoss Tools SVN: r2466 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors: parts and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2007-07-17 10:01:31 -0400 (Tue, 17 Jul 2007)
New Revision: 2466
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ComponentShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ModelElement.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
Log:
http://jira.jboss.com/jira/browse/EXIN-365
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ComponentShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ComponentShape.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ComponentShape.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -16,7 +16,7 @@
public class ComponentShape extends ExpandeableShape {
public static final String SET_CHILDS_HIDEN = "set childs hiden";
- protected boolean childsHiden = true;
+ //protected boolean childsHiden = true;
@@ -40,16 +40,18 @@
}
public void refreshChildsHiden(OrmDiagram ormDiagram) {
- childsHiden = !childsHiden;
+ refHide = !refHide;
for (int i = 0; i < getChildren().size(); i++)
- ((Shape)getChildren().get(i)).setHiden(childsHiden);
+ ((Shape)getChildren().get(i)).setHiden(!refHide);
- if(!childsHiden)
- ormDiagram.refreshComponentReferences(this);
- else
- ormDiagram.hideReferences(this);
+ if(refHide)
+ if(first){
+ ormDiagram.refreshComponentReferences(this);
+ first=false;
+ }
- firePropertyChange(SET_CHILDS_HIDEN, null, new Boolean(childsHiden));
+
+ firePropertyChange(SET_CHILDS_HIDEN, null, new Boolean(!refHide));
}
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ExpandeableShape.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -22,7 +22,8 @@
public static final String SHOW_REFERENCES = "show references";
- private boolean refHide = false;
+ protected boolean refHide = false;
+ protected boolean first=true;
private OrmShape reference=null;
@@ -33,6 +34,11 @@
public OrmShape getReference(){
return reference;
}
+
+ public boolean isReferenceVisible(){
+ return refHide;
+ }
+
public ExpandeableShape(Object ioe) {
super(ioe);
}
@@ -40,10 +46,12 @@
public void refreshReferences(Object model) {
refHide = !refHide;
if (model instanceof OrmDiagram) {
- if(refHide)
- ((OrmDiagram)model).processExpand(this);
- else
- ((OrmDiagram)model).processCollapse(this);
+ if(refHide){
+ if(first){
+ ((OrmDiagram)model).processExpand(this);
+ first = false;
+ }
+ }
}
firePropertyChange(SHOW_REFERENCES, null, new Boolean(refHide));
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ModelElement.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ModelElement.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/ModelElement.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -53,6 +53,16 @@
parent = element;
}
+ public OrmDiagram getOrmDiagram(){
+ ModelElement element = this;
+ while(true){
+ if(element.getParent() == null)break;
+ if(element.getParent() instanceof OrmDiagram) return (OrmDiagram)element.getParent();
+ element = element.getParent();
+ }
+ return null;
+ }
+
class OList extends ArrayList{
public OList(){
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/model/OrmDiagram.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -150,7 +150,7 @@
return ormShape;
}
- private OrmShape getShape(Object ormElement) {
+ public OrmShape getShape(Object ormElement) {
OrmShape ormShape = null;
if (ormElement instanceof RootClass) {
ormShape = elements.get(((RootClass)ormElement).getEntityName());
@@ -166,52 +166,7 @@
return ormShape;
}
- private OrmShape removePersistentClass(PersistentClass persistentClass){
- Table componentClassDatabaseTable=null;
- OrmShape classShape = null;
- OrmShape shape = null;
- if(persistentClass != null) {
- classShape = elements.get(persistentClass.getClassName());
- if (classShape == null) classShape = createShape(persistentClass);
- if(componentClassDatabaseTable == null && persistentClass.getTable() != null)
- componentClassDatabaseTable = persistentClass.getTable();
- if(componentClassDatabaseTable != null) {
- shape = elements.get(componentClassDatabaseTable.getSchema() + "." + componentClassDatabaseTable.getName());
- if (shape != null){
- removeLinks(shape);
- getChildren().remove(shape);
- elements.remove(componentClassDatabaseTable.getSchema() + "." + componentClassDatabaseTable.getName());
- }
- }
- RootClass rc = (RootClass)persistentClass;
- Iterator iter = rc.getSubclassIterator();
- while (iter.hasNext()) {
- SingleTableSubclass singleTableSubclass = (SingleTableSubclass)iter.next();
- OrmShape singleTableSubclassShape = elements.get(singleTableSubclass.getEntityPersisterClass().getCanonicalName());
- if (singleTableSubclassShape != null){
- removeLinks(singleTableSubclassShape);
- getChildren().remove(singleTableSubclassShape);
- elements.remove(singleTableSubclass.getEntityPersisterClass().getCanonicalName());
- }
- }
- if (persistentClass.getIdentifier() instanceof Component) {
- Component identifier = (Component)persistentClass.getIdentifier();
- if (!identifier.getComponentClassName().equals(identifier.getOwner().getClassName())) {
- OrmShape componentClassShape = elements.get(identifier.getComponentClassName());
- if (componentClassShape != null){
- removeLinks(componentClassShape);
- getChildren().remove(componentClassShape);
- elements.remove(identifier.getComponentClassName());
- }
- String tableName = identifier.getTable().getSchema() + "." + identifier.getTable().getName();
- elements.remove(tableName);
- }
- }
- }
- return classShape;
- }
-
private OrmShape getOrCreatePersistentClass(PersistentClass persistentClass, Table componentClassDatabaseTable){
OrmShape classShape = null;
OrmShape shape = null;
@@ -349,53 +304,6 @@
}
}
- public void processCollapse(ExpandeableShape shape) {
- Object element = shape.getOrmElement();
- OrmShape reference = shape.getReference();
- if(reference != null){
- if(element instanceof RootClass){
- RootClass rc = (RootClass)element;
- Table table = rc.getTable();
- OrmShape sh = getShape(table);
- removeLinks(sh);
- getChildren().remove(sh);
- elements.remove(sh);
- }
- if (element instanceof Property) {
- Property property = (Property)element;
- if (!property.isComposite()) {
- Type type = ((Property)element).getType();
- if (type.isEntityType()) {
- EntityType et = (EntityType) type;
- Object clazz = getConfiguration().getClassMapping(et.getAssociatedEntityName());
- if (clazz instanceof RootClass) {
- RootClass rootClass = (RootClass)clazz;
-
- removePersistentClass(rootClass);
- } else if (clazz instanceof SingleTableSubclass) {
- removePersistentClass(((SingleTableSubclass)clazz).getRootClass());
-
- }
- }
- } else {
- removePersistentClass(new SpecialRootClass(property));
-
- }
- for(int i = reference.getChildren().size()-1;i>=0;i--){
- if(reference.getChildren().get(i) instanceof ExpandeableShape)
- processCollapse((ComponentShape)reference.getChildren().get(i));
- if(reference.getChildren().get(i) instanceof ComponentShape)
- hideReferences((ComponentShape)reference.getChildren().get(i));
- }
- removeLinks(reference);
- getChildren().remove(reference);
- elements.remove(reference);
- shape.setReference(null);
- }
- firePropertyChange(REFRESH, null, null);
- }
- }
-
public void processExpand(ExpandeableShape shape) {
OrmShape s=null;
Object element = shape.getOrmElement();
@@ -438,7 +346,8 @@
} else {
s = getOrCreatePersistentClass(new SpecialRootClass(property), null);
}
- shape.setReference(s);
+ if(!shape.getParent().equals(s))
+ shape.setReference(s);
firePropertyChange(REFRESH, null, null);
}
}
@@ -447,123 +356,6 @@
return configuration;
}
- public void hideShapes(ExpandeableShape hidenShape){
- OrmShape reference = hidenShape.getReference();
- if(reference != null){
- Object element = reference.getOrmElement();
- if(element instanceof RootClass){
- RootClass rc = (RootClass)element;
- Table table = rc.getTable();
- OrmShape shape = getShape(table);
- removeLinks(shape);
- getChildren().remove(shape);
- elements.remove(shape);
- }
- for(int i = reference.getChildren().size()-1;i>=0;i--){
- if(reference.getChildren().get(i) instanceof ComponentShape)
- hideReferences((ComponentShape)reference.getChildren().get(i));
- if(reference.getChildren().get(i) instanceof ExpandeableShape)
- processCollapse((ComponentShape)reference.getChildren().get(i));
- }
- removeLinks(reference);
- getChildren().remove(reference);
- elements.remove(reference);
- hidenShape.setReference(null);
- }
- removeLinks(hidenShape);
- firePropertyChange(REFRESH, null, null);
- }
-
- protected void hideReferences(ComponentShape componentShape) {
- OrmShape reference = componentShape.getReference();
- if(reference != null){
- Object element = reference.getOrmElement();
- if(element instanceof RootClass){
- RootClass rc = (RootClass)element;
- Table table = rc.getTable();
- OrmShape shape = getShape(table);
- removeLinks(shape);
- getChildren().remove(shape);
- elements.remove(shape);
- }
- Property property = (Property)componentShape.getOrmElement();
- Type valueType = property.getValue().getType();
- if (valueType.isCollectionType()) {
- Collection collection = (Collection)property.getValue();
- Value component = collection.getElement();
- if (component instanceof Component) {
- Component comp = (Component)((Collection)property.getValue()).getElement();
- if (comp != null) {
- OrmShape classShape = createShape(property);
- OrmShape tableShape = (OrmShape)elements.get(component.getTable().getSchema() + "." + component.getTable().getName());
- removeLinks(tableShape);
- elements.remove(component.getTable().getSchema() + "." + component.getTable().getName());
- }
- } else if (collection.isOneToMany()) {
- OneToMany comp = (OneToMany)((Collection)property.getValue()).getElement();
- if (comp != null){
- Shape sh = elements.get(comp.getAssociatedClass().getTable().getSchema() + "." + comp.getAssociatedClass().getTable().getName());
- removeLinks(sh);
- elements.remove(comp.getAssociatedClass().getTable().getSchema() + "." + comp.getAssociatedClass().getTable().getName());
- Shape sh2 = elements.get(comp.getAssociatedClass().getEntityName());
- removeLinks(sh2);
- elements.remove(comp.getAssociatedClass().getEntityName());
- }
- } else if (collection.isMap() || collection.isSet()) {
- Table databaseTable = collection.getCollectionTable();
- OrmShape tableShape = null;
- if(databaseTable != null) {
- String tableName = databaseTable.getSchema() + "." + databaseTable.getName();
- tableShape = (OrmShape)elements.get(tableName);
- if(tableShape != null) {
- Iterator iterator = getConfiguration().getClassMappings();
- while (iterator.hasNext()) {
- Object clazz = iterator.next();
- if (clazz instanceof RootClass) {
- RootClass cls = (RootClass)clazz;
- Table table = cls.getTable();
- if (tableName.equals(table.getName() + "." + table.getName())) {
- if (elements.get(cls.getEntityName()) != null)
- elements.remove(cls.getEntityName());
- }
- }
- }
- elements.remove(tableName);
- }
- }
- }
- }
- for(int i = reference.getChildren().size()-1;i>=0;i--){
- if(reference.getChildren().get(i) instanceof ComponentShape)
- hideReferences((ComponentShape)reference.getChildren().get(i));
- if(reference.getChildren().get(i) instanceof ExpandeableShape)
- processCollapse((ComponentShape)reference.getChildren().get(i));
- }
- removeLinks(reference);
- getChildren().remove(reference);
- elements.remove(reference);
- componentShape.setReference(null);
- }
- removeLinks(componentShape);
- firePropertyChange(REFRESH, null, null);
- }
-
- protected void removeLinks(Shape shape){
- Connection con;
- for(int i=shape.getSourceConnections().size()-1;i>=0;i--){
- con = shape.getSourceConnections().get(i);
- con.getTarget().getTargetConnections().remove(con);
- shape.getSourceConnections().remove(con);
- }
- for(int i=shape.getTargetConnections().size()-1;i>=0;i--){
- con = shape.getTargetConnections().get(i);
- con.getSource().getSourceConnections().remove(con);
- shape.getTargetConnections().remove(con);
- }
- for(int i=shape.getChildren().size()-1;i>=0;i--){
- removeLinks((Shape)shape.getChildren().get(i));
- }
- }
protected void refreshComponentReferences(ComponentShape componentShape) {
OrmShape childShape = null;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ComponentShapeEditPart.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -28,8 +28,10 @@
import org.jboss.tools.hibernate.ui.veditor.editors.figures.ComponentFigure;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleLabel;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ComponentShape;
+import org.jboss.tools.hibernate.ui.veditor.editors.model.ExpandeableShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmShape;
+import org.jboss.tools.hibernate.ui.veditor.editors.model.Shape;
public class ComponentShapeEditPart extends ExpandeableShapeEditPart {
@@ -70,8 +72,10 @@
figure.setSize(i,-1);
else
figure.setSize(-1,-1);
-
- refresh();
+
+ refreshReference((ExpandeableShape)getCastedModel());
+
+
((OrmShape)getParent().getModel()).refreshReference();
} else {
super.propertyChange(evt);
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-17 13:28:12 UTC (rev 2465)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/parts/ExpandeableShapeEditPart.java 2007-07-17 14:01:31 UTC (rev 2466)
@@ -16,12 +16,18 @@
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.PositionConstants;
+import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.swt.graphics.RGB;
+import org.hibernate.mapping.RootClass;
+import org.hibernate.mapping.Table;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TitleLabel;
import org.jboss.tools.hibernate.ui.veditor.editors.figures.TopLineBorder;
+import org.jboss.tools.hibernate.ui.veditor.editors.model.ComponentShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.ExpandeableShape;
+import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmDiagram;
+import org.jboss.tools.hibernate.ui.veditor.editors.model.OrmShape;
import org.jboss.tools.hibernate.ui.veditor.editors.model.Shape;
@@ -61,6 +67,8 @@
((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new RGB(0,0,0)));
}
}else if (ExpandeableShape.SHOW_REFERENCES.equals(prop)) {
+
+ refreshReference((ExpandeableShape)getCastedModel());
// ((IFigure)getFigure().getChildren().get(0)).setBackgroundColor(getSelectionColor());
// ((IFigure)getFigure().getChildren().get(0)).setForegroundColor(ResourceManager.getInstance().getColor(new RGB(255,255,255)));
} else {
@@ -68,6 +76,49 @@
}
}
+ protected void refreshReference(ExpandeableShape shape){
+ OrmShape refShape = shape.getReference();
+ if(refShape == null) return;
+ OrmEditPart refPart = (OrmEditPart)getViewer().getEditPartRegistry().get(refShape);
+ if(refPart != null){
+ refPart.getFigure().setVisible(shape.isReferenceVisible());
+ setLinksVisible(refPart, shape.isReferenceVisible());
+ }
+ Object element = refShape.getOrmElement();
+ if(element instanceof RootClass){
+ RootClass rc = (RootClass)element;
+ Table table = rc.getTable();
+ OrmShape tableShape = refShape.getOrmDiagram().getShape(table);
+ OrmEditPart tablePart = (OrmEditPart)getViewer().getEditPartRegistry().get(tableShape);
+ if(tablePart != null){
+ tablePart.getFigure().setVisible(shape.isReferenceVisible());
+ setLinksVisible(tablePart, shape.isReferenceVisible());
+ }
+ }
+ for(int i=0;i<refShape.getChildren().size();i++){
+ if(refShape.getChildren().get(i) instanceof ExpandeableShape){
+ refreshReference((ExpandeableShape)refShape.getChildren().get(i));
+ }
+ }
+ }
+
+ private void setLinksVisible(OrmEditPart editPart, boolean flag){
+ ConnectionEditPart link;
+ OrmEditPart child;
+ for(int i=0;i<editPart.getSourceConnections().size();i++){
+ link = (ConnectionEditPart)editPart.getSourceConnections().get(i);
+ link.getFigure().setVisible(flag);
+ }
+ for(int i=0;i<editPart.getTargetConnections().size();i++){
+ link = (ConnectionEditPart)editPart.getTargetConnections().get(i);
+ link.getFigure().setVisible(flag);
+ }
+ for(int i=0;i<editPart.getChildren().size();i++){
+ child = (OrmEditPart)editPart.getChildren().get(i);
+ setLinksVisible(child, flag);
+ }
+ }
+
protected List getModelChildren() {
return ((ExpandeableShape)getModel()).getChildren();
}
17 years, 5 months
JBoss Tools SVN: r2465 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-17 09:28:12 -0400 (Tue, 17 Jul 2007)
New Revision: 2465
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java
Log:
EXIN-217 ISeamProject should not extends IProjectNature
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-17 13:26:59 UTC (rev 2464)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/RootContentProvider.java 2007-07-17 13:28:12 UTC (rev 2465)
@@ -19,9 +19,11 @@
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.seam.core.IRole;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
+import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamScope;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -60,6 +62,15 @@
((ISeamScope)parentElement).getSeamProject().resolve();
return ((ISeamScope)parentElement).getComponents().toArray(new Object[0]);
} else if(parentElement instanceof ISeamComponent) {
+ List<Object> children = new ArrayList<Object>();
+ Set<ISeamComponentDeclaration> ds = ((ISeamComponent)parentElement).getAllDeclarations();
+ children.addAll(ds);
+ for (ISeamComponentDeclaration d : ds) {
+ if(d instanceof ISeamJavaComponentDeclaration) {
+ Set<IRole> rs = ((ISeamJavaComponentDeclaration)d).getRoles();
+ children.addAll(rs);
+ }
+ }
return ((ISeamComponent)parentElement).getAllDeclarations().toArray(new Object[0]);
}
return null;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java 2007-07-17 13:26:59 UTC (rev 2464)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java 2007-07-17 13:28:12 UTC (rev 2465)
@@ -1,5 +1,6 @@
package org.jboss.tools.seam.ui.views;
+import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IType;
@@ -7,9 +8,11 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.seam.core.IRole;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
import org.jboss.tools.seam.core.ISeamElement;
+import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamJavaSourceReference;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamScope;
@@ -18,11 +21,13 @@
public String getText(Object element) {
if(element instanceof ISeamProject) {
- return ((ISeamProject)element).getProject().getName();
+ return ((IProjectNature)element).getProject().getName();
} else if(element instanceof ISeamScope) {
return ((ISeamScope)element).getType().getLabel();
} else if(element instanceof ISeamComponent) {
return ((ISeamComponent)element).getName();
+ } else if (element instanceof IRole) {
+ return "" + ((IRole)element).getName();
} else if(element instanceof ISeamJavaSourceReference) {
ISeamJavaSourceReference d = (ISeamJavaSourceReference)element;
IMember m = d.getSourceMember();
@@ -50,6 +55,11 @@
imageKey = ISharedImages.IMG_OBJ_FOLDER;
} else if(obj instanceof ISeamComponent) {
imageKey = ISharedImages.IMG_OBJ_ELEMENT;
+ } else if(obj instanceof IRole) {
+ //
+ } else if(obj instanceof ISeamJavaComponentDeclaration) {
+ imageKey = org.eclipse.jdt.ui.ISharedImages.IMG_OBJS_CLASS;
+ return new org.eclipse.jdt.internal.ui.SharedImages().getImage(imageKey);
} else if(obj instanceof ISeamComponentDeclaration) {
imageKey = ISharedImages.IMG_OBJ_FILE;
}
17 years, 5 months
JBoss Tools SVN: r2464 - trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-17 09:26:59 -0400 (Tue, 17 Jul 2007)
New Revision: 2464
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/.project
Log:
EXIN-217 seam nature renamed
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/.project
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/.project 2007-07-17 13:26:36 UTC (rev 2463)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/projects/TestScanner/.project 2007-07-17 13:26:59 UTC (rev 2464)
@@ -37,6 +37,6 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.jboss.tools.jsf.jsfnature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
- <nature>org.jboss.tools.seam.core.seam</nature>
+ <nature>org.jboss.tools.seam.core.seamnature</nature>
</natures>
</projectDescription>
17 years, 5 months
JBoss Tools SVN: r2463 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-17 09:26:36 -0400 (Tue, 17 Jul 2007)
New Revision: 2463
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
EXIN-217 seam nature renamed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-17 12:33:41 UTC (rev 2462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-17 13:26:36 UTC (rev 2463)
@@ -14,7 +14,7 @@
</builder>
</extension>
<extension
- id="seam"
+ id="seamnature"
name="Seam Project Nature"
point="org.eclipse.core.resources.natures">
<runtime>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-17 12:33:41 UTC (rev 2462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-17 13:26:36 UTC (rev 2463)
@@ -12,13 +12,12 @@
import java.util.Set;
-import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
-public interface ISeamProject extends IProjectNature, ISeamElement {
+public interface ISeamProject extends ISeamElement {
- public static String NATURE_ID = "org.jboss.tools.seam.core.seam";
+ public static String NATURE_ID = "org.jboss.tools.seam.core.seamnature";
/**
* Returns list of scope objects for all scope types.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-17 12:33:41 UTC (rev 2462)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-17 13:26:36 UTC (rev 2463)
@@ -24,6 +24,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -53,7 +54,7 @@
/**
* @author Viacheslav Kabanovich
*/
-public class SeamProject extends SeamObject implements ISeamProject {
+public class SeamProject extends SeamObject implements ISeamProject, IProjectNature {
IProject project;
ClassPath classPath = new ClassPath(this);
17 years, 5 months