4.19. umbra.components.factory.scriptEditor.scriptEditor — Umbra 1.0.9 documentation

# 4.19. umbra.components.factory.scriptEditor.scriptEditor

scriptEditor.py

Platform:
  Windows, Linux, Mac Os X.
Description:
  Defines the `ScriptEditor` Component Interface class.

Others:

## 4.19.1. Module Attributes

`umbra.components.factory.scriptEditor.scriptEditor.` `LOGGER`

`umbra.components.factory.scriptEditor.scriptEditor.` `COMPONENT_UI_FILE`

## 4.19.2. Classes

class `umbra.components.factory.scriptEditor.scriptEditor.` `ScriptEditor`(parent=None, name=None, *args, **kwargs)

  Bases: `manager.qwidgetComponent.QWidgetComponent`

  Defines the `sibl_gui.components.addons.scriptEditor.scriptEditor` Component Interface class.

  Initializes the class.

  Parameters: | parent (QObject) – Object parent. name (unicode) – Component name. *args (*) – Arguments. **kwargs (**) – Keywords arguments.

  `uiRefresh`

    This signal is emited by the `ScriptEditor` class when the Ui needs to be refreshed. ( pyqtSignal )

  `recentFilesChanged`

    This signal is emited by the `ScriptEditor` class when the recent files list has changed. ( pyqtSignal )

  `fileLoaded`

    This signal is emited by the `ScriptEditor` class when a file is loaded. ( pyqtSignal )

    Returns: | Loaded file.
    Return type: | unicode

  `fileClosed`

    This signal is emited by the `ScriptEditor` class when a file is closed. ( pyqtSignal )

    Returns: | Closed file.
    Return type: | unicode

  `dockArea`

    Property for self.__dockArea attribute.

    Returns: | self.__dockArea.
    Return type: | int

  `engine`

    Property for self.__engine attribute.

    Returns: | self.__engine.
    Return type: | QObject

  `settings`

    Property for self.__settings attribute.

    Returns: | self.__settings.
    Return type: | QSettings

  `settingsSection`

    Property for self.__settingsSection attribute.

    Returns: | self.__settingsSection.
    Return type: | unicode

  `developmentLayout`

    Property for self.__developmentLayout attribute.

    Returns: | self.__developmentLayout.
    Return type: | unicode

  `grammarsDirectory`

    Property for self.__grammarsDirectory attribute.

    Returns: | self.__grammarsDirectory.
    Return type: | unicode

  `extension`

    Property for self.__extension attribute.

    Returns: | self.__extension.
    Return type: | unicode

  `model`

    Property for self.__model attribute.

    Returns: | self.__model.
    Return type: | ProjectsModel

  `languagesModel`

    Property for self.__languagesModel attribute.

    Returns: | self.__languagesModel.
    Return type: | LanguagesModel

  `defaultProject`

    Property for self.__defaultProject attribute.

    Returns: | self.__defaultProject.
    Return type: | unicode

  `defaultLanguage`

    Property for self.__defaultLanguage attribute.

    Returns: | self.__defaultLanguage.
    Return type: | unicode

  `defaultScriptLanguage`

    Property for self.__defaultScriptLanguage attribute.

    Returns: | self.__defaultScriptLanguage.
    Return type: | unicode

  `defaultFileName`

    Property for self.__defaultFileName attribute.

    Returns: | self.__defaultFileName.
    Return type: | unicode

  `defaultFileExtension`

    Property for self.__defaultFileExtension attribute.

    Returns: | self.__defaultFileExtension.
    Return type: | unicode

  `defaultWindowTitle`

    Property for self.__defaultWindowTitle attribute.

    Returns: | self.__defaultWindowTitle.
    Return type: | unicode

  `defaultScriptEditorDirectory`

    Property for self.__defaultScriptEditorDirectory attribute.

    Returns: | self.__defaultScriptEditorDirectory.
    Return type: | unicode

  `defaultSessionDirectory`

    Property for self.__defaultSessionDirectory attribute.

    Returns: | self.__defaultSessionDirectory.
    Return type: | unicode

  `defaultScriptEditorFile`

    Property for self.__defaultScriptEditorFile attribute.

    Returns: | self.__defaultScriptEditorFile.
    Return type: | unicode

  `factoryDefaultScriptEditorFile`

    Property for self.__factoryDefaultScriptEditorFile attribute.

    Returns: | self.__factoryDefaultScriptEditorFile.
    Return type: | unicode

  `scriptEditorFile`

    Property for self.__scriptEditorFile attribute.

    Returns: | self.__scriptEditorFile.
    Return type: | unicode

  `maximumRecentFiles`

    Property for self.__maximumRecentFiles attribute.

    Returns: | self.__maximumRecentFiles.
    Return type: | int

  `recentFilesActions`

    Property for self.__recentFilesActions attribute.

    Returns: | self.__recentFilesActions.
    Return type: | list

  `searchAndReplace`

    Property for self.__searchAndReplace attribute.

    Returns: | self.__searchAndReplace.
    Return type: | SearchAndReplace

  `searchInFiles`

    Property for self.__searchInFiles attribute.

    Returns: | self.__searchInFiles.
    Return type: | SearchInFiles

  `indentWidth`

    Property for self.__indentWidth attribute.

    Returns: | self.__indentWidth.
    Return type: | int

  `defaultFontsSettings`

    Property for self.__defaultFontsSettings attribute.

    Returns: | self.__defaultFontsSettings.
    Return type: | dict

  `console`

    Property for self.__console attribute.

    Returns: | self.__console.
    Return type: | dict

  `memoryHandlerStackDepth`

    Property for self.__memoryHandlerStackDepth attribute.

    Returns: | self.__memoryHandlerStackDepth.
    Return type: | int

  `menuBar`

    Property for self.__menuBar attribute.

    Returns: | self.__menuBar.
    Return type: | QToolbar

  `fileMenu`

    Property for self.__fileMenu attribute.

    Returns: | self.__fileMenu.
    Return type: | QMenu

  `editMenu`

    Property for self.__editMenu attribute.

    Returns: | self.__editMenu.
    Return type: | QMenu

  `sourceMenu`

    Property for self.__sourceMenu attribute.

    Returns: | self.__sourceMenu.
    Return type: | QMenu

  `navigateMenu`

    Property for self.__navigateMenu attribute.

    Returns: | self.__navigateMenu.
    Return type: | QMenu

  `searchMenu`

    Property for self.__searchMenu attribute.

    Returns: | self.__searchMenu.
    Return type: | QMenu

  `commandMenu`

    Property for self.__commandMenu attribute.

    Returns: | self.__commandMenu.
    Return type: | QMenu

  `viewMenu`

    Property for self.__viewMenu attribute.

    Returns: | self.__viewMenu.
    Return type: | QMenu

  `activate`(engine)

    Activates the Component.

    Parameters: | engine (QObject) – Container to attach the Component to.
    Returns: | Method success.
    Return type: | bool

  `deactivate`()

    Deactivates the Component.

    Returns: | Method success.
    Return type: | bool

  `initializeUi`()

    Initializes the Component ui.

    Returns: | Method success.
    Return type: | bool

  `uninitializeUi`()

    Uninitializes the Component ui.

    Returns: | Method success.
    Return type: | bool

  `addWidget`()

    Adds the Component Widget to the engine.

    Returns: | Method success.
    Return type: | bool

  `removeWidget`()

    Removes the Component Widget from the engine.

    Returns: | Method success.
    Return type: | bool

  `onStartup`()

    Defines the slot triggered on Framework startup.

  `onClose`()

    Defines the slot triggered on Framework close.

  `registerFile`(file)

    Registers given file in the fileSystemEventsManager.

    Parameters: | file (unicode) – File.
    Returns: | Method success.
    Return type: | bool

  `unregisterFile`(file)

    Unregisters given file in the fileSystemEventsManager.

    Parameters: | file (unicode) – File.
    Returns: | Method success.
    Return type: | bool

  `registerNodePath`(node)

    Registers given Node path in the fileSystemEventsManager.

    Parameters: | node (FileNode or DirectoryNode or ProjectNode) – Node.
    Returns: | Method success.
    Return type: | bool

  `unregisterNodePath`(node)

    Unregisters given Node path from the fileSystemEventsManager.

    Parameters: | node (FileNode or DirectoryNode or ProjectNode) – Node.
    Returns: | Method success.
    Return type: | bool

  `loadFileUi`()

    Loads user chosen file(s) into Script_Editor_tabWidget Widget tab Model editor(s).

    Returns: | Method success.
    Return type: | bool
    Note: | May require user interaction.

  `addProjectUi`()

    Adds user chosen project Script_Editor_tabWidget Widget tab Model.

    Returns: | Method success.
    Return type: | bool
    Note: | May require user interaction.

  `searchAndReplaceUi`()

    Performs a search and replace in the current Script_Editor_tabWidget Widget tab Model editor.

    Returns: | Method success.
    Return type: | bool
    Note: | May require user interaction.

  `searchInFilesUi`()

    Performs a search in the current user chosen files.

    Returns: | Method success.
    Return type: | bool
    Note: | May require user interaction.

  `getWidget`(index)

    Returns the Script_Editor_tabWidget Widget associated with given index.

    Parameters: | index (int) – Tab index.
    Returns: | Widget.
    Return type: | QWidget

  `getFocusWidget`()

    Returns the Widget with focus.

    Returns: | Widget with focus.
    Return type: | QWidget

  `getEditorTab`(editor)

    Returns the Script_Editor_tabWidget Widget tab associated with the given editor.

    Parameters: | editor (Editor) – Editor to search tab for.
    Returns: | Tab index.
    Return type: | Editor

  `addEditorTab`(editor)

    Adds a new tab to the Script_Editor_tabWidget Widget and sets the given editor as child widget.

    Parameters: | editor (Editor) – Editor.
    Returns: | New tab index.
    Return type: | int

  `removeEditorTab`(editor)

    Removes the Script_Editor_tabWidget Widget tab with given editor.

    Parameters: | editor (Editor) – Editor.
    Returns: | Method success.
    Return type: | bool

  `findEditorTab`(file)

    Finds the Script_Editor_tabWidget Widget tab associated to the given file.

    Parameters: | file (unicode) – File to search tab for.
    Returns: | Tab index.
    Return type: | Editor

  `hasEditorTab`()

    Returns if the Script_Editor_tabWidget Widget has at least one tab.

    Returns: | Has tab.
    Return type: | bool

  `getCurrentEditor`()

    Returns the current Script_Editor_tabWidget Widget tab Model editor.

    Returns: | Current editor.
    Return type: | Editor

  `setCurrentEditor`(file)

    Focus the Script_Editor_tabWidget Widget tab Model editor with given file.

    Parameters: | file (unicode) – File.
    Returns: | Method success.
    Return type: | bool

  `loadPath`(path)

    Loads given path.

    Parameters: | path (unicode) – Path to load.
    Returns: | Method success.
    Return type: | bool

  `loadDocument`(document, file)

    Loads given document into a new Script_Editor_tabWidget Widget tab Model editor.

    Parameters: | document (QTextDocument) – Document to load. file (unicode) – Document file.
    Returns: | Method success.
    Return type: | bool

  `addProject`(path)

    Adds a project.

    Parameters: | path (unicode) – Project path.
    Returns: | Method success.
    Return type: | bool

  `removeProject`(path)

    Removes a project.

    Parameters: | path (unicode) – Project path.
    Returns: | Method success.
    Return type: | bool

  `newFile`()

    Creates a new file into a new Script_Editor_tabWidget Widget tab.

    Returns: | Method success.
    Return type: | bool

  `loadFile`(file)

    Loads user chosen file in a new Script_Editor_tabWidget Widget tab Model editor.

    Parameters: | file (unicode) – File to load.
    Returns: | Method success.
    Return type: | bool

  `reloadFile`(file, isModified=True)

    Reloads given file Script_Editor_tabWidget Widget tab Model editor content.

    Parameters: | file (unicode) – File to reload. isModified (bool) – File modified state.
    Returns: | Method success.
    Return type: | bool

  `saveFile`(file=None)

    Saves either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file (unicode) – File to save.
    Returns: | Method success.
    Return type: | bool

  `saveFileAs`()

    Saves current Script_Editor_tabWidget Widget tab Model editor file as user chosen file.

    Returns: | Method success.
    Return type: | bool

  `saveAllFiles`()

    Saves all Script_Editor_tabWidget Widget tab Model editor files.

    Returns: | Method success.
    Return type: | bool

  `revertFile`(file=None)

    Reverts either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file (unicode) – File to revert.
    Returns: | Method success.
    Return type: | bool

  `closeFile`(file=None, leaveFirstEditor=True)

    Closes either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file (unicode) – File to save. leaveFirstEditor (bool) – Leave first editor.
    Returns: | Method success.
    Return type: | bool

  `closeAllFiles`(leaveFirstEditor=True)

    Closes every opened files and removes their associated Script_Editor_tabWidget Widget tabs.

    Returns: | Method success.
    Return type: | bool

  `closeFirstFile`()

    Attemtps to close the first Script_Editor_tabWidget Widget tab Model editor file.

    Returns: | Method success.
    Return type: | bool

  `listEditors`()

    Returns the Model editors.

    Returns: | Editors.
    Return type: | list

  `listFiles`()

    Returns the Model files.

    Returns: | FileNode nodes.
    Return type: | list

  `listDirectories`()

    Returns the Model directories.

    Returns: | DirectoryNode nodes.
    Return type: | list

  `listProjects`(ignoreDefaultProject=True)

    Returns the Model projects.

    Returns: | ProjectNode nodes.
    Return type: | list

  `getEditor`(file)

    Returns the Model editor associated with given file.

    Parameters: | file (unicode) – File to search editors for.
    Returns: | Editor.
    Return type: | Editor

  `setLanguage`(editor, language)

    Sets given language to given Model editor.

    Parameters: | editor (Editor) – Editor to set language to. language (Language) – Language to set.
    Returns: | Method success.
    Return type: | bool

  `gotoLine`()

    Moves current Script_Editor_tabWidget Widget tab Model editor cursor to user defined line.

    Returns: | Method success.
    Return type: | bool
    Note: | May require user interaction.

  `evaluateSelection`()

    Evaluates current Script_Editor_tabWidget Widget tab Model editor selected content in the interactive console.

    Returns: | Method success.
    Return type: | bool

  `evaluateScript`()

    Evaluates current Script_Editor_tabWidget Widget tab Model editor content into the interactive console.

    Returns: | Method success.
    Return type: | bool

  `evaluateCode`(code)

    Evaluates given code into the interactive console.

    Parameters: | code (unicode) – Code to evaluate.
    Returns: | Method success.
    Return type: | bool

  `storeSession`()

    Stores the current session.

    Returns: | Method success.
    Return type: | bool

  `restoreSession`()

    Restores the stored session.

    Returns: | Method success.
    Return type: | bool

  `loopThroughEditors`(backward=False)

    Loops through the editor tabs.

    Parameters: | backward (bool) – Looping backward.
    Returns: | Method success.
    Return type: | bool

  `restoreDevelopmentLayout`()

    Restores the development layout.

    Returns: | Definition success.
    Return type: | bool