Class ScriptEditControl
- java.lang.Object
-
- net.sf.gridarta.textedit.scripteditor.ScriptEditControl
-
- All Implemented Interfaces:
EditorAction
public class ScriptEditControl extends java.lang.Object implements EditorAction
ScriptEditControl - Manages events and data flow for the script editor entity. There's always at most only one frame open. Additional files get attached to the tab bar.
-
-
Constructor Summary
Constructors Constructor Description 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, @NotNull AppPreferencesModel appPreferencesModel, @NotNull ScriptEditControlCallback callback)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancloseActiveTab()Close the active script-tab.booleancloseAllTabs()Close all opened script-tabs.voidnewScript()Open a new empty script document.voidopenScriptFile(@NotNull java.io.File file)Opens a script file.voidopenUser()Open a file which is chosen by the user.static voidregisterActivePopup(@NotNull CFPythonPopup activePopup)Register last active popup.voidsaveActiveTab()Save the active script-tab to the stored file path.voidsaveAsActiveTab()Open a file browser and prompt the user for a location/name to store this file.voidsetAction(@NotNull javax.swing.Action action, @NotNull java.lang.String name)Sets theActioninstance for this editor action.voidsetTextAreaDefaults(@NotNull TextAreaDefaults textAreaDefaults)Deprecated.
-
-
-
Constructor Detail
-
ScriptEditControl
public ScriptEditControl(@NotNull @NotNull javax.swing.filechooser.FileFilter scriptFileFilter, @NotNull @NotNull java.lang.String scriptSuffix, @NotNull @NotNull java.awt.Frame owner, java.io.File defaultScriptDir, @NotNull @NotNull java.util.prefs.Preferences preferences, @NotNull @NotNull Exiter exiter, @NotNull @NotNull AppPreferencesModel appPreferencesModel, @NotNull @NotNull ScriptEditControlCallback callback)- Parameters:
appPreferencesModel- the globalAppPreferencesModelinstancecallback- the callback function for reporting problems when starting an external editor
-
-
Method Detail
-
setTextAreaDefaults
@Deprecated public void setTextAreaDefaults(@NotNull @NotNull TextAreaDefaults textAreaDefaults)Deprecated.
-
registerActivePopup
public static void registerActivePopup(@NotNull @NotNull CFPythonPopup activePopup)Register last active popup. When the script pad frame is hidden, this popup will be closed (if still open).- Parameters:
activePopup- active popup to register
-
newScript
@ActionMethod public void newScript()
Open a new empty script document.
-
openScriptFile
public void openScriptFile(@NotNull @NotNull java.io.File file)Opens a script file.- Parameters:
file- the script file to open
-
openUser
public void openUser()
Open a file which is chosen by the user.
-
closeActiveTab
public boolean closeActiveTab()
Close the active script-tab.- Returns:
trueif the tab was closed, orfalseif the user has canceled
-
closeAllTabs
public boolean closeAllTabs()
Close all opened script-tabs.- Returns:
trueif all tabs have been closed, orfalseif the user has canceled.
-
saveAsActiveTab
public void saveAsActiveTab()
Open a file browser and prompt the user for a location/name to store this file. If everything goes fine, the file is saved.
-
saveActiveTab
public void saveActiveTab()
Save the active script-tab to the stored file path.
-
setAction
public void setAction(@NotNull @NotNull javax.swing.Action action, @NotNull @NotNull java.lang.String name)Description copied from interface:EditorActionSets theActioninstance for this editor action.- Specified by:
setActionin interfaceEditorAction- Parameters:
action- the action instancename- the name of the action
-
-