com.xpn.xwiki.wysiwyg.client.plugin.link.ui
Class AbstractExternalLinkWizardStep

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
      extended by com.xpn.xwiki.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: AbstractExternalLinkWizardStep.java 24761 2009-10-29 15:45:32Z mflorea $

Field Summary
 
Fields inherited from class com.xpn.xwiki.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
DEFAULT_STYLE_NAME, ERROR_LABEL_STYLE, FIELD_ERROR_STYLE, HELP_LABEL_STYLE, INFO_LABEL_STYLE
 
Constructor Summary
AbstractExternalLinkWizardStep()
          Default constructor.
 
Method Summary
protected abstract  java.lang.String buildURL()
          Builds an URL to the external resource to be linked from the user input, adding protocols, parsing user input, etc.
 com.google.gwt.user.client.ui.Widget display()
          
protected  void displayURLError(java.lang.String errorMessage)
          Displays the URL error message and markers.
protected abstract  java.lang.String getURLErrorMessage()
           
protected abstract  java.lang.String getURLHelpLabel()
           
protected abstract  java.lang.String getURLLabel()
           
 com.google.gwt.user.client.ui.TextBox getUrlTextBox()
           
protected  java.lang.String getURLTextBoxTooltip()
           
protected  void hideErrors()
          Hides the error message and markers for this dialog.
 void init(java.lang.Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          
protected  void saveForm()
          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  boolean validateForm()
          Validates this step's form and displays errors if needed.
 
Methods inherited from class com.xpn.xwiki.wysiwyg.client.plugin.link.ui.LinkConfigWizardStep
addNavigationListener, displayLabelError, getDefaultDirection, getDirectionName, getLabelErrorLabel, getLabelTextBox, getLabelTextBoxTooltip, getLinkData, getMainPanel, getNewWindowCheckBox, getNextStep, getResult, getStepTitle, getTooltipTextBox, getTooltipTextBoxTooltip, getValidDirections, onCancel, onKeyPress, onSubmit, removeNavigationListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExternalLinkWizardStep

public AbstractExternalLinkWizardStep()
Default constructor.

Method Detail

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 LinkConfigWizardStep

setFocus

protected void setFocus()
Sets the default focus in this wizard step.

Overrides:
setFocus in class LinkConfigWizardStep

display

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

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

validateForm

protected boolean validateForm()
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()
Saves the form values in this step's data, to be called only when LinkConfigWizardStep.validateForm() returns true.

Overrides:
saveForm in class LinkConfigWizardStep

getUrlTextBox

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

getURLLabel

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

getURLHelpLabel

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

getURLErrorMessage

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

buildURL

protected abstract java.lang.String buildURL()
Builds an URL to the external resource to be linked from the user input, adding protocols, parsing user input, etc.

Returns:
the URL to the external resource from the user input.

getURLTextBoxTooltip

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

hideErrors

protected void hideErrors()
Hides the error message and markers for this dialog.

Overrides:
hideErrors in class LinkConfigWizardStep

displayURLError

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

Parameters:
errorMessage - the error message to display


Copyright © 2004-2010 XWiki. All Rights Reserved.