public class SetObject extends CommandBase
setObject
.Modifier and Type | Field and Description |
---|---|
protected Name |
attributeName |
protected Element |
element |
protected boolean |
gzip |
protected URL |
objectURL |
protected ResourceType |
resourceType |
recordable, repeatable
Constructor and Description |
---|
SetObject() |
Modifier and Type | Method and Description |
---|---|
static ResourceType |
canSetObject(Element element,
Name attributeName,
ResourceType resourceType) |
protected static URL |
chooseObject(Element element,
String[] fileExtensions,
DocumentView docView) |
protected static boolean |
copy(URL srcURL,
URL dstURL,
DocumentView docView) |
CommandResult |
doExecute(DocumentView docView,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
protected static CommandResult |
doSetObject(URL objectURL,
Element element,
Name attributeName,
ResourceType resourceType,
String[] fileExtensions,
boolean gzip,
DocumentView docView) |
protected static String |
encodeBinaryObject(URL objectURL,
ResourceType resourceType,
boolean gzip,
DocumentView docView) |
protected static String[] |
parseFileExtensions(String parameter,
ResourceType resourceType) |
protected URL |
parseObjectURL(String location) |
protected boolean |
parseParameter(String[] args) |
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 boolean |
setBinaryObject(URL objectURL,
Element element,
Name attributeName,
ResourceType resourceType,
boolean gzip,
DocumentView docView) |
static CommandResult |
setObject(URL objectURL,
Element element,
Name attributeName,
ResourceType resourceType,
boolean gzip,
DocumentView docView) |
static CommandResult |
setObject(URL objectURL,
Element element,
Name attributeName,
ResourceType resourceType,
String[] fileExtensions,
boolean gzip,
DocumentView docView) |
static boolean |
setObjectReference(ResourceDialog.Info info,
Element element,
Name attributeName,
DocumentView docView) |
protected static boolean |
setObjectValue(String objectValue,
Element element,
Name attributeName,
DocumentView docView) |
static boolean |
setXMLObject(URL objectURL,
Element element,
DocumentView docView) |
doExecuteByName, execute, executeCommand, isRecordable, isRepeatable, prepareCommand
protected Element element
protected Name attributeName
protected ResourceType resourceType
protected boolean gzip
protected URL objectURL
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 boolean parseParameter(String[] args)
public 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
protected static String[] parseFileExtensions(String parameter, ResourceType resourceType)
public static ResourceType canSetObject(Element element, Name attributeName, ResourceType resourceType)
public static CommandResult setObject(URL objectURL, Element element, Name attributeName, ResourceType resourceType, boolean gzip, DocumentView docView)
public static CommandResult setObject(URL objectURL, Element element, Name attributeName, ResourceType resourceType, String[] fileExtensions, boolean gzip, DocumentView docView)
protected static CommandResult doSetObject(URL objectURL, Element element, Name attributeName, ResourceType resourceType, String[] fileExtensions, boolean gzip, DocumentView docView)
protected static URL chooseObject(Element element, String[] fileExtensions, DocumentView docView)
public static boolean setObjectReference(ResourceDialog.Info info, Element element, Name attributeName, DocumentView docView)
protected static boolean copy(URL srcURL, URL dstURL, DocumentView docView)
protected static boolean setObjectValue(String objectValue, Element element, Name attributeName, DocumentView docView)
public static boolean setBinaryObject(URL objectURL, Element element, Name attributeName, ResourceType resourceType, boolean gzip, DocumentView docView)
protected static String encodeBinaryObject(URL objectURL, ResourceType resourceType, boolean gzip, DocumentView docView)
public static boolean setXMLObject(URL objectURL, Element element, DocumentView docView)