sk.uniba.euromath.editor.wizards.document
Class InsertListChooserWizard

java.lang.Object
  extended by sk.uniba.euromath.editor.wizards.document.InsertListChooserWizard
All Implemented Interfaces:
IWizard

public class InsertListChooserWizard
extends Object
implements IWizard

Allows the user to choose between multiple insertlists, and to choose the name of each element. These user settings are returned. Alternatively, user may choose to enter some text if it is permitted by the rule.

If required, then new prefixes are queried aswell.

Author:
Martin Vysny

Field Summary
protected  NamespaceManager currentManager
          Current namespace manager.
 InsertListChooserWizardPage ilcPage
          First wizard page.
protected  String title
          The title.
 
Constructor Summary
InsertListChooserWizard(XMLAccess xmlAccess, List<InsertList> insertLists, NamespaceManager nsManager, String parentName, IValueRule textRule, String name)
          The constructor.
 
Method Summary
 boolean canFinish()
          Returns whether this wizard could be finished without further user interaction.
 BaseWizardPage current()
          Fetches the current page.
 void dispose()
          Disposes of this wizard.
 String getName()
          Returns name of this wizard.
 List<QName> getNames()
          Returns qnames of new elements, with appropriate prefixes when needed.
 NewPrefixesQueryWizardPage getNpqPage()
          Returns second wizard page.
 RGB getTitleBarColor()
          Returns the title bar color for this wizard.
 boolean hasNext()
          Checks if there is next page.
 boolean hasPrevious()
          Checks if there is previous page.
 NamespaceManager newNsManager()
          Creates new namespace manager, with new namespace-prefix mappings.
 BaseWizardPage next()
          Fetches the next page.
 boolean performCancel()
          Performs any actions appropriate in response to the user having pressed the Cancel button, or refuse if canceling now is not permitted.
 boolean performFinish()
          Performs any actions appropriate in response to the user having pressed the Finish button, or refuse if finishing now is not permitted.
 BaseWizardPage previous()
          Fetches the previous page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ilcPage

public final InsertListChooserWizardPage ilcPage
First wizard page. Never null.


currentManager

protected final NamespaceManager currentManager
Current namespace manager.


title

protected final String title
The title.

Constructor Detail

InsertListChooserWizard

public InsertListChooserWizard(XMLAccess xmlAccess,
                               List<InsertList> insertLists,
                               NamespaceManager nsManager,
                               String parentName,
                               IValueRule textRule,
                               String name)
The constructor.

Parameters:
xmlAccess - the XML Access instance.
insertLists - the list of choosable insertlists.
nsManager - the map of namespace>prefix mapping. It will not get modified. If null then manager from xmlAccess will be used.
parentName - the displayable qname of the parent. It is only displayed in a window as a text - it is not used in other way.
textRule - if not null then it is possible to choose a text value also. This value must comply this rule.
name - the wizard title. Each page will receive this title.
Method Detail

getNpqPage

public NewPrefixesQueryWizardPage getNpqPage()
Returns second wizard page. null when wizard is on the first page.

Returns:
second wizard page instance.

newNsManager

public NamespaceManager newNsManager()
Creates new namespace manager, with new namespace-prefix mappings. If no new mappings are defined, function simply returns old namespace manager.

Returns:
new namespace manager, or instance given to the object constructor if no new namespaces are introduced.
Throws:
IllegalArgumentException - if the page contains errors thus some prefixes cannot be registered.
IllegalStateException - if the page contains errors thus some prefixes cannot be registered.

canFinish

public boolean canFinish()
Description copied from interface: IWizard
Returns whether this wizard could be finished without further user interaction.

The result of this method is typically used by the wizard container to enable or disable the Finish button.

Specified by:
canFinish in interface IWizard
Returns:
true if the wizard could be finished, and false otherwise

dispose

public void dispose()
Description copied from interface: IWizard
Disposes of this wizard. All SWT resources are freed automatically when this method finishes.

Specified by:
dispose in interface IWizard

hasNext

public boolean hasNext()
Description copied from interface: IWizard
Checks if there is next page. This method must return false if current page contains errors.

Specified by:
hasNext in interface IWizard
Returns:
true if there is next wizard or false if next() will fail.

hasPrevious

public boolean hasPrevious()
Description copied from interface: IWizard
Checks if there is previous page.

Specified by:
hasPrevious in interface IWizard
Returns:
true if there is previous wizard or false if previous() will fail.

next

public BaseWizardPage next()
Description copied from interface: IWizard
Fetches the next page. Function may fail even when hasNext() returned true - it may throw ProviderException.

Specified by:
next in interface IWizard
Returns:
next page. The page does not have to be initialized - MultiWizard initializes it for you. Never null.

previous

public BaseWizardPage previous()
Description copied from interface: IWizard
Fetches the previous page. Current page is automatically disposed.

Specified by:
previous in interface IWizard
Returns:
previous page.

performCancel

public boolean performCancel()
Description copied from interface: IWizard
Performs any actions appropriate in response to the user having pressed the Cancel button, or refuse if canceling now is not permitted.

Specified by:
performCancel in interface IWizard
Returns:
true to indicate the cancel request was accepted, and false to indicate that the cancel request was refused

performFinish

public boolean performFinish()
Description copied from interface: IWizard
Performs any actions appropriate in response to the user having pressed the Finish button, or refuse if finishing now is not permitted. Normally this method is only called on the container's current wizard. However if the current wizard is a nested wizard this method will also be called on all wizards in its parent chain. Such parents may use this notification to save state etc. However, the value the parents return from this method is ignored.

Specified by:
performFinish in interface IWizard
Returns:
true to indicate the finish request was accepted, and false to indicate that the finish request was refused

getNames

public List<QName> getNames()
Returns qnames of new elements, with appropriate prefixes when needed. Throws exception when no insertlist is selected.

Returns:
qnames of new elements. Never null.

current

public BaseWizardPage current()
Description copied from interface: IWizard
Fetches the current page.

Specified by:
current in interface IWizard
Returns:
current page. May return null only if the provider provides no pages.

getName

public String getName()
Description copied from interface: IWizard
Returns name of this wizard. Describes this wizard. Shown in the dialog.

Specified by:
getName in interface IWizard
Returns:
displayable wizard name, like 'New element contents'.

getTitleBarColor

public RGB getTitleBarColor()
Description copied from interface: IWizard
Returns the title bar color for this wizard.

Specified by:
getTitleBarColor in interface IWizard
Returns:
the title bar color, or null if default should be used.


Copyright © 2003-2006 null. All Rights Reserved.