Permalink
Browse files

enhanced forms model:

 - rows attribute added to text inputs
 - valid values attribute added to text inputs (local vocab, list of strings)
 - added precision setting to any dates supplied to date inputs
  • Loading branch information...
gregjan committed Nov 1, 2012
1 parent fa165a9 commit 29851fc4b2b446320485892ad35c1b93746f3c85

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -132,71 +132,71 @@ public Image getImage(Object element) {
*/
public Image getImage(View view) {
switch (CrosswalkVisualIDRegistry.getVisualID(view)) {
- case TabbedDataFieldEditPart.VISUAL_ID:
+ case CurrentUsernameEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?TabbedDataField", CrosswalkElementTypes.TabbedDataField_3002); //$NON-NLS-1$
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?CurrentUsername", CrosswalkElementTypes.CurrentUsername_3022); //$NON-NLS-1$
+ case MappedElementEditPart.VISUAL_ID:
+ return getImage(
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedElement", CrosswalkElementTypes.MappedElement_3007); //$NON-NLS-1$
case DictionaryEditPart.VISUAL_ID:
return getImage(
"Navigator?TopLevelNode?http://lib.unc.edu/schemas/crosswalk?Dictionary", CrosswalkElementTypes.Dictionary_2002); //$NON-NLS-1$
- case TextEditPart.VISUAL_ID:
- return getImage("Navigator?Node?http://lib.unc.edu/schemas/crosswalk?Text", CrosswalkElementTypes.Text_3005); //$NON-NLS-1$
+ case DateInputFieldEditPart.VISUAL_ID:
+ return getImage(
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DateInputField", CrosswalkElementTypes.DateInputField_3024); //$NON-NLS-1$
+ case TextInputFieldEditPart.VISUAL_ID:
+ return getImage(
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?TextInputField", CrosswalkElementTypes.TextInputField_3023); //$NON-NLS-1$
+ case DateRecognizerEditPart.VISUAL_ID:
+ return getImage(
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DateRecognizer", CrosswalkElementTypes.DateRecognizer_3004); //$NON-NLS-1$
case ParagraphEditPart.VISUAL_ID:
return getImage(
"Navigator?Node?http://lib.unc.edu/schemas/crosswalk?Paragraph", CrosswalkElementTypes.Paragraph_3020); //$NON-NLS-1$
- case DelimitedFileEditPart.VISUAL_ID:
+ case MappedAttributeEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DelimitedFile", CrosswalkElementTypes.DelimitedFile_3001); //$NON-NLS-1$
- case MappedElement2EditPart.VISUAL_ID:
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedAttribute", CrosswalkElementTypes.MappedAttribute_3009); //$NON-NLS-1$
+ case TabbedDataFieldEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedElement", CrosswalkElementTypes.MappedElement_3008); //$NON-NLS-1$
- case FormEditPart.VISUAL_ID:
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?TabbedDataField", CrosswalkElementTypes.TabbedDataField_3002); //$NON-NLS-1$
+ case TextEditPart.VISUAL_ID:
+ return getImage("Navigator?Node?http://lib.unc.edu/schemas/crosswalk?Text", CrosswalkElementTypes.Text_3005); //$NON-NLS-1$
+ case EditingContainerEditPart.VISUAL_ID:
return getImage(
- "Navigator?TopLevelNode?http://lib.unc.edu/schemas/crosswalk?Form", CrosswalkElementTypes.Form_2003); //$NON-NLS-1$
+ "Navigator?Diagram?http://lib.unc.edu/schemas/crosswalk?EditingContainer", CrosswalkElementTypes.EditingContainer_1000); //$NON-NLS-1$
case OriginalNameRecordMatcherEditPart.VISUAL_ID:
return getImage(
"Navigator?Node?http://lib.unc.edu/schemas/crosswalk?OriginalNameRecordMatcher", CrosswalkElementTypes.OriginalNameRecordMatcher_3003); //$NON-NLS-1$
- case MetadataBlockEditPart.VISUAL_ID:
- return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MetadataBlock", CrosswalkElementTypes.MetadataBlock_3010); //$NON-NLS-1$
case TrimWhitespaceEditPart.VISUAL_ID:
return getImage(
"Navigator?Node?http://lib.unc.edu/schemas/crosswalk?TrimWhitespace", CrosswalkElementTypes.TrimWhitespace_3006); //$NON-NLS-1$
case MetadataBlock3EditPart.VISUAL_ID:
return getImage(
"Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MetadataBlock", CrosswalkElementTypes.MetadataBlock_3019); //$NON-NLS-1$
- case CurrentUsernameEditPart.VISUAL_ID:
+ case MetadataBlock2EditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?CurrentUsername", CrosswalkElementTypes.CurrentUsername_3022); //$NON-NLS-1$
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MetadataBlock", CrosswalkElementTypes.MetadataBlock_3018); //$NON-NLS-1$
case CurrentDateEditPart.VISUAL_ID:
return getImage(
"Navigator?Node?http://lib.unc.edu/schemas/crosswalk?CurrentDate", CrosswalkElementTypes.CurrentDate_3021); //$NON-NLS-1$
- case DateRecognizerEditPart.VISUAL_ID:
+ case FormEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DateRecognizer", CrosswalkElementTypes.DateRecognizer_3004); //$NON-NLS-1$
+ "Navigator?TopLevelNode?http://lib.unc.edu/schemas/crosswalk?Form", CrosswalkElementTypes.Form_2003); //$NON-NLS-1$
case CrossWalkEditPart.VISUAL_ID:
return getImage(
"Navigator?TopLevelNode?http://lib.unc.edu/schemas/crosswalk?CrossWalk", CrosswalkElementTypes.CrossWalk_2001); //$NON-NLS-1$
case InputOutputEditPart.VISUAL_ID:
return getImage(
"Navigator?Link?http://lib.unc.edu/schemas/crosswalk?Input?Output", CrosswalkElementTypes.InputOutput_4001); //$NON-NLS-1$
- case TextInputFieldEditPart.VISUAL_ID:
- return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?TextInputField", CrosswalkElementTypes.TextInputField_3023); //$NON-NLS-1$
- case MappedElementEditPart.VISUAL_ID:
- return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedElement", CrosswalkElementTypes.MappedElement_3007); //$NON-NLS-1$
- case EditingContainerEditPart.VISUAL_ID:
- return getImage(
- "Navigator?Diagram?http://lib.unc.edu/schemas/crosswalk?EditingContainer", CrosswalkElementTypes.EditingContainer_1000); //$NON-NLS-1$
- case DateInputFieldEditPart.VISUAL_ID:
+ case DelimitedFileEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DateInputField", CrosswalkElementTypes.DateInputField_3024); //$NON-NLS-1$
- case MetadataBlock2EditPart.VISUAL_ID:
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?DelimitedFile", CrosswalkElementTypes.DelimitedFile_3001); //$NON-NLS-1$
+ case MappedElement2EditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MetadataBlock", CrosswalkElementTypes.MetadataBlock_3018); //$NON-NLS-1$
- case MappedAttributeEditPart.VISUAL_ID:
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedElement", CrosswalkElementTypes.MappedElement_3008); //$NON-NLS-1$
+ case MetadataBlockEditPart.VISUAL_ID:
return getImage(
- "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MappedAttribute", CrosswalkElementTypes.MappedAttribute_3009); //$NON-NLS-1$
+ "Navigator?Node?http://lib.unc.edu/schemas/crosswalk?MetadataBlock", CrosswalkElementTypes.MetadataBlock_3010); //$NON-NLS-1$
}
return getImage("Navigator?UnknownElement", null); //$NON-NLS-1$
}
@@ -248,50 +248,50 @@ public String getText(View view) {
return getUnresolvedDomainElementProxyText(view);
}
switch (CrosswalkVisualIDRegistry.getVisualID(view)) {
- case TabbedDataFieldEditPart.VISUAL_ID:
- return getTabbedDataField_3002Text(view);
+ case CurrentUsernameEditPart.VISUAL_ID:
+ return getCurrentUsername_3022Text(view);
+ case MappedElementEditPart.VISUAL_ID:
+ return getMappedElement_3007Text(view);
case DictionaryEditPart.VISUAL_ID:
return getDictionary_2002Text(view);
- case TextEditPart.VISUAL_ID:
- return getText_3005Text(view);
+ case DateInputFieldEditPart.VISUAL_ID:
+ return getDateInputField_3024Text(view);
+ case TextInputFieldEditPart.VISUAL_ID:
+ return getTextInputField_3023Text(view);
+ case DateRecognizerEditPart.VISUAL_ID:
+ return getDateRecognizer_3004Text(view);
case ParagraphEditPart.VISUAL_ID:
return getParagraph_3020Text(view);
- case DelimitedFileEditPart.VISUAL_ID:
- return getDelimitedFile_3001Text(view);
- case MappedElement2EditPart.VISUAL_ID:
- return getMappedElement_3008Text(view);
- case FormEditPart.VISUAL_ID:
- return getForm_2003Text(view);
+ case MappedAttributeEditPart.VISUAL_ID:
+ return getMappedAttribute_3009Text(view);
+ case TabbedDataFieldEditPart.VISUAL_ID:
+ return getTabbedDataField_3002Text(view);
+ case TextEditPart.VISUAL_ID:
+ return getText_3005Text(view);
+ case EditingContainerEditPart.VISUAL_ID:
+ return getEditingContainer_1000Text(view);
case OriginalNameRecordMatcherEditPart.VISUAL_ID:
return getOriginalNameRecordMatcher_3003Text(view);
- case MetadataBlockEditPart.VISUAL_ID:
- return getMetadataBlock_3010Text(view);
case TrimWhitespaceEditPart.VISUAL_ID:
return getTrimWhitespace_3006Text(view);
case MetadataBlock3EditPart.VISUAL_ID:
return getMetadataBlock_3019Text(view);
- case CurrentUsernameEditPart.VISUAL_ID:
- return getCurrentUsername_3022Text(view);
+ case MetadataBlock2EditPart.VISUAL_ID:
+ return getMetadataBlock_3018Text(view);
case CurrentDateEditPart.VISUAL_ID:
return getCurrentDate_3021Text(view);
- case DateRecognizerEditPart.VISUAL_ID:
- return getDateRecognizer_3004Text(view);
+ case FormEditPart.VISUAL_ID:
+ return getForm_2003Text(view);
case CrossWalkEditPart.VISUAL_ID:
return getCrossWalk_2001Text(view);
case InputOutputEditPart.VISUAL_ID:
return getInputOutput_4001Text(view);
- case TextInputFieldEditPart.VISUAL_ID:
- return getTextInputField_3023Text(view);
- case MappedElementEditPart.VISUAL_ID:
- return getMappedElement_3007Text(view);
- case EditingContainerEditPart.VISUAL_ID:
- return getEditingContainer_1000Text(view);
- case DateInputFieldEditPart.VISUAL_ID:
- return getDateInputField_3024Text(view);
- case MetadataBlock2EditPart.VISUAL_ID:
- return getMetadataBlock_3018Text(view);
- case MappedAttributeEditPart.VISUAL_ID:
- return getMappedAttribute_3009Text(view);
+ case DelimitedFileEditPart.VISUAL_ID:
+ return getDelimitedFile_3001Text(view);
+ case MappedElement2EditPart.VISUAL_ID:
+ return getMappedElement_3008Text(view);
+ case MetadataBlockEditPart.VISUAL_ID:
+ return getMetadataBlock_3010Text(view);
}
return getUnknownElementText(view);
}
@@ -181,3 +181,5 @@ _UI_DatePrecision_day_literal = day
_UI_DatePrecision_hour_literal = hour
_UI_DatePrecision_minute_literal = minute
_UI_DatePrecision_second_literal = second
+_UI_TextInputField_validValues_feature = Valid Values
+_UI_TextInputField_rows_feature = Rows
@@ -65,6 +65,8 @@ public TextInputFieldItemProvider(AdapterFactory adapterFactory) {
addMaxSizePropertyDescriptor(object);
addVocabularyURLPropertyDescriptor(object);
addAllowFreeTextPropertyDescriptor(object);
+ addValidValuesPropertyDescriptor(object);
+ addRowsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
@@ -157,6 +159,50 @@ protected void addAllowFreeTextPropertyDescriptor(Object object) {
null));
}
+ /**
+ * This adds a property descriptor for the Valid Values feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addValidValuesPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TextInputField_validValues_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TextInputField_validValues_feature", "_UI_TextInputField_type"),
+ CrosswalkPackage.Literals.TEXT_INPUT_FIELD__VALID_VALUES,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
+ null,
+ null));
+ }
+
+ /**
+ * This adds a property descriptor for the Rows feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected void addRowsPropertyDescriptor(Object object) {
+ itemPropertyDescriptors.add
+ (createItemPropertyDescriptor
+ (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
+ getResourceLocator(),
+ getString("_UI_TextInputField_rows_feature"),
+ getString("_UI_PropertyDescriptor_description", "_UI_TextInputField_rows_feature", "_UI_TextInputField_type"),
+ CrosswalkPackage.Literals.TEXT_INPUT_FIELD__ROWS,
+ true,
+ false,
+ false,
+ ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE,
+ null,
+ null));
+ }
+
/**
* This returns TextInputField.gif.
* <!-- begin-user-doc -->
@@ -198,6 +244,8 @@ public void notifyChanged(Notification notification) {
case CrosswalkPackage.TEXT_INPUT_FIELD__MAX_SIZE:
case CrosswalkPackage.TEXT_INPUT_FIELD__VOCABULARY_URL:
case CrosswalkPackage.TEXT_INPUT_FIELD__ALLOW_FREE_TEXT:
+ case CrosswalkPackage.TEXT_INPUT_FIELD__VALID_VALUES:
+ case CrosswalkPackage.TEXT_INPUT_FIELD__ROWS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
@@ -170,6 +170,10 @@
unsettable="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="allowFreeText" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="validValues" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="rows" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
+ defaultValueLiteral="1"/>
<eGenericSuperTypes eClassifier="#//InputField">
<eTypeArguments eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eGenericSuperTypes>
@@ -139,6 +139,8 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute crosswalk.ecore#//TextInputField/maxSize"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute crosswalk.ecore#//TextInputField/vocabularyURL"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute crosswalk.ecore#//TextInputField/allowFreeText"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute crosswalk.ecore#//TextInputField/validValues"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute crosswalk.ecore#//TextInputField/rows"/>
</genClasses>
<genClasses image="false" ecoreClass="crosswalk.ecore#//ContextProvider">
<genFeatures property="None" notify="false" createChild="false" propertySortChoices="true"
@@ -1440,10 +1440,10 @@
</diagram>
<plugin
provider="UNC Chapel Hill Libraries"
- version="4.0.0.qualifier">
+ version="4.0.1.qualifier">
<requiredPlugins>org.eclipse.draw2d</requiredPlugins>
<requiredPlugins>org.eclipse.gmf.runtime.draw2d.ui</requiredPlugins>
- <requiredPlugins>org.eclipse.gmf.tooling.runtime</requiredPlugins>
+ <requiredPlugins>org.eclipse.gmf.runtime.tooling</requiredPlugins>
</plugin>
<editor/>
<navigator>
@@ -1323,14 +1323,32 @@
*/
int TEXT_INPUT_FIELD__ALLOW_FREE_TEXT = INPUT_FIELD_FEATURE_COUNT + 3;
+ /**
+ * The feature id for the '<em><b>Valid Values</b></em>' attribute list.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TEXT_INPUT_FIELD__VALID_VALUES = INPUT_FIELD_FEATURE_COUNT + 4;
+
+ /**
+ * The feature id for the '<em><b>Rows</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int TEXT_INPUT_FIELD__ROWS = INPUT_FIELD_FEATURE_COUNT + 5;
+
/**
* The number of structural features of the '<em>Text Input Field</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int TEXT_INPUT_FIELD_FEATURE_COUNT = INPUT_FIELD_FEATURE_COUNT + 4;
+ int TEXT_INPUT_FIELD_FEATURE_COUNT = INPUT_FIELD_FEATURE_COUNT + 6;
/**
* The meta object id for the '{@link crosswalk.MappingContainer <em>Mapping Container</em>}' class.
@@ -2552,6 +2570,28 @@
*/
EAttribute getTextInputField_AllowFreeText();
+ /**
+ * Returns the meta object for the attribute list '{@link crosswalk.TextInputField#getValidValues <em>Valid Values</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute list '<em>Valid Values</em>'.
+ * @see crosswalk.TextInputField#getValidValues()
+ * @see #getTextInputField()
+ * @generated
+ */
+ EAttribute getTextInputField_ValidValues();
+
+ /**
+ * Returns the meta object for the attribute '{@link crosswalk.TextInputField#getRows <em>Rows</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Rows</em>'.
+ * @see crosswalk.TextInputField#getRows()
+ * @see #getTextInputField()
+ * @generated
+ */
+ EAttribute getTextInputField_Rows();
+
/**
* Returns the meta object for class '{@link crosswalk.ContextProvider <em>Context Provider</em>}'.
* <!-- begin-user-doc -->
@@ -3524,6 +3564,22 @@
*/
EAttribute TEXT_INPUT_FIELD__ALLOW_FREE_TEXT = eINSTANCE.getTextInputField_AllowFreeText();
+ /**
+ * The meta object literal for the '<em><b>Valid Values</b></em>' attribute list feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TEXT_INPUT_FIELD__VALID_VALUES = eINSTANCE.getTextInputField_ValidValues();
+
+ /**
+ * The meta object literal for the '<em><b>Rows</b></em>' attribute feature.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ EAttribute TEXT_INPUT_FIELD__ROWS = eINSTANCE.getTextInputField_Rows();
+
/**
* The meta object literal for the '{@link crosswalk.impl.ContextProviderImpl <em>Context Provider</em>}' class.
* <!-- begin-user-doc -->
Oops, something went wrong.

0 comments on commit 29851fc

Please sign in to comment.