4.15. umbra.components.factory.scriptEditor.editor — Umbra 1.0.4 documentation

### Navigation

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

# 4.15. umbra.components.factory.scriptEditor.editor

editor.py

Platform:
  Windows, Linux, Mac Os X.
Description:
  This module defines the `Editor` class and others editing helper objects.

Others:

## 4.15.1. Module Attributes

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

## 4.15.2. Classes

class `umbra.components.factory.scriptEditor.editor.` `Editor`(parent=None, file=None, language=None, *args, **kwargs)

  Bases: `umbra.ui.widgets.codeEditor_QPlainTextEdit.CodeEditor_QPlainTextEdit`

  This class defines the default editor used by the `umbra.components.factory.scriptEditor.scriptEditor.ScriptEditor` Component Interface class.

  Parameters: | parent – Object parent. ( QObject ) file – File path. ( String ) language – Editor language. ( Language ) *args – Arguments. ( * ) **kwargs – Keywords arguments. ( ** )

  `titleChanged`

    This signal is emited by the `Editor` class when the current title is changed. ( pyqtSignal )

  `fileLoaded`

    This signal is emited by the `Editor` class when the current file is loaded. ( pyqtSignal )

  `fileSaved`

    This signal is emited by the `Editor` class when the current file is saved. ( pyqtSignal )

  `fileReloaded`

    This signal is emited by the `Editor` class when the current file is reloaded. ( pyqtSignal )

  `fileClosed`

    This signal is emited by the `Editor` class when the current file is closed. ( pyqtSignal )

  `contentsChanged`

    This signal is emited by the `Editor` class when the current editor document content has changed. ( pyqtSignal )

  `modificationChanged`

    This signal is emited by the `Editor` class when the current editor document content has been modified. ( pyqtSignal )

  `file`

    This method is the property for self.__file attribute.

    Returns: | self.__file. ( String )

  `defaultFontsSettings`

    This method is the property for self.__defaultFontsSettings attribute.

    Returns: | self.__defaultFontsSettings. ( Dictionary )

  `tabWidth`

    This method is the property for self.__tabWidth attribute.

    Returns: | self.__tabWidth. ( Integer )

  `title`

    This method is the property for self.__title attribute.

    Returns: | self.__title. ( String )

  `isUntitled`

    This method is the property for self.__isUntitled attribute.

    Returns: | self.__isUntitled. ( Boolean )

  `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 )

  `setTitle`(title=None)

    This method sets the editor title.

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

  `setFile`(file=None, isModified=False, isUntitled=False)

    This method sets the editor file.

    Parameters: | File – File to set. ( String ) isModified – File modified state. ( Boolean ) isUntitled – File untitled state. ( Boolean )
    Returns: | Method success. ( Boolean )

  `getFileShortName`()

    This method returns the current editor file short name.

    Returns: | File short name. ( String )

  `getUntitledFileName`()

    This method returns an untitled editor file name.

    Returns: | Untitled file name. ( String )

  `loadDocument`(document, file=None, language=None)

    This method loads given document into the editor.

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

  `newFile`()

    This method creates a new editor file.

    Returns: | File name. ( String )

  `loadFile`(*args, **kwargs)

    This method reads and loads given file into the editor.

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

  `reloadFile`(*args, **kwargs)

    This method reloads the current editor file.

    Parameters: | isModified – File modified state. ( Boolean )
    Returns: | Method success. ( Boolean )

  `saveFile`()

    This method saves the editor file content.

    Returns: | Method success. ( Boolean )

  `saveFileAs`(file=None)

    This method saves the editor file content either using given file or user chosen file.

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

  `writeFile`(file)

    This method writes the editor file content into given file.

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

  `closeFile`()

    This method closes the editor file.

    Returns: | Method success. ( Boolean )

### Navigation

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