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

java.lang.Object
  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 java.lang.Object
implements WizardStep, 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: LinkConfigWizardStep.java 31743 2010-10-13 01:20:32Z mflorea $

Field Summary
static java.lang.String DEFAULT_STYLE_NAME
          The default style of the link configuration dialog.
static java.lang.String ERROR_LABEL_STYLE
          The style of the error labels in this form.
protected static java.lang.String FIELD_ERROR_STYLE
          The style of the fields under error.
static java.lang.String HELP_LABEL_STYLE
          The style of the description labels in this form.
static java.lang.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)
          
 com.google.gwt.user.client.ui.Widget display()
          
protected  void displayLabelError(java.lang.String errorMessage)
          Display the label error message and markers.
protected  EntityLink<LinkConfig> getData()
           
 NavigationListener.NavigationDirection getDefaultDirection()
           
 java.lang.String getDirectionName(NavigationListener.NavigationDirection direction)
          
protected  com.google.gwt.user.client.ui.Label getLabelErrorLabel()
           
protected  com.google.gwt.user.client.ui.TextBox getLabelTextBox()
           
protected  java.lang.String getLabelTextBoxTooltip()
           
 com.google.gwt.user.client.ui.Panel getMainPanel()
           
 com.google.gwt.user.client.ui.CheckBox getNewWindowCheckBox()
           
 java.lang.String getNextStep()
          
 java.lang.Object getResult()
          
 java.lang.String getStepTitle()
          
 com.google.gwt.user.client.ui.TextBox getTooltipTextBox()
           
protected  java.lang.String getTooltipTextBoxTooltip()
           
 java.util.EnumSet<NavigationListener.NavigationDirection> getValidDirections()
          .
protected  WikiServiceAsync getWikiService()
           
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<?> callback)
          
 void onCancel()
          
 void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
          
 void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
          
 void removeNavigationListener(NavigationListener listener)
          
protected  void saveForm(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STYLE_NAME

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

See Also:
Constant Field Values

INFO_LABEL_STYLE

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

See Also:
Constant Field Values

HELP_LABEL_STYLE

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

See Also:
Constant Field Values

ERROR_LABEL_STYLE

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

See Also:
Constant Field Values

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

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(java.lang.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.


display

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

Specified by:
display in interface WizardStep

getMainPanel

public com.google.gwt.user.client.ui.Panel getMainPanel()
Returns:
the mainPanel, to be used by subclasses to display the form defined by this wizard step.

getLabelTextBox

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

getLabelTextBoxTooltip

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

getTooltipTextBoxTooltip

protected java.lang.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<java.lang.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<java.lang.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 java.lang.Object getResult()

Specified by:
getResult in interface WizardStep

getNextStep

public java.lang.String getNextStep()

Specified by:
getNextStep in interface WizardStep

getStepTitle

public java.lang.String getStepTitle()

Specified by:
getStepTitle in interface WizardStep

getValidDirections

public java.util.EnumSet<NavigationListener.NavigationDirection> getValidDirections()
. Configure this as the last wizard step, by default, allowing to finish, cancel or go to previous step if the navigation stack is not empty at this point.

Specified by:
getValidDirections in interface WizardStep

getDirectionName

public java.lang.String getDirectionName(NavigationListener.NavigationDirection direction)

Specified by:
getDirectionName 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(java.lang.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 WizardStep

getWikiService

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


Copyright © 2004-2011 XWiki. All Rights Reserved.