org.kuali.student.common.ui.client.configurable.mvc.sections
Class SwapSection
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.SwapSection
- All Implemented Interfaces:
- com.google.gwt.event.logical.shared.HasAttachHandlers, 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.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, Iterable<com.google.gwt.user.client.ui.Widget>, HasLayoutController, HasSectionDeletion, Section, ReportExportWidget
public class SwapSection
- extends BaseSection
- implements HasSectionDeletion
A section that contains sections that can be swapped in based on user selection on a KSSelectItemWidgetAbstract
- Author:
- Kuali Student Team
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 |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.IndexedPanel |
com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget |
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets |
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget |
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, addStyleName, addWidget, clearValidationErrors, clearValidationWarnings, enableField, enableValidation, ensureDirtyFlagPath, getField, getFields, getLayout, getLayoutController, getSection, getSections, getUnnestedFields, isDirty, isValidationEnabled, processValidationResults, processValidationResults, progressiveEnableAndRequireFields, progressiveEnableFields, progressiveRequireFields, removeField, removeField, removeSection, removeSection, removeWidget, removeWidget, resetDirtyFlags, resetFieldInteractionFlags, setFieldHasHadFocusFlags, setHelp, setInstructions, setIsDirty, setLayoutController, setRequired, setSectionId, setStyleName, updateModel, updateWidgetData |
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel |
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove |
Methods inherited from class com.google.gwt.user.client.ui.Panel |
add, adopt, adopt, clear, disown, doAttachChildren, doDetachChildren, orphan, remove |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, onLoad, onUnload, 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, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents |
swapSectionMap
private HashMap<String,Section> swapSectionMap
selectableWidget
private KSSelectItemWidgetAbstract selectableWidget
deleted
private List<Section> deleted
dialog
private ConfirmationDialog dialog
showConfirmation
private boolean showConfirmation
lastSelection
private List<String> lastSelection
deletionParentKeys
private List<String> deletionParentKeys
swapEventHandler
private SwapEventHandler swapEventHandler
prevSelection
protected List<String> prevSelection
SwapSection
public SwapSection(KSSelectItemWidgetAbstract selectableWidget)
- Constructor for SwapSection, note that the SelectableWidget passed in is not added to the
UI but is instead used as reference to show different sections. The widget must still be added
to a layout as a field or a widget to show in the UI. A default confirmation dialog will be used.
- Parameters:
selectableWidget
-
SwapSection
public SwapSection(KSSelectItemWidgetAbstract selectableWidget,
ConfirmationDialog dialog)
init
private void init(KSSelectItemWidgetAbstract selectableWidget)
handleUserSelection
private void handleUserSelection()
handleSelection
private void handleSelection()
- This is handled differently than handleUserSelection because it is assumed that the client
is setting the correct values into the widgets, therefore no need to delete sections
(also reduces chance of actually deleting data before it is even shown)
showSwappableSection
private void showSwappableSection(String key)
removeSwappableSection
private void removeSwappableSection(String key)
enableConfirmation
public void enableConfirmation(boolean enable)
addSection
public String addSection(Section section,
String swapKey)
addSection
public String addSection(String key,
Section section,
String swapKey)
addSection
public String addSection(Section section)
- Description copied from class:
BaseSection
- Adds a section to this section's layout.
- Specified by:
addSection
in interface Section
- Overrides:
addSection
in class BaseSection
- See Also:
Section.addSection(org.kuali.student.common.ui.client.configurable.mvc.sections.Section)
addSection
public String addSection(String key,
Section section)
- Description copied from class:
BaseSection
- Same as addSection except with an option user defined key (for retrieval of the section if necessary).
- Specified by:
addSection
in interface Section
- Overrides:
addSection
in class BaseSection
- See Also:
Section.addSection(java.lang.String, org.kuali.student.common.ui.client.configurable.mvc.sections.Section)
getDeletedSections
public List<Section> getDeletedSections()
- Specified by:
getDeletedSections
in interface HasSectionDeletion
getDeletionParentKeys
public List<String> getDeletionParentKeys()
- Specified by:
getDeletionParentKeys
in interface HasSectionDeletion
setDeletionParentKey
public void setDeletionParentKey(List<String> deletionParentKeys)
- deletionParentKeys is optional and is only needed when you want to delete the
entire structure in addition to individual fields with in deleted sections.
- Specified by:
setDeletionParentKey
in interface HasSectionDeletion
- See Also:
SectionBinding.setModelValue(Section, org.kuali.student.common.ui.client.mvc.DataModel, String)
getSwapEventHandler
public SwapEventHandler getSwapEventHandler()
setSwapEventHandler
public void setSwapEventHandler(SwapEventHandler swapEventHandler)
Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.