Package node_manager_fkie :: Module xml_editor :: Class Editor
[frames] | no frames]

Class Editor

source code

PySide.QtGui.QTextEdit --+
                         |
                        Editor

The XML editor to handle the included files. If an included file in the opened launch file is detected, this can be open by STRG+(mouse click) in a new editor.

Instance Methods
 
__init__(self, filename, parent=None) source code
 
save(self)
Saves changes to the file.
source code
 
setCurrentPath(self, path)
Sets the current working path.
source code
str
interpretPath(self, path)
Tries to determine the path of the included file.
source code
int
index(self, text)
Searches in the given text for key indicates the including of a file and return their index.
source code
 
includedFiles(self)
Returns all included files in the document.
source code
[str, ...]
fileWithText(self, search_text)
Searches for given text in this document and all included files.
source code
 
mouseReleaseEvent(self, event)
Opens the new editor, if the user clicked on the included file and sets the default cursor.
source code
 
mouseMoveEvent(self, event)
Sets the QtCore.Qt.PointingHandCursor if the control key is pressed and the mouse is over the included file.
source code
 
keyPressEvent(self, event)
Enable the mouse tracking by setMouseTracking() if the control key is pressed.
source code
 
keyReleaseEvent(self, event)
Disable the mouse tracking by setMouseTracking() if the control key is released and set the cursor back to QtCore.Qt.IBeamCursor.
source code
 
shiftText(self)
Increase (Decrease) indentation using Tab (Ctrl+Tab).
source code
Instance Variables
  load_request_signal = QtCore.Signal(str)
A signal for request to open a configuration file
Method Details

setCurrentPath(self, path)

source code 

Sets the current working path. This path is to open the included files, which contains the relative path.

Parameters:
  • path (str) - the path of the current opened file (without the file)

interpretPath(self, path)

source code 

Tries to determine the path of the included file. The statement of $(find 'package') will be resolved.

Parameters:
  • path (str) - the sting which contains the included path
Returns: str
if no leading os.sep is detected, the path setted by setCurrentPath() will be prepend. $(find 'package') will be resolved. Otherwise the parameter itself will be returned

index(self, text)

source code 

Searches in the given text for key indicates the including of a file and return their index.

Parameters:
  • text (str) - text to find
Returns: int
the index of the including key or -1

fileWithText(self, search_text)

source code 

Searches for given text in this document and all included files.

Parameters:
  • search_text (str) - text to find
Returns: [str, ...]
the list with all files contain the text