public final class CopyAsInclusion extends CommandBase
copyAsInclusion
command.recordable, repeatable
Constructor and Description |
---|
CopyAsInclusion() |
Modifier and Type | Method and Description |
---|---|
CommandResult |
doExecute(DocumentView docView,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
static String |
formatInclusion(Node child1,
Node child2,
SimpleInclusionScheme scheme,
boolean createAbsRef,
String absRef,
Map<Object,Object> inclusionOpts,
boolean checkAdvancedXInclude,
DocumentView docView) |
static boolean |
getAllowAdvancedXInclude(CommandEnv env)
Returns
true if copying a reference to a range of nodes
using XInclude is allowed; false otherwise. |
static boolean |
getWarnAboutAdvancedXInclude(CommandEnv env)
Returns
true if a warning is to be reported when copying
a reference to a range of nodes using XInclude; false
otherwise. |
boolean |
prepare(DocumentView docView,
String parameter,
int x,
int y)
Tests whether this command can be executed with specified parameter
and in specified context.
|
static void |
setAllowAdvancedXInclude(CommandEnv env,
boolean allow)
Specifies whether copying a reference to a range of nodes
using XInclude is allowed.
|
static void |
setWarnAboutAdvancedXInclude(CommandEnv env,
boolean warn)
Specifies whether a warning is to be reported when copying
a reference to a range of nodes using XInclude.
|
doExecuteByName, execute, executeCommand, isRecordable, isRepeatable, prepareCommand
public static void setAllowAdvancedXInclude(CommandEnv env, boolean allow)
By default, this is not allowed.
public static boolean getAllowAdvancedXInclude(CommandEnv env)
true
if copying a reference to a range of nodes
using XInclude is allowed; false
otherwise.public static void setWarnAboutAdvancedXInclude(CommandEnv env, boolean warn)
By default, a warning is reported.
public static boolean getWarnAboutAdvancedXInclude(CommandEnv env)
true
if a warning is to be reported when copying
a reference to a range of nodes using XInclude; false
otherwise.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 inputpublic CommandResult doExecute(DocumentView docView, String parameter, int x, int y)
CommandBase
This method assumes that CommandBase.prepare(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
has been
successfully invoked immediately before its own invocation.
IMPORTANT: application code which executes a command
must always use CommandBase.execute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
or CommandBase.executeCommand(com.xmlmind.xmledit.gadget.Gadget, java.lang.String, int, int)
to do so,
NOT CommandBase.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
. CommandBase.doExecute(com.xmlmind.xmledit.view.DocumentView, java.lang.String, int, int)
is intended to be used
only by commands which invoke helper "sub-commands".
doExecute
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 inputnull
.
If the command execution is successful and
the command is repeatable and/or recordable then
CommandResult.details
field of the result is expected
to be one of:
null
Object
String
s
public static final String formatInclusion(Node child1, Node child2, SimpleInclusionScheme scheme, boolean createAbsRef, String absRef, Map<Object,Object> inclusionOpts, boolean checkAdvancedXInclude, DocumentView docView)