Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 226268 Details for
Bug 399380
Move @Replace support into Scout core and extend it
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
applied patch
MoveReplaceSupportIntoScout.patch (text/plain), 234.69 KB, created by
Andi Bur
on 2013-01-29 11:27:26 EST
(
hide
)
Description:
applied patch
Filename:
MIME Type:
Creator:
Andi Bur
Created:
2013-01-29 11:27:26 EST
Size:
234.69 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.scout.rt.extension.client >Index: src/org/eclipse/scout/rt/extension/client/Replace.java >=================================================================== >--- src/org/eclipse/scout/rt/extension/client/Replace.java (revision 3368) >+++ src/org/eclipse/scout/rt/extension/client/Replace.java (working copy) >@@ -20,9 +20,12 @@ > * the first object is removed which type is the annotated class's super class. > * > * @since 3.9.0 >+ * @deprecated Do not use this class any more. It has been replaced by >+ * {@link org.eclipse.scout.commons.annotations.Replace}. > */ > @Retention(RetentionPolicy.RUNTIME) > @Target(ElementType.TYPE) >+@Deprecated > public @interface Replace { > > /** >Index: src/org/eclipse/scout/rt/extension/client/ExtensionUtility.java >=================================================================== >--- src/org/eclipse/scout/rt/extension/client/ExtensionUtility.java (revision 3368) >+++ src/org/eclipse/scout/rt/extension/client/ExtensionUtility.java (working copy) >@@ -23,6 +23,7 @@ > import org.eclipse.scout.commons.BeanUtility; > import org.eclipse.scout.commons.CompareUtility; > import org.eclipse.scout.commons.CompositeObject; >+import org.eclipse.scout.commons.ConfigurationUtility; > import org.eclipse.scout.commons.TypeCastUtility; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; >@@ -63,7 +64,15 @@ > /** > * Removes those objects of the given list that match any {@link Replace} annotation on other elements being part of > * the same list. >+ * >+ * @deprecated The {@link Replace} annotation this method works for has been replaced by >+ * {@link org.eclipse.scout.commons.annotations.Replace}. The corresponding methods for this one are >+ * {@link ConfigurationUtility#removeReplacedClasses(Class[])}, >+ * {@link ConfigurationUtility#getReplacementMapping(Class[])} and >+ * {@link ConfigurationUtility#getReplacingLeafClasses(Class[])}. > */ >+ @Deprecated >+ @SuppressWarnings("deprecation") > public static <T> Map<T, T> processReplaceAnnotations(List<T> list) { > if (list == null || list.isEmpty()) { > return Collections.emptyMap(); >Index: src/org/eclipse/scout/rt/extension/client/ui/basic/table/AbstractExtensibleTable.java >=================================================================== >--- src/org/eclipse/scout/rt/extension/client/ui/basic/table/AbstractExtensibleTable.java (revision 3368) >+++ src/org/eclipse/scout/rt/extension/client/ui/basic/table/AbstractExtensibleTable.java (working copy) >@@ -34,6 +34,7 @@ > * > * @since 3.9.0 > */ >+@SuppressWarnings("deprecation") > public abstract class AbstractExtensibleTable extends AbstractTable implements IExtensibleScoutObject { > private static final IScoutLogger LOG = ScoutLogManager.getLogger(AbstractExtensibleTable.class); > >#P org.eclipse.scout.commons >Index: src/org/eclipse/scout/commons/ConfigurationUtility.java >=================================================================== >--- src/org/eclipse/scout/commons/ConfigurationUtility.java (revision 3395) >+++ src/org/eclipse/scout/commons/ConfigurationUtility.java (working copy) >@@ -15,11 +15,18 @@ > import java.lang.reflect.Modifier; > import java.util.ArrayList; > import java.util.Collection; >+import java.util.Collections; >+import java.util.HashMap; >+import java.util.HashSet; >+import java.util.List; >+import java.util.Map; >+import java.util.Set; > import java.util.TreeMap; > > import org.eclipse.scout.commons.annotations.IOrdered; > import org.eclipse.scout.commons.annotations.InjectFieldTo; > import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; > >@@ -55,7 +62,9 @@ > orderedClassesMap.put(new CompositeObject(order.value(), i), classes[i]); > } > else { >- LOG.error("missing @Order annotation: " + classes[i].getName()); >+ if (!classes[i].isAnnotationPresent(Replace.class)) { >+ LOG.error("missing @Order annotation: " + classes[i].getName()); >+ } > orderedClassesMap.put(new CompositeObject(Double.MAX_VALUE, i), classes[i]); > } > } >@@ -111,7 +120,7 @@ > * > * @param classes > * @param filter >- * @return first occurrence of filter, might be annotated with {@link InjectFieldTo} >+ * @return first occurrence of filter, might be annotated with {@link InjectFieldTo} or {@link Replace} > */ > @SuppressWarnings("unchecked") > public static <T> Class<T> filterClass(Class[] classes, Class<T> filter) { >@@ -124,7 +133,8 @@ > } > > /** >- * same as {@link #filterClass(Class[], Class)} but ignoring classes with {@link InjectFieldTo} annotation >+ * same as {@link #filterClass(Class[], Class)} but ignoring classes with {@link InjectFieldTo} and {@link Replace} >+ * annotations > * > * @since 3.8.1 > */ >@@ -132,7 +142,7 @@ > public static <T> Class<T> filterClassIgnoringInjectFieldAnnotation(Class[] classes, Class<T> filter) { > for (Class c : classes) { > if (filter.isAssignableFrom(c) && !Modifier.isAbstract(c.getModifiers())) { >- if (!c.isAnnotationPresent(InjectFieldTo.class)) { >+ if (!isInjectFieldAnnotationPresent(c)) { > return c; > } > } >@@ -161,7 +171,8 @@ > } > > /** >- * same as {@link #filterClasses(Class[], Class)} but ignoring classes with {@link InjectFieldTo} annotation >+ * same as {@link #filterClasses(Class[], Class)} but ignoring classes with {@link InjectFieldTo} and {@link Replace} >+ * annotations > * > * @since 3.8.1 > */ >@@ -170,7 +181,7 @@ > ArrayList<Class<T>> list = new ArrayList<Class<T>>(); > for (Class c : classes) { > if (filter.isAssignableFrom(c) && !Modifier.isAbstract(c.getModifiers())) { >- if (!c.isAnnotationPresent(InjectFieldTo.class)) { >+ if (!isInjectFieldAnnotationPresent(c)) { > list.add(c); > } > } >@@ -179,7 +190,8 @@ > } > > /** >- * same as {@link #filterClasses(Class[], Class)} but only accepting classes with {@link InjectFieldTo} annotation >+ * same as {@link #filterClasses(Class[], Class)} but only accepting classes with {@link InjectFieldTo} and >+ * {@link Replace} annotations > * > * @since 3.8.1 > */ >@@ -188,7 +200,7 @@ > ArrayList<Class<T>> list = new ArrayList<Class<T>>(); > for (Class c : classes) { > if (filter.isAssignableFrom(c) && !Modifier.isAbstract(c.getModifiers())) { >- if (c.isAnnotationPresent(InjectFieldTo.class)) { >+ if (isInjectFieldAnnotationPresent(c)) { > list.add(c); > } > } >@@ -197,6 +209,16 @@ > } > > /** >+ * @return Returns <code>true</code> if the given class is annotated by {@link InjectFieldTo} or {@link Replace}. >+ * Otherwise <code>false</code>. >+ * <p/> >+ * <b>Note:</b> This method throws a {@link NullPointerException} if the given class is null. >+ */ >+ public static boolean isInjectFieldAnnotationPresent(Class<?> c) { >+ return c.isAnnotationPresent(InjectFieldTo.class) || c.isAnnotationPresent(Replace.class); >+ } >+ >+ /** > * get all declared classes (inner types) of the specified class and all its > * super classes > */ >@@ -261,4 +283,163 @@ > } > return c; > } >+ >+ /** >+ * Returns a new array without those classes, that are replaced by another class. The returned array is a new >+ * instance, except there are no replacing classes. Replacing classes are annotated with {@link Replace}. Replacing >+ * classes are reordered according to their nearest {@link Order} annotation that is found up the type hierarchy. >+ * >+ * @param classes >+ * @return >+ * @since 3.8.2 >+ */ >+ @SuppressWarnings("unchecked") >+ public static <T> Class<? extends T>[] removeReplacedClasses(Class<? extends T>[] classes) { >+ Set<Class<? extends T>> replacingClasses = getReplacingLeafClasses(classes); >+ if (replacingClasses.isEmpty()) { >+ // there are no replacing classes -> return original array >+ return classes; >+ } >+ >+ // compute resulting list of ordered classes >+ List<Class<? extends T>> list = new ArrayList<Class<? extends T>>(); >+ for (Class<? extends T> c : classes) { >+ list.add(c); >+ } >+ >+ for (Class<? extends T> replacingClass : replacingClasses) { >+ boolean reorder = !replacingClass.isAnnotationPresent(Order.class); >+ boolean reordered = false; >+ >+ // handle transitive replacements >+ Class<?> classToBeReplaced = replacingClass.getSuperclass(); >+ while (classToBeReplaced.isAnnotationPresent(Replace.class)) { >+ // reorder replacement if necessary >+ if (reorder && !reordered && classToBeReplaced.isAnnotationPresent(Order.class)) { >+ reordered = moveBefore(list, replacingClass, (Class<? extends T>) classToBeReplaced); >+ } >+ list.remove(classToBeReplaced); >+ classToBeReplaced = classToBeReplaced.getSuperclass(); >+ } >+ >+ // reorder replacement if necessary >+ if (reorder && !reordered) { >+ moveBefore(list, replacingClass, (Class<? extends T>) classToBeReplaced); >+ } >+ list.remove(classToBeReplaced); >+ } >+ >+ return list.toArray(new Class[list.size()]); >+ } >+ >+ /** >+ * Computes a map based on the given classes that contains replaced classes pointing to their replacing classes. This >+ * method never returns <code>null</code>. >+ * <p/> >+ * <b>Example:</b> Given the following two classes >+ * >+ * <pre> >+ * public class A { >+ * } >+ * >+ * @Replace >+ * public class B extends A { >+ * } >+ * </pre> >+ * >+ * The invocation of <code>getReplacementMapping(new Class[] {B.class, String.class})</code> returns a map containing >+ * <code><A.class, B.class></code>. >+ * >+ * @param classes >+ * @return >+ * @since 3.8.2 >+ */ >+ public static <T> Map<Class<?>, Class<? extends T>> getReplacementMapping(Class<? extends T>[] classes) { >+ Set<Class<? extends T>> replacingClasses = getReplacingLeafClasses(classes); >+ if (replacingClasses.isEmpty()) { >+ // there are no replacing classes -> return original array >+ return Collections.emptyMap(); >+ } >+ >+ // compute resulting replacement mapping >+ Map<Class<?>, Class<? extends T>> mappings = new HashMap<Class<?>, Class<? extends T>>(); >+ for (Class<? extends T> c : replacingClasses) { >+ Class<?> tmpClass = c; >+ do { >+ tmpClass = tmpClass.getSuperclass(); >+ mappings.put(tmpClass, c); >+ } >+ while (tmpClass.isAnnotationPresent(Replace.class)); >+ } >+ return mappings; >+ } >+ >+ /** >+ * Computes the set of classes that are annotated with {@link Replace} and removes transitive dependencies, so that >+ * the most specific classes are returned. >+ * <p/> >+ * <b>Example:</b> Given the following two classes >+ * >+ * <pre> >+ * public class A { >+ * } >+ * >+ * @Replace >+ * public class B extends A { >+ * } >+ * </pre> >+ * >+ * The invocation of <code>getReplacingLeafClasses(new Class[] {A.class, B.class, String.class})</code> returns a set >+ * that contains <code>B.class</code> only. <code>String.class</code> is not annotated with {@link Replace} and >+ * <code>A.class</code> is not a leaf replacement, but further replaced by <code>B.class</code>. >+ * >+ * @param classes >+ * @return Returns the set of replacing leaf classes or an empty set. >+ * @since 3.8.2 >+ */ >+ public static <T> Set<Class<? extends T>> getReplacingLeafClasses(Class<? extends T>[] classes) { >+ // gather all replacing and replaced classes (i.e. those annotated with @Replace and their super classes) >+ Set<Class<? extends T>> replacingClasses = new HashSet<Class<? extends T>>(); >+ Set<Class<?>> replacedClasses = new HashSet<Class<?>>(); >+ for (Class<? extends T> c : classes) { >+ if (c.isAnnotationPresent(Replace.class)) { >+ replacingClasses.add(c); >+ Class<?> tmpClass = c; >+ do { >+ tmpClass = tmpClass.getSuperclass(); >+ replacedClasses.add(tmpClass); >+ } >+ while (tmpClass.isAnnotationPresent(Replace.class)); >+ } >+ } >+ >+ if (replacingClasses.isEmpty()) { >+ return Collections.emptySet(); >+ } >+ >+ // remove transitive replacements (e.g. if A replaces B and B replaces C, A and B are replacing classes but we are interested in A only) >+ replacingClasses.removeAll(replacedClasses); >+ return replacingClasses; >+ } >+ >+ /** >+ * Moves the given element before the reference element. Both are expected to be part of the given list. If the >+ * reference element is not in the list, the list remains untouched. If the element to move is not part of the list, >+ * it is added before the reference element. >+ * >+ * @param list >+ * @param element >+ * @param referenceElement >+ * @return Returns <code>true</code> if the element has been moved or inserted. Otherwise <code>false</code>. >+ * @since 3.8.2 >+ */ >+ private static <T> boolean moveBefore(List<T> list, T element, T referenceElement) { >+ int index = list.indexOf(referenceElement); >+ if (index != -1) { >+ list.remove(element); >+ list.add(index, element); >+ return true; >+ } >+ return false; >+ } > } >Index: src/org/eclipse/scout/commons/annotations/Replace.java >=================================================================== >--- src/org/eclipse/scout/commons/annotations/Replace.java (revision 0) >+++ src/org/eclipse/scout/commons/annotations/Replace.java (revision 0) >@@ -0,0 +1,146 @@ >+package org.eclipse.scout.commons.annotations; >+ >+import java.lang.annotation.ElementType; >+import java.lang.annotation.Retention; >+import java.lang.annotation.RetentionPolicy; >+import java.lang.annotation.Target; >+ >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+ >+/** >+ * Annotation on a class used to replace the first occurrence of its super class. The Annotation can be applied to >+ * several scout objects types like columns, menus, form fields. Further, the annotation can be applied recursively >+ * (i.e. replaced objects can be replaced as well). >+ * <p/> >+ * <h3>Usage on form fields</h3> If this annotation is added to a form field in an extended form, it works like the >+ * {@link InjectFieldTo} annotation except that the original field is removed. The replaced field's container is used by >+ * the replacing field as well. If the {@link Order} annotation is missing on the replacing class, the order of the >+ * extended class is used. Finally, the {@link FormData} annotation is inherited form the replaced field. If the >+ * replaced field does not have a form field data, the replacing field may crate on using {@link SdkCommand#CREATE} or >+ * {@link SdkCommand#USE}. >+ * <p/> >+ * <b>Example:</b> The NameExField replaces the NameField in the original BaseForm without changing its order within the >+ * FirstGroupBox. <b>Note:</b> the weird looking super constructor call is required for initializing the extended >+ * <em>inner class</em>. >+ * >+ * <pre> >+ * public class BaseForm extends AbstractForm { >+ * @Order(10) >+ * public class MainBox extends AbstractGroupBox { >+ * @Order(10) >+ * public class FirstGroupBox extends AbstractGroupBox { >+ * @Order(10) >+ * public class NameField extends AbstractStringField { >+ * } >+ * } >+ * } >+ * } >+ * >+ * public class ExtendedForm extends BaseForm { >+ * @Replace >+ * public class NameExField extends NameField { >+ * public NameExField(BaseForm.MainBox.FirstGroupBox container) { >+ * container.super(); >+ * } >+ * } >+ * } >+ * </pre> >+ * >+ * <h3>Usage on table columns</h3> The annotation can be used to modify or move columns within a table. By default, the >+ * replaced column uses the same {@link Order} of the replaced column. >+ * <p/> >+ * <b>Example 1:</b> The FirstExColumn replaces the FirstColumn in the original Table without changing its order. >+ * >+ * <pre> >+ * public class Table extends AbstractTable { >+ * @Order(10) >+ * public class FirstColumn extends AbstractStringColumn { >+ * } >+ * >+ * @Order(20) >+ * public class SecondColumn extends AbstractStringColumn { >+ * } >+ * } >+ * >+ * public class ExtendedTable extends Table { >+ * @Replace >+ * public class FirstExColumn extends FirstColumn { >+ * } >+ * } >+ * </pre> >+ * >+ * <b>Example 2:</b> Modifying the table of a table field requires to replace the table field as well: >+ * >+ * <pre> >+ * public class BaseForm extends AbstractForm { >+ * @Order(10) >+ * public class MainBox extends AbstractGroupBox { >+ * @Order(10) >+ * public class FirstGroupBox extends AbstractGroupBox { >+ * @Order(10) >+ * public class TableField extends AbstractTableField { >+ * public class Table extends AbstractTable { >+ * @Order(10) >+ * public class FirstColumn extends AbstractStringColumn { >+ * } >+ * } >+ * } >+ * } >+ * } >+ * } >+ * >+ * public class ExtendedForm extends BaseForm { >+ * @Replace >+ * public class TableExField extends NameField { >+ * public TableExField(BaseForm.MainBox.FirstGroupBox container) { >+ * container.super(); >+ * } >+ * >+ * public class TableEx extends Table { >+ * @Replace >+ * public class FirstExColumn extends FirstColumn { >+ * } >+ * } >+ * } >+ * } >+ * </pre> >+ * >+ * <h3>Usage on action containers</h3> The annotation can be used to change the behavior of an action. Menus, key >+ * strokes, tool buttons and view buttons are actions as well. >+ * <p/> >+ * <b>Example:</b> Modify the behavior of a menu defined on a smart field: >+ * >+ * <pre> >+ * public class BaseForm extends AbstractForm { >+ * @Order(10) >+ * public class MainBox extends AbstractGroupBox { >+ * @Order(10) >+ * public class MySmartField extends AbstractSmartField<Long> { >+ * @Order(10) >+ * public class MyMenu extends AbstractMenu { >+ * } >+ * } >+ * } >+ * } >+ * >+ * public class ExtendedForm extends BaseForm { >+ * @Replace >+ * public class MyExSmartField extends MySmartField { >+ * public MyExSmartField(BaseForm.MainBox container) { >+ * container.super(); >+ * } >+ * >+ * @Replace >+ * public class MyExMenu extends MyMenu { >+ * } >+ * } >+ * } >+ * </pre> >+ * >+ * @since 3.8.2 >+ */ >+@Retention(RetentionPolicy.RUNTIME) >+@Target(ElementType.TYPE) >+public @interface Replace { >+ >+} >#P org.eclipse.scout.sdk >Index: src/org/eclipse/scout/sdk/RuntimeClasses.java >=================================================================== >--- src/org/eclipse/scout/sdk/RuntimeClasses.java (revision 3375) >+++ src/org/eclipse/scout/sdk/RuntimeClasses.java (working copy) >@@ -128,6 +128,7 @@ > public static final String BasicHierarchyPermission = "org.eclipse.scout.rt.shared.security.BasicHierarchyPermission"; // NO_UCD > public static final String BasicPermission = "java.security.BasicPermission"; // NO_UCD > public static final String FormData = "org.eclipse.scout.commons.annotations.FormData"; // NO_UCD >+ public static final String Replace = "org.eclipse.scout.commons.annotations.Replace"; // NO_UCD > public static final String FormData_UpdateOperation = "org.eclipse.scout.commons.annotations.FormData.UpdateOperation"; // NO_UCD > public static final String ClientProxyServiceFactory = "org.eclipse.scout.rt.client.services.ClientProxyServiceFactory"; // NO_UCD > public static final String ClientServiceFactory = "org.eclipse.scout.rt.client.services.ClientServiceFactory"; // NO_UCD >Index: src/org/eclipse/scout/sdk/workspace/type/ScoutTypeUtility.java >=================================================================== >--- src/org/eclipse/scout/sdk/workspace/type/ScoutTypeUtility.java (revision 3375) >+++ src/org/eclipse/scout/sdk/workspace/type/ScoutTypeUtility.java (working copy) >@@ -47,6 +47,7 @@ > import org.eclipse.scout.sdk.icon.IIconProvider; > import org.eclipse.scout.sdk.internal.ScoutSdk; > import org.eclipse.scout.sdk.operation.form.formdata.FormDataAnnotation; >+import org.eclipse.scout.sdk.operation.form.formdata.FormDataUtility; > import org.eclipse.scout.sdk.util.Regex; > import org.eclipse.scout.sdk.util.ScoutMethodUtility; > import org.eclipse.scout.sdk.util.ScoutUtility; >@@ -182,6 +183,61 @@ > return null; > } > >+ /** >+ * @return Returns <code>true</code> if the given type exists and if it is annotated with an >+ * {@link RuntimeClasses#Replace} annotation. >+ * @since 3.8.2 >+ */ >+ public static boolean isReplaceAnnotationPresent(IType type) { >+ IAnnotation annotation = JdtUtility.getAnnotation(type, RuntimeClasses.Replace); >+ return TypeUtility.exists(annotation); >+ } >+ >+ /** >+ * @return Returns the form field data for the given form field or <code>null</code> if it does not have one. >+ * @since 3.8.2 >+ */ >+ public static IType getFormDataType(IType formField, ITypeHierarchy hierarchy) throws JavaModelException { >+ IType primaryType = getFormFieldDataPrimaryTypeRec(formField, hierarchy); >+ if (!TypeUtility.exists(primaryType)) { >+ return null; >+ } >+ IType formDataType = primaryType.getType(FormDataUtility.getBeanName(FormDataUtility.getFieldNameWithoutSuffix(formField.getElementName()), true)); >+ if (TypeUtility.exists(formDataType)) { >+ return formDataType; >+ } >+ return null; >+ } >+ >+ /** >+ * @return Returns the form field data for the given form field or <code>null</code> if it does not have one. The >+ * method walks recursively through the list of declaring classes until it has reached a primary type. >+ * @since 3.8.2 >+ */ >+ private static IType getFormFieldDataPrimaryTypeRec(IType recursiveDeclaringType, ITypeHierarchy hierarchy) throws JavaModelException { >+ if (!TypeUtility.exists(recursiveDeclaringType)) { >+ return null; >+ } >+ FormDataAnnotation formDataAnnotation = findFormDataAnnotation(recursiveDeclaringType, hierarchy); >+ if (formDataAnnotation == null) { >+ return null; >+ } >+ if (FormDataAnnotation.isIgnore(formDataAnnotation)) { >+ return null; >+ } >+ >+ IType declaringType = recursiveDeclaringType.getDeclaringType(); >+ if (declaringType == null) { >+ // primary type >+ if (FormDataAnnotation.isSdkCommandCreate(formDataAnnotation) || FormDataAnnotation.isSdkCommandUse(formDataAnnotation)) { >+ return getTypeBySignature(formDataAnnotation.getFormDataTypeSignature()); >+ } >+ return null; >+ } >+ >+ return getFormFieldDataPrimaryTypeRec(declaringType, hierarchy); >+ } >+ > public static FormDataAnnotation findFormDataAnnotation(IType type, ITypeHierarchy hierarchy) throws JavaModelException { > return findFormDataAnnnotationImpl(type, hierarchy); > } >@@ -212,8 +268,37 @@ > > private static void parseFormDataAnnotationReq(FormDataAnnotation annotation, IType type, ITypeHierarchy hierarchy, boolean isOwner) { > if (TypeUtility.exists(type)) { >+ boolean replaceAnnotationPresent = isReplaceAnnotationPresent(type); > IType superType = hierarchy.getSuperclass(type); >- parseFormDataAnnotationReq(annotation, superType, hierarchy, false); >+ parseFormDataAnnotationReq(annotation, superType, hierarchy, replaceAnnotationPresent); >+ >+ if (replaceAnnotationPresent) { >+ if (!isReplaceAnnotationPresent(superType)) { >+ // super type is the original field that is going to be replaced by the given type >+ // check whether the super type is embedded into a form field that is annotated by @FormData with SdkCommand.IGNORE. >+ try { >+ IType declaringType = superType.getDeclaringType(); >+ while (TypeUtility.exists(declaringType)) { >+ FormDataAnnotation declaringTypeformDataAnnotation = findFormDataAnnotation(declaringType, hierarchy); >+ if (FormDataAnnotation.isIgnore(declaringTypeformDataAnnotation)) { >+ // super type is embedded into a ignored form field. Hence this field is ignored as well. Adjust parsed annotation. >+ annotation.setSdkCommand(SdkCommand.IGNORE); >+ break; >+ } >+ declaringType = declaringType.getDeclaringType(); >+ } >+ } >+ catch (JavaModelException e) { >+ ScoutSdk.logWarning("could not determine enclosing class's @FormData annotation", e); >+ } >+ } >+ >+ if (!FormDataAnnotation.isIgnore(annotation)) { >+ // a form field data must always be created for a replacing fields if its parent has one and it must extend the parent field's field data class >+ return; >+ } >+ } >+ > try { > fillFormDataAnnotation(type, annotation, isOwner); > } >@@ -704,19 +789,28 @@ > } > > /** >+ * @see #getValidationRuleMethods(IType, ITypeHierarchy) >+ */ >+ public static List<ValidationRuleMethod> getValidationRuleMethods(IType declaringType) throws JavaModelException { >+ return getValidationRuleMethods(declaringType, null); >+ } >+ >+ /** > * @return a map with all validation rule names mapped to the method on the most specific declaring type > * @throws JavaModelException > */ >- public static List<ValidationRuleMethod> getValidationRuleMethods(IType declaringType) throws JavaModelException { >+ public static List<ValidationRuleMethod> getValidationRuleMethods(IType declaringType, org.eclipse.jdt.core.ITypeHierarchy superTypeHierarchy) throws JavaModelException { > TreeMap<String, ValidationRuleMethod> ruleMap = new TreeMap<String, ValidationRuleMethod>(); >- org.eclipse.jdt.core.ITypeHierarchy superTypeHierarchy = null; >- try { >- superTypeHierarchy = declaringType.newSupertypeHierarchy(null); >- } >- catch (JavaModelException e) { >- ScoutSdk.logWarning("could not build super type hierarchy for '" + declaringType.getFullyQualifiedName() + "'", e); >- return Collections.emptyList(); >+ if (superTypeHierarchy == null) { >+ try { >+ superTypeHierarchy = declaringType.newSupertypeHierarchy(null); >+ } >+ catch (JavaModelException e) { >+ ScoutSdk.logWarning("could not build super type hierarchy for '" + declaringType.getFullyQualifiedName() + "'", e); >+ return Collections.emptyList(); >+ } > } >+ > ArrayList<IType> targetTypeList = new ArrayList<IType>(5); > targetTypeList.add(0, declaringType); > IType[] superClasses = superTypeHierarchy.getAllSuperclasses(declaringType); >@@ -807,10 +901,6 @@ > continue; > } > //found new rule annotation, now find most specific method in subclasses to generate source code >- if (ruleSkip.booleanValue()) { >- ruleMap.put(hashKey, null); >- continue; >- } > if (ruleGeneratedSourceCode != null && ruleGeneratedSourceCode.length() == 0) { > ruleGeneratedSourceCode = null; > } >@@ -840,7 +930,7 @@ > implementedMethod = annotatedMethod; > } > //new rule is sufficiently parsed >- ValidationRuleMethod vm = new ValidationRuleMethod(validationRuleAnnotation, ruleField, ruleString, ruleGeneratedSourceCode, annotatedMethod, implementedMethod, superTypeHierarchy); >+ ValidationRuleMethod vm = new ValidationRuleMethod(validationRuleAnnotation, ruleField, ruleString, ruleGeneratedSourceCode, annotatedMethod, implementedMethod, superTypeHierarchy, ruleSkip); > ruleMap.put(hashKey, vm); > } > } >Index: src/org/eclipse/scout/sdk/workspace/type/validationrule/ValidationRuleMethod.java >=================================================================== >--- src/org/eclipse/scout/sdk/workspace/type/validationrule/ValidationRuleMethod.java (revision 3375) >+++ src/org/eclipse/scout/sdk/workspace/type/validationrule/ValidationRuleMethod.java (working copy) >@@ -26,8 +26,9 @@ > private final IMethod m_annotatedMethod; > private final IMethod m_implementedMethod; > private final ITypeHierarchy m_superTypeHierarchy; >+ private final boolean m_skipRule; > >- public ValidationRuleMethod(IAnnotation annotation, IField ruleField, String ruleName, String ruleGeneratedSourceCode, IMethod annotatedMethod, IMethod implementedMethod, ITypeHierarchy superTypeHierarchy) { >+ public ValidationRuleMethod(IAnnotation annotation, IField ruleField, String ruleName, String ruleGeneratedSourceCode, IMethod annotatedMethod, IMethod implementedMethod, ITypeHierarchy superTypeHierarchy, boolean skipRule) { > m_annotation = annotation; > m_ruleField = ruleField; > m_ruleName = ruleName; >@@ -35,6 +36,7 @@ > m_annotatedMethod = annotatedMethod; > m_implementedMethod = implementedMethod; > m_superTypeHierarchy = superTypeHierarchy; >+ m_skipRule = skipRule; > } > > /** >@@ -86,4 +88,10 @@ > return m_superTypeHierarchy; > } > >+ /** >+ * @return Returns <code>true</code> if this rule should be skipped. >+ */ >+ public boolean isSkipRule() { >+ return m_skipRule; >+ } > } >Index: src/org/eclipse/scout/sdk/operation/form/formdata/FormDataUtility.java >=================================================================== >--- src/org/eclipse/scout/sdk/operation/form/formdata/FormDataUtility.java (revision 3375) >+++ src/org/eclipse/scout/sdk/operation/form/formdata/FormDataUtility.java (working copy) >@@ -33,6 +33,7 @@ > import org.eclipse.scout.sdk.util.signature.SignatureUtility; > import org.eclipse.scout.sdk.util.type.TypeUtility; > import org.eclipse.scout.sdk.util.typecache.ITypeHierarchy; >+import org.eclipse.scout.sdk.workspace.type.ScoutTypeUtility; > import org.eclipse.text.edits.InsertEdit; > import org.eclipse.text.edits.MultiTextEdit; > >@@ -104,8 +105,13 @@ > public static ITypeSourceBuilder getPrimaryTypeFormDataSourceBuilder(String superTypeSignature, IType formField, ITypeHierarchy hierarchy) { > ITypeSourceBuilder builder = null; > try { >- String typeErasure = Signature.getTypeErasure(superTypeSignature); >- if (Signature.getSignatureSimpleName(typeErasure).equals(Signature.getSimpleName(RuntimeClasses.AbstractTableFieldData))) { >+ IType superType = ScoutTypeUtility.getTypeBySignature(superTypeSignature); >+ ITypeHierarchy superTypeHierarchy = null; >+ if (TypeUtility.exists(superType)) { >+ superTypeHierarchy = TypeUtility.getSuperTypeHierarchy(superType); >+ } >+ >+ if (superTypeHierarchy != null && superTypeHierarchy.contains(TypeUtility.getType(RuntimeClasses.AbstractTableFieldData))) { > builder = new TableFieldSourceBuilder(formField, hierarchy); > } > else { >@@ -119,10 +125,14 @@ > return builder; > } > >- public static ITypeSourceBuilder getInnerTypeFormDataSourceBuilder(String superTypeSignature, IType formField, ITypeHierarchy hierarchy) { >+ public static ITypeSourceBuilder getInnerTypeFormDataSourceBuilder(IType superType, String superTypeSignature, IType formField, ITypeHierarchy hierarchy) { > ITypeSourceBuilder builder = null; >- String typeErasure = Signature.getTypeErasure(superTypeSignature); >- if (Signature.toString(typeErasure).equals(RuntimeClasses.AbstractTableFieldData)) { >+ ITypeHierarchy superTypeHierarchy = null; >+ if (TypeUtility.exists(superType)) { >+ superTypeHierarchy = TypeUtility.getSuperTypeHierarchy(superType); >+ } >+ >+ if (superTypeHierarchy != null && superTypeHierarchy.contains(TypeUtility.getType(RuntimeClasses.AbstractTableFieldData))) { > builder = new TableFieldSourceBuilder(formField, hierarchy); > } > else { >Index: src/org/eclipse/scout/sdk/operation/form/formdata/SourceBuilderWithProperties.java >=================================================================== >--- src/org/eclipse/scout/sdk/operation/form/formdata/SourceBuilderWithProperties.java (revision 3375) >+++ src/org/eclipse/scout/sdk/operation/form/formdata/SourceBuilderWithProperties.java (working copy) >@@ -143,10 +143,42 @@ > protected void addValidationRules(IType type) { > // validation rules > try { >- List<ValidationRuleMethod> list = ScoutTypeUtility.getValidationRuleMethods(type); >+ boolean replaceAnnotationPresent = ScoutTypeUtility.isReplaceAnnotationPresent(type); >+ >+ ITypeHierarchy hierarchy = TypeUtility.getSuperTypeHierarchy(type); >+ if (hierarchy == null) { >+ return; >+ } >+ >+ // If the replace annotation is available, we have to check whether the replaced field >+ // is not associated to a form field data >+ boolean superTypeHasNoFormFieldData = false; >+ if (replaceAnnotationPresent) { >+ IType superType = hierarchy.getSuperclass(type); >+ superTypeHasNoFormFieldData = ScoutTypeUtility.getFormDataType(superType, hierarchy) == null; >+ } >+ >+ List<ValidationRuleMethod> list = ScoutTypeUtility.getValidationRuleMethods(type, hierarchy.getJdtHierarchy()); > if (list.size() > 0) { > for (Iterator<ValidationRuleMethod> it = list.iterator(); it.hasNext();) { > ValidationRuleMethod vm = it.next(); >+ if (replaceAnnotationPresent) { >+ if (superTypeHasNoFormFieldData && vm.isSkipRule()) { >+ it.remove(); >+ continue; >+ } >+ else if (!superTypeHasNoFormFieldData && !type.equals(vm.getImplementedMethod().getDeclaringType())) { >+ // remove all validation rules that are not overridden by the replacement class >+ it.remove(); >+ continue; >+ } >+ } >+ else if (vm.isSkipRule()) { >+ // class does not replace its super class. Hence remove all skipped validation rules >+ it.remove(); >+ continue; >+ } >+ > String generatedSourceCode = vm.getRuleGeneratedSourceCode(); > if (generatedSourceCode != null) { > if (generatedSourceCode.equals("null")) { >@@ -198,7 +230,7 @@ > String generatedSourceCode = vm.getRuleGeneratedSourceCode(); > //filter > generatedSourceCode = filterGeneratedSourceCode(vm.getImplementedMethod(), generatedSourceCode, validator); >- if (generatedSourceCode == null || containsBrackets(generatedSourceCode)) { >+ if (!vm.isSkipRule() && (generatedSourceCode == null || containsBrackets(generatedSourceCode))) { > //add javadoc warning > String fqn = vm.getImplementedMethod().getDeclaringType().getFullyQualifiedName('.') + " # " + vm.getImplementedMethod().getElementName(); > buf.append("/**"); >@@ -224,11 +256,18 @@ > } > // > buf.append(NL); >- buf.append("ruleMap.put("); >- buf.append(ruleDecl); >- buf.append(", "); >- buf.append(generatedSourceCode); >- buf.append(");"); >+ if (vm.isSkipRule()) { >+ buf.append("ruleMap.remove("); >+ buf.append(ruleDecl); >+ buf.append(");"); >+ } >+ else { >+ buf.append("ruleMap.put("); >+ buf.append(ruleDecl); >+ buf.append(", "); >+ buf.append(generatedSourceCode); >+ buf.append(");"); >+ } > } > catch (Exception e) { > String fqn = vm.getImplementedMethod().getDeclaringType().getFullyQualifiedName() + "#" + vm.getImplementedMethod().getElementName(); >Index: src/org/eclipse/scout/sdk/operation/form/formdata/CompositePrimaryTypeSourceBuilder.java >=================================================================== >--- src/org/eclipse/scout/sdk/operation/form/formdata/CompositePrimaryTypeSourceBuilder.java (revision 3375) >+++ src/org/eclipse/scout/sdk/operation/form/formdata/CompositePrimaryTypeSourceBuilder.java (working copy) >@@ -66,20 +66,39 @@ > if (formDataAnnotation != null) { > if (FormDataAnnotation.isCreate(formDataAnnotation)) { > String formDataElementName = FormDataUtility.getBeanName(FormDataUtility.getFieldNameWithoutSuffix(formField.getElementName()), true); >- String superTypeSignature = formDataAnnotation.getSuperTypeSignature(); >- if (formDataAnnotation.getGenericOrdinal() >= 0) { >- IType superType = TypeUtility.getTypeBySignature(superTypeSignature); >- if (TypeUtility.isGenericType(superType)) { >- String genericTypeSig = org.eclipse.scout.sdk.operation.form.formdata.FormDataUtility.computeFormFieldGenericType(formField, formFieldHierarchy); >- if (genericTypeSig != null) { >- superTypeSignature = superTypeSignature.replaceAll("\\;$", "<" + genericTypeSig + ">;"); >+ String superTypeSignature = null; >+ IType superType = null; >+ >+ boolean replaceAnnotationPresent = ScoutTypeUtility.isReplaceAnnotationPresent(formField); >+ if (replaceAnnotationPresent) { >+ IType replacedType = formFieldHierarchy.getSuperclass(formField); >+ IType replacedFormFieldDataType = ScoutTypeUtility.getFormDataType(replacedType, formFieldHierarchy); >+ if (replacedFormFieldDataType != null) { >+ superTypeSignature = Signature.createTypeSignature(replacedFormFieldDataType.getTypeQualifiedName(), false); >+ superType = replacedFormFieldDataType; >+ } >+ } >+ >+ if (superTypeSignature == null) { >+ superTypeSignature = formDataAnnotation.getSuperTypeSignature(); >+ superType = TypeUtility.getTypeBySignature(superTypeSignature); >+ if (formDataAnnotation.getGenericOrdinal() >= 0) { >+ if (TypeUtility.isGenericType(superType)) { >+ String genericTypeSig = org.eclipse.scout.sdk.operation.form.formdata.FormDataUtility.computeFormFieldGenericType(formField, formFieldHierarchy); >+ if (genericTypeSig != null) { >+ superTypeSignature = superTypeSignature.replaceAll("\\;$", "<" + genericTypeSig + ">;"); >+ } > } > } > } >- ITypeSourceBuilder builder = FormDataUtility.getInnerTypeFormDataSourceBuilder(superTypeSignature, formField, formFieldHierarchy); >+ >+ ITypeSourceBuilder builder = FormDataUtility.getInnerTypeFormDataSourceBuilder(superType, superTypeSignature, formField, formFieldHierarchy); > builder.setElementName(formDataElementName); > builder.setSuperTypeSignature(superTypeSignature); > builder.setFlags(Flags.AccPublic | Flags.AccStatic); >+ if (replaceAnnotationPresent) { >+ builder.addAnnotation(new AnnotationSourceBuilder(Signature.createTypeSignature(RuntimeClasses.Replace, true))); >+ } > addBuilder(builder, CATEGORY_TYPE_FIELD); > MethodSourceBuilder getterBuilder = new MethodSourceBuilder(NL); > getterBuilder.setElementName("get" + formDataElementName); >#P org.eclipse.scout.rt.client >Index: src/org/eclipse/scout/rt/client/ui/action/tree/AbstractActionNode.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/action/tree/AbstractActionNode.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/action/tree/AbstractActionNode.java (working copy) >@@ -38,7 +38,8 @@ > */ > private Class<? extends IActionNode>[] getConfiguredChildActions() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IActionNode.class); >+ Class<IActionNode>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IActionNode.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @Override >@@ -65,7 +66,6 @@ > catch (Exception e) { > LOG.error("error occured while dynamically contribute action nodes.", e); > } >- > setChildActions(nodeList); > } > >Index: src/org/eclipse/scout/rt/client/ui/action/AbstractAction.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/action/AbstractAction.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/action/AbstractAction.java (working copy) >@@ -18,6 +18,7 @@ > import org.eclipse.scout.commons.annotations.ConfigProperty; > import org.eclipse.scout.commons.annotations.ConfigPropertyValue; > import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.beans.AbstractPropertyObserver; > import org.eclipse.scout.commons.exception.ProcessingException; > import org.eclipse.scout.commons.logger.IScoutLogger; >@@ -272,7 +273,11 @@ > > @Override > public String getActionId() { >- String s = getClass().getName(); >+ Class<?> c = getClass(); >+ while (c.isAnnotationPresent(Replace.class)) { >+ c = c.getSuperclass(); >+ } >+ String s = c.getName(); > int i = Math.max(s.lastIndexOf('$'), s.lastIndexOf('.')); > s = s.substring(i + 1); > return s; >Index: src/org/eclipse/scout/rt/client/ui/basic/calendar/provider/AbstractCalendarItemProvider.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/calendar/provider/AbstractCalendarItemProvider.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/calendar/provider/AbstractCalendarItemProvider.java (working copy) >@@ -89,7 +89,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > /** >Index: src/org/eclipse/scout/rt/client/ui/basic/calendar/AbstractCalendar.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/calendar/AbstractCalendar.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/calendar/AbstractCalendar.java (working copy) >@@ -94,12 +94,14 @@ > > private Class<? extends ICalendarItemProvider>[] getConfiguredProducers() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, ICalendarItemProvider.class); >+ Class<ICalendarItemProvider>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, ICalendarItemProvider.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @ConfigOperation >@@ -452,7 +454,8 @@ > } > > /** >- * do not use this internal method unless you are implementing a container that holds and controls an {@link ICalendar} >+ * do not use this internal method unless you are implementing a container that holds and controls an >+ * {@link ICalendar} > */ > public void setContainerInternal(Object container) { > propertySupport.setProperty(PROP_CONTAINER, container); >Index: src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTreeNode.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTreeNode.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTreeNode.java (working copy) >@@ -144,7 +144,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class<?>[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > protected void initConfig() { >@@ -607,6 +608,7 @@ > > @Override > public <T extends IMenu> T getMenu(Class<T> menuType) throws ProcessingException { >+ // ActionFinder performs instance-of checks. Hence the menu replacement mapping is not required > return new ActionFinder().findAction(getMenus(), menuType); > } > >Index: src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTree.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTree.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/tree/AbstractTree.java (working copy) >@@ -235,12 +235,14 @@ > > private Class<? extends IKeyStroke>[] getConfiguredKeyStrokes() { > Class<?>[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ Class<IKeyStroke>[] fca = ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class<?>[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @ConfigOperation >@@ -491,6 +493,7 @@ > > @Override > public <T extends IMenu> T getMenu(Class<T> menuType) throws ProcessingException { >+ // ActionFinder performs instance-of checks. Hence the menu replacement mapping is not required > return new ActionFinder().findAction(getMenus(), menuType); > } > >Index: src/org/eclipse/scout/rt/client/ui/basic/activitymap/AbstractActivityMap.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/activitymap/AbstractActivityMap.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/activitymap/AbstractActivityMap.java (working copy) >@@ -137,7 +137,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > /** >Index: src/org/eclipse/scout/rt/client/ui/basic/table/AbstractTable.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/table/AbstractTable.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/table/AbstractTable.java (working copy) >@@ -39,6 +39,7 @@ > import org.eclipse.scout.commons.annotations.ConfigProperty; > import org.eclipse.scout.commons.annotations.ConfigPropertyValue; > import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.beans.AbstractPropertyObserver; > import org.eclipse.scout.commons.dnd.TextTransferObject; > import org.eclipse.scout.commons.dnd.TransferObject; >@@ -109,6 +110,7 @@ > private final HashMap<CompositeObject, ITableRow> m_deletedRows; > private TreeSet<ITableRow/* ordered by rowIndex */> m_selectedRows = new TreeSet<ITableRow>(new RowIndexComparator()); > private IMenu[] m_menus; >+ private Map<Class<?>, Class<? extends IMenu>> m_menuReplacementMapping; > private ITableUIFacade m_uiFacade; > private final ArrayList<ITableRowFilter> m_rowFilters; > private String m_userPreferenceContext; >@@ -702,17 +704,20 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > private Class<? extends IColumn>[] getConfiguredColumns() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IColumn.class); >+ Class<IColumn>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IColumn.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > private Class<? extends IKeyStroke>[] getConfiguredKeyStrokes() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ Class<IKeyStroke>[] fca = ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > protected void initConfig() { >@@ -742,6 +747,10 @@ > // menus > ArrayList<IMenu> menuList = new ArrayList<IMenu>(); > Class<? extends IMenu>[] ma = getConfiguredMenus(); >+ Map<Class<?>, Class<? extends IMenu>> replacements = ConfigurationUtility.getReplacementMapping(ma); >+ if (!replacements.isEmpty()) { >+ m_menuReplacementMapping = replacements; >+ } > for (int i = 0; i < ma.length; i++) { > try { > IMenu menu = ConfigurationUtility.newInnerInstance(this, ma[i]); >@@ -1531,13 +1540,15 @@ > > @Override > public <T extends IMenu> T getMenu(Class<T> menuType) throws ProcessingException { >+ // ActionFinder performs instance-of checks. Hence the menu replacement mapping is not required > return new ActionFinder().findAction(getMenus(), menuType); > } > > @Override > public boolean runMenu(Class<? extends IMenu> menuType) throws ProcessingException { >+ Class<? extends IMenu> c = getReplacingMenuClass(menuType); > for (IMenu m : getMenus()) { >- if (m.getClass() == menuType) { >+ if (m.getClass() == c) { > if (!m.isEnabledProcessingAction()) { > return false; > } >@@ -1557,6 +1568,26 @@ > } > > /** >+ * Checks whether the menu with the given class has been replaced by another menu. If so, the replacing >+ * menu's class is returned. Otherwise the given class itself. >+ * >+ * @param c >+ * @return Returns the possibly available replacing menu class for the given class. >+ * @see Replace >+ * @since 3.8.2 >+ */ >+ private <T extends IMenu> Class<? extends T> getReplacingMenuClass(Class<T> c) { >+ if (m_menuReplacementMapping != null) { >+ @SuppressWarnings("unchecked") >+ Class<? extends T> replacingMenuClass = (Class<? extends T>) m_menuReplacementMapping.get(c); >+ if (replacingMenuClass != null) { >+ return replacingMenuClass; >+ } >+ } >+ return c; >+ } >+ >+ /** > * factory to manage table column filters > * <p> > * default creates a {@link DefaultTableColumnFilterManager} >Index: src/org/eclipse/scout/rt/client/ui/basic/table/ColumnSet.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/table/ColumnSet.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/table/ColumnSet.java (working copy) >@@ -22,6 +22,7 @@ > import org.eclipse.scout.commons.CompareUtility; > import org.eclipse.scout.commons.CompositeObject; > import org.eclipse.scout.commons.ConfigurationUtility; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; > import org.eclipse.scout.rt.client.ui.ClientUIPreferences; >@@ -60,7 +61,23 @@ > */ > private final HashMap<String, IColumn> m_idIndexes = new HashMap<String, IColumn>(); > >+ private final Map<Class<?>, Class<? extends IColumn>> m_columnReplacements; >+ > public ColumnSet(AbstractTable table, Collection<IColumn> columns) { >+ // process @Replace annotations >+ @SuppressWarnings("unchecked") >+ Class<? extends IColumn>[] columnArray = new Class[columns.size()]; >+ int i = 0; >+ for (IColumn c : columns) { >+ columnArray[i] = c.getClass(); >+ i++; >+ } >+ Map<Class<?>, Class<? extends IColumn>> replacements = ConfigurationUtility.getReplacementMapping(columnArray); >+ if (replacements.isEmpty()) { >+ replacements = null; >+ } >+ m_columnReplacements = replacements; >+ // > m_table = table; > m_columns = new IColumn[columns.size()]; > m_userSortColumns = new ArrayList<IColumn>(); >@@ -282,7 +299,8 @@ > > @SuppressWarnings("unchecked") > public <T extends IColumn> T getColumnByClass(Class<T> c) { >- T col = (T) m_classIndexes.get(c); >+ Class<? extends T> columnClass = getReplacingColumnClass(c); >+ T col = (T) m_classIndexes.get(columnClass); > return col; > } > >@@ -291,6 +309,26 @@ > return (T) m_idIndexes.get(id); > } > >+ /** >+ * Checks whether the column with the given class has been replaced by another column. If so, the replacing >+ * column's class is returned. Otherwise the given class itself. >+ * >+ * @param c >+ * @return Returns the possibly available replacing column class for the given class. >+ * @see Replace >+ * @since 3.8.2 >+ */ >+ private <T extends IColumn> Class<? extends T> getReplacingColumnClass(Class<T> c) { >+ if (m_columnReplacements != null) { >+ @SuppressWarnings("unchecked") >+ Class<? extends T> replacingColumnClass = (Class<? extends T>) m_columnReplacements.get(c); >+ if (replacingColumnClass != null) { >+ return replacingColumnClass; >+ } >+ } >+ return c; >+ } >+ > public IColumn getDisplayableColumn(int index) { > if (index >= 0 && index < m_displayableIndexes.length) { > return m_columns[m_displayableIndexes[index]]; >Index: src/org/eclipse/scout/rt/client/ui/basic/table/columns/AbstractColumn.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/basic/table/columns/AbstractColumn.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/basic/table/columns/AbstractColumn.java (working copy) >@@ -25,6 +25,7 @@ > import org.eclipse.scout.commons.annotations.ConfigProperty; > import org.eclipse.scout.commons.annotations.ConfigPropertyValue; > import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.beans.AbstractPropertyObserver; > import org.eclipse.scout.commons.exception.ProcessingException; > import org.eclipse.scout.commons.logger.IScoutLogger; >@@ -828,7 +829,11 @@ > > @Override > public String getColumnId() { >- String s = getClass().getSimpleName(); >+ Class<?> c = getClass(); >+ while (c.isAnnotationPresent(Replace.class)) { >+ c = c.getSuperclass(); >+ } >+ String s = c.getSimpleName(); > if (s.endsWith("Column")) { > s = s.replaceAll("Column$", ""); > } >Index: src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktop.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktop.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktop.java (working copy) >@@ -199,7 +199,8 @@ > > private Class<? extends IAction>[] getConfiguredActions() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, IAction.class); >+ Class<IAction>[] fca = ConfigurationUtility.filterClasses(dca, IAction.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > /** >@@ -619,6 +620,7 @@ > > @Override > public <T extends IMenu> T getMenu(Class<? extends T> searchType) { >+ // ActionFinder performs instance-of checks. Hence the menu replacement mapping is not required > return new ActionFinder().findAction(getMenus(), searchType); > } > >@@ -921,8 +923,11 @@ > > @Override > public void setOutline(Class<? extends IOutline> outlineType) { >+ if (outlineType == null) { >+ return; >+ } > for (IOutline o : getAvailableOutlines()) { >- if (o.getClass() == outlineType) { >+ if (outlineType.isInstance(o)) { > setOutline(o); > return; > } >Index: src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktopExtension.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktopExtension.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/desktop/AbstractDesktopExtension.java (working copy) >@@ -373,7 +373,8 @@ > > private Class<? extends IAction>[] getConfiguredActions() { > Class<?>[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, IAction.class); >+ Class<IAction>[] fca = ConfigurationUtility.filterClasses(dca, IAction.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > } >Index: src/org/eclipse/scout/rt/client/ui/form/DefaultFormFieldInjection.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/DefaultFormFieldInjection.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/DefaultFormFieldInjection.java (working copy) >@@ -1,77 +0,0 @@ >-/******************************************************************************* >- * Copyright (c) 2010 BSI Business Systems Integration AG. >- * All rights reserved. This program and the accompanying materials >- * are 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: >- * BSI Business Systems Integration AG - initial API and implementation >- ******************************************************************************/ >-package org.eclipse.scout.rt.client.ui.form; >- >-import java.util.ArrayList; >-import java.util.List; >- >-import org.eclipse.scout.commons.annotations.InjectFieldTo; >-import org.eclipse.scout.commons.annotations.Order; >-import org.eclipse.scout.rt.client.ui.form.fields.IFormField; >- >-/** >- * Default implementation that inserts the fields at the right place based on their {@link Order} annotation. >- * >- * @since 3.8.1 >- */ >-public class DefaultFormFieldInjection implements IFormFieldInjection { >- private final ArrayList<IFormField> m_list = new ArrayList<IFormField>(); >- >- public void addField(IFormField f) { >- m_list.add(f); >- } >- >- @Override >- public void injectFields(IFormField container, List<IFormField> fieldList) { >- if (container == null || fieldList == null || m_list.isEmpty()) { >- return; >- } >- Class<?> containerClazz = container.getClass(); >- for (IFormField f : m_list) { >- InjectFieldTo ann = f.getClass().getAnnotation(InjectFieldTo.class); >- if (ann == null) { >- continue; >- } >- if (ann.value() != containerClazz) { >- continue; >- } >- insertField(fieldList, f); >- } >- } >- >- /** >- * add the field f to the list at the right place regarding the {@link Order} annotation >- */ >- protected void insertField(List<IFormField> list, IFormField f) { >- //check if list already contains f >- if (list.contains(f)) { >- return; >- } >- Class<?> c = f.getClass(); >- if (!c.isAnnotationPresent(Order.class)) { >- list.add(f); >- return; >- } >- double newOrder = c.getAnnotation(Order.class).value(); >- for (int i = 0, n = list.size(); i < n; i++) { >- Class<?> existingClazz = list.get(i).getClass(); >- if (existingClazz.isAnnotationPresent(Order.class)) { >- double existingOrder = existingClazz.getAnnotation(Order.class).value(); >- if (newOrder < existingOrder) { >- list.add(i, f); >- return; >- } >- } >- } >- //default at end >- list.add(f); >- } >-} >Index: src/org/eclipse/scout/rt/client/ui/form/FormFieldInjectionThreadLocal.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/FormFieldInjectionThreadLocal.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/FormFieldInjectionThreadLocal.java (working copy) >@@ -14,11 +14,12 @@ > import java.util.List; > > import org.eclipse.scout.commons.annotations.InjectFieldTo; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.rt.client.ui.form.fields.AbstractFormField; > import org.eclipse.scout.rt.client.ui.form.fields.IFormField; > > /** >- * Thread local used to inject form fields using the {@link InjectFieldTo} annotation >+ * Thread local used to inject form fields using the {@link InjectFieldTo} and {@link Replace} annotations. > * <p> > * This thread local is used by {@link AbstractForm} and {@link AbstractFormField} to put its contributions. > * <p> >@@ -52,6 +53,17 @@ > > /** > * @param container >+ * is the container field the given field classes are created for >+ * @param fieldList >+ * live and mutable list of configured field classes (i.e. yet not instantiated) >+ * @since 3.8.2 >+ */ >+ public static void filterFields(IFormField container, List<Class<? extends IFormField>> fieldList) { >+ THREAD_LOCAL.get().filterFieldsInternal(container, fieldList); >+ } >+ >+ /** >+ * @param container > * is the container field that is being added potential injected fields > * @param fieldList > * live and mutable list of currently (configured) fields, not yet initialized >@@ -94,4 +106,15 @@ > i.injectFields(container, fieldList); > } > } >+ >+ private void filterFieldsInternal(IFormField container, List<Class<? extends IFormField>> fieldList) { >+ if (m_stack.isEmpty()) { >+ return; >+ } >+ for (IFormFieldInjection i : m_stack) { >+ if (i instanceof IFormFieldInjection2) { >+ ((IFormFieldInjection2) i).filterFields(container, fieldList); >+ } >+ } >+ } > } >Index: src/org/eclipse/scout/rt/client/ui/form/AbstractForm.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/AbstractForm.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/AbstractForm.java (working copy) >@@ -21,8 +21,6 @@ > import java.nio.charset.Charset; > import java.security.Permission; > import java.util.ArrayList; >-import java.util.Arrays; >-import java.util.Comparator; > import java.util.EventListener; > import java.util.HashMap; > import java.util.HashSet; >@@ -139,6 +137,9 @@ > private DataChangeListener m_internalDataChangeListener; > private IEventHistory<FormEvent> m_eventHistory; > >+ // field replacement support >+ private Map<Class<?>, Class<? extends IFormField>> m_fieldReplacements; >+ > public AbstractForm() throws ProcessingException { > this(true); > } >@@ -452,27 +453,7 @@ > > private Class<? extends IFormField>[] getConfiguredInjectedFields() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- Class<IFormField>[] filteredClasses = ConfigurationUtility.filterClassesWithInjectFieldAnnotation(dca, IFormField.class); >- // sort injected fields by enclosing class so that sub classes are before parent classes >- // this order is required so that sub classes may inject fields to other injected fields defined in a super class >- // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=392972 >- Comparator<Class<?>> comparator = new Comparator<Class<?>>() { >- @Override >- public int compare(Class<?> c1, Class<?> c2) { >- Class<?> ec1 = c1.getEnclosingClass(); >- Class<?> ec2 = c2.getEnclosingClass(); >- >- if (ec1 == ec2) { >- return 0; >- } >- if (ec2 != null && ec2.getSuperclass() == ec1) { >- return 1; >- } >- return -1; >- } >- }; >- Arrays.sort(filteredClasses, comparator); >- return filteredClasses; >+ return ConfigurationUtility.filterClassesWithInjectFieldAnnotation(dca, IFormField.class); > } > > protected void initConfig() throws ProcessingException { >@@ -482,25 +463,12 @@ > // prepare injected fields > Class<? extends IFormField>[] fieldArray = getConfiguredInjectedFields(); > DefaultFormFieldInjection injectedFields = null; >- if (fieldArray.length > 0) { >- injectedFields = new DefaultFormFieldInjection(); >- } > IGroupBox rootBox = getRootGroupBox(); > try { >- if (injectedFields != null) { >+ if (fieldArray.length > 0) { >+ injectedFields = new DefaultFormFieldInjection(this); >+ injectedFields.addFields(fieldArray); > FormFieldInjectionThreadLocal.push(injectedFields); >- // create instances of injected fields >- for (Class<? extends IFormField> clazz : fieldArray) { >- try { >- IFormField f = ConfigurationUtility.newInnerInstance(this, clazz); >- if (f != null) { >- injectedFields.addField(f); >- } >- }// end try >- catch (Throwable t) { >- SERVICES.getService(IExceptionHandlerService.class).handleException(new ProcessingException("field: " + clazz.getName(), t)); >- } >- } > } > // > // add mainbox if getter returns null >@@ -517,6 +485,7 @@ > } > finally { > if (injectedFields != null) { >+ m_fieldReplacements = injectedFields.getReplacementMapping(); > FormFieldInjectionThreadLocal.pop(injectedFields); > } > } >@@ -2117,7 +2086,33 @@ > } > > /** >- * Model Observer . >+ * @return Returns a map having old field classes as keys and replacement field classes as values. <code>null</code> is >+ * returned if no form fields are replaced. Do not use this internal method. >+ * @since 3.8.2 >+ */ >+ public Map<Class<?>, Class<? extends IFormField>> getFormFieldReplacementsInternal() { >+ return m_fieldReplacements; >+ } >+ >+ /** >+ * Registers the given form field replacements on this form. Do not use this internal method. >+ * >+ * @param replacements >+ * Map having old field classes as key and replacing field classes as values. >+ * @since 3.8.2 >+ */ >+ public void registerFormFieldReplacementsInternal(Map<Class<?>, Class<? extends IFormField>> replacements) { >+ if (replacements == null || replacements.isEmpty()) { >+ return; >+ } >+ if (m_fieldReplacements == null) { >+ m_fieldReplacements = new HashMap<Class<?>, Class<? extends IFormField>>(); >+ } >+ m_fieldReplacements.putAll(replacements); >+ } >+ >+ /** >+ * Model Observer. > */ > @Override > public void addFormListener(FormListener listener) { >Index: src/org/eclipse/scout/rt/client/ui/form/fields/smartfield/AbstractSmartField.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/smartfield/AbstractSmartField.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/smartfield/AbstractSmartField.java (working copy) >@@ -347,7 +347,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > // override to freeze >Index: src/org/eclipse/scout/rt/client/ui/form/fields/filechooserfield/AbstractFileChooserField.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/filechooserfield/AbstractFileChooserField.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/filechooserfield/AbstractFileChooserField.java (working copy) >@@ -128,7 +128,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class<?>[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @Override >Index: src/org/eclipse/scout/rt/client/ui/form/fields/imagebox/AbstractImageField.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/imagebox/AbstractImageField.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/imagebox/AbstractImageField.java (working copy) >@@ -138,7 +138,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @Override >Index: src/org/eclipse/scout/rt/client/ui/form/fields/AbstractCompositeField.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/AbstractCompositeField.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/AbstractCompositeField.java (working copy) >@@ -14,11 +14,14 @@ > import java.beans.PropertyChangeListener; > import java.util.ArrayList; > import java.util.List; >+import java.util.Map; > > import org.eclipse.scout.commons.ConfigurationUtility; > import org.eclipse.scout.commons.annotations.InjectFieldTo; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.exception.ProcessingException; > import org.eclipse.scout.commons.holders.Holder; >+import org.eclipse.scout.rt.client.ui.form.AbstractForm; > import org.eclipse.scout.rt.client.ui.form.DefaultFormFieldInjection; > import org.eclipse.scout.rt.client.ui.form.FormFieldInjectionThreadLocal; > import org.eclipse.scout.rt.client.ui.form.IForm; >@@ -31,6 +34,7 @@ > public abstract class AbstractCompositeField extends AbstractFormField implements ICompositeField { > > private IFormField[] m_fields; >+ private Map<Class<?>, Class<? extends IFormField>> m_formFieldReplacements; > > public AbstractCompositeField() { > this(true); >@@ -66,21 +70,16 @@ > Class<? extends IFormField>[] fieldArray = getConfiguredFields(); > // prepare injected fields > DefaultFormFieldInjection injectedFields = null; >+ List<Class<? extends IFormField>> configuredFields = new ArrayList<Class<? extends IFormField>>(); > for (Class<? extends IFormField> clazz : fieldArray) { >- if (!clazz.isAnnotationPresent(InjectFieldTo.class)) { >- continue; >- } >- try { >- IFormField f = ConfigurationUtility.newInnerInstance(this, clazz); >- if (f != null) { >- if (injectedFields == null) { >- injectedFields = new DefaultFormFieldInjection(); >- } >- injectedFields.addField(f); >+ if (ConfigurationUtility.isInjectFieldAnnotationPresent(clazz)) { >+ if (injectedFields == null) { >+ injectedFields = new DefaultFormFieldInjection(this); > } >- }// end try >- catch (Throwable t) { >- SERVICES.getService(IExceptionHandlerService.class).handleException(new ProcessingException("field: " + clazz.getName(), t)); >+ injectedFields.addField(clazz); >+ } >+ else { >+ configuredFields.add(clazz); > } > } > ArrayList<IFormField> fieldList = new ArrayList<IFormField>(); >@@ -89,10 +88,8 @@ > FormFieldInjectionThreadLocal.push(injectedFields); > } > // >- for (Class<? extends IFormField> clazz : fieldArray) { >- if (clazz.isAnnotationPresent(InjectFieldTo.class)) { >- continue; >- } >+ filterFieldsInternal(configuredFields); >+ for (Class<? extends IFormField> clazz : configuredFields) { > try { > IFormField f = ConfigurationUtility.newInnerInstance(this, clazz); > fieldList.add(f); >@@ -105,6 +102,7 @@ > } > finally { > if (injectedFields != null) { >+ m_formFieldReplacements = injectedFields.getReplacementMapping(); > FormFieldInjectionThreadLocal.pop(injectedFields); > } > } >@@ -120,6 +118,19 @@ > } > > /** >+ * Filter list of configured fields before they are instantiated. >+ * <p/> >+ * The default implementation removes fields replaced by another field annotated with {@link Replace}. >+ * >+ * @param fieldList >+ * live and mutable list of configured field classes (i.e. yet not instantiated) >+ * @since 3.8.2 >+ */ >+ protected void filterFieldsInternal(List<Class<? extends IFormField>> fieldList) { >+ FormFieldInjectionThreadLocal.filterFields(this, fieldList); >+ } >+ >+ /** > * Override this internal method only in order to make use of dynamic fields<br> > * Used to manage field list and add/remove fields (see {@link AbstractGroupBox} with wizard buttons) > * <p> >@@ -136,6 +147,9 @@ > @Override > public void setFormInternal(IForm form) { > super.setFormInternal(form); >+ if (form instanceof AbstractForm) { >+ ((AbstractForm) form).registerFormFieldReplacementsInternal(m_formFieldReplacements); >+ } > IFormField[] a = m_fields; > for (int i = 0; i < a.length; i++) { > IFormField f = a[i]; >@@ -192,13 +206,14 @@ > } > > @Override >- public <T extends IFormField> T getFieldByClass(final Class<T> c) { >+ public <T extends IFormField> T getFieldByClass(Class<T> c) { >+ final Class<? extends T> formFieldClass = getReplacingFieldClass(c); > final Holder<T> found = new Holder<T>(c); > IFormFieldVisitor v = new IFormFieldVisitor() { > @Override > @SuppressWarnings("unchecked") > public boolean visitField(IFormField field, int level, int fieldIndex) { >- if (field.getClass() == c) { >+ if (field.getClass() == formFieldClass) { > found.setValue((T) field); > } > return found.getValue() == null; >@@ -208,6 +223,30 @@ > return found.getValue(); > } > >+ /** >+ * Checks whether the form field with the given class has been replaced by another form field. If so, the replacing >+ * form field's class is returned. Otherwise the given class itself. >+ * >+ * @param c >+ * @return Returns the possibly available replacing field class for the given class. >+ * @see Replace >+ * @since 3.8.2 >+ */ >+ private <T extends IFormField> Class<? extends T> getReplacingFieldClass(Class<T> c) { >+ IForm form = getForm(); >+ if (form instanceof AbstractForm) { >+ Map<Class<?>, Class<? extends IFormField>> mapping = ((AbstractForm) form).getFormFieldReplacementsInternal(); >+ if (mapping != null) { >+ @SuppressWarnings("unchecked") >+ Class<? extends T> replacementFieldClass = (Class<? extends T>) mapping.get(c); >+ if (replacementFieldClass != null) { >+ return replacementFieldClass; >+ } >+ } >+ } >+ return c; >+ } >+ > @Override > public IFormField[] getFields() { > IFormField[] a = new IFormField[m_fields.length]; >Index: src/org/eclipse/scout/rt/client/ui/form/fields/AbstractFormField.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/AbstractFormField.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/AbstractFormField.java (working copy) >@@ -27,12 +27,12 @@ > import org.eclipse.scout.commons.annotations.FormData; > import org.eclipse.scout.commons.annotations.FormData.SdkCommand; > import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.beans.AbstractPropertyObserver; > import org.eclipse.scout.commons.beans.BasicPropertySupport; > import org.eclipse.scout.commons.exception.IProcessingStatus; > import org.eclipse.scout.commons.exception.ProcessingException; > import org.eclipse.scout.commons.exception.ProcessingStatus; >-import org.eclipse.scout.commons.holders.Holder; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; > import org.eclipse.scout.commons.xmlparser.SimpleXmlElement; >@@ -43,7 +43,6 @@ > import org.eclipse.scout.rt.client.ui.action.keystroke.IKeyStroke; > import org.eclipse.scout.rt.client.ui.desktop.IDesktop; > import org.eclipse.scout.rt.client.ui.form.IForm; >-import org.eclipse.scout.rt.client.ui.form.IFormFieldVisitor; > import org.eclipse.scout.rt.client.ui.form.PrintDevice; > import org.eclipse.scout.rt.client.ui.form.fields.button.IButton; > import org.eclipse.scout.rt.client.ui.form.fields.groupbox.AbstractGroupBox; >@@ -651,7 +650,8 @@ > > private Class<? extends IKeyStroke>[] getConfiguredKeyStrokes() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ Class<IKeyStroke>[] fca = ConfigurationUtility.filterClasses(dca, IKeyStroke.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > @ConfigOperation >@@ -805,24 +805,12 @@ > return getForm().getFieldByClass(c); > } > >- final Holder<T> found = new Holder<T>(c); >- IFormFieldVisitor v = new IFormFieldVisitor() { >- @Override >- @SuppressWarnings("unchecked") >- public boolean visitField(IFormField field, int level, int fieldIndex) { >- if (field.getClass() == c) { >- found.setValue((T) field); >- } >- return found.getValue() == null; >- } >- }; >- > // search requested field within critical parent field > Collections.reverse(enclosingFields); > for (ICompositeField parentField : enclosingFields) { >- parentField.visitFields(v, 0); >- if (found.getValue() != null) { >- return found.getValue(); >+ T field = parentField.getFieldByClass(c); >+ if (field != null) { >+ return field; > } > } > >@@ -1033,7 +1021,11 @@ > > @Override > public String getFieldId() { >- return getClass().getSimpleName(); >+ Class<?> c = getClass(); >+ while (c.isAnnotationPresent(Replace.class)) { >+ c = c.getSuperclass(); >+ } >+ return c.getSimpleName(); > } > > /* >@@ -1736,7 +1728,8 @@ > SERVICES.getService(IExceptionHandlerService.class).handleException(new ProcessingException("keyStroke: " + shortcutArray[i].getName(), t)); > } > } >- return ksMap.values().toArray(new IKeyStroke[ksMap.size()]); >+ List<IKeyStroke> ksList = new ArrayList<IKeyStroke>(ksMap.values()); >+ return ksList.toArray(new IKeyStroke[ksList.size()]); > } > > @Override >Index: src/org/eclipse/scout/rt/client/ui/form/fields/button/AbstractButton.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/fields/button/AbstractButton.java (revision 3402) >+++ src/org/eclipse/scout/rt/client/ui/form/fields/button/AbstractButton.java (working copy) >@@ -210,7 +210,8 @@ > > private Class<? extends IMenu>[] getConfiguredMenus() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ Class<IMenu>[] foca = ConfigurationUtility.sortFilteredClassesByOrderAnnotation(dca, IMenu.class); >+ return ConfigurationUtility.removeReplacedClasses(foca); > } > > @Override >Index: src/org/eclipse/scout/rt/client/ui/form/IFormFieldInjection2.java >=================================================================== >--- src/org/eclipse/scout/rt/client/ui/form/IFormFieldInjection2.java (revision 0) >+++ src/org/eclipse/scout/rt/client/ui/form/IFormFieldInjection2.java (revision 0) >@@ -0,0 +1,33 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.scout.rt.client.ui.form; >+ >+import java.util.List; >+ >+import org.eclipse.scout.rt.client.ui.form.fields.IFormField; >+ >+/** >+ * Interface extension to {@link IFormFieldInjection} that provides additional methods for filtering form fields before >+ * they are initialized. >+ * >+ * @since 3.8.2 >+ */ >+public interface IFormFieldInjection2 extends IFormFieldInjection { >+ >+ /** >+ * @param container >+ * is the container field the given field classes are created for >+ * @param fieldList >+ * live and mutable list of configured field classes (i.e. yet not instantiated) >+ * @since 3.8.2 >+ */ >+ void filterFields(IFormField container, List<Class<? extends IFormField>> fieldList); >+} >#P org.eclipse.scout.rt.extension.client.test.fragment >Index: src/org/eclipse/scout/rt/extension/client/ExtensionUtilityTest.java >=================================================================== >--- src/org/eclipse/scout/rt/extension/client/ExtensionUtilityTest.java (revision 3396) >+++ src/org/eclipse/scout/rt/extension/client/ExtensionUtilityTest.java (working copy) >@@ -34,6 +34,7 @@ > /** > * @since 3.9.0 > */ >+@SuppressWarnings("deprecation") > public class ExtensionUtilityTest { > > private List<Object> m_instanceList; >Index: src/org/eclipse/scout/rt/extension/client/ui/basic/table/ExtensibleTableTest.java >=================================================================== >--- src/org/eclipse/scout/rt/extension/client/ui/basic/table/ExtensibleTableTest.java (revision 3396) >+++ src/org/eclipse/scout/rt/extension/client/ui/basic/table/ExtensibleTableTest.java (working copy) >@@ -22,6 +22,7 @@ > /** > * @since 3.9.0 > */ >+@SuppressWarnings("deprecation") > public class ExtensibleTableTest { > > @Test >#P org.eclipse.scout.sdk.test >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/BaseFormData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/BaseFormData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/BaseFormData.java (revision 0) >@@ -0,0 +1,135 @@ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.rt.shared.data.form.ValidationRule; >+import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; >+import org.eclipse.scout.rt.shared.data.form.AbstractFormData; >+ >+public class BaseFormData extends AbstractFormData { >+ private static final long serialVersionUID = 1L; >+ >+ public BaseFormData() { >+ } >+ >+ public Lookup getLookup() { >+ return getFieldByClass(Lookup.class); >+ } >+ >+ public Name getName() { >+ return getFieldByClass(Name.class); >+ } >+ >+ public SdkCommandCreate getSdkCommandCreate() { >+ return getFieldByClass(SdkCommandCreate.class); >+ } >+ >+ public SdkCommandNone getSdkCommandNone() { >+ return getFieldByClass(SdkCommandNone.class); >+ } >+ >+ public SdkCommandUse getSdkCommandUse() { >+ return getFieldByClass(SdkCommandUse.class); >+ } >+ >+ public Smart getSmart() { >+ return getFieldByClass(Smart.class); >+ } >+ >+ public static class Lookup extends AbstractValueFieldData<Long> { >+ private static final long serialVersionUID = 1L; >+ >+ public Lookup() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.LOOKUP_CALL, TestingLookupCall.class); >+ ruleMap.put(ValidationRule.ZERO_NULL_EQUALITY, true); >+ } >+ } >+ >+ public static class Name extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public Name() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MANDATORY, true); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 60); >+ } >+ } >+ >+ public static class SdkCommandCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ public static class SdkCommandNone extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNone() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ public static class SdkCommandUse extends UsingFormFieldData { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUse() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ public static class Smart extends AbstractValueFieldData<Long> { >+ private static final long serialVersionUID = 1L; >+ >+ public Smart() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.CODE_TYPE, TestingCodeType.class); >+ ruleMap.put(ValidationRule.ZERO_NULL_EQUALITY, true); >+ } >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedExtendedFormData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedExtendedFormData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedExtendedFormData.java (revision 0) >@@ -0,0 +1,848 @@ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.rt.shared.data.form.ValidationRule; >+import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; >+import org.eclipse.scout.rt.shared.data.form.properties.AbstractPropertyData; >+ >+public class ExtendedExtendedFormData extends ExtendedFormData { >+ private static final long serialVersionUID = 1L; >+ >+ public ExtendedExtendedFormData() { >+ } >+ >+ public IgnoringGroupBoxExCreateNone getIgnoringGroupBoxExCreateNone() { >+ return getFieldByClass(IgnoringGroupBoxExCreateNone.class); >+ } >+ >+ public IgnoringGroupBoxExNoneCreate getIgnoringGroupBoxExNoneCreate() { >+ return getFieldByClass(IgnoringGroupBoxExNoneCreate.class); >+ } >+ >+ public NameExEx getNameExEx() { >+ return getFieldByClass(NameExEx.class); >+ } >+ >+ public SdkCommandCreateCreateCreate getSdkCommandCreateCreateCreate() { >+ return getFieldByClass(SdkCommandCreateCreateCreate.class); >+ } >+ >+ public SdkCommandCreateCreateIgnore getSdkCommandCreateCreateIgnore() { >+ return getFieldByClass(SdkCommandCreateCreateIgnore.class); >+ } >+ >+ public SdkCommandCreateCreateNone getSdkCommandCreateCreateNone() { >+ return getFieldByClass(SdkCommandCreateCreateNone.class); >+ } >+ >+ public SdkCommandCreateCreateUse getSdkCommandCreateCreateUse() { >+ return getFieldByClass(SdkCommandCreateCreateUse.class); >+ } >+ >+ public SdkCommandCreateIgnoreCreate getSdkCommandCreateIgnoreCreate() { >+ return getFieldByClass(SdkCommandCreateIgnoreCreate.class); >+ } >+ >+ public SdkCommandCreateIgnoreIgnore getSdkCommandCreateIgnoreIgnore() { >+ return getFieldByClass(SdkCommandCreateIgnoreIgnore.class); >+ } >+ >+ public SdkCommandCreateIgnoreNone getSdkCommandCreateIgnoreNone() { >+ return getFieldByClass(SdkCommandCreateIgnoreNone.class); >+ } >+ >+ public SdkCommandCreateIgnoreUse getSdkCommandCreateIgnoreUse() { >+ return getFieldByClass(SdkCommandCreateIgnoreUse.class); >+ } >+ >+ public SdkCommandCreateNoneCreate getSdkCommandCreateNoneCreate() { >+ return getFieldByClass(SdkCommandCreateNoneCreate.class); >+ } >+ >+ public SdkCommandCreateNoneIgnore getSdkCommandCreateNoneIgnore() { >+ return getFieldByClass(SdkCommandCreateNoneIgnore.class); >+ } >+ >+ public SdkCommandCreateNoneNone getSdkCommandCreateNoneNone() { >+ return getFieldByClass(SdkCommandCreateNoneNone.class); >+ } >+ >+ public SdkCommandCreateNoneUse getSdkCommandCreateNoneUse() { >+ return getFieldByClass(SdkCommandCreateNoneUse.class); >+ } >+ >+ public SdkCommandCreateUseCreate getSdkCommandCreateUseCreate() { >+ return getFieldByClass(SdkCommandCreateUseCreate.class); >+ } >+ >+ public SdkCommandCreateUseIgnore getSdkCommandCreateUseIgnore() { >+ return getFieldByClass(SdkCommandCreateUseIgnore.class); >+ } >+ >+ public SdkCommandCreateUseNone getSdkCommandCreateUseNone() { >+ return getFieldByClass(SdkCommandCreateUseNone.class); >+ } >+ >+ public SdkCommandCreateUseUse getSdkCommandCreateUseUse() { >+ return getFieldByClass(SdkCommandCreateUseUse.class); >+ } >+ >+ public SdkCommandIgnoreCreateCreate getSdkCommandIgnoreCreateCreate() { >+ return getFieldByClass(SdkCommandIgnoreCreateCreate.class); >+ } >+ >+ public SdkCommandIgnoreCreateIgnore getSdkCommandIgnoreCreateIgnore() { >+ return getFieldByClass(SdkCommandIgnoreCreateIgnore.class); >+ } >+ >+ public SdkCommandIgnoreCreateNone getSdkCommandIgnoreCreateNone() { >+ return getFieldByClass(SdkCommandIgnoreCreateNone.class); >+ } >+ >+ public SdkCommandIgnoreCreateUse getSdkCommandIgnoreCreateUse() { >+ return getFieldByClass(SdkCommandIgnoreCreateUse.class); >+ } >+ >+ public SdkCommandIgnoreIgnoreCreate getSdkCommandIgnoreIgnoreCreate() { >+ return getFieldByClass(SdkCommandIgnoreIgnoreCreate.class); >+ } >+ >+ public SdkCommandIgnoreIgnoreUse getSdkCommandIgnoreIgnoreUse() { >+ return getFieldByClass(SdkCommandIgnoreIgnoreUse.class); >+ } >+ >+ public SdkCommandIgnoreNoneCreate getSdkCommandIgnoreNoneCreate() { >+ return getFieldByClass(SdkCommandIgnoreNoneCreate.class); >+ } >+ >+ public SdkCommandIgnoreNoneUse getSdkCommandIgnoreNoneUse() { >+ return getFieldByClass(SdkCommandIgnoreNoneUse.class); >+ } >+ >+ public SdkCommandIgnoreUseCreate getSdkCommandIgnoreUseCreate() { >+ return getFieldByClass(SdkCommandIgnoreUseCreate.class); >+ } >+ >+ public SdkCommandIgnoreUseIgnore getSdkCommandIgnoreUseIgnore() { >+ return getFieldByClass(SdkCommandIgnoreUseIgnore.class); >+ } >+ >+ public SdkCommandIgnoreUseNone getSdkCommandIgnoreUseNone() { >+ return getFieldByClass(SdkCommandIgnoreUseNone.class); >+ } >+ >+ public SdkCommandIgnoreUseUse getSdkCommandIgnoreUseUse() { >+ return getFieldByClass(SdkCommandIgnoreUseUse.class); >+ } >+ >+ public SdkCommandNoneCreateCreate getSdkCommandNoneCreateCreate() { >+ return getFieldByClass(SdkCommandNoneCreateCreate.class); >+ } >+ >+ public SdkCommandNoneCreateIgnore getSdkCommandNoneCreateIgnore() { >+ return getFieldByClass(SdkCommandNoneCreateIgnore.class); >+ } >+ >+ public SdkCommandNoneCreateNone getSdkCommandNoneCreateNone() { >+ return getFieldByClass(SdkCommandNoneCreateNone.class); >+ } >+ >+ public SdkCommandNoneCreateUse getSdkCommandNoneCreateUse() { >+ return getFieldByClass(SdkCommandNoneCreateUse.class); >+ } >+ >+ public SdkCommandNoneIgnoreCreate getSdkCommandNoneIgnoreCreate() { >+ return getFieldByClass(SdkCommandNoneIgnoreCreate.class); >+ } >+ >+ public SdkCommandNoneIgnoreIgnore getSdkCommandNoneIgnoreIgnore() { >+ return getFieldByClass(SdkCommandNoneIgnoreIgnore.class); >+ } >+ >+ public SdkCommandNoneIgnoreNone getSdkCommandNoneIgnoreNone() { >+ return getFieldByClass(SdkCommandNoneIgnoreNone.class); >+ } >+ >+ public SdkCommandNoneIgnoreUse getSdkCommandNoneIgnoreUse() { >+ return getFieldByClass(SdkCommandNoneIgnoreUse.class); >+ } >+ >+ public SdkCommandNoneNoneCreate getSdkCommandNoneNoneCreate() { >+ return getFieldByClass(SdkCommandNoneNoneCreate.class); >+ } >+ >+ public SdkCommandNoneNoneIgnore getSdkCommandNoneNoneIgnore() { >+ return getFieldByClass(SdkCommandNoneNoneIgnore.class); >+ } >+ >+ public SdkCommandNoneNoneNone getSdkCommandNoneNoneNone() { >+ return getFieldByClass(SdkCommandNoneNoneNone.class); >+ } >+ >+ public SdkCommandNoneNoneUse getSdkCommandNoneNoneUse() { >+ return getFieldByClass(SdkCommandNoneNoneUse.class); >+ } >+ >+ public SdkCommandNoneUseCreate getSdkCommandNoneUseCreate() { >+ return getFieldByClass(SdkCommandNoneUseCreate.class); >+ } >+ >+ public SdkCommandNoneUseIgnore getSdkCommandNoneUseIgnore() { >+ return getFieldByClass(SdkCommandNoneUseIgnore.class); >+ } >+ >+ public SdkCommandNoneUseNone getSdkCommandNoneUseNone() { >+ return getFieldByClass(SdkCommandNoneUseNone.class); >+ } >+ >+ public SdkCommandNoneUseUse getSdkCommandNoneUseUse() { >+ return getFieldByClass(SdkCommandNoneUseUse.class); >+ } >+ >+ public SdkCommandUseCreateCreate getSdkCommandUseCreateCreate() { >+ return getFieldByClass(SdkCommandUseCreateCreate.class); >+ } >+ >+ public SdkCommandUseCreateIgnore getSdkCommandUseCreateIgnore() { >+ return getFieldByClass(SdkCommandUseCreateIgnore.class); >+ } >+ >+ public SdkCommandUseCreateNone getSdkCommandUseCreateNone() { >+ return getFieldByClass(SdkCommandUseCreateNone.class); >+ } >+ >+ public SdkCommandUseCreateUse getSdkCommandUseCreateUse() { >+ return getFieldByClass(SdkCommandUseCreateUse.class); >+ } >+ >+ public SdkCommandUseIgnoreCreate getSdkCommandUseIgnoreCreate() { >+ return getFieldByClass(SdkCommandUseIgnoreCreate.class); >+ } >+ >+ public SdkCommandUseIgnoreIgnore getSdkCommandUseIgnoreIgnore() { >+ return getFieldByClass(SdkCommandUseIgnoreIgnore.class); >+ } >+ >+ public SdkCommandUseIgnoreNone getSdkCommandUseIgnoreNone() { >+ return getFieldByClass(SdkCommandUseIgnoreNone.class); >+ } >+ >+ public SdkCommandUseIgnoreUse getSdkCommandUseIgnoreUse() { >+ return getFieldByClass(SdkCommandUseIgnoreUse.class); >+ } >+ >+ public SdkCommandUseNoneCreate getSdkCommandUseNoneCreate() { >+ return getFieldByClass(SdkCommandUseNoneCreate.class); >+ } >+ >+ public SdkCommandUseNoneIgnore getSdkCommandUseNoneIgnore() { >+ return getFieldByClass(SdkCommandUseNoneIgnore.class); >+ } >+ >+ public SdkCommandUseNoneNone getSdkCommandUseNoneNone() { >+ return getFieldByClass(SdkCommandUseNoneNone.class); >+ } >+ >+ public SdkCommandUseNoneUse getSdkCommandUseNoneUse() { >+ return getFieldByClass(SdkCommandUseNoneUse.class); >+ } >+ >+ public SdkCommandUseUseCreate getSdkCommandUseUseCreate() { >+ return getFieldByClass(SdkCommandUseUseCreate.class); >+ } >+ >+ public SdkCommandUseUseIgnore getSdkCommandUseUseIgnore() { >+ return getFieldByClass(SdkCommandUseUseIgnore.class); >+ } >+ >+ public SdkCommandUseUseNone getSdkCommandUseUseNone() { >+ return getFieldByClass(SdkCommandUseUseNone.class); >+ } >+ >+ public SdkCommandUseUseUse getSdkCommandUseUseUse() { >+ return getFieldByClass(SdkCommandUseUseUse.class); >+ } >+ >+ @Replace >+ public static class IgnoringGroupBoxExCreateNone extends ExtendedFormData.IgnoringGroupBoxExCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public IgnoringGroupBoxExCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class IgnoringGroupBoxExNoneCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public IgnoringGroupBoxExNoneCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class NameExEx extends ExtendedFormData.NameEx { >+ private static final long serialVersionUID = 1L; >+ >+ public NameExEx() { >+ } >+ >+ public StringPropertyProperty getStringPropertyProperty() { >+ return getPropertyByClass(StringPropertyProperty.class); >+ } >+ >+ /** >+ * access method for property StringProperty. >+ */ >+ public String getStringProperty() { >+ return getStringPropertyProperty().getValue(); >+ } >+ >+ /** >+ * access method for property StringProperty. >+ */ >+ public void setStringProperty(String stringProperty) { >+ getStringPropertyProperty().setValue(stringProperty); >+ } >+ >+ public class StringPropertyProperty extends AbstractPropertyData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public StringPropertyProperty() { >+ } >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 15); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateCreateCreate extends ExtendedFormData.SdkCommandCreateCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateCreateCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateCreateIgnore extends ExtendedFormData.SdkCommandCreateCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateCreateIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateCreateNone extends ExtendedFormData.SdkCommandCreateCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateCreateUse extends ExtendedFormData.SdkCommandCreateCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateCreateUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateIgnoreCreate extends ExtendedFormData.SdkCommandCreateIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateIgnoreCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateIgnoreIgnore extends ExtendedFormData.SdkCommandCreateIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateIgnoreIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateIgnoreNone extends ExtendedFormData.SdkCommandCreateIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateIgnoreNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateIgnoreUse extends ExtendedFormData.SdkCommandCreateIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateIgnoreUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateNoneCreate extends ExtendedFormData.SdkCommandCreateNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateNoneCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateNoneIgnore extends ExtendedFormData.SdkCommandCreateNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateNoneIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateNoneNone extends ExtendedFormData.SdkCommandCreateNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateNoneNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateNoneUse extends ExtendedFormData.SdkCommandCreateNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateNoneUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateUseCreate extends ExtendedFormData.SdkCommandCreateUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateUseCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateUseIgnore extends ExtendedFormData.SdkCommandCreateUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateUseIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateUseNone extends ExtendedFormData.SdkCommandCreateUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateUseNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateUseUse extends ExtendedFormData.SdkCommandCreateUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateUseUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreCreateCreate extends ExtendedFormData.SdkCommandIgnoreCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreCreateCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreCreateIgnore extends ExtendedFormData.SdkCommandIgnoreCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreCreateIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreCreateNone extends ExtendedFormData.SdkCommandIgnoreCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreCreateUse extends ExtendedFormData.SdkCommandIgnoreCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreCreateUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreIgnoreCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreIgnoreCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreIgnoreUse extends UsingFormFieldData { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreIgnoreUse() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreNoneCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreNoneCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreNoneUse extends UsingFormFieldData { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreNoneUse() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreUseCreate extends ExtendedFormData.SdkCommandIgnoreUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreUseCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreUseIgnore extends ExtendedFormData.SdkCommandIgnoreUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreUseIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreUseNone extends ExtendedFormData.SdkCommandIgnoreUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreUseNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreUseUse extends ExtendedFormData.SdkCommandIgnoreUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreUseUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneCreateCreate extends ExtendedFormData.SdkCommandNoneCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneCreateCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneCreateIgnore extends ExtendedFormData.SdkCommandNoneCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneCreateIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneCreateNone extends ExtendedFormData.SdkCommandNoneCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneCreateUse extends ExtendedFormData.SdkCommandNoneCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneCreateUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneIgnoreCreate extends ExtendedFormData.SdkCommandNoneIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneIgnoreCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneIgnoreIgnore extends ExtendedFormData.SdkCommandNoneIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneIgnoreIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneIgnoreNone extends ExtendedFormData.SdkCommandNoneIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneIgnoreNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneIgnoreUse extends ExtendedFormData.SdkCommandNoneIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneIgnoreUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneNoneCreate extends ExtendedFormData.SdkCommandNoneNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneNoneCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneNoneIgnore extends ExtendedFormData.SdkCommandNoneNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneNoneIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneNoneNone extends ExtendedFormData.SdkCommandNoneNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneNoneNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneNoneUse extends ExtendedFormData.SdkCommandNoneNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneNoneUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneUseCreate extends ExtendedFormData.SdkCommandNoneUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneUseCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneUseIgnore extends ExtendedFormData.SdkCommandNoneUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneUseIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneUseNone extends ExtendedFormData.SdkCommandNoneUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneUseNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneUseUse extends ExtendedFormData.SdkCommandNoneUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneUseUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseCreateCreate extends ExtendedFormData.SdkCommandUseCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseCreateCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseCreateIgnore extends ExtendedFormData.SdkCommandUseCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseCreateIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseCreateNone extends ExtendedFormData.SdkCommandUseCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseCreateUse extends ExtendedFormData.SdkCommandUseCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseCreateUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseIgnoreCreate extends ExtendedFormData.SdkCommandUseIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseIgnoreCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseIgnoreIgnore extends ExtendedFormData.SdkCommandUseIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseIgnoreIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseIgnoreNone extends ExtendedFormData.SdkCommandUseIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseIgnoreNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseIgnoreUse extends ExtendedFormData.SdkCommandUseIgnore { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseIgnoreUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseNoneCreate extends ExtendedFormData.SdkCommandUseNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseNoneCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseNoneIgnore extends ExtendedFormData.SdkCommandUseNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseNoneIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseNoneNone extends ExtendedFormData.SdkCommandUseNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseNoneNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseNoneUse extends ExtendedFormData.SdkCommandUseNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseNoneUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseUseCreate extends ExtendedFormData.SdkCommandUseUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseUseCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseUseIgnore extends ExtendedFormData.SdkCommandUseUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseUseIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseUseNone extends ExtendedFormData.SdkCommandUseUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseUseNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseUseUse extends ExtendedFormData.SdkCommandUseUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseUseUse() { >+ } >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedFormData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedFormData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/ExtendedFormData.java (revision 0) >@@ -0,0 +1,302 @@ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.rt.shared.data.form.ValidationRule; >+import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; >+ >+public class ExtendedFormData extends BaseFormData { >+ private static final long serialVersionUID = 1L; >+ >+ public ExtendedFormData() { >+ } >+ >+ public FirstName getFirstName() { >+ return getFieldByClass(FirstName.class); >+ } >+ >+ public IgnoringGroupBoxExCreate getIgnoringGroupBoxExCreate() { >+ return getFieldByClass(IgnoringGroupBoxExCreate.class); >+ } >+ >+ public IgnoringGroupBoxExUse getIgnoringGroupBoxExUse() { >+ return getFieldByClass(IgnoringGroupBoxExUse.class); >+ } >+ >+ public NameEx getNameEx() { >+ return getFieldByClass(NameEx.class); >+ } >+ >+ public SdkCommandCreateCreate getSdkCommandCreateCreate() { >+ return getFieldByClass(SdkCommandCreateCreate.class); >+ } >+ >+ public SdkCommandCreateIgnore getSdkCommandCreateIgnore() { >+ return getFieldByClass(SdkCommandCreateIgnore.class); >+ } >+ >+ public SdkCommandCreateNone getSdkCommandCreateNone() { >+ return getFieldByClass(SdkCommandCreateNone.class); >+ } >+ >+ public SdkCommandCreateUse getSdkCommandCreateUse() { >+ return getFieldByClass(SdkCommandCreateUse.class); >+ } >+ >+ public SdkCommandIgnoreCreate getSdkCommandIgnoreCreate() { >+ return getFieldByClass(SdkCommandIgnoreCreate.class); >+ } >+ >+ public SdkCommandIgnoreUse getSdkCommandIgnoreUse() { >+ return getFieldByClass(SdkCommandIgnoreUse.class); >+ } >+ >+ public SdkCommandNoneCreate getSdkCommandNoneCreate() { >+ return getFieldByClass(SdkCommandNoneCreate.class); >+ } >+ >+ public SdkCommandNoneIgnore getSdkCommandNoneIgnore() { >+ return getFieldByClass(SdkCommandNoneIgnore.class); >+ } >+ >+ public SdkCommandNoneNone getSdkCommandNoneNone() { >+ return getFieldByClass(SdkCommandNoneNone.class); >+ } >+ >+ public SdkCommandNoneUse getSdkCommandNoneUse() { >+ return getFieldByClass(SdkCommandNoneUse.class); >+ } >+ >+ public SdkCommandUseCreate getSdkCommandUseCreate() { >+ return getFieldByClass(SdkCommandUseCreate.class); >+ } >+ >+ public SdkCommandUseIgnore getSdkCommandUseIgnore() { >+ return getFieldByClass(SdkCommandUseIgnore.class); >+ } >+ >+ public SdkCommandUseNone getSdkCommandUseNone() { >+ return getFieldByClass(SdkCommandUseNone.class); >+ } >+ >+ public SdkCommandUseUse getSdkCommandUseUse() { >+ return getFieldByClass(SdkCommandUseUse.class); >+ } >+ >+ public SmartEx getSmartEx() { >+ return getFieldByClass(SmartEx.class); >+ } >+ >+ public static class FirstName extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public FirstName() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class IgnoringGroupBoxExCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public IgnoringGroupBoxExCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class IgnoringGroupBoxExUse extends UsingFormFieldData { >+ private static final long serialVersionUID = 1L; >+ >+ public IgnoringGroupBoxExUse() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class NameEx extends BaseFormData.Name { >+ private static final long serialVersionUID = 1L; >+ >+ public NameEx() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 100); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateCreate extends BaseFormData.SdkCommandCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateIgnore extends BaseFormData.SdkCommandCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateNone extends BaseFormData.SdkCommandCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandCreateUse extends BaseFormData.SdkCommandCreate { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandCreateUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreCreate extends AbstractValueFieldData<String> { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreCreate() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandIgnoreUse extends UsingFormFieldData { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandIgnoreUse() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.put(ValidationRule.MAX_LENGTH, 4000); >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneCreate extends BaseFormData.SdkCommandNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneIgnore extends BaseFormData.SdkCommandNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneNone extends BaseFormData.SdkCommandNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandNoneUse extends BaseFormData.SdkCommandNone { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandNoneUse() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseCreate extends BaseFormData.SdkCommandUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseCreate() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseIgnore extends BaseFormData.SdkCommandUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseIgnore() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseNone extends BaseFormData.SdkCommandUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseNone() { >+ } >+ } >+ >+ @Replace >+ public static class SdkCommandUseUse extends BaseFormData.SdkCommandUse { >+ private static final long serialVersionUID = 1L; >+ >+ public SdkCommandUseUse() { >+ } >+ } >+ >+ @Replace >+ public static class SmartEx extends BaseFormData.Smart { >+ private static final long serialVersionUID = 1L; >+ >+ public SmartEx() { >+ } >+ >+ /** >+ * list of derived validation rules. >+ */ >+ @Override >+ protected void initValidationRules(java.util.Map<String, Object> ruleMap) { >+ super.initValidationRules(ruleMap); >+ ruleMap.remove(ValidationRule.CODE_TYPE); >+ } >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldBaseFormData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldBaseFormData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldBaseFormData.java (revision 0) >@@ -0,0 +1,158 @@ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.rt.shared.data.basic.table.AbstractTableRowData; >+import org.eclipse.scout.rt.shared.data.form.AbstractFormData; >+import org.eclipse.scout.rt.shared.data.form.fields.tablefield.AbstractTableFieldBeanData; >+ >+public class TableFieldBaseFormData extends AbstractFormData { >+ private static final long serialVersionUID = 1L; >+ >+ public TableFieldBaseFormData() { >+ } >+ >+ public EmptyTable getEmptyTable() { >+ return getFieldByClass(EmptyTable.class); >+ } >+ >+ public NoTable getNoTable() { >+ return getFieldByClass(NoTable.class); >+ } >+ >+ public Table getTable() { >+ return getFieldByClass(Table.class); >+ } >+ >+ public static class EmptyTable extends AbstractTableFieldBeanData { >+ private static final long serialVersionUID = 1L; >+ >+ public EmptyTable() { >+ } >+ >+ @Override >+ public EmptyTableRowData addRow(int rowState) { >+ return (EmptyTableRowData) super.addRow(rowState); >+ } >+ >+ @Override >+ public EmptyTableRowData addRow() { >+ return (EmptyTableRowData) super.addRow(); >+ } >+ >+ @Override >+ public EmptyTableRowData createRow() { >+ return new EmptyTableRowData(); >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return EmptyTableRowData.class; >+ } >+ >+ @Override >+ public EmptyTableRowData[] getRows() { >+ return (EmptyTableRowData[]) super.getRows(); >+ } >+ >+ @Override >+ public EmptyTableRowData rowAt(int idx) { >+ return (EmptyTableRowData) super.rowAt(idx); >+ } >+ >+ public void setRows(EmptyTableRowData[] rows) { >+ super.setRows(rows); >+ } >+ >+ public static class EmptyTableRowData extends AbstractTableRowData { >+ private static final long serialVersionUID = 1L; >+ >+ public EmptyTableRowData() { >+ } >+ } >+ } >+ >+ public static class NoTable extends AbstractTableFieldBeanData { >+ private static final long serialVersionUID = 1L; >+ >+ public NoTable() { >+ } >+ >+ @Override >+ public AbstractTableRowData createRow() { >+ return new AbstractTableRowData() { >+ private static final long serialVersionUID = 1L; >+ }; >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return AbstractTableRowData.class; >+ } >+ } >+ >+ public static class Table extends AbstractTableFieldBeanData { >+ private static final long serialVersionUID = 1L; >+ >+ public Table() { >+ } >+ >+ @Override >+ public TableRowData addRow() { >+ return (TableRowData) super.addRow(); >+ } >+ >+ @Override >+ public TableRowData addRow(int rowState) { >+ return (TableRowData) super.addRow(rowState); >+ } >+ >+ @Override >+ public TableRowData createRow() { >+ return new TableRowData(); >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return TableRowData.class; >+ } >+ >+ @Override >+ public TableRowData[] getRows() { >+ return (TableRowData[]) super.getRows(); >+ } >+ >+ @Override >+ public TableRowData rowAt(int idx) { >+ return (TableRowData) super.rowAt(idx); >+ } >+ >+ public void setRows(TableRowData[] rows) { >+ super.setRows(rows); >+ } >+ >+ public static class TableRowData extends AbstractTableRowData { >+ private static final long serialVersionUID = 1L; >+ >+ public TableRowData() { >+ } >+ >+ private String m_first; >+ private String m_second; >+ >+ public String getFirst() { >+ return m_first; >+ } >+ >+ public void setFirst(String first) { >+ m_first = first; >+ } >+ >+ public String getSecond() { >+ return m_second; >+ } >+ >+ public void setSecond(String second) { >+ m_second = second; >+ } >+ } >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldExFormData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldExFormData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TableFieldExFormData.java (revision 0) >@@ -0,0 +1,200 @@ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.rt.shared.data.basic.table.AbstractTableRowData; >+ >+public class TableFieldExFormData extends TableFieldBaseFormData { >+ private static final long serialVersionUID = 1L; >+ >+ public TableFieldExFormData() { >+ } >+ >+ public EmptyTableExtended getEmptyTableExtended() { >+ return getFieldByClass(EmptyTableExtended.class); >+ } >+ >+ public NoTableExtended getNoTableExtended() { >+ return getFieldByClass(NoTableExtended.class); >+ } >+ >+ public TableExtended getTableExtended() { >+ return getFieldByClass(TableExtended.class); >+ } >+ >+ @Replace >+ public static class EmptyTableExtended extends TableFieldBaseFormData.EmptyTable { >+ private static final long serialVersionUID = 1L; >+ >+ public EmptyTableExtended() { >+ } >+ >+ @Override >+ public TableExRowData addRow() { >+ return (TableExRowData) super.addRow(); >+ } >+ >+ @Override >+ public TableExRowData addRow(int rowState) { >+ return (TableExRowData) super.addRow(rowState); >+ } >+ >+ @Override >+ public TableExRowData createRow() { >+ return new TableExRowData(); >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return TableExRowData.class; >+ } >+ >+ @Override >+ public TableExRowData[] getRows() { >+ return (TableExRowData[]) super.getRows(); >+ } >+ >+ @Override >+ public TableExRowData rowAt(int idx) { >+ return (TableExRowData) super.rowAt(idx); >+ } >+ >+ public void setRows(TableExRowData[] rows) { >+ super.setRows(rows); >+ } >+ >+ public static class TableExRowData extends TableFieldBaseFormData.EmptyTable.EmptyTableRowData { >+ private static final long serialVersionUID = 1L; >+ >+ public TableExRowData() { >+ } >+ >+ private String m_single; >+ >+ public void setSingle(String single) { >+ m_single = single; >+ } >+ >+ public String getSingle() { >+ return m_single; >+ } >+ } >+ } >+ >+ @Replace >+ public static class NoTableExtended extends TableFieldBaseFormData.NoTable { >+ private static final long serialVersionUID = 1L; >+ >+ public NoTableExtended() { >+ } >+ >+ @Override >+ public NoTableExtendedRowData addRow() { >+ return (NoTableExtendedRowData) super.addRow(); >+ } >+ >+ @Override >+ public NoTableExtendedRowData addRow(int rowState) { >+ return (NoTableExtendedRowData) super.addRow(rowState); >+ } >+ >+ @Override >+ public NoTableExtendedRowData createRow() { >+ return new NoTableExtendedRowData(); >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return NoTableExtendedRowData.class; >+ } >+ >+ @Override >+ public NoTableExtendedRowData[] getRows() { >+ return (NoTableExtendedRowData[]) super.getRows(); >+ } >+ >+ @Override >+ public NoTableExtendedRowData rowAt(int idx) { >+ return (NoTableExtendedRowData) super.rowAt(idx); >+ } >+ >+ public void setRows(NoTableExtendedRowData[] rows) { >+ super.setRows(rows); >+ } >+ >+ public static class NoTableExtendedRowData extends AbstractTableRowData { >+ private static final long serialVersionUID = 1L; >+ >+ public NoTableExtendedRowData() { >+ } >+ >+ private String m_newValue; >+ >+ public void setNew(String newValue) { >+ m_newValue = newValue; >+ } >+ >+ public String getNew() { >+ return m_newValue; >+ } >+ } >+ } >+ >+ @Replace >+ public static class TableExtended extends TableFieldBaseFormData.Table { >+ private static final long serialVersionUID = 1L; >+ >+ public TableExtended() { >+ } >+ >+ @Override >+ public TableExRowData addRow(int rowState) { >+ return (TableExRowData) super.addRow(rowState); >+ } >+ >+ @Override >+ public TableExRowData addRow() { >+ return (TableExRowData) super.addRow(); >+ } >+ >+ @Override >+ public TableExRowData createRow() { >+ return new TableExRowData(); >+ } >+ >+ @Override >+ public Class<? extends AbstractTableRowData> getRowType() { >+ return TableExRowData.class; >+ } >+ >+ @Override >+ public TableExRowData[] getRows() { >+ return (TableExRowData[]) super.getRows(); >+ } >+ >+ @Override >+ public TableExRowData rowAt(int idx) { >+ return (TableExRowData) super.rowAt(idx); >+ } >+ >+ public void setRows(TableExRowData[] rows) { >+ super.setRows(rows); >+ } >+ >+ public static class TableExRowData extends TableFieldBaseFormData.Table.TableRowData { >+ private static final long serialVersionUID = 1L; >+ >+ public TableExRowData() { >+ } >+ >+ private Boolean m_booleanValue; >+ >+ public void setBoolean(Boolean booleanValue) { >+ m_booleanValue = booleanValue; >+ } >+ >+ public Boolean getBoolean() { >+ return m_booleanValue; >+ } >+ } >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingCodeType.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingCodeType.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingCodeType.java (revision 0) >@@ -0,0 +1,23 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.rt.shared.services.common.code.AbstractCodeType; >+ >+public class TestingCodeType extends AbstractCodeType<Long> { >+ >+ private static final long serialVersionUID = 1L; >+ >+ @Override >+ public Long getId() { >+ return 42L; >+ } >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingLookupCall.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingLookupCall.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/TestingLookupCall.java (revision 0) >@@ -0,0 +1,19 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.rt.shared.services.lookup.LookupCall; >+ >+public class TestingLookupCall extends LookupCall { >+ >+ private static final long serialVersionUID = 1L; >+ >+} >Index: resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/UsingFormFieldData.java >=================================================================== >--- resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/UsingFormFieldData.java (revision 0) >+++ resources/operation/formData/formdata.shared/src/formdata/shared/services/process/replace/UsingFormFieldData.java (revision 0) >@@ -0,0 +1,19 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.shared.services.process.replace; >+ >+import org.eclipse.scout.rt.shared.data.form.fields.AbstractValueFieldData; >+ >+public class UsingFormFieldData extends AbstractValueFieldData<String> { >+ >+ private static final long serialVersionUID = 1L; >+ >+} >Index: resources/operation/formData/formdata.shared/META-INF/MANIFEST.MF >=================================================================== >--- resources/operation/formData/formdata.shared/META-INF/MANIFEST.MF (revision 3375) >+++ resources/operation/formData/formdata.shared/META-INF/MANIFEST.MF (working copy) >@@ -10,5 +10,6 @@ > org.eclipse.scout.rt.shared;visibility:=reexport > Export-Package: formdata.shared, > formdata.shared.services.process, >+ formdata.shared.services.process.replace, > formdata.shared.security, > formdata.shared.services.common.text >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/AbstractLookupField.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/AbstractLookupField.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/AbstractLookupField.java (revision 0) >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.rt.client.ui.form.fields.smartfield.AbstractSmartField; >+import org.eclipse.scout.rt.shared.services.lookup.LookupCall; >+ >+import formdata.shared.services.process.replace.TestingLookupCall; >+ >+public abstract class AbstractLookupField extends AbstractSmartField<Long> { >+ >+ @Override >+ protected Class<? extends LookupCall> getConfiguredLookupCall() { >+ return TestingLookupCall.class; >+ } >+} >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/BaseForm.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/BaseForm.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/BaseForm.java (revision 0) >@@ -0,0 +1,136 @@ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.commons.annotations.FormData; >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.exception.ProcessingException; >+import org.eclipse.scout.rt.client.ui.form.AbstractForm; >+import org.eclipse.scout.rt.client.ui.form.fields.button.AbstractCloseButton; >+import org.eclipse.scout.rt.client.ui.form.fields.groupbox.AbstractGroupBox; >+import org.eclipse.scout.rt.client.ui.form.fields.smartfield.AbstractSmartField; >+import org.eclipse.scout.rt.client.ui.form.fields.stringfield.AbstractStringField; >+import org.eclipse.scout.rt.shared.services.common.code.ICodeType; >+ >+import formdata.client.ui.forms.replace.BaseForm.MainBox.CloseButton; >+import formdata.client.ui.forms.replace.BaseForm.MainBox.GroupBox; >+import formdata.client.ui.forms.replace.BaseForm.MainBox.GroupBox.NameField; >+import formdata.client.ui.forms.replace.BaseForm.MainBox.GroupBox.SmartField; >+import formdata.client.ui.forms.replace.BaseForm.MainBox.IgnoringGroupBox; >+import formdata.client.ui.forms.replace.BaseForm.MainBox.IgnoringGroupBox.IgnoringGroupBoxField; >+import formdata.shared.services.process.replace.BaseFormData; >+import formdata.shared.services.process.replace.TestingCodeType; >+import formdata.shared.services.process.replace.UsingFormFieldData; >+ >+@FormData(value = BaseFormData.class, sdkCommand = SdkCommand.CREATE) >+public class BaseForm extends AbstractForm { >+ >+ public BaseForm() throws ProcessingException { >+ super(); >+ } >+ >+ public MainBox getMainBox() { >+ return getFieldByClass(MainBox.class); >+ } >+ >+ public GroupBox getGroupBox() { >+ return getFieldByClass(GroupBox.class); >+ } >+ >+ public NameField getNameField() { >+ return getFieldByClass(NameField.class); >+ } >+ >+ public SmartField getSmartField() { >+ return getFieldByClass(SmartField.class); >+ } >+ >+ public IgnoringGroupBox getIgnoringGroupBox() { >+ return getFieldByClass(IgnoringGroupBox.class); >+ } >+ >+ public IgnoringGroupBoxField getIgnoringGroupBoxField() { >+ return getFieldByClass(IgnoringGroupBoxField.class); >+ } >+ >+ public CloseButton getCloseButton() { >+ return getFieldByClass(CloseButton.class); >+ } >+ >+ @Order(10.0) >+ public class MainBox extends AbstractGroupBox { >+ >+ @Order(10) >+ public class NoneFormDataFieldsGroupBox extends AbstractGroupBox { >+ @Order(10) >+ public class SdkCommandNoneField extends AbstractStringField { >+ } >+ } >+ >+ @Order(20) >+ public class CreatingFormDataFieldsGroupBox extends AbstractGroupBox { >+ @Order(10) >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateField extends AbstractStringField { >+ } >+ } >+ >+ @Order(30) >+ public class UsingFormDataFieldsGroupBox extends AbstractGroupBox { >+ @Order(10) >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseField extends AbstractStringField { >+ } >+ } >+ >+ @Order(40) >+ public class IgnoringFormDataFieldsGroupBox extends AbstractGroupBox { >+ @Order(10) >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreField extends AbstractStringField { >+ } >+ } >+ >+ @Order(50.0) >+ public class GroupBox extends AbstractGroupBox { >+ >+ @Order(10.0) >+ public class NameField extends AbstractStringField { >+ >+ @Override >+ protected boolean getConfiguredMandatory() { >+ return true; >+ } >+ >+ @Override >+ protected int getConfiguredMaxLength() { >+ return 60; >+ } >+ } >+ >+ @Order(20.0) >+ public class SmartField extends AbstractSmartField<Long> { >+ @Override >+ protected Class<? extends ICodeType<?>> getConfiguredCodeType() { >+ return TestingCodeType.class; >+ } >+ } >+ >+ @Order(30.0) >+ public class LookupField extends AbstractLookupField { >+ } >+ } >+ >+ @Order(20.0) >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class IgnoringGroupBox extends AbstractGroupBox { >+ >+ @Order(10.0) >+ public class IgnoringGroupBoxField extends AbstractStringField { >+ } >+ } >+ >+ @Order(100.0) >+ public class CloseButton extends AbstractCloseButton { >+ } >+ } >+} >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedExtendedForm.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedExtendedForm.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedExtendedForm.java (revision 0) >@@ -0,0 +1,610 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.commons.annotations.FormData; >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.commons.exception.ProcessingException; >+ >+import formdata.client.ui.forms.replace.BaseForm.MainBox.GroupBox; >+import formdata.shared.services.process.replace.ExtendedExtendedFormData; >+import formdata.shared.services.process.replace.UsingFormFieldData; >+ >+@FormData(value = ExtendedExtendedFormData.class, sdkCommand = SdkCommand.CREATE) >+public class ExtendedExtendedForm extends ExtendedForm { >+ >+ public ExtendedExtendedForm() throws ProcessingException { >+ super(); >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are creating a form data (without explicitly >+ * defining a @FormData annotation) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandNoneNoneNoneField extends ExtendedForm.SdkCommandNoneNoneField { >+ public SdkCommandNoneNoneNoneField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandNoneNoneCreateField extends ExtendedForm.SdkCommandNoneNoneField { >+ public SdkCommandNoneNoneCreateField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandNoneNoneUseField extends ExtendedForm.SdkCommandNoneNoneField { >+ public SdkCommandNoneNoneUseField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandNoneNoneIgnoreField extends ExtendedForm.SdkCommandNoneNoneField { >+ public SdkCommandNoneNoneIgnoreField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandNoneCreateNoneField extends ExtendedForm.SdkCommandNoneCreateField { >+ public SdkCommandNoneCreateNoneField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandNoneCreateCreateField extends ExtendedForm.SdkCommandNoneCreateField { >+ public SdkCommandNoneCreateCreateField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandNoneCreateUseField extends ExtendedForm.SdkCommandNoneCreateField { >+ public SdkCommandNoneCreateUseField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandNoneCreateIgnoreField extends ExtendedForm.SdkCommandNoneCreateField { >+ public SdkCommandNoneCreateIgnoreField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandNoneUseNoneField extends ExtendedForm.SdkCommandNoneUseField { >+ public SdkCommandNoneUseNoneField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandNoneUseCreateField extends ExtendedForm.SdkCommandNoneUseField { >+ public SdkCommandNoneUseCreateField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandNoneUseUseField extends ExtendedForm.SdkCommandNoneUseField { >+ public SdkCommandNoneUseUseField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandNoneUseIgnoreField extends ExtendedForm.SdkCommandNoneUseField { >+ public SdkCommandNoneUseIgnoreField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandNoneIgnoreNoneField extends ExtendedForm.SdkCommandNoneIgnoreField { >+ public SdkCommandNoneIgnoreNoneField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandNoneIgnoreCreateField extends ExtendedForm.SdkCommandNoneIgnoreField { >+ public SdkCommandNoneIgnoreCreateField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandNoneIgnoreUseField extends ExtendedForm.SdkCommandNoneIgnoreField { >+ public SdkCommandNoneIgnoreUseField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandNoneIgnoreIgnoreField extends ExtendedForm.SdkCommandNoneIgnoreField { >+ public SdkCommandNoneIgnoreIgnoreField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are creating a form data (SdkCommand CREATE) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandCreateNoneNoneField extends ExtendedForm.SdkCommandCreateNoneField { >+ public SdkCommandCreateNoneNoneField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateNoneCreateField extends ExtendedForm.SdkCommandCreateNoneField { >+ public SdkCommandCreateNoneCreateField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandCreateNoneUseField extends ExtendedForm.SdkCommandCreateNoneField { >+ public SdkCommandCreateNoneUseField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandCreateNoneIgnoreField extends ExtendedForm.SdkCommandCreateNoneField { >+ public SdkCommandCreateNoneIgnoreField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandCreateCreateNoneField extends ExtendedForm.SdkCommandCreateCreateField { >+ public SdkCommandCreateCreateNoneField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateCreateCreateField extends ExtendedForm.SdkCommandCreateCreateField { >+ public SdkCommandCreateCreateCreateField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandCreateCreateUseField extends ExtendedForm.SdkCommandCreateCreateField { >+ public SdkCommandCreateCreateUseField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandCreateCreateIgnoreField extends ExtendedForm.SdkCommandCreateCreateField { >+ public SdkCommandCreateCreateIgnoreField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandCreateUseNoneField extends ExtendedForm.SdkCommandCreateUseField { >+ public SdkCommandCreateUseNoneField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateUseCreateField extends ExtendedForm.SdkCommandCreateUseField { >+ public SdkCommandCreateUseCreateField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandCreateUseUseField extends ExtendedForm.SdkCommandCreateUseField { >+ public SdkCommandCreateUseUseField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandCreateUseIgnoreField extends ExtendedForm.SdkCommandCreateUseField { >+ public SdkCommandCreateUseIgnoreField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandCreateIgnoreNoneField extends ExtendedForm.SdkCommandCreateIgnoreField { >+ public SdkCommandCreateIgnoreNoneField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateIgnoreCreateField extends ExtendedForm.SdkCommandCreateIgnoreField { >+ public SdkCommandCreateIgnoreCreateField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandCreateIgnoreUseField extends ExtendedForm.SdkCommandCreateIgnoreField { >+ public SdkCommandCreateIgnoreUseField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandCreateIgnoreIgnoreField extends ExtendedForm.SdkCommandCreateIgnoreField { >+ public SdkCommandCreateIgnoreIgnoreField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are using a form data (SdkCommand USE) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandUseNoneNoneField extends ExtendedForm.SdkCommandUseNoneField { >+ public SdkCommandUseNoneNoneField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandUseNoneCreateField extends ExtendedForm.SdkCommandUseNoneField { >+ public SdkCommandUseNoneCreateField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseNoneUseField extends ExtendedForm.SdkCommandUseNoneField { >+ public SdkCommandUseNoneUseField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandUseNoneIgnoreField extends ExtendedForm.SdkCommandUseNoneField { >+ public SdkCommandUseNoneIgnoreField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandUseCreateNoneField extends ExtendedForm.SdkCommandUseCreateField { >+ public SdkCommandUseCreateNoneField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandUseCreateCreateField extends ExtendedForm.SdkCommandUseCreateField { >+ public SdkCommandUseCreateCreateField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseCreateUseField extends ExtendedForm.SdkCommandUseCreateField { >+ public SdkCommandUseCreateUseField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandUseCreateIgnoreField extends ExtendedForm.SdkCommandUseCreateField { >+ public SdkCommandUseCreateIgnoreField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandUseUseNoneField extends ExtendedForm.SdkCommandUseUseField { >+ public SdkCommandUseUseNoneField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandUseUseCreateField extends ExtendedForm.SdkCommandUseUseField { >+ public SdkCommandUseUseCreateField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseUseUseField extends ExtendedForm.SdkCommandUseUseField { >+ public SdkCommandUseUseUseField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandUseUseIgnoreField extends ExtendedForm.SdkCommandUseUseField { >+ public SdkCommandUseUseIgnoreField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandUseIgnoreNoneField extends ExtendedForm.SdkCommandUseIgnoreField { >+ public SdkCommandUseIgnoreNoneField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandUseIgnoreCreateField extends ExtendedForm.SdkCommandUseIgnoreField { >+ public SdkCommandUseIgnoreCreateField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseIgnoreUseField extends ExtendedForm.SdkCommandUseIgnoreField { >+ public SdkCommandUseIgnoreUseField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandUseIgnoreIgnoreField extends ExtendedForm.SdkCommandUseIgnoreField { >+ public SdkCommandUseIgnoreIgnoreField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ /* ######################################################################## >+ * replacing fields that are ignoring a form data (SdkCommand IGNORE) >+ * expectation: replacing form field data must be created if the replacement >+ * field is not annotated with SdkCommand.IGNORE. There is no >+ * special parent field data handling required. >+ * ######################################################################## >+ */ >+ @Replace >+ public class SdkCommandIgnoreNoneNoneField extends ExtendedForm.SdkCommandIgnoreNoneField { >+ public SdkCommandIgnoreNoneNoneField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandIgnoreNoneCreateField extends ExtendedForm.SdkCommandIgnoreNoneField { >+ public SdkCommandIgnoreNoneCreateField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandIgnoreNoneUseField extends ExtendedForm.SdkCommandIgnoreNoneField { >+ public SdkCommandIgnoreNoneUseField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreNoneIgnoreField extends ExtendedForm.SdkCommandIgnoreNoneField { >+ public SdkCommandIgnoreNoneIgnoreField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandIgnoreCreateNoneField extends ExtendedForm.SdkCommandIgnoreCreateField { >+ public SdkCommandIgnoreCreateNoneField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandIgnoreCreateCreateField extends ExtendedForm.SdkCommandIgnoreCreateField { >+ public SdkCommandIgnoreCreateCreateField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandIgnoreCreateUseField extends ExtendedForm.SdkCommandIgnoreCreateField { >+ public SdkCommandIgnoreCreateUseField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreCreateIgnoreField extends ExtendedForm.SdkCommandIgnoreCreateField { >+ public SdkCommandIgnoreCreateIgnoreField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandIgnoreUseNoneField extends ExtendedForm.SdkCommandIgnoreUseField { >+ public SdkCommandIgnoreUseNoneField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandIgnoreUseCreateField extends ExtendedForm.SdkCommandIgnoreUseField { >+ public SdkCommandIgnoreUseCreateField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandIgnoreUseUseField extends ExtendedForm.SdkCommandIgnoreUseField { >+ public SdkCommandIgnoreUseUseField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreUseIgnoreField extends ExtendedForm.SdkCommandIgnoreUseField { >+ public SdkCommandIgnoreUseIgnoreField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class SdkCommandIgnoreIgnoreNoneField extends ExtendedForm.SdkCommandIgnoreIgnoreField { >+ public SdkCommandIgnoreIgnoreNoneField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandIgnoreIgnoreCreateField extends ExtendedForm.SdkCommandIgnoreIgnoreField { >+ public SdkCommandIgnoreIgnoreCreateField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandIgnoreIgnoreUseField extends ExtendedForm.SdkCommandIgnoreIgnoreField { >+ public SdkCommandIgnoreIgnoreUseField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreIgnoreIgnoreField extends ExtendedForm.SdkCommandIgnoreIgnoreField { >+ public SdkCommandIgnoreIgnoreIgnoreField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ super(container); >+ } >+ } >+ >+ /* ######################################################################## >+ * additional tests >+ * ######################################################################## >+ */ >+ @Replace >+ public class NameExExField extends NameExField { >+ >+ private String m_stringProperty; >+ >+ public NameExExField(GroupBox container) { >+ super(container); >+ } >+ >+ @FormData >+ public String getStringProperty() { >+ return m_stringProperty; >+ } >+ >+ @FormData >+ public void setStringProperty(String stringProperty) { >+ m_stringProperty = stringProperty; >+ } >+ >+ @Override >+ protected int getConfiguredMaxLength() { >+ return 15; >+ } >+ } >+ >+ @Replace >+ public class IgnoringGroupBoxExNoneNoneField extends ExtendedForm.IgnoringGroupBoxExNoneField { >+ >+ public IgnoringGroupBoxExNoneNoneField(BaseForm.MainBox.IgnoringGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class IgnoringGroupBoxExNoneCreateField extends ExtendedForm.IgnoringGroupBoxExNoneField { >+ >+ public IgnoringGroupBoxExNoneCreateField(BaseForm.MainBox.IgnoringGroupBox container) { >+ super(container); >+ } >+ } >+ >+ @Replace >+ public class IgnoringGroupBoxExCreateNoneField extends ExtendedForm.IgnoringGroupBoxExCreateField { >+ >+ public IgnoringGroupBoxExCreateNoneField(BaseForm.MainBox.IgnoringGroupBox container) { >+ super(container); >+ } >+ } >+} >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedForm.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedForm.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/ExtendedForm.java (revision 0) >@@ -0,0 +1,276 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.commons.annotations.FormData; >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+import org.eclipse.scout.commons.annotations.InjectFieldTo; >+import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.commons.exception.ProcessingException; >+import org.eclipse.scout.rt.client.ui.form.fields.stringfield.AbstractStringField; >+import org.eclipse.scout.rt.shared.data.form.ValidationRule; >+import org.eclipse.scout.rt.shared.services.common.code.ICodeType; >+ >+import formdata.shared.services.process.replace.ExtendedFormData; >+import formdata.shared.services.process.replace.UsingFormFieldData; >+ >+@FormData(value = ExtendedFormData.class, sdkCommand = SdkCommand.CREATE) >+public class ExtendedForm extends BaseForm { >+ >+ public ExtendedForm() throws ProcessingException { >+ super(); >+ } >+ >+ /* ########################################################################## >+ * injecting additional field >+ * ########################################################################## >+ */ >+ @Order(20) >+ @InjectFieldTo(BaseForm.MainBox.class) >+ public class FirstNameField extends AbstractStringField { >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are creating a form data (without explicitly >+ * defining a @FormData annotation) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandNoneNoneField extends BaseForm.MainBox.NoneFormDataFieldsGroupBox.SdkCommandNoneField { >+ public SdkCommandNoneNoneField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandNoneCreateField extends BaseForm.MainBox.NoneFormDataFieldsGroupBox.SdkCommandNoneField { >+ public SdkCommandNoneCreateField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandNoneUseField extends BaseForm.MainBox.NoneFormDataFieldsGroupBox.SdkCommandNoneField { >+ public SdkCommandNoneUseField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandNoneIgnoreField extends BaseForm.MainBox.NoneFormDataFieldsGroupBox.SdkCommandNoneField { >+ public SdkCommandNoneIgnoreField(BaseForm.MainBox.NoneFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are creating a form data (SdkCommand CREATE) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandCreateNoneField extends BaseForm.MainBox.CreatingFormDataFieldsGroupBox.SdkCommandCreateField { >+ public SdkCommandCreateNoneField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandCreateCreateField extends BaseForm.MainBox.CreatingFormDataFieldsGroupBox.SdkCommandCreateField { >+ public SdkCommandCreateCreateField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandCreateUseField extends BaseForm.MainBox.CreatingFormDataFieldsGroupBox.SdkCommandCreateField { >+ public SdkCommandCreateUseField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandCreateIgnoreField extends BaseForm.MainBox.CreatingFormDataFieldsGroupBox.SdkCommandCreateField { >+ public SdkCommandCreateIgnoreField(BaseForm.MainBox.CreatingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ /* ########################################################################## >+ * replacing fields that are using a form data (SdkCommand USE) >+ * expectation: replacing form field data must be created and it must be a >+ * subclass of the parent field's form field data. Hence any >+ * @FormData annotation available on the field replacements are >+ * ignored. >+ * ########################################################################## >+ */ >+ @Replace >+ public class SdkCommandUseNoneField extends BaseForm.MainBox.UsingFormDataFieldsGroupBox.SdkCommandUseField { >+ public SdkCommandUseNoneField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandUseCreateField extends BaseForm.MainBox.UsingFormDataFieldsGroupBox.SdkCommandUseField { >+ public SdkCommandUseCreateField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandUseUseField extends BaseForm.MainBox.UsingFormDataFieldsGroupBox.SdkCommandUseField { >+ public SdkCommandUseUseField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandUseIgnoreField extends BaseForm.MainBox.UsingFormDataFieldsGroupBox.SdkCommandUseField { >+ public SdkCommandUseIgnoreField(BaseForm.MainBox.UsingFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ /* ######################################################################## >+ * replacing fields that are ignoring a form data (SdkCommand IGNORE) >+ * expectation: replacing form field data must be created if the replacement >+ * field is not annotated with SdkCommand.IGNORE. There is no >+ * special parent field data handling required. >+ * ######################################################################## >+ */ >+ @Replace >+ public class SdkCommandIgnoreNoneField extends BaseForm.MainBox.IgnoringFormDataFieldsGroupBox.SdkCommandIgnoreField { >+ public SdkCommandIgnoreNoneField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class SdkCommandIgnoreCreateField extends BaseForm.MainBox.IgnoringFormDataFieldsGroupBox.SdkCommandIgnoreField { >+ public SdkCommandIgnoreCreateField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class SdkCommandIgnoreUseField extends BaseForm.MainBox.IgnoringFormDataFieldsGroupBox.SdkCommandIgnoreField { >+ public SdkCommandIgnoreUseField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class SdkCommandIgnoreIgnoreField extends BaseForm.MainBox.IgnoringFormDataFieldsGroupBox.SdkCommandIgnoreField { >+ public SdkCommandIgnoreIgnoreField(BaseForm.MainBox.IgnoringFormDataFieldsGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ /* ######################################################################## >+ * additional tests >+ * ######################################################################## >+ */ >+ @Replace >+ public class NameExField extends BaseForm.MainBox.GroupBox.NameField { >+ >+ public NameExField(BaseForm.MainBox.GroupBox container) { >+ container.super(); >+ } >+ >+ @Override >+ protected boolean getConfiguredMandatory() { >+ return false; >+ } >+ >+ @Override >+ protected int getConfiguredMaxLength() { >+ return 100; >+ } >+ } >+ >+ @Replace >+ public class SmartExField extends BaseForm.MainBox.GroupBox.SmartField { >+ >+ public SmartExField(BaseForm.MainBox.GroupBox container) { >+ container.super(); >+ } >+ >+ @Override >+ @ValidationRule(value = ValidationRule.CODE_TYPE, skip = true) >+ protected Class<? extends ICodeType<?>> getConfiguredCodeType() { >+ return super.getConfiguredCodeType(); >+ } >+ } >+ >+ @Replace >+ public class IgnoringGroupBoxExNoneField extends BaseForm.MainBox.IgnoringGroupBox.IgnoringGroupBoxField { >+ >+ public IgnoringGroupBoxExNoneField(BaseForm.MainBox.IgnoringGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.CREATE) >+ public class IgnoringGroupBoxExCreateField extends BaseForm.MainBox.IgnoringGroupBox.IgnoringGroupBoxField { >+ >+ public IgnoringGroupBoxExCreateField(BaseForm.MainBox.IgnoringGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.USE, value = UsingFormFieldData.class) >+ public class IgnoringGroupBoxExUseField extends BaseForm.MainBox.IgnoringGroupBox.IgnoringGroupBoxField { >+ >+ public IgnoringGroupBoxExUseField(BaseForm.MainBox.IgnoringGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ @FormData(sdkCommand = SdkCommand.IGNORE) >+ public class IgnoringGroupBoxExIgnoreField extends BaseForm.MainBox.IgnoringGroupBox.IgnoringGroupBoxField { >+ >+ public IgnoringGroupBoxExIgnoreField(BaseForm.MainBox.IgnoringGroupBox container) { >+ container.super(); >+ } >+ } >+ >+ @Replace >+ public class CloseExButton extends BaseForm.MainBox.CloseButton { >+ >+ public CloseExButton(BaseForm.MainBox container) { >+ container.super(); >+ } >+ } >+} >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldBaseForm.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldBaseForm.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldBaseForm.java (revision 0) >@@ -0,0 +1,71 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.commons.annotations.FormData; >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.exception.ProcessingException; >+import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable; >+import org.eclipse.scout.rt.client.ui.basic.table.ITable; >+import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumn; >+import org.eclipse.scout.rt.client.ui.form.AbstractForm; >+import org.eclipse.scout.rt.client.ui.form.fields.groupbox.AbstractGroupBox; >+import org.eclipse.scout.rt.client.ui.form.fields.tablefield.AbstractTableField; >+import org.eclipse.scout.rt.shared.data.form.fields.tablefield.AbstractTableFieldBeanData; >+ >+import formdata.shared.services.process.replace.TableFieldBaseFormData; >+ >+@FormData(value = TableFieldBaseFormData.class, sdkCommand = SdkCommand.CREATE) >+public class TableFieldBaseForm extends AbstractForm { >+ >+ /** >+ * @throws ProcessingException >+ */ >+ public TableFieldBaseForm() throws ProcessingException { >+ super(); >+ } >+ >+ @Order(10.0) >+ public class MainBox extends AbstractGroupBox { >+ >+ @Order(10.0) >+ @FormData(sdkCommand = SdkCommand.USE, value = AbstractTableFieldBeanData.class) >+ public class TableField extends AbstractTableField<TableField.Table> { >+ >+ public class Table extends AbstractTable { >+ >+ @Order(10.0) >+ public class FirstColumn extends AbstractStringColumn { >+ >+ } >+ >+ @Order(20.0) >+ public class SecondColumn extends AbstractStringColumn { >+ >+ } >+ } >+ } >+ >+ @Order(20.0) >+ @FormData(sdkCommand = SdkCommand.USE, value = AbstractTableFieldBeanData.class) >+ public class EmptyTableField extends AbstractTableField<EmptyTableField.Table> { >+ >+ public class Table extends AbstractTable { >+ } >+ } >+ >+ @Order(30.0) >+ @FormData(sdkCommand = SdkCommand.USE, value = AbstractTableFieldBeanData.class) >+ public class NoTableField extends AbstractTableField<ITable> { >+ } >+ } >+} >Index: resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldExForm.java >=================================================================== >--- resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldExForm.java (revision 0) >+++ resources/operation/formData/formdata.client/src/formdata/client/ui/forms/replace/TableFieldExForm.java (revision 0) >@@ -0,0 +1,85 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package formdata.client.ui.forms.replace; >+ >+import org.eclipse.scout.commons.annotations.FormData; >+import org.eclipse.scout.commons.annotations.FormData.SdkCommand; >+import org.eclipse.scout.commons.annotations.Order; >+import org.eclipse.scout.commons.annotations.Replace; >+import org.eclipse.scout.commons.exception.ProcessingException; >+import org.eclipse.scout.rt.client.ui.basic.table.AbstractTable; >+import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractBooleanColumn; >+import org.eclipse.scout.rt.client.ui.basic.table.columns.AbstractStringColumn; >+ >+import formdata.shared.services.process.replace.TableFieldExFormData; >+ >+/** >+ * >+ */ >+@FormData(value = TableFieldExFormData.class, sdkCommand = SdkCommand.CREATE) >+public class TableFieldExForm extends TableFieldBaseForm { >+ >+ public TableFieldExForm() throws ProcessingException { >+ super(); >+ } >+ >+ @Replace >+ public class TableExtendedField extends TableFieldBaseForm.MainBox.TableField { >+ >+ public TableExtendedField(TableFieldBaseForm.MainBox container) { >+ container.super(); >+ } >+ >+ public class TableEx extends Table { >+ >+ @Order(30) >+ @Replace >+ public class FirstExtendedColumn extends FirstColumn { >+ >+ } >+ >+ @Order(40) >+ public class BooleanColumn extends AbstractBooleanColumn { >+ >+ } >+ } >+ } >+ >+ @Replace >+ public class EmptyTableExtendedField extends TableFieldBaseForm.MainBox.EmptyTableField { >+ >+ public EmptyTableExtendedField(TableFieldBaseForm.MainBox container) { >+ container.super(); >+ } >+ >+ public class TableEx extends Table { >+ >+ public class SingleColumn extends AbstractStringColumn { >+ >+ } >+ } >+ } >+ >+ @Replace >+ public class NoTableExtendedField extends TableFieldBaseForm.MainBox.NoTableField { >+ >+ public NoTableExtendedField(TableFieldBaseForm.MainBox container) { >+ container.super(); >+ } >+ >+ public class Table extends AbstractTable { >+ >+ public class NewColumn extends AbstractStringColumn { >+ >+ } >+ } >+ } >+} >Index: src/org/eclipse/scout/sdk/internal/test/operation/formdata/_SuiteFormData.java >=================================================================== >--- src/org/eclipse/scout/sdk/internal/test/operation/formdata/_SuiteFormData.java (revision 3375) >+++ src/org/eclipse/scout/sdk/internal/test/operation/formdata/_SuiteFormData.java (working copy) >@@ -17,15 +17,16 @@ > //@SuiteClasses({FormWithTemplateTest.class, TemplateFormDataTest.class}) > @SuiteClasses({ > ExternalCheckboxFieldTest.class, >+ ExternalGroupboxTest.class, > ExternalTableFieldTest.class, > FormPropertiesTest.class, > FormWithGroupboxesTest.class, > FormWithTemplateTest.class, > IgnoredFieldsFormTest.class, > ListBoxFormTest.class, >+ ReplaceFormFiledTest.class, > SimpleFormTest.class, >- TableFieldFormTest.class, >- ExternalGroupboxTest.class}) >+ TableFieldFormTest.class}) > public class _SuiteFormData { > > } >Index: src/org/eclipse/scout/sdk/internal/test/operation/formdata/ReplaceFormFiledTest.java >=================================================================== >--- src/org/eclipse/scout/sdk/internal/test/operation/formdata/ReplaceFormFiledTest.java (revision 0) >+++ src/org/eclipse/scout/sdk/internal/test/operation/formdata/ReplaceFormFiledTest.java (revision 0) >@@ -0,0 +1,998 @@ >+/******************************************************************************* >+ * Copyright (c) 2010 BSI Business Systems Integration AG. >+ * All rights reserved. This program and the accompanying materials >+ * are 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: >+ * BSI Business Systems Integration AG - initial API and implementation >+ ******************************************************************************/ >+package org.eclipse.scout.sdk.internal.test.operation.formdata; >+ >+import static org.junit.Assert.assertEquals; >+import static org.junit.Assert.assertFalse; >+import static org.junit.Assert.assertNotNull; >+import static org.junit.Assert.assertTrue; >+ >+import java.util.HashMap; >+import java.util.Map; >+ >+import javax.annotation.Generated; >+ >+import org.eclipse.core.resources.IProject; >+import org.eclipse.jdt.core.IMethod; >+import org.eclipse.jdt.core.ISourceRange; >+import org.eclipse.jdt.core.IType; >+import org.eclipse.scout.sdk.jobs.OperationJob; >+import org.eclipse.scout.sdk.operation.form.formdata.FormDataUpdateOperation; >+import org.eclipse.scout.sdk.test.AbstractScoutSdkTest; >+import org.eclipse.scout.sdk.util.type.TypeUtility; >+import org.junit.BeforeClass; >+import org.junit.Test; >+ >+public class ReplaceFormFiledTest extends AbstractScoutSdkTest { >+ >+ private static IType s_baseFormData; >+ private static IType s_extendedFormData; >+ private static IType s_extendedExtendedFormData; >+ private static Map<String, String> s_validationRules; >+ >+ @BeforeClass >+ public static void setUpWorkspace() throws Exception { >+ setupWorkspace("operation/formData", "formdata.shared", "formdata.client"); >+ >+ IProject sharedProject = getProject("formdata.shared"); >+ assertNotNull(sharedProject); >+ >+ s_baseFormData = updateFormData(sharedProject, "formdata.client.ui.forms.replace.BaseForm", "formdata.shared.services.process.replace.BaseFormData", "AbstractFormData"); >+ s_extendedFormData = updateFormData(sharedProject, "formdata.client.ui.forms.replace.ExtendedForm", "formdata.shared.services.process.replace.ExtendedFormData", "BaseFormData"); >+ s_extendedExtendedFormData = updateFormData(sharedProject, "formdata.client.ui.forms.replace.ExtendedExtendedForm", "formdata.shared.services.process.replace.ExtendedExtendedFormData", "ExtendedFormData"); >+ >+ s_validationRules = new HashMap<String, String>(); >+ s_validationRules.put("ValidationRule.MANDATORY", "\"mandatory\""); >+ s_validationRules.put("ValidationRule.MIN_VALUE", "\"minValue\""); >+ s_validationRules.put("ValidationRule.MAX_VALUE", "\"maxValue\""); >+ s_validationRules.put("ValidationRule.MIN_LENGTH", "\"minLength\""); >+ s_validationRules.put("ValidationRule.MAX_LENGTH", "\"maxLength\""); >+ s_validationRules.put("ValidationRule.CODE_TYPE", "\"codeType\""); >+ s_validationRules.put("ValidationRule.LOOKUP_CALL", "\"lookupCall\""); >+ s_validationRules.put("ValidationRule.REGEX", "\"regex\""); >+ s_validationRules.put("ValidationRule.MASTER_VALUE_FIELD", "\"masterValueField\""); >+ s_validationRules.put("ValidationRule.MASTER_VALUE_REQUIRED", "\"masterValueRequired\""); >+ s_validationRules.put("ValidationRule.ZERO_NULL_EQUALITY", "\"zeroNullEquality\""); >+ } >+ >+ private static IType updateFormData(IProject sharedProject, String formFqcn, String formDataFqcn, String formDataSuperClassName) throws Exception { >+ IType form = TypeUtility.getType(formFqcn); >+ assertTrue(TypeUtility.exists(form)); >+ >+ FormDataUpdateOperation op = new FormDataUpdateOperation(form); >+ OperationJob job = new OperationJob(op); >+ job.schedule(); >+ job.join(); >+ buildWorkspace(); >+ IType formData = op.getFormDataType(); >+ assertTrue(TypeUtility.exists(formData)); >+ assertEquals(formDataFqcn, formData.getFullyQualifiedName()); >+ assertEquals(formDataSuperClassName, formData.getSuperclassName()); >+ return formData; >+ } >+ >+ private static void assertValidationRules(IType type, String... expectedLines) throws Exception { >+ IMethod initValidationRulesMethod = TypeUtility.getMethod(type, "initValidationRules"); >+ >+ if (expectedLines == null || expectedLines.length == 0) { >+ assertFalse(TypeUtility.exists(initValidationRulesMethod)); >+ return; >+ } >+ >+ // validation rules are expected. Check contents. >+ assertTrue(TypeUtility.exists(initValidationRulesMethod)); >+ >+ String source = initValidationRulesMethod.getSource(); >+ ISourceRange range = TypeUtility.getContentRange(initValidationRulesMethod); >+ source = initValidationRulesMethod.getOpenable().getBuffer().getText(range.getOffset(), range.getLength()); >+ >+ assertNotNull(source); >+ >+ source = source.replace("super.initValidationRules(ruleMap);", ""); >+ for (String line : expectedLines) { >+ source = source.replace(line, ""); >+ >+ // inline constants >+ for (Map.Entry<String, String> rule : s_validationRules.entrySet()) { >+ line = line.replace(rule.getKey(), rule.getValue()); >+ } >+ source = source.replace(line, ""); >+ } >+ >+ source = source.trim(); >+ assertEquals("", source); >+ } >+ >+ /* ########################################################################## >+ * BaseForm tests >+ * ########################################################################## >+ */ >+ @Test >+ public void testBaseFormName() throws Exception { >+ IType type = s_baseFormData.getType("Name"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MANDATORY, true);", >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 60);"); >+ } >+ >+ @Test >+ public void testBaseFormSmart() throws Exception { >+ IType type = s_baseFormData.getType("Smart"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<Long>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.CODE_TYPE, TestingCodeType.class);", >+ "ruleMap.put(ValidationRule.ZERO_NULL_EQUALITY, true);"); >+ } >+ >+ @Test >+ public void testBaseFormLookup() throws Exception { >+ IType type = s_baseFormData.getType("Lookup"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<Long>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.LOOKUP_CALL, TestingLookupCall.class);", >+ "ruleMap.put(ValidationRule.ZERO_NULL_EQUALITY, true);"); >+ } >+ >+ @Test >+ public void testBaseFormDataIgnoringGroupBox() throws Exception { >+ IType type = s_baseFormData.getType("IgnoringGroupBox"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ public void testBaseFormDataClose() throws Exception { >+ IType type = s_baseFormData.getType("Close"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testBaseFormDataSdkCommandNone() throws Exception { >+ IType type = s_baseFormData.getType("SdkCommandNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testBaseFormDataSdkCommandCreate() throws Exception { >+ IType type = s_baseFormData.getType("SdkCommandCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testBaseFormDataSdkCommandUse() throws Exception { >+ IType type = s_baseFormData.getType("SdkCommandUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("UsingFormFieldData", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testBaseFormDataSdkCommandIgnore() throws Exception { >+ IType type = s_baseFormData.getType("SdkCommandIgnore"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ /* ########################################################################## >+ * ExtendedForm tests >+ * ########################################################################## >+ */ >+ @Test >+ public void testExtendedFormFirstname() throws Exception { >+ IType type = s_extendedFormData.getType("FirstName"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ public void testExtendedFormNameEx() throws Exception { >+ IType type = s_extendedFormData.getType("NameEx"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.Name", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MANDATORY, false);", >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 100);"); >+ } >+ >+ @Test >+ public void testExtendedFormSmartEx() throws Exception { >+ IType type = s_extendedFormData.getType("SmartEx"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.Smart", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.remove(ValidationRule.CODE_TYPE);"); >+ } >+ >+ @Test >+ public void testExtendedFormDataIgnoringGroupBoxExNone() throws Exception { >+ IType type = s_extendedFormData.getType("IgnoringGroupBoxExNone"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ public void testExtendedFormDataIgnoringGroupBoxExWithCreate() throws Exception { >+ IType type = s_extendedFormData.getType("IgnoringGroupBoxExCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ public void testExtendedFormDataIgnoringGroupBoxExUse() throws Exception { >+ IType type = s_extendedFormData.getType("IgnoringGroupBoxExUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("UsingFormFieldData", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ public void testExtendedFormDataIgnoringGroupBoxExIgnore() throws Exception { >+ IType type = s_extendedFormData.getType("IgnoringGroupBoxExIgnore"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ public void testExtendedFormDataCloseEx() throws Exception { >+ IType type = s_extendedFormData.getType("CloseEx"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ public void testExtendedFormIgnoringGroupBoxExNone() throws Exception { >+ IType type = s_extendedFormData.getType("IgnoringGroupBoxExNone"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandNoneNone() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandNoneNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandNoneCreate() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandNoneCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandNoneUse() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandNoneUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandNoneIgnore() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandNoneIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandCreateNone() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandCreateNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandCreateCreate() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandCreateCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandCreateUse() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandCreateUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandCreateIgnore() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandCreateIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandUseNone() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandUseNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandUseCreate() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandUseCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandUseUse() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandUseUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandUseIgnore() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandUseIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("BaseFormData.SdkCommandUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandIgnoreNone() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandIgnoreNone"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandIgnoreCreate() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandIgnoreCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandIgnoreUse() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandIgnoreUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("UsingFormFieldData", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedFormDataSdkCommandIgnoreIgnore() throws Exception { >+ IType type = s_extendedFormData.getType("SdkCommandIgnoreIgnore"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ /* ########################################################################## >+ * ExtendedExtendedForm tests >+ * ########################################################################## >+ */ >+ @Test >+ public void testExtendedExtendedFormNameExEx() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("NameExEx"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.NameEx", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 15);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneNoneNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneNoneNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneNoneCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneNoneCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneNoneUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneNoneUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneNoneIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneNoneIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneCreateNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneCreateNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneCreateCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneCreateCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneCreateUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneCreateUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneCreateIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneCreateIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneUseNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneUseNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneUseCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneUseCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneUseUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneUseUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneUseIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneUseIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneIgnoreNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneIgnoreNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneIgnoreCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneIgnoreCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneIgnoreUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneIgnoreUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandNoneIgnoreIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandNoneIgnoreIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandNoneIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateNoneNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateNoneNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateNoneCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateNoneCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateNoneUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateNoneUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateNoneIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateNoneIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateCreateNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateCreateNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateCreateCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateCreateCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateCreateUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateCreateUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateCreateIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateCreateIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateUseNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateUseNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateUseCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateUseCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateUseUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateUseUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateUseIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateUseIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateIgnoreNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateIgnoreNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateIgnoreCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateIgnoreCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateIgnoreUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateIgnoreUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandCreateIgnoreIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandCreateIgnoreIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandCreateIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseNoneNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseNoneNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseNoneCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseNoneCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseNoneUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseNoneUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseNoneIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseNoneIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseNone", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseCreateNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseCreateNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseCreateCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseCreateCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseCreateUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseCreateUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseCreateIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseCreateIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseUseNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseUseNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseUseCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseUseCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseUseUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseUseUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseUseIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseUseIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseIgnoreNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseIgnoreNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseIgnoreCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseIgnoreCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseIgnoreUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseIgnoreUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandUseIgnoreIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandUseIgnoreIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandUseIgnore", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreNoneNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreNoneNone"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreNoneCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreNoneCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreNoneUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreNoneUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("UsingFormFieldData", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreNoneIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreNoneIgnore"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreCreateNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreCreateNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreCreateCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreCreateCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreCreateUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreCreateUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreCreateIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreCreateIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreCreate", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreUseNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreUseNone"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreUseCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreUseCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreUseUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreUseUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreUseIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreUseIgnore"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("ExtendedFormData.SdkCommandIgnoreUse", type.getSuperclassName()); >+ assertValidationRules(type); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreIgnoreNone() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreIgnoreNone"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreIgnoreCreate() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreIgnoreCreate"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("AbstractValueFieldData<String>", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreIgnoreUse() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreIgnoreUse"); >+ assertTrue(TypeUtility.exists(type)); >+ assertEquals("UsingFormFieldData", type.getSuperclassName()); >+ assertValidationRules(type, >+ "ruleMap.put(ValidationRule.MAX_LENGTH, 4000);"); >+ } >+ >+ @Test >+ @Generated("Replace Field Test Generator") >+ public void testExtendedExtendedFormDataSdkCommandIgnoreIgnoreIgnore() throws Exception { >+ IType type = s_extendedExtendedFormData.getType("SdkCommandIgnoreIgnoreIgnore"); >+ assertFalse(TypeUtility.exists(type)); >+ } >+ >+} >#P org.eclipse.scout.rt.shared >Index: src/org/eclipse/scout/rt/shared/data/form/fields/AbstractFormFieldData.java >=================================================================== >--- src/org/eclipse/scout/rt/shared/data/form/fields/AbstractFormFieldData.java (revision 3366) >+++ src/org/eclipse/scout/rt/shared/data/form/fields/AbstractFormFieldData.java (working copy) >@@ -15,6 +15,7 @@ > import java.util.Map; > > import org.eclipse.scout.commons.ConfigurationUtility; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; > import org.eclipse.scout.rt.shared.data.form.FormDataUtility; >@@ -24,6 +25,7 @@ > private static final IScoutLogger LOG = ScoutLogManager.getLogger(AbstractFormFieldData.class); > private static final long serialVersionUID = 1L; > >+ private Map<Class<?>, Class<? extends AbstractFormFieldData>> m_fieldDataReplacements; > private Map<Class<? extends AbstractPropertyData>, AbstractPropertyData> m_propertyMap; > private Map<Class<? extends AbstractFormFieldData>, AbstractFormFieldData> m_fieldMap; > private boolean m_valueSet; >@@ -39,7 +41,8 @@ > > private Class<? extends AbstractFormFieldData>[] getConfiguredFieldDatas() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, AbstractFormFieldData.class); >+ Class<AbstractFormFieldData>[] fca = ConfigurationUtility.filterClasses(dca, AbstractFormFieldData.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > protected void initConfig() { >@@ -71,6 +74,10 @@ > }// end for > if (map.size() > 0) { > m_fieldMap = map; >+ Map<Class<?>, Class<? extends AbstractFormFieldData>> replacements = ConfigurationUtility.getReplacementMapping(fieldArray); >+ if (!replacements.isEmpty()) { >+ m_fieldDataReplacements = replacements; >+ } > } > } > >@@ -84,7 +91,11 @@ > } > > public String getFieldId() { >- String s = getClass().getName(); >+ Class<?> c = getClass(); >+ while (c.isAnnotationPresent(Replace.class)) { >+ c = c.getSuperclass(); >+ } >+ String s = c.getName(); > int i = Math.max(s.lastIndexOf('$'), s.lastIndexOf('.')); > s = s.substring(i + 1); > return s; >@@ -126,10 +137,10 @@ > } > > public AbstractFormFieldData getFieldById(String id) { >- String fieldDataId = FormDataUtility.getFieldDataId(id); > if (m_fieldMap == null) { > return null; > } >+ String fieldDataId = FormDataUtility.getFieldDataId(id); > for (AbstractFormFieldData f : m_fieldMap.values()) { > if (f.getFieldId().equals(fieldDataId)) { > return f; >@@ -143,21 +154,43 @@ > if (m_fieldMap == null) { > return null; > } >- return (T) m_fieldMap.get(c); >+ Class<? extends T> clazz = getReplacingFieldDataClass(c); >+ return (T) m_fieldMap.get(clazz); > } > > public <T extends AbstractFormFieldData> void setFieldByClass(Class<T> c, T v) { >+ Class<? extends T> clazz = getReplacingFieldDataClass(c); > if (v == null) { > if (m_fieldMap != null) { >- m_fieldMap.remove(c); >+ m_fieldMap.remove(clazz); > } > } > else { > if (m_fieldMap == null) { > m_fieldMap = new HashMap<Class<? extends AbstractFormFieldData>, AbstractFormFieldData>(); > } >- m_fieldMap.put(c, v); >+ m_fieldMap.put(clazz, v); >+ } >+ } >+ >+ /** >+ * Checks whether the form field data with the given class has been replaced by another field. If so, the replacing >+ * form field data's class is returned. Otherwise the given class itself. >+ * >+ * @param c >+ * @return Returns the possibly available replacing field data class for the given class. >+ * @see Replace >+ * @since 3.8.2 >+ */ >+ private <T> Class<? extends T> getReplacingFieldDataClass(Class<T> c) { >+ if (m_fieldDataReplacements != null) { >+ @SuppressWarnings("unchecked") >+ Class<? extends T> replacingFieldClass = (Class<? extends T>) m_fieldDataReplacements.get(c); >+ if (replacingFieldClass != null) { >+ return replacingFieldClass; >+ } > } >+ return c; > } > > public AbstractFormFieldData[] getFields() { >Index: src/org/eclipse/scout/rt/shared/data/form/AbstractFormData.java >=================================================================== >--- src/org/eclipse/scout/rt/shared/data/form/AbstractFormData.java (revision 3366) >+++ src/org/eclipse/scout/rt/shared/data/form/AbstractFormData.java (working copy) >@@ -19,6 +19,7 @@ > import org.eclipse.scout.commons.ClassIdentifier; > import org.eclipse.scout.commons.CloneUtility; > import org.eclipse.scout.commons.ConfigurationUtility; >+import org.eclipse.scout.commons.annotations.Replace; > import org.eclipse.scout.commons.exception.ProcessingException; > import org.eclipse.scout.commons.logger.IScoutLogger; > import org.eclipse.scout.commons.logger.ScoutLogManager; >@@ -29,6 +30,7 @@ > private static final IScoutLogger LOG = ScoutLogManager.getLogger(AbstractFormData.class); > private static final long serialVersionUID = 1L; > >+ private Map<Class<?>, Class<? extends AbstractFormFieldData>> m_fieldDataReplacements; > private Map<Class<? extends AbstractPropertyData>, AbstractPropertyData> m_propertyMap; > private Map<Class<? extends AbstractFormFieldData>, AbstractFormFieldData> m_fieldMap; > >@@ -43,7 +45,8 @@ > > private Class<? extends AbstractFormFieldData>[] getConfiguredFieldDatas() { > Class[] dca = ConfigurationUtility.getDeclaredPublicClasses(getClass()); >- return ConfigurationUtility.filterClasses(dca, AbstractFormFieldData.class); >+ Class<AbstractFormFieldData>[] fca = ConfigurationUtility.filterClasses(dca, AbstractFormFieldData.class); >+ return ConfigurationUtility.removeReplacedClasses(fca); > } > > protected void initConfig() { >@@ -63,6 +66,10 @@ > // add fields > m_fieldMap = new HashMap<Class<? extends AbstractFormFieldData>, AbstractFormFieldData>(); > Class<? extends AbstractFormFieldData>[] fieldArray = getConfiguredFieldDatas(); >+ Map<Class<?>, Class<? extends AbstractFormFieldData>> replacements = ConfigurationUtility.getReplacementMapping(fieldArray); >+ if (!replacements.isEmpty()) { >+ m_fieldDataReplacements = replacements; >+ } > for (int i = 0; i < fieldArray.length; i++) { > AbstractFormFieldData f; > try { >@@ -114,16 +121,38 @@ > > @SuppressWarnings("unchecked") > public <T extends AbstractFormFieldData> T getFieldByClass(Class<T> c) { >- return (T) m_fieldMap.get(c); >+ Class<? extends T> clazz = getReplacingFieldDataClass(c); >+ return (T) m_fieldMap.get(clazz); > } > > public <T extends AbstractFormFieldData> void setFieldByClass(Class<T> c, T v) { >+ Class<? extends T> clazz = getReplacingFieldDataClass(c); > if (v == null) { >- m_fieldMap.remove(c); >+ m_fieldMap.remove(clazz); > } > else { >- m_fieldMap.put(c, v); >+ m_fieldMap.put(clazz, v); >+ } >+ } >+ >+ /** >+ * Checks whether the form field data with the given class has been replaced by another field. If so, the replacing >+ * form field data's class is returned. Otherwise the given class itself. >+ * >+ * @param c >+ * @return Returns the possibly available replacing field data class for the given class. >+ * @see Replace >+ * @since 3.8.2 >+ */ >+ private <T extends AbstractFormFieldData> Class<? extends T> getReplacingFieldDataClass(Class<T> c) { >+ if (m_fieldDataReplacements != null) { >+ @SuppressWarnings("unchecked") >+ Class<T> replacingFieldDataClass = (Class<T>) m_fieldDataReplacements.get(c); >+ if (replacingFieldDataClass != null) { >+ return replacingFieldDataClass; >+ } > } >+ return c; > } > > /**
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 399380
: 226268