public interface ToolCreateData
| Modifier and Type | Method and Description |
|---|---|
void |
autoCSD(File f)
Generates the CSD for a file if it is open and if auto generate is on.
|
File |
createTmpFile(Component ref,
String prefix,
String suffix,
String contents,
Charset charset,
String toolName)
Creates a temporary file using the default system file encoding.
|
void |
editFile(File f)
Pops up a file in an editing window in jGRASP.
|
String |
getData(Class<?> cls,
int code)
Gets configuration data.
|
void |
guiChanged()
Updates all elements in jGRASP that may depend on whether or not tool
actions apply to current conditions.
|
void |
openURL(URL url)
Attempts to open a URL in an external browser.
|
void |
parentChanged(File f)
Updates all elements in jGRASP that may depend on directory contents.
|
void |
showError(Component ref,
String message,
String title)
Displays an error dialog.
|
void |
showMessage(Component ref,
String message,
String title)
Displays a message dialog.
|
String |
showQuestion(Component ref,
String title,
String message,
String buttons,
String defaultButton)
Displays a question dialog.
|
void |
storeData(Class<?> cls,
int code,
String data)
Stores configuration data.
|
String |
writeFile(File file,
Charset charset,
boolean bom,
String data)
Writes string data to a file.
|
void autoCSD(File f)
f - the file for which the CSD will be generated.File createTmpFile(Component ref, String prefix, String suffix, String contents, Charset charset, String toolName)
ref - reference component for popping up dialogs. This may be null.prefix - temp file prefix.suffix - temp file suffix. This may be null to use ".tmp".contents - file contents.charset - the charset to use for encoding the contents.toolName - name to be used in error messages.void editFile(File f)
f - the file to be edited.String getData(Class<?> cls, int code)
cls - the tool class.code - a code value used to ensure uniqueness in data storage.void guiChanged()
void openURL(URL url) throws IOException
url - the url to be opened.IOException - if an external browser could not be launched.void parentChanged(File f)
f - a child of the directory that may have changed.void showError(Component ref, String message, String title)
ref - reference component that determines the dialog parent and
initial location. This may be null.message - the message text.title - the dialog title.void showMessage(Component ref, String message, String title)
ref - reference component that determines the dialog parent and
initial location. This may be null.message - the message text.title - the dialog title.String showQuestion(Component ref, String title, String message, String buttons, String defaultButton)
ref - reference component that determines the dialog parent and
initial location. This may be null.title - the dialog title.message - the message text.buttons - string containing dialog button labels separated by ~ ,
like "OK~Cancel".defaultButton - label of default button. If this is null, there will
be no default button.void storeData(Class<?> cls, int code, String data)
cls - the tool class.code - a code value used to ensure uniqueness in data storage.data - the data to be stored.String writeFile(File file, Charset charset, boolean bom, String data)
file - the file to which data will be written.charset - the charset that will be used to encode the data.bom - true if a BOM should be written (if the charset supports it),
false if it should not be (unless the charset requires it).data - the data to write.