Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Static Public Attributes
idlelib.ClassBrowser.ClassBrowserTreeItem Class Reference
Inheritance diagram for idlelib.ClassBrowser.ClassBrowserTreeItem:
Inheritance graph
[legend]
Collaboration diagram for idlelib.ClassBrowser.ClassBrowserTreeItem:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def GetText
def GetIconName
def IsExpandable
def GetSubList
def OnDoubleClick
def listmethods
def GetLabelText
def IsEditable
def SetText
def GetSelectedIconName

Public Attributes

 name
 classes
 file
 cl
 isfunction

Static Public Attributes

 expandable = None

Detailed Description

Definition at line 123 of file ClassBrowser.py.


Constructor & Destructor Documentation

def idlelib.ClassBrowser.ClassBrowserTreeItem.__init__ (   self,
  name,
  classes,
  file 
)

Definition at line 125 of file ClassBrowser.py.

00125 
00126     def __init__(self, name, classes, file):
00127         self.name = name
00128         self.classes = classes
00129         self.file = file
00130         try:
00131             self.cl = self.classes[self.name]
00132         except (IndexError, KeyError):
00133             self.cl = None
00134         self.isfunction = isinstance(self.cl, pyclbr.Function)

Here is the caller graph for this function:


Member Function Documentation

Return name of icon to be displayed normally.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 141 of file ClassBrowser.py.

00141 
00142     def GetIconName(self):
00143         if self.isfunction:
00144             return "python"
00145         else:
00146             return "folder"

def idlelib.TreeWidget.TreeItem.GetLabelText (   self) [inherited]
Return label text string to display in front of text (if any).

Reimplemented in idlelib.StackViewer.VariablesTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 319 of file TreeWidget.py.

00319 
00320     def GetLabelText(self):
00321         """Return label text string to display in front of text (if any)."""

Return name of icon to be displayed when selected.

Definition at line 352 of file TreeWidget.py.

00352 
00353     def GetSelectedIconName(self):
00354         """Return name of icon to be displayed when selected."""

Return list of items forming sublist.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 154 of file ClassBrowser.py.

00154 
00155     def GetSubList(self):
00156         if not self.cl:
00157             return []
00158         sublist = []
00159         for name in self.listmethods():
00160             item = MethodBrowserTreeItem(name, self.cl, self.file)
00161             sublist.append(item)
00162         return sublist

Here is the call graph for this function:

Here is the caller graph for this function:

Return text string to display.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 135 of file ClassBrowser.py.

00135 
00136     def GetText(self):
00137         if self.isfunction:
00138             return "def " + self.name + "(...)"
00139         else:
00140             return "class " + self.name

def idlelib.TreeWidget.TreeItem.IsEditable (   self) [inherited]
Return whether the item's text may be edited.

Reimplemented in idlelib.TreeWidget.FileTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 343 of file TreeWidget.py.

00343 
00344     def IsEditable(self):
00345         """Return whether the item's text may be edited."""

Return whether there are subitems.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 147 of file ClassBrowser.py.

00147 
00148     def IsExpandable(self):
00149         if self.cl:
00150             try:
00151                 return not not self.cl.methods
00152             except AttributeError:
00153                 return False

Here is the caller graph for this function:

Definition at line 171 of file ClassBrowser.py.

00171 
00172     def listmethods(self):
00173         if not self.cl:
00174             return []
00175         items = []
00176         for name, lineno in self.cl.methods.items():
00177             items.append((lineno, name))
00178         items.sort()
00179         list = []
00180         for item, name in items:
00181             list.append(name)
00182         return list

Here is the caller graph for this function:

Called on a double-click on the item.

Reimplemented from idlelib.TreeWidget.TreeItem.

Definition at line 163 of file ClassBrowser.py.

00163 
00164     def OnDoubleClick(self):
00165         if not os.path.exists(self.file):
00166             return
00167         edit = PyShell.flist.open(self.file)
00168         if hasattr(self.cl, 'lineno'):
00169             lineno = self.cl.lineno
00170             edit.gotoline(lineno)

def idlelib.TreeWidget.TreeItem.SetText (   self,
  text 
) [inherited]
Change the item's text (if it is editable).

Reimplemented in idlelib.TreeWidget.FileTreeItem, and idlelib.ObjectBrowser.ObjectTreeItem.

Definition at line 346 of file TreeWidget.py.

00346 
00347     def SetText(self, text):
00348         """Change the item's text (if it is editable)."""


Member Data Documentation

Definition at line 130 of file ClassBrowser.py.

Definition at line 127 of file ClassBrowser.py.

idlelib.TreeWidget.TreeItem.expandable = None [static, inherited]
Do not override!  Called by TreeNode.

Definition at line 322 of file TreeWidget.py.

Definition at line 128 of file ClassBrowser.py.

Definition at line 133 of file ClassBrowser.py.

Definition at line 126 of file ClassBrowser.py.


The documentation for this class was generated from the following file: