|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.refractions.udig.style.sld.editor.ImportFrom
public class ImportFrom
Abstract class can be used to implement your own "import from" operations.
Nested Class Summary | |
---|---|
protected class |
ImportFrom.PromptAndImport
Responsible for asking the user for a filename and calleding exporTo. |
Constructor Summary | |
---|---|
ImportFrom()
|
Method Summary | |
---|---|
java.lang.String[] |
addTo(java.lang.String[] more,
java.lang.String[] original)
|
boolean |
canImport(java.lang.Object target)
Let the extention point perform any additional checks before bothering the users with a prompt. |
java.lang.String |
defaultName(java.lang.Object target)
Default name for provided target. |
java.lang.String[] |
getExtentions()
Called by getFilterExtentions (example "sld"). |
java.lang.String[] |
getFilterExtentions()
Override as required (example "*.sld"). |
java.lang.String[] |
getFilterNames()
Override as required (example "Style Layer Descriptor document"). |
java.lang.Object |
importFrom(java.io.File file,
IProgressMonitor monitor)
Subclass should override to actually do something. |
void |
importFrom(java.lang.Object target,
java.io.File file,
IProgressMonitor monitor)
|
void |
op(Display display,
java.lang.Object target,
IProgressMonitor monitor)
This method is called in a non ui thread... |
java.lang.String |
prompt(java.lang.Object target)
Prompt to use for title (example: "Import from") |
java.io.File |
promptFile(Display display,
java.lang.Object target)
Asks the users for a filename to import ... |
void |
status(java.lang.String msg)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ImportFrom()
Method Detail |
---|
public boolean canImport(java.lang.Object target)
The extention point lets you specify the exact interface (or class)
required. This method returns true
, but could be used
to perform a more indepth check of say a Layer's Schema to pervent
the export of a FeatureType with multiple Geometry attributes
being exported as a Shapefile.
target
- Target to be considered for export
true
if non null
, subclass can override with additional testspublic void importFrom(java.lang.Object target, java.io.File file, IProgressMonitor monitor) throws java.lang.Exception
java.lang.Exception
public java.lang.Object importFrom(java.io.File file, IProgressMonitor monitor) throws java.lang.Exception
target
- file
- monitor
-
java.lang.Exception
public java.lang.String prompt(java.lang.Object target)
target
-
public java.lang.String defaultName(java.lang.Object target)
Should make use of provided target's title if available. This will be combined with the first filter extention to form a valid filename.
target
-
public java.lang.String[] getFilterExtentions()
public java.lang.String[] getExtentions()
public java.lang.String[] getFilterNames()
Care should be taken to internationalization these.
public java.io.File promptFile(Display display, java.lang.Object target)
If the user asks for an existing filename they will be prompted to confirm that they do indeed wish to replace. If they press Yes the existing file will be removed so the opperation can repalce it, if they select false the they will be reprompted.
display
- Display used to prompt withtarget
- Target (may be used to figure out prompt)
null
to be used to exportpublic void op(Display display, java.lang.Object target, IProgressMonitor monitor) throws java.lang.Exception
java.lang.Exception
public void status(java.lang.String msg)
msg
- Display msg on status bar (if possible)public java.lang.String[] addTo(java.lang.String[] more, java.lang.String[] original)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |