org.xwiki.gwt.wysiwyg.client.plugin.image.ui
Class ImagesExplorerWizardStep

java.lang.Object
  extended by org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep<EntityLink<ImageConfig>>
      extended by org.xwiki.gwt.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<EntityLink<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 31743 2010-10-13 01:20:32Z mflorea $

Constructor Summary
ImagesExplorerWizardStep(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.Object getResult()
          
 java.lang.String getStepTitle()
          
protected  void initCurrentPage(AttachmentReference imageReference, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Initializes and displays list of images attached to the same page as the specified image, and selects the specified image.
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(AttachmentReference imageReference, com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
          Refreshes the list of images with the images attached to the same page as the specified image, and then selects the specified image.
 
Methods inherited from class org.xwiki.gwt.wysiwyg.client.widget.wizard.util.AbstractSelectorWizardStep
getData, getDirectionName, 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(boolean displayWikiSelector,
                                WikiServiceAsync wikiService)
Builds an image explorer with the default selection on the passed resource.

Parameters:
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(AttachmentReference imageReference,
                         com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Refreshes the list of images with the images attached to the same page as the specified image, and then selects the specified image.

Parameters:
imageReference - a reference to the image to be selected
cb - the object to be notified after the specified image is selected

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(AttachmentReference imageReference,
                               com.google.gwt.user.client.rpc.AsyncCallback<?> cb)
Initializes and displays list of images attached to the same page as the specified image, and selects the specified image.

Parameters:
imageReference - a reference to the image to be selected after the list of images is updated
cb - the object to be notified after the list of images is updated

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<EntityLink<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<EntityLink<ImageConfig>>

getResult

public java.lang.Object getResult()

Specified by:
getResult in interface WizardStep
Overrides:
getResult in class AbstractSelectorWizardStep<EntityLink<ImageConfig>>
See Also:
AbstractSelectorWizardStep.getResult()


Copyright © 2004-2011 XWiki. All Rights Reserved.