public class SelectConvertedFile extends SelectFile
selectConvertedFile
.Modifier and Type | Field and Description |
---|---|
protected String |
extension |
protected boolean |
lastPreviewChoice |
protected static String |
PREVIEWED_URL_PROP |
protected JCheckBox |
previewToggle |
dirMode, lastOpenDirectory, lastOpenDirectoryURL, lastOpenFile, lastOpenFileURL, lastSaveDirectory, lastSaveDirectoryURL, lastSaveFile, lastSaveFileURL, lastSelectedURLs, saveMode, template, title, urlMode
recordable, repeatable
Constructor and Description |
---|
SelectConvertedFile() |
Modifier and Type | Method and Description |
---|---|
protected CommandResult |
checkWriteLock(DocumentView docView,
CommandResult selected) |
protected List<URL> |
createLastSelectedURLs(DocumentView docView) |
protected static JLabel |
createMangledInfo(String extension,
String unrestricted) |
protected static JCheckBox |
createPreviewToggle() |
CommandResult |
doExecute(DocumentView docView,
String parameter,
int x,
int y)
Actually executes this command with specified parameter and in
specified context.
|
protected URL |
getDefaultTemplate(DocumentView docView) |
static URL |
getPreviewedURL(DocumentView docView)
Returns the URL of the file which is the result of the current
document conversion, when this file is to be previewed
using a helper application.
|
protected boolean |
parseAction(DocumentView docView,
String 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 URL |
selectURL(DocumentView docView,
String title,
boolean dirMode,
boolean saveMode,
URL dir,
String name,
URL[] lastSelectedURLs) |
protected void |
setDefaultTemplate(DocumentView docView,
URL selected) |
static void |
setPreviewedURL(DocumentView docView,
URL url)
Specifies the URL of the file which is the result of the current
document conversion, when this file is to be previewed
using a helper application.
|
protected void |
setURLChooserAccessory(DocumentView docView,
URLChooserDialog urlChooser) |
protected void |
setURLChooserAccessory2(DocumentView docView,
URLChooserDialog urlChooser) |
addLastSelectedURL, getLastSelectedURLs, parseOption, parseParameter
doExecuteByName, execute, executeCommand, isRecordable, isRepeatable, prepareCommand
protected String extension
protected JCheckBox previewToggle
protected boolean lastPreviewChoice
protected static final String PREVIEWED_URL_PROP
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 SelectFile
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 parseAction(DocumentView docView, String parameter)
parseAction
in class SelectFile
protected URL getDefaultTemplate(DocumentView docView)
getDefaultTemplate
in class SelectFile
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 SelectFile
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 CommandResult checkWriteLock(DocumentView docView, CommandResult selected)
protected URL selectURL(DocumentView docView, String title, boolean dirMode, boolean saveMode, URL dir, String name, URL[] lastSelectedURLs)
selectURL
in class SelectFile
protected void setURLChooserAccessory(DocumentView docView, URLChooserDialog urlChooser)
protected static final JCheckBox createPreviewToggle()
protected void setURLChooserAccessory2(DocumentView docView, URLChooserDialog urlChooser)
protected static final JLabel createMangledInfo(String extension, String unrestricted)
public static void setPreviewedURL(DocumentView docView, URL url)
docView
- a view of the document being convertedurl
- URL of the file which is the result of current document
conversion. Use null
to remove this specification.getPreviewedURL(com.xmlmind.xmledit.view.DocumentView)
public static URL getPreviewedURL(DocumentView docView)
docView
- a view of the document being convertednull
setPreviewedURL(com.xmlmind.xmledit.view.DocumentView, java.net.URL)
protected List<URL> createLastSelectedURLs(DocumentView docView)
createLastSelectedURLs
in class SelectFile
protected void setDefaultTemplate(DocumentView docView, URL selected)
setDefaultTemplate
in class SelectFile