eric3.UI.Browser

Module implementing a browser with class browsing capabilities.

The class browsing part is based on IDLE's classbrowser.

Classes

Browser Class used to display a file system tree.
BrowserClass Class implementing a BrowserNode that represents a python class or function.
BrowserClassAttributes Class implementing a BrowserNode that represents the attributes of a python class.
BrowserDirectory Class implementing a BrowserNode that represents a directory.
BrowserFile Class implementing a BrowserNode that represents a file.
BrowserMethod Class implementing a BrowserNode that represents a python method.
BrowserNode Class implementing a thin wrapper around QListViewItem.
BrowserSysPath Class implementing a BrowserNode that represents the Python sys.path.

Functions

None


Browser

Class used to display a file system tree. Via the context menu that is displayed by a right click the user can select various actions on the selected file.

Signals

designerFile(string)
emitted to open a Qt-Designer file
linguistFile(string)
emitted to open a Qt-Linguist file
pixmapFile(string)
emitted to open a pixmap file
projectFile(string)
emitted to open an eric3 project file
pythonFile(string, int)
emitted to open a Python file at a line
unittestOpen(string)
emitted to open a Python file for a unittest

Derived from

QListView

Methods

Browser Constructor
contentsMouseDoubleClickEvent Protected method of QListView.
createPopupMenus Private method to generate the various popup menus.
getItemsFiltered Public method to get the items of a specific type.
getSelectedItems Public method to get the selected items.
getSelectedItemsCount Public method to get the count of items selcted.
handleAddAsToplevelDir Private slot to handle the Add as toplevel directory popup menu entry.
handleContextMenu Private slot to show the context menu of the listview.
handleNewToplevelDir Private slot to handle the New toplevel directory popup menu entry.
handleOpen Private slot to handle the open popup menu entry.
handlePreferencesChanged Public slot used to handle the preferencesChanged signal.
handleProgramChange Public slot to handle the programChange signal.
handleRemoveToplevel Private slot to handle the Remove from toplevel popup menu entry.
handleUnittest Private slot to handle the unittest popup menu entry.
refreshTree Private slot to refresh the tree.
saveToplevelDirs Public slot to save the toplevel directories.
wantedItem Private method to check type of a listview item.

Browser (Constructor)

Browser(parent=None)

Constructor

parent
parent widget (QWidget)

Browser.contentsMouseDoubleClickEvent

contentsMouseDoubleClickEvent(mouseEvent)

Protected method of QListView. Reimplemented to disable expanding/collapsing of items when double-clicking. Instead the double-clicked entry is opened.

mouseEvent
the mouse event (QMouseEvent)

Browser.createPopupMenus

createPopupMenus()

Private method to generate the various popup menus.

Browser.getItemsFiltered

getItemsFiltered(filter)

Public method to get the items of a specific type.

filter
list of class to check against
Returns:
list of items (list of QListViewItem)

Browser.getSelectedItems

getSelectedItems(filter=None)

Public method to get the selected items.

filter
list of class to check against
Returns:
list of selected items (list of QListViewItem)

Browser.getSelectedItemsCount

getSelectedItemsCount(filter=None)

Public method to get the count of items selcted.

filter
list of class to check against
Returns:
count of items selected (integer)

Browser.handleAddAsToplevelDir

handleAddAsToplevelDir()

Private slot to handle the Add as toplevel directory popup menu entry.

Browser.handleContextMenu

handleContextMenu(itm, coord, col)

Private slot to show the context menu of the listview.

itm
the selected listview item (QListViewItem)
coord
the position of the mouse pointer (QPoint)
col
the column of the mouse pointer (int)

Browser.handleNewToplevelDir

handleNewToplevelDir()

Private slot to handle the New toplevel directory popup menu entry.

Browser.handleOpen

handleOpen()

Private slot to handle the open popup menu entry.

Browser.handlePreferencesChanged

handlePreferencesChanged()

Public slot used to handle the preferencesChanged signal.

Browser.handleProgramChange

handleProgramChange(fn)

Public slot to handle the programChange signal.

Browser.handleRemoveToplevel

handleRemoveToplevel()

Private slot to handle the Remove from toplevel popup menu entry.

Browser.handleUnittest

handleUnittest()

Private slot to handle the unittest popup menu entry.

Browser.refreshTree

refreshTree()

Private slot to refresh the tree. The tree is refreshed by closing all open items and reopening them.

Browser.saveToplevelDirs

saveToplevelDirs()

Public slot to save the toplevel directories.

Browser.wantedItem

wantedItem(itm, filter=None)

Private method to check type of a listview item.

itm
the listview item to check (QListViewItem)
filter
list of class to check against
Returns:
flag indicating item is a valid type (boolean)

Up


BrowserClass

Class implementing a BrowserNode that represents a python class or function.

Derived from

BrowserNode

Methods

BrowserClass Constructor
fileName Public method returning the name of the file defining this class.
setOpen Public slot to set/reset the open state.

BrowserClass (Constructor)

BrowserClass(parent, cl, after, filename)

Constructor

parent
parent Browser or BrowserNode
cl
Class object to be shown
after
sibling this node is positioned after
filename
filename of the file defining this class

BrowserClass.fileName

fileName()

Public method returning the name of the file defining this class.

Returns:
filename (string)

BrowserClass.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up


BrowserClassAttributes

Class implementing a BrowserNode that represents the attributes of a python class.

Derived from

BrowserNode

Methods

BrowserClassAttributes Constructor
setOpen Public slot to set/reset the open state.

BrowserClassAttributes (Constructor)

BrowserClassAttributes(parent, after, attributes)

Constructor

parent
parent Browser or BrowserNode
after
sibling this node is positioned after
attributes
list of attribute names

