org.kuali.student.common.ui.client.configurable.mvc.sections
Class MultiplicitySection
java.lang.Object
com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
com.google.gwt.user.client.ui.Panel
com.google.gwt.user.client.ui.ComplexPanel
org.kuali.student.common.ui.client.widgets.field.layout.element.SpanPanel
org.kuali.student.common.ui.client.configurable.mvc.sections.BaseSection
org.kuali.student.common.ui.client.configurable.mvc.sections.MultiplicitySection
- All Implemented Interfaces:
- com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasWidgets, com.google.gwt.user.client.ui.IndexedPanel, Iterable<com.google.gwt.user.client.ui.Widget>, HasLayoutController, Section
public class MultiplicitySection
- extends BaseSection
This class creates a section containing a multiplicity widget based on the supplied configuration
Sample code to use this class :-
private void addVersionCodeFields(Section section) {
QueryPath parentPath = QueryPath.concat(COURSE, QueryPath.getPathSeparator(), VERSIONS);
MultiplicityConfiguration config = new MultiplicityConfiguration(MultiplicityConfiguration.MultiplicityType.GROUP,
MultiplicityConfiguration.StyleType.TOP_LEVEL_GROUP, getMetaData(parentPath.toString()));
config.setAddItemLabel(getLabel(LUConstants.ADD_VERSION_CODE_LABEL_KEY));
config.setItemLabel(getLabel(LUConstants.VERSION_CODE_LABEL_KEY));
config.setUpdateable(true);
FieldDescriptor parentFd = buildFieldDescriptor(COURSE + QueryPath.getPathSeparator() + VERSIONS, getLabel(LUConstants.VERSION_CODES_LABEL_KEY), null);
config.setParentFd(parentFd);
FieldDescriptor versionCode = buildFieldDescriptor(CreditCourseVersionsConstants.VERSION_CODE, LUConstants.VERSION_CODE_LABEL_KEY, parentPath.toString());
FieldDescriptor versionTitle = buildFieldDescriptor(CreditCourseVersionsConstants.VERSION_TITLE, LUConstants.TITLE_LABEL_KEY, parentPath.toString());
config.addField(versionCode);
config.addField(versionTitle);
MultiplicitySection ms = new MultiplicitySection(config);
section.addSection(ms);
}
TODO:
- Create factory methods for each 'flavour' of multiplicity
- Styling options for table, e.g. no grid lines
- For read-only multiplicities, set contained widgets to be read only too
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
DEBUG_ID_PREFIX |
Methods inherited from class org.kuali.student.common.ui.client.configurable.mvc.sections.BaseSection |
add, addField, addSection, addSection, addStyleName, addWidget, clearValidation, enableValidation, ensureDirtyFlagPath, getField, getFields, getLayout, getLayoutController, getSection, getSections, getUnnestedFields, isValidationEnabled, processValidationResults, processValidationResults, removeField, removeField, removeSection, removeSection, removeWidget, removeWidget, setFieldHasHadFocusFlags, setHelp, setInstructions, setIsDirty, setLayoutController, setRequired, setStyleName, updateModel, updateWidgetData |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, insert, insert, iterator, remove, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, onLoad, onUnload, orphan |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
addDomHandler, addHandler, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
addStyleDependentName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, toString, unsinkEvents |
config
private MultiplicityConfiguration config
widget
private com.google.gwt.user.client.ui.Widget widget
swappableFieldsDefinition
private Map<SwapCompositeCondition,List<SwapCompositeConditionFieldConfig>> swappableFieldsDefinition
deletionParentKeys
private List<String> deletionParentKeys
MultiplicitySection
public MultiplicitySection(MultiplicityConfiguration config)
MultiplicitySection
public MultiplicitySection(MultiplicityConfiguration config,
Map<SwapCompositeCondition,List<SwapCompositeConditionFieldConfig>> swappableFieldsDefinition,
List<String> deletionParentKeys)
initialize
private void initialize()
buildLayout
private void buildLayout()
- Builds a suitable layout and adds the required multiplicity widget
Builds a MultiplicityGroup for a grid layout or a MultiplicityTable
for a FlexTable layout . Sets the appropriate binding for the selected
widget
setParentPath
public void setParentPath(String parentPath)
resetFieldInteractionFlags
public void resetFieldInteractionFlags()
- Description copied from class:
BaseSection
- Resets all the dirty and focus flags on fields.
- Specified by:
resetFieldInteractionFlags
in interface Section
- Overrides:
resetFieldInteractionFlags
in class BaseSection
- See Also:
Section.resetFieldInteractionFlags()
resetDirtyFlags
public void resetDirtyFlags()
- Specified by:
resetDirtyFlags
in interface Section
- Overrides:
resetDirtyFlags
in class BaseSection
isDirty
public boolean isDirty()
- Description copied from class:
BaseSection
- Returns true if this this section is considered dirty (the user may have entered data into this
section)
- Specified by:
isDirty
in interface Section
- Overrides:
isDirty
in class BaseSection
- See Also:
Section.isDirty()
getConfig
public MultiplicityConfiguration getConfig()
Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.