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

### Navigation

- index
- modules |
- next |
- previous |
- Umbra 1.0.8 documentation »
- 4. Api »

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

scriptEditor.py

Platform:
  Windows, Linux, Mac Os X.
Description:
  This module 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`

  This class is the `sibl_gui.components.addons.scriptEditor.scriptEditor` Component Interface class.

  Parameters: | parent – Object parent. ( QObject ) name – Component name. ( String ) *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. ( String )

  `fileClosed`

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

    Returns: | Closed file. ( String )

  `dockArea`

    This method is the property for self.__dockArea attribute.

    Returns: | self.__dockArea. ( Integer )

  `engine`

    This method is the property for self.__engine attribute.

    Returns: | self.__engine. ( QObject )

  `settings`

    This method is the property for self.__settings attribute.

    Returns: | self.__settings. ( QSettings )

  `settingsSection`

    This method is the property for self.__settingsSection attribute.

    Returns: | self.__settingsSection. ( String )

  `developmentLayout`

    This method is the property for self.__developmentLayout attribute.

    Returns: | self.__developmentLayout. ( String )

  `grammarsDirectory`

    This method is the property for self.__grammarsDirectory attribute.

    Returns: | self.__grammarsDirectory. ( String )

  `extension`

    This method is the property for self.__extension attribute.

    Returns: | self.__extension. ( String )

  `model`

    This method is the property for self.__model attribute.

    Returns: | self.__model. ( ProjectsModel )

  `languagesModel`

    This method is the property for self.__languagesModel attribute.

    Returns: | self.__languagesModel. ( LanguagesModel )

  `defaultProject`

    This method is the property for self.__defaultProject attribute.

    Returns: | self.__defaultProject. ( String )

  `defaultLanguage`

    This method is the property for self.__defaultLanguage attribute.

    Returns: | self.__defaultLanguage. ( String )

  `defaultScriptLanguage`

    This method is the property for self.__defaultScriptLanguage attribute.

    Returns: | self.__defaultScriptLanguage. ( String )

  `defaultFileName`

    This method is the property for self.__defaultFileName attribute.

    Returns: | self.__defaultFileName. ( String )

  `defaultFileExtension`

    This method is the property for self.__defaultFileExtension attribute.

    Returns: | self.__defaultFileExtension. ( String )

  `defaultWindowTitle`

    This method is the property for self.__defaultWindowTitle attribute.

    Returns: | self.__defaultWindowTitle. ( String )

  `defaultScriptEditorDirectory`

    This method is the property for self.__defaultScriptEditorDirectory attribute.

    Returns: | self.__defaultScriptEditorDirectory. ( String )

  `defaultSessionDirectory`

    This method is the property for self.__defaultSessionDirectory attribute.

    Returns: | self.__defaultSessionDirectory. ( String )

  `defaultScriptEditorFile`

    This method is the property for self.__defaultScriptEditorFile attribute.

    Returns: | self.__defaultScriptEditorFile. ( String )

  `factoryDefaultScriptEditorFile`

    This method is the property for self.__factoryDefaultScriptEditorFile attribute.

    Returns: | self.__factoryDefaultScriptEditorFile. ( String )

  `scriptEditorFile`

    This method is the property for self.__scriptEditorFile attribute.

    Returns: | self.__scriptEditorFile. ( String )

  `maximumRecentFiles`

    This method is the property for self.__maximumRecentFiles attribute.

    Returns: | self.__maximumRecentFiles. ( Integer )

  `recentFilesActions`

    This method is the property for self.__recentFilesActions attribute.

    Returns: | self.__recentFilesActions. ( List )

  `searchAndReplace`

    This method is the property for self.__searchAndReplace attribute.

    Returns: | self.__searchAndReplace. ( SearchAndReplace )

  `searchInFiles`

    This method is the property for self.__searchInFiles attribute.

    Returns: | self.__searchInFiles. ( SearchInFiles )

  `indentWidth`

    This method is the property for self.__indentWidth attribute.

    Returns: | self.__indentWidth. ( Integer )

  `defaultFontsSettings`

    This method is the property for self.__defaultFontsSettings attribute.

    Returns: | self.__defaultFontsSettings. ( Dictionary )

  `console`

    This method is the property for self.__console attribute.

    Returns: | self.__console. ( Dictionary )

  `memoryHandlerStackDepth`

    This method is the property for self.__memoryHandlerStackDepth attribute.

    Returns: | self.__memoryHandlerStackDepth. ( Integer )

  `menuBar`

    This method is the property for self.__menuBar attribute.

    Returns: | self.__menuBar. ( QToolbar )

  `fileMenu`

    This method is the property for self.__fileMenu attribute.

    Returns: | self.__fileMenu. ( QMenu )

  `editMenu`

    This method is the property for self.__editMenu attribute.

    Returns: | self.__editMenu. ( QMenu )

  `sourceMenu`

    This method is the property for self.__sourceMenu attribute.

    Returns: | self.__sourceMenu. ( QMenu )

  `navigateMenu`

    This method is the property for self.__navigateMenu attribute.

    Returns: | self.__navigateMenu. ( QMenu )

  `searchMenu`

    This method is the property for self.__searchMenu attribute.

    Returns: | self.__searchMenu. ( QMenu )

  `commandMenu`

    This method is the property for self.__commandMenu attribute.

    Returns: | self.__commandMenu. ( QMenu )

  `viewMenu`

    This method is the property for self.__viewMenu attribute.

    Returns: | self.__viewMenu. ( QMenu )

  `activate`(engine)

    This method activates the Component.

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

  `deactivate`()

    This method deactivates the Component.

    Returns: | Method success. ( Boolean )

  `initializeUi`()

    This method initializes the Component ui.

    Returns: | Method success. ( Boolean )

  `uninitializeUi`()

    This method uninitializes the Component ui.

    Returns: | Method success. ( Boolean )

  `addWidget`()

    This method adds the Component Widget to the engine.

    Returns: | Method success. ( Boolean )

  `removeWidget`()

    This method removes the Component Widget from the engine.

    Returns: | Method success. ( Boolean )

  `onStartup`()

    This method is triggered on Framework startup.

  `onClose`()

    This method is triggered on Framework close.

  `registerNodePath`(node)

    This method registers given Node path in the fileSystemEventsManager.

    Parameters: | node – Node. ( FileNode / DirectoryNode / ProjectNode )
    Returns: | Method success. ( Boolean )

  `unregisterNodePath`(node)

    This method unregisters given Node path from the fileSystemEventsManager..

    Parameters: | node – Node. ( FileNode / DirectoryNode / ProjectNode )
    Returns: | Method success. ( Boolean )

  `loadFileUi`()

    This method loads user chosen file(s) into Script_Editor_tabWidget Widget tab Model editor(s).

    Returns: | Method success. ( Boolean )
    Note : | This method may require user interaction.

  `addProjectUi`()

    This method adds user chosen project Script_Editor_tabWidget Widget tab Model.

    Returns: | Method success. ( Boolean )
    Note : | This method may require user interaction.

  `searchAndReplaceUi`()

    This method performs a search and replace in the current Script_Editor_tabWidget Widget tab Model editor.

    Returns: | Method success. ( Boolean )
    Note : | This method may require user interaction.

  `searchInFilesUi`()

    This method performs a search in the current user chosen files.

    Returns: | Method success. ( Boolean )
    Note : | This method may require user interaction.

  `getWidget`(index)

    This method returns the Script_Editor_tabWidget Widget associated with given index.

    Parameters: | index – Tab index. ( Integer )
    Returns: | Widget. ( QWidget )

  `getFocusWidget`()

    This method returns the Widget with focus.

    Returns: | Widget with focus. ( QWidget )

  `getEditorTab`(editor)

    This method returns the Script_Editor_tabWidget Widget tab associated with the given editor.

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

  `addEditorTab`(editor)

    This method 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. ( Integer )

  `removeEditorTab`(editor)

    This method removes the Script_Editor_tabWidget Widget tab with given editor.

    Parameters: | editor – Editor. ( Editor )
    Returns: | Method success. ( Boolean )

  `findEditorTab`(file)

    This method finds the Script_Editor_tabWidget Widget tab associated to the given file.

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

  `hasEditorTab`()

    This method returns if the Script_Editor_tabWidget Widget has at least one tab.

    Returns: | Has tab. ( Boolean )

  `getCurrentEditor`()

    This method returns the current Script_Editor_tabWidget Widget tab Model editor.

    Returns: | Current editor. ( Editor )

  `setCurrentEditor`(file)

    This method focus the Script_Editor_tabWidget Widget tab Model editor with given file.

    Parameters: | file – File. ( String )
    Returns: | Method success. ( Boolean )

  `loadPath`(path)

    This method loads given path.

    Parameters: | path – Path to load. ( String )
    Returns: | Method success. ( Boolean )

  `loadDocument`(document, file)

    This method loads given document into a new Script_Editor_tabWidget Widget tab Model editor.

    Parameters: | document – Document to load. ( QTextDocument ) file – Document file. ( String )
    Returns: | Method success. ( Boolean )

  `addProject`(path)

    This method adds a project.

    Parameters: | path – Project path. ( String )
    Returns: | Method success. ( Boolean )

  `removeProject`(path)

    This method removes a project.

    Parameters: | path – Project path. ( String )
    Returns: | Method success. ( Boolean )

  `newFile`()

    This method creates a new file into a new Script_Editor_tabWidget Widget tab.

    Returns: | Method success. ( Boolean )

  `loadFile`(file)

    This method loads user chosen file in a new Script_Editor_tabWidget Widget tab Model editor.

    Parameters: | file – File to load. ( String )
    Returns: | Method success. ( Boolean )

  `reloadFile`(file, isModified=True)

    This method reloads given file Script_Editor_tabWidget Widget tab Model editor content.

    Parameters: | file – File to reload. ( String ) isModified – File modified state. ( Boolean )
    Returns: | Method success. ( Boolean )

  `saveFile`(file=None)

    This method saves either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file – File to save. ( String )
    Returns: | Method success. ( Boolean )

  `saveFileAs`()

    This method saves current Script_Editor_tabWidget Widget tab Model editor file as user chosen file.

    Returns: | Method success. ( Boolean )

  `saveAllFiles`()

    This method saves all Script_Editor_tabWidget Widget tab Model editor files.

    Returns: | Method success. ( Boolean )

  `revertFile`(file=None)

    This method reverts either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file – File to revert. ( String )
    Returns: | Method success. ( Boolean )

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

    This method closes either given file or current Script_Editor_tabWidget Widget tab Model editor file.

    Parameters: | file – File to save. ( String ) leaveFirstEditor – Leave first editor. ( Boolean )
    Returns: | Method success. ( Boolean )

  `closeAllFiles`(leaveFirstEditor=True)

    This method closes every opened files and removes their associated Script_Editor_tabWidget Widget tabs.

    Returns: | Method success. ( Boolean )

  `closeFirstFile`()

    This method attemtps to close the first Script_Editor_tabWidget Widget tab Model editor file.

    Returns: | Method success. ( Boolean )

  `listEditors`()

    This method returns the Model editors.

    Returns: | Editors. ( List )

  `listFiles`()

    This method returns the Model files.

    Returns: | FileNode nodes. ( List )

  `listDirectories`()

    This method returns the Model directories.

    Returns: | DirectoryNode nodes. ( List )

  `listProjects`(ignoreDefaultProject=True)

    This method returns the Model projects.

    Returns: | ProjectNode nodes. ( List )

  `getEditor`(file)

    This method returns the Model editor associated with given file.

    Parameters: | file – File to search editors for. ( String )
    Returns: | Editor. ( Editor )

  `setLanguage`(editor, language)

    This method sets given language to given Model editor.

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

  `gotoLine`()

    This method moves current Script_Editor_tabWidget Widget tab Model editor cursor to user defined line.

    Returns: | Method success. ( Boolean )
    Note : | This method may require user interaction.

  `evaluateSelection`()

    This method evaluates current Script_Editor_tabWidget Widget tab Model editor selected content in the interactive console.

    Returns: | Method success. ( Boolean )

  `evaluateScript`()

    This method evaluates current Script_Editor_tabWidget Widget tab Model editor content into the interactive console.

    Returns: | Method success. ( Boolean )

  `evaluateCode`(code)

    This method evaluates given code into the interactive console.

    Parameters: | code – Code to evaluate. ( String )
    Returns: | Method success. ( Boolean )

  `storeSession`()

    This method stores the current session.

    Returns: | Method success. ( Boolean )

  `restoreSession`()

    This method restores the stored session.

    Returns: | Method success. ( Boolean )

  `loopThroughEditors`(backward=False)

    This method loops through the editor tabs.

    Parameters: | backward – Looping backward. ( Boolean )
    Returns: | Method success. ( Boolean )

  `restoreDevelopmentLayout`()

    This definition restores the development layout.

    Returns: | Definition success. ( Boolean )

### Navigation

- index
- modules |
- next |
- previous |
- Umbra 1.0.8 documentation »
- 4. Api »