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

Class XmlEditor

source code

PySide.QtGui.QDialog --+
                       |
                      XmlEditor

Creates a dialog to edit a launch file.

Instance Methods
 
__init__(self, filenames, search_text='', parent=None) source code
 
on_load_request(self, filename, search_text='')
Loads a file in a new tab or focus the tab, if the file is already open.
source code
 
on_close_tab(self, tab_index)
Signal handling to close single tabs.
source code
 
closeEvent(self, event)
Test the open files for changes and save this if needed.
source code
 
on_saveButton_clicked(self)
Saves the current document.
source code
 
on_editor_textChanged(self)
If the content was changed, a '*' will be shown in the tab name.
source code
 
on_editor_positionChanged(self)
Shows the number of the line and column in a label.
source code
 
on_shortcut_find(self)
Opens a find dialog.
source code
 
on_shortcut_goto(self)
Opens a goto dialog.
source code
 
on_find_dialog_clicked(self, button)
Method to handle the button actions of the find dialog.
source code
 
find(self, search_text, recursive)
Searches for text in the current text editor.
source code
 
find_dialog_itemActivated(self, item)
On recursive search all files contained the search text are listed.
source code
Class Variables
  finished_signal = QtCore.Signal(list)
finished_signal has as parameter the filenames of the initialization and is emitted, if this dialog was closed.
Instance Variables
  files
list with all open files
Method Details

__init__(self, filenames, search_text='', parent=None)
(Constructor)

source code 
Parameters:
  • filenames ([str, ...]) - a list with filenames. The last one will be activated.
  • search_text (str (Default: Empty String)) - if not empty, searches in new document for first occurrence of the given text

on_load_request(self, filename, search_text='')

source code 

Loads a file in a new tab or focus the tab, if the file is already open.

Parameters:
  • filename (str) - the path to file
  • search_text (str (Default: Empty String)) - if not empty, searches in new document for first occurrence of the given text

on_close_tab(self, tab_index)

source code 

Signal handling to close single tabs.

Parameters:
  • tab_index (int) - tab index to close

on_saveButton_clicked(self)

source code 

Saves the current document. This method is called if the save button was clicked.

find(self, search_text, recursive)

source code 

Searches for text in the current text editor. If `recursive` is True, the included files will be searched.

Parameters:
  • search_text (str) - text to find
  • recursive (bool) - search in included files if this is True

find_dialog_itemActivated(self, item)

source code 

On recursive search all files contained the search text are listed. If one of this file is activated, it will be open in a new tab and the cursor moved to the search text position.

Parameters:
  • item (PySide.QtGui.QListWidgetItem) - The activated item of the QListWidget