BrowserClassAttributes.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up


BrowserDirectory

Class implementing a BrowserNode that represents a directory.

Derived from

BrowserNode

Methods

BrowserDirectory Constructor
compare Private method to compare two items.
fileName Public method returning the directory name of this node.
setOpen Public slot to set/reset the open state.

BrowserDirectory (Constructor)

BrowserDirectory(parent, dinfo, after, full=1, bold=0)

Constructor

parent
parent Browser or BrowserNode
dinfo
dinfo is the string for the directory (string or QString)
after
sibling this node is positioned after
full
flag indicating full pathname should be displayed (boolean)
bold
flag indicating a highlighted display (boolean)

BrowserDirectory.compare

compare(item, col, ascending)

Private method to compare two items.

BrowserDirectory.fileName

fileName()

Public method returning the directory name of this node.

Returns:
directory name (string)

BrowserDirectory.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up


BrowserFile

Class implementing a BrowserNode that represents a file.

Derived from

BrowserNode

Methods

BrowserFile Constructor
compare Private method to compare two items.
fileName Public method returning the filename.
isDesignerFile Public method to check, if this file is a Qt-Designer file.
isDesignerHeaderFile Public method to check, if this file is a Qt-Designer header file.
isIdlFile Public method to check, if this file is a CORBA IDL file.
isLinguistFile Public method to check, if this file is a Qt-Linguist.
isPixmapFile Public method to check, if this file is a pixmap file.
isProjectFile Public method to check, if this file is an eric3 project file.
isPythonFile Public method to check, if this file is a Python script.
isRubyFile Public method to check, if this file is a Ruby script.
setOpen Public slot to set/reset the open state.

BrowserFile (Constructor)

BrowserFile(parent, finfo, after, special=0, dtext=QString.null, bold=0, isPyFile=0)

Constructor

parent
parent Browser or BrowserNode
finfo
the string for the file (string)
after
sibling this node is positioned after
special
flag indicating special treatment (boolean)
dtext
display text if special is set (string or QString)
bold
flag indicating a highlighted display (boolean)
isPyFile
flag indicating that this is a Python file even if it doesn't have the .py extension (boolean)

BrowserFile.compare

compare(item, col, ascending)

Private method to compare two items.

BrowserFile.fileName

fileName()

Public method returning the filename.

Returns:
filename (string)

BrowserFile.isDesignerFile

isDesignerFile()

Public method to check, if this file is a Qt-Designer file.

Returns:
flag indicating a Qt-Designer file (boolean)

BrowserFile.isDesignerHeaderFile

isDesignerHeaderFile()

Public method to check, if this file is a Qt-Designer header file.

Returns:
flag indicating a Qt-Designer header file (boolean)

BrowserFile.isIdlFile

isIdlFile()

Public method to check, if this file is a CORBA IDL file.

Returns:
flag indicating a CORBA IDL file (boolean)

BrowserFile.isLinguistFile

isLinguistFile()

Public method to check, if this file is a Qt-Linguist.

Returns:
flag indicating a Qt-Linguist file (boolean)

BrowserFile.isPixmapFile

isPixmapFile()

Public method to check, if this file is a pixmap file.

Returns:
flag indicating a pixmap file (boolean)

BrowserFile.isProjectFile

isProjectFile()

Public method to check, if this file is an eric3 project file.

Returns:
flag indicating an eric3 project file (boolean)

BrowserFile.isPythonFile

isPythonFile()

Public method to check, if this file is a Python script.

Returns:
flag indicating a Python file (boolean)

BrowserFile.isRubyFile

isRubyFile()

Public method to check, if this file is a Ruby script.

Returns:
flag indicating a Ruby file (boolean)

BrowserFile.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up


BrowserMethod

Class implementing a BrowserNode that represents a python method.

Derived from

BrowserNode

Methods

BrowserMethod Constructor
compare Private method to compare two items.
fileName Public method returning the name of the file defining this class.
setOpen Public slot to set/reset the open state.

BrowserMethod (Constructor)

BrowserMethod(parent, fn, after, filename)

Constructor

parent
parent Browser or BrowserNode
fn
Function object to be shown
after
sibling this node is positioned after
filename
filename of the file defining this method

BrowserMethod.compare

compare(item, col, ascending)

Private method to compare two items.

BrowserMethod.fileName

fileName()

Public method returning the name of the file defining this class.

Returns:
filename (string)

BrowserMethod.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up


BrowserNode

Class implementing a thin wrapper around QListViewItem. It makes sure that it is positioned after the previous sibling.

Derived from

QListViewItem

Methods

BrowserNode Constructor
paintCell Overwritten class to set a different text color, if bold is true.

BrowserNode (Constructor)

BrowserNode(parent, text, after, bold=0)

Constructor

parent
parent Browser or BrowserNode
text
text to be displayed by this node (string or QString)
after
sibling this node is positioned after
bold
flag indicating a highlighted font

BrowserNode.paintCell

paintCell(p, cg, column, width, alignment)

Overwritten class to set a different text color, if bold is true.

p
the painter (QPainter)
cg
the color group (QColorGroup)
column
the column (int)
width
width of the cell (int)
alignment
alignment of the cell (int)

Up


BrowserSysPath

Class implementing a BrowserNode that represents the Python sys.path.

Derived from

BrowserNode

Methods

BrowserSysPath Constructor
setOpen Public slot to set/reset the open state.

BrowserSysPath (Constructor)

BrowserSysPath(parent, after)

Constructor

parent
parent Browser or BrowserNode
after
sibling this node is positioned after

BrowserSysPath.setOpen

setOpen(o)

Public slot to set/reset the open state.

o
flag indicating the open state

Up