public class Convert extends ChooseFieldCommand
convert
.fieldChooser, NO_FIELDS
recordable, repeatable
Modifier | Constructor and Description |
---|---|
|
Convert() |
protected |
Convert(boolean wrap) |
Modifier and Type | Method and Description |
---|---|
protected CommandResult |
doExecute(DocumentView docView,
String parameter,
FieldChoice choice) |
protected FieldChoice |
getPreparedFieldChoice()
Returns the field choice created by
CommandBase.prepare(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int) corresponding to
the "complete parameter" passed to this method. |
FieldChoices |
listFieldChoices(DocumentView docView,
String parameter)
List all possible field choices for this command given
specified selection (obtained through argument
docView )
and specified parameter. |
boolean |
prepare(DocumentView docView,
String parameter,
int x,
int y)
Tests whether this command can be executed with specified parameter
and in specified context.
|
protected void |
resetCommand() |
chooseField, doExecute
doExecuteByName, execute, executeCommand, isRecordable, isRepeatable, prepareCommand
public boolean prepare(DocumentView docView, String parameter, int x, int y)
CommandBase
If the command can be executed, this method returns
true
after having configured its internal state for
consumption by method CommandBase.execute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
which should be invoked
immediately after this one.
Returns false
if this command cannot be executed with
specified parameter and in specified context.
prepare
in class CommandBase
docView
- the target of this commandparameter
- parameterizes the command (that is, modifies the
behavior of the command in a command specific way)x
- X position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputy
- Y position relative to docView of the mouse event
having triggered this command; -1 if this command was triggered by a
keyboard inputprotected FieldChoice getPreparedFieldChoice()
ChooseFieldCommand
CommandBase.prepare(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
corresponding to
the "complete parameter" passed to this method.
Returns null
if there is no such field choice because
this command is to be run interactively.
Method ChooseFieldCommand.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
is implemented as follows:
FieldChoice choice = getPreparedFieldChoice(); if (choice == null) { FieldChoices choices = listFieldChoices(docView, parameter); ...
getPreparedFieldChoice
in class ChooseFieldCommand
ChooseFieldCommand.listFieldChoices(com.xmlmind.xmledit.view.DocumentView, java.lang.String)
public FieldChoices listFieldChoices(DocumentView docView, String parameter)
ChooseFieldCommand
docView
)
and specified parameter.
Method ChooseFieldCommand.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
is implemented as follows:
FieldChoice choice = getPreparedFieldChoice(); if (choice == null) { FieldChoices choices = listFieldChoices(docView, parameter); ...
listFieldChoices
in class ChooseFieldCommand
ChooseFieldCommand.getPreparedFieldChoice()
protected CommandResult doExecute(DocumentView docView, String parameter, FieldChoice choice)
doExecute
in class ChooseFieldCommand
protected void resetCommand()
resetCommand
in class ChooseFieldCommand