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

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
All Implemented Interfaces:
com.google.gwt.event.dom.client.KeyPressHandler, com.google.gwt.event.shared.EventHandler, SourcesNavigationEvents, WizardStep
Direct Known Subclasses:
AbstractExternalLinkWizardStep

public class LinkConfigWizardStep
extends AbstractInteractiveWizardStep
implements SourcesNavigationEvents, com.google.gwt.event.dom.client.KeyPressHandler

Default implementation for the link configuration parameters, such as link labels, link tooltip, or opening the link in a new window or not.

Version:
$Id: d655cf68b83f9b84c8ac1b617ad424cc89161a34 $

Field Summary
static String DEFAULT_STYLE_NAME
          The default style of the link configuration dialog.
static String ERROR_LABEL_STYLE
          The style of the error labels in this form.
protected static String FIELD_ERROR_STYLE
          The style of the fields under error.
static String HELP_LABEL_STYLE
          The style of the description labels in this form.
static String INFO_LABEL_STYLE
          The style of the information labels in this form.
 
Constructor Summary
LinkConfigWizardStep(WikiServiceAsync wikiService)
          Creates a new link configuration wizard step.
 
Method Summary
 void addNavigationListener(NavigationListener listener)
          
protected  void displayLabelError(String errorMessage)
          Display the label error message and markers.
protected  EntityLink<LinkConfig> getData()
           
 NavigationListener.NavigationDirection getDefaultDirection()
           
protected  com.google.gwt.user.client.ui.Label getLabelErrorLabel()
           
protected  com.google.gwt.user.client.ui.TextBox getLabelTextBox()
           
protected  String getLabelTextBoxTooltip()
           
 com.google.gwt.user.client.ui.CheckBox getNewWindowCheckBox()
           
 Object getResult()
          
 com.google.gwt.user.client.ui.TextBox getTooltipTextBox()
           
protected  String getTooltipTextBoxTooltip()
           
protected  WikiServiceAsync getWikiService()
           
protected  void hideErrors()
          Hides the error message and markers for this dialog.
 void init(Object data, com.google.gwt.user.client.rpc.AsyncCallback<?> callback)
          
 void onCancel()
          
 void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
          
 void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> async)
          
 void removeNavigationListener(NavigationListener listener)
          
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 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 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
 

Field Detail

DEFAULT_STYLE_NAME

public static final String DEFAULT_STYLE_NAME
The default style of the link configuration dialog.

See Also:
Constant Field Values

INFO_LABEL_STYLE

public static final String INFO_LABEL_STYLE
The style of the information labels in this form.

See Also:
Constant Field Values

HELP_LABEL_STYLE

public static final String HELP_LABEL_STYLE
The style of the description labels in this form.

See Also:
Constant Field Values

ERROR_LABEL_STYLE

public static final String ERROR_LABEL_STYLE
The style of the error labels in this form.

See Also:
Constant Field Values

FIELD_ERROR_STYLE

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

See Also:
Constant Field Values
Constructor Detail

LinkConfigWizardStep

public LinkConfigWizardStep(WikiServiceAsync wikiService)
Creates a new link configuration wizard step.

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

init

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

Specified by:
init in interface WizardStep

setFocus

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


getLabelTextBox

protected com.google.gwt.user.client.ui.TextBox getLabelTextBox()
Returns:
the labelTextBox

getLabelTextBoxTooltip

protected String getLabelTextBoxTooltip()
Returns:
the tooltip for label text box

getTooltipTextBoxTooltip

protected String getTooltipTextBoxTooltip()
Returns:
the tooltip for the tooltip text box

getTooltipTextBox

public com.google.gwt.user.client.ui.TextBox getTooltipTextBox()
Returns:
the tooltipTextBox

getNewWindowCheckBox

public com.google.gwt.user.client.ui.CheckBox getNewWindowCheckBox()
Returns:
the newWindowCheckBox

onSubmit

public void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<Boolean> async)

Specified by:
onSubmit in interface WizardStep

validateForm

protected boolean validateForm()
Validates this step's form and displays errors if needed.

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

Parameters:
callback - the object to be notified after the form is saved

onCancel

public void onCancel()

Specified by:
onCancel in interface WizardStep

getResult

public Object getResult()

Specified by:
getResult in interface WizardStep

getDefaultDirection

public NavigationListener.NavigationDirection getDefaultDirection()
Returns:
the default navigation direction, to be fired automatically when enter is hit in an input in the form of this configuration wizard step. To be overridden by subclasses to provide the specific direction to be followed.

addNavigationListener

public void addNavigationListener(NavigationListener listener)

Specified by:
addNavigationListener in interface SourcesNavigationEvents

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)

Specified by:
removeNavigationListener in interface SourcesNavigationEvents

onKeyPress

public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)

Specified by:
onKeyPress in interface com.google.gwt.event.dom.client.KeyPressHandler
See Also:
KeyPressHandler.onKeyPress(KeyPressEvent)

displayLabelError

protected void displayLabelError(String errorMessage)
Display the label error message and markers.

Parameters:
errorMessage - the error message to display.

hideErrors

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


getLabelErrorLabel

protected com.google.gwt.user.client.ui.Label getLabelErrorLabel()
Returns:
the labelErrorLabel

getData

protected EntityLink<LinkConfig> getData()
Returns:
the data configured by this wizard step

getWikiService

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


Copyright © 2004-2012 XWiki. All Rights Reserved.