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;
}
Show replies by date