public class ScriptEditControl extends java.lang.Object implements EditorAction
| Constructor and Description |
|---|
ScriptEditControl(javax.swing.filechooser.FileFilter scriptFileFilter,
java.lang.String scriptSuffix,
java.awt.Frame owner,
java.io.File defaultScriptDir,
java.util.prefs.Preferences preferences,
Exiter exiter) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
closeActiveTab()
Close the active script-tab.
|
boolean |
closeAllTabs()
Close all opened script-tabs.
|
void |
newScript()
Open a new empty script document.
|
void |
openScriptFile(java.lang.String pathName)
Open a new empty script document.
|
void |
openUser()
Open a file which is chosen by the user.
|
static void |
registerActivePopup(CFPythonPopup activePopup)
Register last active popup.
|
void |
saveActiveTab()
Save the active script-tab to the stored file path.
|
void |
saveAsActiveTab()
Open a file browser and prompt the user for a location/name to store this
file.
|
boolean |
saveTextToFile(java.io.File file,
java.lang.String text)
Write the given text into the specified file.
|
void |
setAction(javax.swing.Action action,
java.lang.String name)
Sets the
Action instance for this editor action. |
void |
setTextAreaDefaults(TextAreaDefaults textAreaDefaults)
Deprecated.
|
public ScriptEditControl(@NotNull
javax.swing.filechooser.FileFilter scriptFileFilter,
@NotNull
java.lang.String scriptSuffix,
@NotNull
java.awt.Frame owner,
java.io.File defaultScriptDir,
@NotNull
java.util.prefs.Preferences preferences,
@NotNull
Exiter exiter)
@Deprecated
public void setTextAreaDefaults(@NotNull
TextAreaDefaults textAreaDefaults)
public static void registerActivePopup(@NotNull
CFPythonPopup activePopup)
activePopup - active popup to register@ActionMethod public void newScript()
public void openScriptFile(@NotNull
java.lang.String pathName)
public void openUser()
public boolean closeActiveTab()
true if the tab was closed, or false if the user
has canceledpublic boolean closeAllTabs()
true if all tabs have been closed, or false if
the user has canceled.public void saveAsActiveTab()
public void saveActiveTab()
public boolean saveTextToFile(@NotNull
java.io.File file,
@NotNull
java.lang.String text)
file - text gets saved into this filetext - text to be savedtrue if the file was saved, or false if an error
occurredpublic void setAction(@NotNull
javax.swing.Action action,
@NotNull
java.lang.String name)
Action instance for this editor action.setAction in interface EditorActionaction - the action instancename - the name of the action