|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.editor.wizards.document.InsertElementWizardProvider
public class InsertElementWizardProvider
A wizard that queries contents of new element(s) that should be inserted at
given location. When wizard finishes, these elements are returned as an array
of insertpoints and elements. Wizard does not insert those elements itself,
you may use
ElementLoc.insert()
method
to do that.
Field Summary | |
---|---|
protected MultiWizard |
parent
We are being executed in this multiwizard. |
protected List<Element> |
roots
'Root' elements - elements that'll be inserted into given parent element. |
protected List<NewElementRule> |
rules
Contains rules for elements. |
protected InsertList |
selected
Selected insert list. |
protected NamespaceManager |
startNsManager
This manager was given to the constructor. |
protected List<IWizard> |
wizards
Wizards that has been activated. |
protected XMLAccess |
xmlAccess
The document instance. |
Constructor Summary | |
---|---|
InsertElementWizardProvider(XMLAccess xmlAccess,
List<InsertList> insertLists,
Element parent,
NamespaceManager nsManager)
Constructor. |
Method Summary | |
---|---|
IWizard |
current()
Fetches the current wizard. |
void |
dispose()
Provider should dispose any objects it collected. |
static ElementLoc |
execute(Shell parent,
XMLAccess xmlAccess,
sk.baka.ikslibs.ptr.DomPointer place,
NamespaceManager nsManager,
QName preselected)
Helper method that executes the insert element wizard. |
protected IWizard |
findNextWizard()
Finds next wizard for querying contents of an element. |
List<Element> |
getElements()
'Root' elements - elements that'll be inserted into given parent element. |
InsertList |
getInsertList()
Selected insert list. |
String |
getName()
Returns name of this wizard. |
NamespaceManager |
getPrevNsManager()
Previous namespace manager. |
boolean |
hasNext()
Checks if there is next wizard. |
boolean |
hasPrevious()
Checks if there is previous wizard. |
NamespaceManager |
newNsManager()
Current namespace manager. |
IWizard |
next()
Fetches the next wizard. |
void |
performCancel()
Called when all opened wizards (from first wizard to current wizard) have already been cancelled. |
void |
performFinish()
Called when all wizards (from first wizard to current wizard) have already been finished. |
IWizard |
previous()
Fetches the previous wizard. |
void |
setWizard(MultiWizard wizard)
Sets the multi-wizard object instance, that'll navigate user through other wizards using this provider. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final XMLAccess xmlAccess
protected final List<IWizard> wizards
null
s
in order to be consistent with rules
and
roots
lists.
protected final NamespaceManager startNsManager
protected MultiWizard parent
protected final List<NewElementRule> rules
roots.get(i)
using
wizards.get(i+1)
wizard. Note that this wizard may be
null
if element does not require any contents.
protected List<Element> roots
protected InsertList selected
null
if this provider is showing
first wizard.
Constructor Detail |
---|
public InsertElementWizardProvider(XMLAccess xmlAccess, List<InsertList> insertLists, Element parent, NamespaceManager nsManager)
xmlAccess
- instance of the document.insertLists
- list of possible insertlists.parent
- the parent element - here all elements will be created.nsManager
- the namespace manager instance.Method Detail |
---|
public static ElementLoc execute(Shell parent, XMLAccess xmlAccess, sk.baka.ikslibs.ptr.DomPointer place, NamespaceManager nsManager, QName preselected)
parent
- parent of the wizard dialog. Can be null
but
this is not recommended.place
- where to insert new elements.xmlAccess
- the document instance.nsManager
- the namespace manager instance.preselected
- this element was requested by user to appear as first
element. May be null
.
null
if user
cancelled the wizard or no elements are insertable.public void performFinish()
IMultiWizardProvider
performFinish
in interface IMultiWizardProvider
public void performCancel()
IMultiWizardProvider
performCancel
in interface IMultiWizardProvider
public void dispose()
IMultiWizardProvider
MultiWizard
.
dispose
in interface IMultiWizardProvider
public void setWizard(MultiWizard wizard)
IMultiWizardProvider
setWizard
in interface IMultiWizardProvider
wizard
- the wizard that'll use this provider.public IWizard current()
IMultiWizardProvider
current
in interface IMultiWizardProvider
null
only if the
provider provides no wizards.public List<Element> getElements()
null
is returned.
null
if wizard shows its
first page.public InsertList getInsertList()
null
if this provider is
showing first wizard.public NamespaceManager getPrevNsManager()
public NamespaceManager newNsManager()
public IWizard next()
IMultiWizardProvider
hasNext()
returned true
- it may throw
ProviderException
.
next
in interface IMultiWizardProvider
MultiWizard
initializes it for you. Never
null
.protected IWizard findNextWizard()
null
if no wizard is needed. All used rules are placed
into the rules
array to mark progress done. The
wizards
array is filled with null
s if
required, to remain consistent with the rules
array.
null
if no wizard is needed.public IWizard previous()
IMultiWizardProvider
previous
in interface IMultiWizardProvider
public boolean hasNext()
IMultiWizardProvider
hasNext
in interface IMultiWizardProvider
true
if there is next wizard or false
if next()
will fail.public boolean hasPrevious()
IMultiWizardProvider
hasPrevious
in interface IMultiWizardProvider
true
if there is previous wizard or
false
if previous()
will fail.public String getName()
IMultiWizardProvider
getName
in interface IMultiWizardProvider
null
then the name is collected from child wizards.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |