Author: estherbin
Date: 2008-08-08 11:49:53 -0400 (Fri, 08 Aug 2008)
New Revision: 9630
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
Log:
JBIDE-2594 issue implementation add global el variables scope.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-08-08
13:35:42 UTC (rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-08-08
15:49:53 UTC (rev 9630)
@@ -15,6 +15,12 @@
VPEElReferenceExt.location=El Value
VPEElReferenceExt.prefix=Value
+VPEGlobalElReference.location=El Value
+VPEGlobalElReference.prefix=Value
+
+VPEGlobalElReferenceExt.location=El Value
+VPEGlobalElReferenceExt.prefix=Value
+
VpeResourcesDialog.WindowTitle=References to Resources
VpeResourcesDialog.Title=Page Design Options
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-08 13:35:42 UTC
(rev 9629)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-08-08 15:49:53 UTC
(rev 9630)
@@ -219,6 +219,112 @@
+
+
+ <!-- Added by estherbin
https://jira.jboss.org/jira/browse/JBIDE-2594 -->
+ <XModelEntity ImplementingClass="%Regular%"
name="VPEGlobalElReference">
+
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="action.empty" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute name="location" xmlname="location">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <value name="Global: For all projects in workspace"/>
+ <XModelAttribute name="prefix">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Add El Reference..." kind="action"
name="AddItem">
+ <EntityData EntityName="VPEGlobalElReference">
+ <AttributeData AttributeName="location" Mandatory="no"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Edit El Reference..." kind="action"
name="EditItem">
+ <EntityData EntityName="VPEGlobalElReference">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+
+ <XModelEntity ImplementingClass="%Regular%"
name="VPEGlobalElReferenceExt">
+
+
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="action.empty" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute name="location" xmlname="location">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="border=true"
+ default="Folder: Any Page at the Same Folder" name="scope"
xmlname="scope">
+ <Constraint loader="ListString">
+ <value name="Global: For all projects in workspace"/>
+ </Constraint>
+ <Editor name="RadioArray"/>
+ </XModelAttribute>
+ <XModelAttribute name="prefix">
+ <Constraint/>
+ <Editor/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Add El Reference..." kind="action"
name="AddItem">
+ <EntityData EntityName="VPEGlobalElReferenceExt">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HandlerClassName="%SpecialWizard%"
ICON="action.empty"
+
PROPERTIES="support=org.jboss.tools.vpe.editor.css.VpeAddReferenceSupport"
+ displayName="Edit El Reference..." kind="action"
name="EditItem">
+ <EntityData EntityName="VPEGlobalElReferenceExt">
+ <AttributeData AttributeName="location"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="prefix" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <!-- -->
+
+
+
+
<XModelEntity ImplementingClass="%Regular%"
name="VPEFolderReference">
<XChildrenEntities/>
<XEntityRenderer>
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ElVariablesComposite.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -13,7 +13,7 @@
* Creates the table provider.
*
* @param dataList the data list
- *
+ * g
* @return the resource references table provider
*/
@Override
@@ -32,7 +32,7 @@
return (file != null) ? "VPEElReference" :
"VPEElReferenceExt";
}
- /**
+ /**c
* Gets the reference list.
*
* @return the reference list
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.vpe.editor.css;
+
+import org.eclipse.core.runtime.QualifiedName;
+
+/**
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalELReferenceList extends ResourceReferenceList {
+ /** The PROPERT y_ NAME. */
+ private static QualifiedName PROPERTY_NAME = new QualifiedName("",
"org.jboss.tools.vpe.editor.css.GlobalELReference");
+
+ /** The instance. */
+ private static GlobalELReferenceList instance = new GlobalELReferenceList();
+
+ /**
+ * Gets the instance.
+ *
+ * @return the instance
+ */
+ public synchronized static GlobalELReferenceList getInstance() {
+ return instance;
+ }
+
+ private GlobalELReferenceList() {
+ super();
+ }
+
+ /**
+ * Gets the property name.
+ *
+ * @return the property name
+ */
+ protected QualifiedName getPropertyName() {
+ return PROPERTY_NAME;
+ }
+
+
+}
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalELReferenceList.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.vpe.editor.css;
+
+import java.util.List;
+
+/**
+ * Composite class for the global el variables.
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalElVariablesComposite extends ResourceReferencesComposite {
+
+ /**
+ * @see
org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createGroupLabel()
+ */
+ @Override
+ protected String createGroupLabel() {
+ return "";
+ }
+
+ /**
+ * @see
org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#createTableProvider(java.util.List)
+ */
+ @Override
+ protected ResourceReferencesTableProvider createTableProvider(List dataList) {
+ return ResourceReferencesTableProvider.getGlobalELTableProvider(dataList);
+ }
+
+ /**
+ * @see org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#getEntity()
+ */
+ @Override
+ protected String getEntity() {
+ return (file != null) ? "VPEGlobalElReference" :
"VPEGlobalElReferenceExt";
+ }
+
+ /**
+ * @see
org.jboss.tools.vpe.editor.css.ResourceReferencesComposite#getReferenceList()
+ */
+ @Override
+ protected ResourceReferenceList getReferenceList() {
+ return GlobalELReferenceList.getInstance();
+ }
+
+ @Override
+ protected ResourceReference getDefaultResourceReference() {
+ ResourceReference rf = new ResourceReference("",
ResourceReference.GLOBAL_SCOPE);
+ rf.setGlobal(true);
+ return rf;
+ }
+
+}
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalElVariablesComposite.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is 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:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.vpe.editor.css;
+
+/**
+ * Global resource reference
+ * @author Evgenij Stherbin
+ *
+ */
+public class GlobalResourceReference extends ResourceReference {
+
+ /**
+ * @param location
+ * @param scope
+ */
+ public GlobalResourceReference(String location, int scope) {
+ super(location, scope);
+ }
+
+}
Property changes on:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/GlobalResourceReference.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReference.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -11,18 +11,29 @@
package org.jboss.tools.vpe.editor.css;
public class ResourceReference {
- public static int FILE_SCOPE = 0;
- public static int FOLDER_SCOPE = 1;
- public static int PROJECT_SCOPE = 2;
+ public final static int FILE_SCOPE = 0;
+ public final static int FOLDER_SCOPE = 1;
+ public final static int PROJECT_SCOPE = 2;
+ public final static int GLOBAL_SCOPE = 3;
- public static String[] SCOPE_NAMES = new String[]{"Page", "Folder",
"Project"};
+ public final static String[] SCOPE_NAMES = new String[]{"Page",
"Folder", "Project","Global"};
- private String location;
- private int scope;
- private int depth = 0;
- private String properties = "";
+ protected String location;
+ protected int scope;
+ protected int depth = 0;
+ protected String properties = "";
- public ResourceReference(String location, int scope) {
+ protected boolean isGlobal = false;
+
+ public boolean isGlobal() {
+ return isGlobal;
+ }
+
+ public void setGlobal(boolean isGlobal) {
+ this.isGlobal = isGlobal;
+ }
+
+ public ResourceReference(String location, int scope) {
this.location = location;
this.scope = scope;
int q = location.indexOf('%');
@@ -75,5 +86,24 @@
}
return v;
}
+
+
+// public static ResourceReference createResourceReference(String location, int scope) {
+// ResourceReference rst = null;
+//
+// switch (scope) {
+// case FILE_SCOPE:
+// case FOLDER_SCOPE:
+// case PROJECT_SCOPE:
+// rst = new ResourceReference(location, scope);
+// break;
+// case GLOBAL_SCOPE:
+// rst = new GlobalResourceReference(location, scope);
+// break;
+// default:
+// throw new IllegalArgumentException("Illegal scope=" + scope);
+// }
+// return rst;
+// }
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferenceList.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -202,11 +202,16 @@
List css = new ArrayList();
IPath parent = path.removeLastSegments(1);
int depth = 0;
+ boolean isGlobal = path.equals(Platform.getLocation());
+ int setScope = isGlobal ? ResourceReference.GLOBAL_SCOPE :
ResourceReference.FILE_SCOPE;
while(parent != null && parent.segmentCount() > 1) {
- String[] dcss = getDeclaredResources(parent);
+ String[] dcss = getDeclaredResources(path);
for (int i = 0; i < dcss.length; i++) {
if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i],
ResourceReference.FOLDER_SCOPE);
+ ResourceReference ref = new ResourceReference(dcss[i],isGlobal ?
ResourceReference.GLOBAL_SCOPE : ResourceReference.FOLDER_SCOPE);
+ if(isGlobal){
+ ref.setGlobal(true);
+ }
ref.setDepth(depth);
locations.add(dcss[i]);
css.add(ref);
@@ -217,7 +222,10 @@
String[] dcss = getDeclaredResources(path);
for (int i = 0; i < dcss.length; i++) {
if(locations.contains(dcss[i])) continue;
- ResourceReference ref = new ResourceReference(dcss[i], ResourceReference.FILE_SCOPE);
+ ResourceReference ref = new ResourceReference(dcss[i], setScope);
+ if(setScope == ResourceReference.GLOBAL_SCOPE){
+ ref.setGlobal(true);
+ }
locations.add(dcss[i]);
css.add(ref);
}
@@ -231,7 +239,10 @@
public void setAllResources(IPath path, ResourceReference[] entries) {
IPath changed = null;
- boolean b = setDeclaredResources(path, entries, ResourceReference.FILE_SCOPE, 0);
+ boolean b = false;
+ int checkScope = path.equals(Platform.getLocation()) ? ResourceReference.GLOBAL_SCOPE :
ResourceReference.FILE_SCOPE;
+
+ b = setDeclaredResources(path, entries, checkScope, 0);
if(b) changed = path;
IPath parent = path.removeLastSegments(1);
int depth = 0;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesComposite.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -128,7 +128,7 @@
public void action(String command) {
int index = table.getSelectionIndex();
if(ADD.equals(command)) {
- add(index);
+ add(index);
} else if(EDIT.equals(command)) {
edit(index);
} else if(REMOVE.equals(command)) {
@@ -139,7 +139,8 @@
}
protected void add(int index) {
- ResourceReference css = new ResourceReference("",
ResourceReference.FOLDER_SCOPE);
+ ResourceReference css = getDefaultResourceReference();
+
initFilterInFileChooser();
boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
if(!ok) return;
@@ -147,6 +148,13 @@
update();
table.setSelection(dataList.size() - 1);
}
+
+ /**
+ * @return
+ */
+ protected ResourceReference getDefaultResourceReference() {
+ return new ResourceReference("", ResourceReference.FOLDER_SCOPE);
+ }
protected void edit(int index) {
if(index < 0) return;
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/ResourceReferencesTableProvider.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -19,6 +19,7 @@
static String[] IMG_COLUMNS = new String[]{"Scope", "Image Folder
Path"};
static String[] TLD_COLUMNS = new String[]{"Scope", "URI",
"Prefix"};
static String[] EL_COLUMNS = new String[]{"Scope", "El Expression",
"Value"};
+ private final static String[] GLOBAL_EL_COLUMNS = new
String[]{"Scope","El Expression", "Value"};
int[] widths = new int[]{50, 200};
List dataList;
@@ -49,7 +50,16 @@
p.widths = new int[]{50, 150, 50};
return p;
}
+
+ public static ResourceReferencesTableProvider getGlobalELTableProvider(final List
dataList) {
+ ResourceReferencesTableProvider p = new
ResourceReferencesTableProvider(dataList);
+
+ p.columns = GLOBAL_EL_COLUMNS;
+ p.widths = new int[]{50,150, 50};
+ return p;
+ }
+
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-08
13:35:42 UTC (rev 9629)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/css/VpeAddReferenceSupport.java 2008-08-08
15:49:53 UTC (rev 9630)
@@ -50,7 +50,11 @@
if(ok) {
css.setLocation(object.getAttributeValue("location"));
Integer scope = (Integer)p.get("scope");
+
css.setScope(scope.intValue());
+ if(css.isGlobal()){
+ css.setScope(ResourceReference.GLOBAL_SCOPE);
+ }
String properties = object.getAttributeValue("prefix");
if(properties != null) css.setProperties(properties);
}
@@ -70,8 +74,18 @@
if(initialPrefix != null) {
setAttributeValue(0, "prefix", initialPrefix);
}
- scopeNames =
((XAttributeConstraintL)getTarget().getModelEntity().getAttribute("scope").getConstraint()).getValues();
+ final XAttributeConstraintL scopeAttribute = ((XAttributeConstraintL)
getTarget().getModelEntity().getAttribute("scope")
+ .getConstraint());
+ if (scopeAttribute != null) {
+ scopeNames = scopeAttribute.getValues();
+ }
int scopeIndex = ((Integer)getProperties().get("scope")).intValue();
+
+ if(scopeIndex == 1 && scopeNames.length == 1){
+ scopeIndex = 0;
+ }else if(scopeIndex > scopeNames.length){
+ scopeIndex = scopeNames.length -1;
+ }
String scope = scopeNames[scopeIndex];
setAttributeValue(0, "scope", scope);
list = (ResourceReference[])getProperties().get("list");