|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep<D>
org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractListSelectorWizardStep<D,L>
D - the type of data edited by this wizard step, i.e. expected on initialization and returned as resultL - the type of data to add in the list handled by this wizard steppublic abstract class AbstractListSelectorWizardStep<D,L>
Generic wizard step for selecting from a list of items: it handles list creation and population along with item selection on double click and enter. Subclasses should only handle the operations specific to retrieving the items to put in the list and the UI of the list items.
| Constructor Summary | |
|---|---|
AbstractListSelectorWizardStep()
Default constructor, creating the UI of this wizard step. |
|
| Method Summary | |
|---|---|
void |
addNavigationListener(NavigationListener listener)
|
com.google.gwt.user.client.ui.Widget |
display()
|
protected void |
displayError()
Displays the specified error message and error markers for this wizard step. |
protected abstract void |
fetchData(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<L>> callback)
Fetches the list of items to be displayed in this list from the server. |
protected void |
fillList(java.util.List<L> dataList,
L selectedData)
Fills the list with the given data and selects the specified item. |
protected com.google.gwt.user.client.ui.Label |
getErrorLabel()
|
protected ListBox<L> |
getList()
|
protected abstract ListItem<L> |
getListItem(L data)
|
protected VerticalResizePanel |
getMainPanel()
|
protected ListItem<L> |
getNewOptionListItem()
|
protected ListItem<L> |
getSelectedItem()
Helper method to get the selected item in the list managed by this wizard step. |
protected abstract java.lang.String |
getSelectErrorMessage()
|
protected abstract java.lang.String |
getSelectHelpLabel()
|
protected void |
hideError()
Hides the error markers for this wizard step. |
void |
init(java.lang.Object data,
com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
|
protected boolean |
isSelectedByDefault(L listItemData)
|
void |
onCancel()
|
void |
onDoubleClick(com.google.gwt.event.dom.client.DoubleClickEvent event)
|
void |
onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
|
void |
onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
|
protected void |
refreshList(com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Reloads the list of image previews in asynchronous manner. |
void |
removeNavigationListener(NavigationListener listener)
|
protected abstract void |
saveSelectedValue(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
Saves the current selection in this panel in the data managed by this wizard step, if all validation goes well on the submit time. |
void |
setActive()
Notifies this wizard step that it has been activated, when part of an aggregator for example. |
void |
setNewOptionOnTop(boolean newOptionOnTop)
|
| Methods inherited from class org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep |
|---|
getData, getDirectionName, getResult, getValidDirections, initializeSelection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.xwiki.gwt.user.client.ui.wizard.WizardStep |
|---|
getNextStep, getStepTitle |
| Constructor Detail |
|---|
public AbstractListSelectorWizardStep()
| Method Detail |
|---|
protected abstract java.lang.String getSelectHelpLabel()
protected abstract java.lang.String getSelectErrorMessage()
public void init(java.lang.Object data,
com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
init in interface WizardStepinit in class AbstractSelectorWizardStep<D>protected void refreshList(com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
cb - the callback to handle server callprotected abstract void fetchData(com.google.gwt.user.client.rpc.AsyncCallback<java.util.List<L>> callback)
callback - the callback to notify when the fetching is done.
protected void fillList(java.util.List<L> dataList,
L selectedData)
dataList - the list of data to fill the listselectedData - the data to be selectedprotected boolean isSelectedByDefault(L listItemData)
listItemData - a list item data
true of the list item with the given data should be selected by default, false otherwiseprotected abstract ListItem<L> getListItem(L data)
data - the data to build a list item representation for.
protected ListItem<L> getNewOptionListItem()
null if no such item
should be appended to the list.public com.google.gwt.user.client.ui.Widget display()
display in interface WizardSteppublic void onCancel()
onCancel in interface WizardSteppublic void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
onSubmit in interface WizardStepprotected abstract void saveSelectedValue(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
async - the object to be notified after the selected value is savedonSubmit(AsyncCallback)protected void displayError()
protected void hideError()
public void onDoubleClick(com.google.gwt.event.dom.client.DoubleClickEvent event)
onDoubleClick in interface com.google.gwt.event.dom.client.DoubleClickHandlerDoubleClickHandler.onDoubleClick(DoubleClickEvent)public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
onKeyUp in interface com.google.gwt.event.dom.client.KeyUpHandlerpublic void addNavigationListener(NavigationListener listener)
addNavigationListener in interface SourcesNavigationEventspublic void removeNavigationListener(NavigationListener listener)
removeNavigationListener in interface SourcesNavigationEventsprotected ListBox<L> getList()
protected ListItem<L> getSelectedItem()
protected VerticalResizePanel getMainPanel()
public void setNewOptionOnTop(boolean newOptionOnTop)
newOptionOnTop - set whether the option to add a new item to the list should be added at the top of the list
or at its bottom.public void setActive()
setActive in class AbstractSelectorWizardStep<D>protected com.google.gwt.user.client.ui.Label getErrorLabel()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||