Author: max.andersen(a)jboss.com
Date: 2007-07-16 17:36:37 -0400 (Mon, 16 Jul 2007)
New Revision: 2451
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java
Log:
better scope names in ui
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java 2007-07-16
21:08:48 UTC (rev 2450)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ScopeType.java 2007-07-16
21:36:37 UTC (rev 2451)
@@ -15,27 +15,35 @@
* @author Alexey Kazakov
*/
public enum ScopeType implements SeamScope {
- STATELESS(),
- METHOD(),
- EVENT(EVENT_PRIORITY_ORDER),
- PAGE(PAGE_PRIORITY_ORDER),
- CONVERSATION(CONVERSATION_PRIORITY_ORDER),
- SESSION(SESSION_PRIORITY_ORDER),
- APPLICATION(APPLICATION_PRIORITY_ORDER),
- BUSINESS_PROCESS(BUSINESS_PROCESS_PRIORITY_ORDER),
- UNSPECIFIED(UNDEFINED_PRIORITY_ORDER);
+ STATELESS("Stateless"),
+ METHOD("Method"),
+ EVENT("Event", EVENT_PRIORITY_ORDER),
+ PAGE("Page", PAGE_PRIORITY_ORDER),
+ CONVERSATION("Conversation", CONVERSATION_PRIORITY_ORDER),
+ SESSION("Session", SESSION_PRIORITY_ORDER),
+ APPLICATION("Application", APPLICATION_PRIORITY_ORDER),
+ BUSINESS_PROCESS("Business Process", BUSINESS_PROCESS_PRIORITY_ORDER),
+ UNSPECIFIED("Unspecified", UNDEFINED_PRIORITY_ORDER);
int priority;
+ private String label;
- ScopeType(int priority) {
+ ScopeType(String label, int priority) {
this.priority = priority;
+ this.label = label;
}
- ScopeType() {
+ ScopeType(String label) {
this.priority = UNDEFINED_PRIORITY_ORDER;
+ this.label = label;
}
public int getPriority() {
return priority;
}
+
+ public String getLabel() {
+ return label;
+ }
+
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-16
21:08:48 UTC (rev 2450)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponent.java 2007-07-16
21:36:37 UTC (rev 2451)
@@ -256,4 +256,8 @@
}
}
+ @Override
+ public String toString() {
+ return "SeamComponent: " + getName();
+ }
}
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-16
21:08:48 UTC (rev 2450)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamLabelProvider.java 2007-07-16
21:36:37 UTC (rev 2451)
@@ -20,16 +20,16 @@
if(element instanceof ISeamProject) {
return ((ISeamProject)element).getProject().getName();
} else if(element instanceof ISeamScope) {
- return ((ISeamScope)element).getType().toString();
+ return ((ISeamScope)element).getType().getLabel();
} else if(element instanceof ISeamComponent) {
- return "" + ((ISeamComponent)element).getName();
+ return ((ISeamComponent)element).getName();
} else if(element instanceof ISeamJavaSourceReference) {
ISeamJavaSourceReference d = (ISeamJavaSourceReference)element;
IMember m = d.getSourceMember();
IType type = (m instanceof IType) ? (IType)m : m.getTypeRoot().findPrimaryType();
- if(type.isBinary()) {
+ if(type.isBinary()) {
IResource r = ((ISeamElement)element).getResource();
- String s = (r == null) ? "???" : r.getName();
+ String s = (r == null) ? "<no name>" : r.getName();
return s + "/" + type.getFullyQualifiedName();
} else {
return type.getFullyQualifiedName();
Show replies by date