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

java.lang.Object
  extended by org.xwiki.gwt.user.client.ui.wizard.AbstractNavigationAwareWizardStep
      extended by org.xwiki.gwt.user.client.ui.wizard.AbstractInteractiveWizardStep
          extended by org.xwiki.gwt.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
              extended by org.xwiki.gwt.wysiwyg.client.plugin.link.ui.AbstractExternalLinkWizardStep
All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyPressHandler, com.google.gwt.event.shared.EventHandler, SourcesNavigationEvents, WizardStep
Direct Known Subclasses:
EmailAddressLinkWizardStep, WebPageLinkWizardStep

public abstract class AbstractExternalLinkWizardStep
extends LinkConfigWizardStep

Wizard step to collect the data about an external link (e.g. http: or mailto:). Extends the default link configuration wizard step by adding the field to collect the external link URL.

Version:
$Id: cc0c3b442b00f9a229966ee984bfeb4b33ed811c $

Field Summary
 
Fields inherited from class org.xwiki.gwt.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
DEFAULT_STYLE_NAME, ERROR_LABEL_STYLE, FIELD_ERROR_STYLE, HELP_LABEL_STYLE, INFO_LABEL_STYLE
 
Constructor Summary
AbstractExternalLinkWizardStep(WikiServiceAsync wikiService)
          Creates a new wizard step for configuring links to external entities.
 
Method Summary
protected  void displayURLError(String errorMessage)
          Displays the URL error message and markers.
protected  String getURL()
          Subclasses can overwrite this method to adjust the URL the user has set.
protected abstract  String getURLErrorMessage()
           
protected abstract  String getURLHelpLabel()
           
protected abstract  String getURLLabel()
           
 com.google.gwt.user.client.ui.TextBox getUrlTextBox()
           
protected  String getURLTextBoxTooltip()
           
protected  void hideErrors()
          Hides the error message and markers for this dialog.
 void init(Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          
protected  void saveForm(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> callback)
          Saves the form values in this step's data, to be called only when LinkConfigWizardStep.validateForm() returns true.
protected  void setFocus()
          Sets the default focus in this wizard step.
protected  void setURL(String url)
          Fills the URL text box with the given URL.
protected  boolean validateForm()
          Validates this step's form and displays errors if needed.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
addNavigationListener, displayLabelError, getData, getDefaultDirection, getLabelErrorLabel, getLabelTextBox, getLabelTextBoxTooltip, getNewWindowCheckBox, getResult, getTooltipTextBox, getTooltipTextBoxTooltip, getWikiService, onCancel, onKeyPress, onSubmit, removeNavigationListener
 
Methods inherited from class org.xwiki.gwt.user.client.ui.wizard.AbstractInteractiveWizardStep
display, getStepTitle, isAutoSubmit, setStepTitle
 
Methods inherited from class org.xwiki.gwt.user.client.ui.wizard.AbstractNavigationAwareWizardStep
getDirectionName, getNextStep, getValidDirections, setDirectionName, setNextStep, setValidDirections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExternalLinkWizardStep

public AbstractExternalLinkWizardStep(WikiServiceAsync wikiService)
Creates a new wizard step for configuring links to external entities.

Parameters:
wikiService - the service to be used for parsing the image reference when the link label is an image
Method Detail

init

public void init(Object data,
                 com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Description copied from class: LinkConfigWizardStep

Specified by:
init in interface WizardStep
Overrides:
init in class LinkConfigWizardStep

setFocus

protected void setFocus()
Description copied from class: LinkConfigWizardStep
Sets the default focus in this wizard step.

Overrides:
setFocus in class LinkConfigWizardStep

validateForm

protected boolean validateForm()
Description copied from class: LinkConfigWizardStep
Validates this step's form and displays errors if needed.

Overrides:
validateForm in class LinkConfigWizardStep
Returns:
true if the form is valid and data can be saved, false otherwise.

saveForm

protected void saveForm(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> callback)
Description copied from class: LinkConfigWizardStep
Saves the form values in this step's data, to be called only when LinkConfigWizardStep.validateForm() returns true.

Overrides:
saveForm in class LinkConfigWizardStep
Parameters:
callback - the object to be notified after the form is saved

getUrlTextBox

public com.google.gwt.user.client.ui.TextBox getUrlTextBox()
Returns:
the urlTextBox

getURLLabel

protected abstract String getURLLabel()
Returns:
the label text for the particular external resource link to be created.

getURLHelpLabel

protected abstract String getURLHelpLabel()
Returns:
the label text for the help label for the url of the external link to be created.

getURLErrorMessage

protected abstract String getURLErrorMessage()
Returns:
the error message to be displayed when the user uri is missing.

getURL

protected String getURL()
Subclasses can overwrite this method to adjust the URL the user has set.

Returns:
the value of the URL text box

setURL

protected void setURL(String url)
Fills the URL text box with the given URL. Subclasses can overwrite this method to adjust the URL.

Parameters:
url - the URL to fill the text box with

getURLTextBoxTooltip

protected String getURLTextBoxTooltip()
Returns:
the tooltip for URL text box.

hideErrors

protected void hideErrors()
Description copied from class: LinkConfigWizardStep
Hides the error message and markers for this dialog.

Overrides:
hideErrors in class LinkConfigWizardStep

displayURLError

protected void displayURLError(String errorMessage)
Displays the URL error message and markers.

Parameters:
errorMessage - the error message to display


Copyright © 2004-2012 XWiki. All Rights Reserved.