com.xpn.xwiki.wysiwyg.client.plugin.image.ui
Class ImagesExplorerWizardStep

java.lang.Object
  extended by com.xpn.xwiki.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep<ImageConfig>
      extended by com.xpn.xwiki.wysiwyg.client.plugin.image.ui.ImagesExplorerWizardStep
All Implemented Interfaces:
com.google.gwt.event.dom.client.ChangeHandler, com.google.gwt.event.shared.EventHandler, SourcesNavigationEvents, WizardStep

public class ImagesExplorerWizardStep
extends AbstractSelectorWizardStep<ImageConfig>
implements com.google.gwt.event.dom.client.ChangeHandler, SourcesNavigationEvents

Wizard step to explore and select images from all the pages in the wiki.

Version:
$Id: ImagesExplorerWizardStep.java 25062 2009-11-14 12:26:11Z mflorea $

Constructor Summary
ImagesExplorerWizardStep(ResourceName editedResource, boolean displayWikiSelector, WikiServiceAsync wikiService)
          Builds an image explorer with the default selection on the passed resource.
 
Method Summary
 void addNavigationListener(NavigationListener listener)
          
 com.google.gwt.user.client.ui.Widget display()
          
 java.lang.String getNextStep()
          
 java.lang.String getStepTitle()
          
protected  void initCurrentPage(ResourceName resource, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Initializes and displays the page selector panel for the currently selected resource.
protected  void initializeSelection(com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Initializes the selection on AbstractSelectorWizardStep.init(Object, AsyncCallback) time.
 void onCancel()
          
 void onChange(com.google.gwt.event.dom.client.ChangeEvent event)
          
 void onSubmit(com.google.gwt.user.client.rpc.AsyncCallback<java.lang.Boolean> async)
          
 void removeNavigationListener(NavigationListener listener)
          
 void setActive()
          Notifies this wizard step that it has been activated, when part of an aggregator for example.
 void setSelection(java.lang.String wiki, java.lang.String space, java.lang.String page, java.lang.String fileName, boolean forceRefresh, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Sets the selection to the specified wiki, space and page and reloads the images panel.
 
Methods inherited from class com.xpn.xwiki.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep
getData, getDirectionName, getResult, getValidDirections, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImagesExplorerWizardStep

public ImagesExplorerWizardStep(ResourceName editedResource,
                                boolean displayWikiSelector,
                                WikiServiceAsync wikiService)
Builds an image explorer with the default selection on the passed resource.

Parameters:
editedResource - the resource edited by the wizard in which this wizard step appears (the page currently edited with the wysiwyg)
displayWikiSelector - whether this explorer should show the selector to choose an image from a different wiki or not
wikiService - the service used to access the wiki
Method Detail

setSelection

public void setSelection(java.lang.String wiki,
                         java.lang.String space,
                         java.lang.String page,
                         java.lang.String fileName,
                         boolean forceRefresh,
                         com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Sets the selection to the specified wiki, space and page and reloads the images panel.

Parameters:
wiki - the wiki to set the selection to
space - the space to set the selection on
page - the page to set the selection on
fileName - the filename of the image to set as currently selected image
forceRefresh - if a refresh should be forced on the list of wikis, spaces, pages in the list boxes
cb - callback to handle asynchronous fill of the wiki, space, page list boxes

onChange

public void onChange(com.google.gwt.event.dom.client.ChangeEvent event)

Specified by:
onChange in interface com.google.gwt.event.dom.client.ChangeHandler
See Also:
ChangeHandler.onChange(ChangeEvent)

initCurrentPage

protected void initCurrentPage(ResourceName resource,
                               com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Initializes and displays the page selector panel for the currently selected resource.

Parameters:
resource - the resource to display the selector panel for
cb - the callback to handle asynchronous initialization

display

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

Specified by:
display 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

initializeSelection

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

Overrides:
initializeSelection in class AbstractSelectorWizardStep<ImageConfig>
Parameters:
cb - the initialization callback, to handle asynchronous initialization.

onCancel

public void onCancel()

Specified by:
onCancel in interface WizardStep

onSubmit

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

Specified by:
onSubmit in interface WizardStep

addNavigationListener

public void addNavigationListener(NavigationListener listener)

Specified by:
addNavigationListener in interface SourcesNavigationEvents

removeNavigationListener

public void removeNavigationListener(NavigationListener listener)

Specified by:
removeNavigationListener in interface SourcesNavigationEvents

setActive

public void setActive()
Notifies this wizard step that it has been activated, when part of an aggregator for example.
FIXME: this function should not be here but in it's own decorating interface for aggregated wizard steps or, cleaner, all wizard steps who need to be notified when they're activated should implement Focusable interface and all wizard step handlers (the dialog, the aggregator) should call setFocus(). This is a quick solution to handle tab change in the selector aggregator.

Overrides:
setActive in class AbstractSelectorWizardStep<ImageConfig>


Copyright © 2004-2010 XWiki. All Rights Reserved.