org.xwiki.gwt.wysiwyg.client.plugin.link.ui
Class AbstractExplorerWizardStep

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep<EntityLink<LinkConfig>>
      extended by org.xwiki.gwt.wysiwyg.client.plugin.link.ui.AbstractExplorerWizardStep
All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler, com.smartgwt.client.widgets.events.KeyPressHandler, com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler, SourcesNavigationEvents, WizardStep
Direct Known Subclasses:
AttachmentExplorerWizardStep, WikiPageExplorerWizardStep

public abstract class AbstractExplorerWizardStep
extends AbstractSelectorWizardStep<EntityLink<LinkConfig>>
implements SourcesNavigationEvents, com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler, com.smartgwt.client.widgets.events.KeyPressHandler

Wizard step to provide an interface to selecting a wiki resource, using an XWikiExplorer.

Version:
$Id: AbstractExplorerWizardStep.java 31743 2010-10-13 01:20:32Z mflorea $

Field Summary
protected static java.lang.String FIELD_ERROR_STYLE
          The style of the fields under error.
 
Constructor Summary
  AbstractExplorerWizardStep(WikiServiceAsync wikiService, boolean addPage, boolean showAttachments, boolean addAttachments)
          Builds a AbstractExplorerWizardStep from the passed settings.
protected AbstractExplorerWizardStep(WikiServiceAsync wikiService, boolean addPage, boolean showAttachments, boolean addAttachments, int width, int height)
          Builds a AbstractExplorerWizardStep from the passed settings, with parameters for size.
 
Method Summary
 void addNavigationListener(NavigationListener listener)
          
 com.google.gwt.user.client.ui.Widget display()
          
protected  void displayError(java.lang.String errorMessage)
          Displays the passed error message and markers in this wizard step.
 XWikiExplorer getExplorer()
           
 java.lang.String getStepTitle()
          
protected  WikiServiceAsync getWikiService()
           
protected  void hideError()
          Hides the error messages and markers in this wizard step.
 void init(java.lang.Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          
protected  void initializeSelection(com.google.gwt.user.client.rpc.AsyncCallback<?> initCallback)
          Initializes the selection on AbstractSelectorWizardStep.init(Object, AsyncCallback) time.
protected  void invalidateExplorerData()
          Invalidates the cache on the explorer, so that it will be reloaded on next display.
 void onCancel()
          
 void onKeyPress(com.smartgwt.client.widgets.events.KeyPressEvent event)
          
 void onRecordDoubleClick(com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent event)
          
 void removeNavigationListener(NavigationListener listener)
          
 void setHelpLabelText(java.lang.String helpLabelText)
          Sets the help message to be displayed on top of the explorer tree.
 void setStepTitle(java.lang.String stepTitle)
          Sets the step title.
protected  void updateLinkConfig(EntityReference selectedEntityReference, com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> callback)
          Updates the link configuration object based on the selected entity.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep
getData, getDirectionName, getResult, getValidDirections, setActive
 
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, onSubmit
 

Field Detail

FIELD_ERROR_STYLE

protected static final java.lang.String FIELD_ERROR_STYLE
The style of the fields under error.

See Also:
Constant Field Values
Constructor Detail

AbstractExplorerWizardStep

public AbstractExplorerWizardStep(WikiServiceAsync wikiService,
                                  boolean addPage,
                                  boolean showAttachments,
                                  boolean addAttachments)
Builds a AbstractExplorerWizardStep from the passed settings.

Parameters:
wikiService - the service to be used to parse and serialize entity references
addPage - specifies whether the wiki explorer should show the option to add a page
showAttachments - specifies whether the wiki explorer should show the attached files for pages
addAttachments - specifies whether the wiki explorer should show the option to add an attachment

AbstractExplorerWizardStep

protected AbstractExplorerWizardStep(WikiServiceAsync wikiService,
                                     boolean addPage,
                                     boolean showAttachments,
                                     boolean addAttachments,
                                     int width,
                                     int height)
Builds a AbstractExplorerWizardStep from the passed settings, with parameters for size.
FIXME: remove the size parameters when the explorer will be correctly sizable from CSS.

Parameters:
wikiService - the service to be used to parse and serialize entity references
addPage - specifies whether the wiki explorer should show the option to add a page
showAttachments - specifies whether the wiki explorer should show the attached files for pages
addAttachments - specifies whether the wiki explorer should show the option to add an attachment
width - explorer width in pixels
height - explorer height in pixels
Method Detail

setHelpLabelText

public void setHelpLabelText(java.lang.String helpLabelText)
Sets the help message to be displayed on top of the explorer tree.

Parameters:
helpLabelText - the new help message

invalidateExplorerData

protected void invalidateExplorerData()
Invalidates the cache on the explorer, so that it will be reloaded on next display. To be used to request an update of the tree when new data is added to it.


display

public com.google.gwt.user.client.ui.Widget display()

Specified by:
display in interface WizardStep

getExplorer

public XWikiExplorer getExplorer()
Returns:
the wiki explorer used by this selector

init

public void init(java.lang.Object data,
                 com.google.gwt.user.client.rpc.AsyncCallback<?> cb)

Specified by:
init in interface WizardStep
Overrides:
init in class AbstractSelectorWizardStep<EntityLink<LinkConfig>>

initializeSelection

protected void initializeSelection(com.google.gwt.user.client.rpc.AsyncCallback<?> initCallback)
Initializes the selection on AbstractSelectorWizardStep.init(Object, AsyncCallback) time.

Overrides:
initializeSelection in class AbstractSelectorWizardStep<EntityLink<LinkConfig>>
Parameters:
initCallback - the initialization callback, to handle asynchronous initialization.
See Also:
AbstractSelectorWizardStep.initializeSelection(AsyncCallback)

displayError

protected void displayError(java.lang.String errorMessage)
Displays the passed error message and markers in this wizard step.

Parameters:
errorMessage - the error message to print

hideError

protected void hideError()
Hides the error messages and markers in this wizard step.


addNavigationListener

public void addNavigationListener(NavigationListener listener)

Specified by:
addNavigationListener in interface SourcesNavigationEvents

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)

Specified by:
removeNavigationListener in interface SourcesNavigationEvents

onRecordDoubleClick

public void onRecordDoubleClick(com.smartgwt.client.widgets.grid.events.RecordDoubleClickEvent event)

Specified by:
onRecordDoubleClick in interface com.smartgwt.client.widgets.grid.events.RecordDoubleClickHandler

onKeyPress

public void onKeyPress(com.smartgwt.client.widgets.events.KeyPressEvent event)

Specified by:
onKeyPress in interface com.smartgwt.client.widgets.events.KeyPressHandler

updateLinkConfig

protected void updateLinkConfig(EntityReference selectedEntityReference,
                                com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> callback)
Updates the link configuration object based on the selected entity.

Parameters:
selectedEntityReference - a reference to the selected entity
callback - the object to be notified after the link configuration object has been updated

getWikiService

protected WikiServiceAsync getWikiService()
Returns:
the service used to parse and serialize entity references

onCancel

public void onCancel()

Specified by:
onCancel in interface WizardStep
See Also:
WizardStep.onCancel()

getStepTitle

public java.lang.String getStepTitle()

Specified by:
getStepTitle in interface WizardStep
See Also:
WizardStep.getStepTitle()

setStepTitle

public void setStepTitle(java.lang.String stepTitle)
Sets the step title.

Parameters:
stepTitle - the new step title


Copyright © 2004-2010 XWiki. All Rights Reserved.