CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin Class Reference
Inheritance diagram for Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin:
Vispa.Main.VispaPlugin.VispaPlugin Vispa.Plugins.ConfigEditor.ConfigEditorPlugin.ConfigEditorPlugin Vispa.Plugins.EventBrowser.EventBrowserPlugin.EventBrowserPlugin Vispa.Plugins.EdmBrowser.EdmBrowserPlugin.EdmBrowserPlugin

Public Member Functions

def __init__
 
def addCenterView
 
def availableCenterViews
 
def boxContentAction
 
def collapseAllAction
 
def defaultCenterViewId
 
def disabledCenterViewIds
 
def expandAllAction
 
def expandToDepthAction
 
def filterDialog
 
def newTab
 
def openFile
 
def saveImage
 
def saveImageAction
 
def setDisabledCenterViewIds
 
def startUp
 
def switchCenterViewSlot
 
def viewClassId
 
def viewMenu
 
def zoomAction
 
def zoomDialog
 
- Public Member Functions inherited from Vispa.Main.VispaPlugin.VispaPlugin
def __init__
 
def addNewFileAction
 
def application
 
def filetypes
 
def getNewFileActions
 
def openFile
 
def registerFiletype
 
def registerFiletypesFromTabController
 
def shutdown
 

Private Member Functions

def _collapseAll
 
def _expandAll
 
def _expandToDepth
 
def _fillMenu
 
def _showBoxContentDialog
 

Private Attributes

 _availableCenterViews
 
 _boxContentAction
 
 _collapseAllAction
 
 _defaultCenterViewId
 
 _disabledCenterViewIds
 
 _expandAllAction
 
 _expandToDepthAction
 
 _filterAction
 
 _saveImageAction
 
 _startUp
 
 _viewMenu
 
 _zoomAction
 

Detailed Description

The BrowserPlugin supplies the view menu and supports center views.

Definition at line 10 of file BrowserPlugin.py.

Constructor & Destructor Documentation

def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.__init__ (   self,
  application = None 
)

Definition at line 14 of file BrowserPlugin.py.

14 
15  def __init__(self, application=None):
16  logging.debug(__name__ + ": __init__")
17  VispaPlugin.__init__(self, application)
21  self._startUp=True

Member Function Documentation

def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._collapseAll (   self)
private
Calls collapseAll() function of tree view.

Definition at line 78 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

78 
79  def _collapseAll(self):
80  """ Calls collapseAll() function of tree view.
81  """
82  try:
83  self.application().currentTabController().tab().treeView().collapseAll()
84  except NoCurrentTabControllerException:
85  logging.warning(self.__class__.__name__ + ": _collapseAll() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandAll (   self)
private
Calls expandAll() function of tree view.

Definition at line 62 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

62 
63  def _expandAll(self):
64  """ Calls expandAll() function of tree view.
65  """
66  try:
67  self.application().currentTabController().tab().treeView().expandAll()
68  except NoCurrentTabControllerException:
69  logging.warning(self.__class__.__name__ + ": _expandAll() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandToDepth (   self)
private
Calls expandToDepthDialog() function of current tab controller.

Definition at line 70 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

70 
71  def _expandToDepth(self):
72  """ Calls expandToDepthDialog() function of current tab controller.
73  """
74  try:
75  self.application().currentTabController().tab().treeView().expandToDepthDialog()
76  except NoCurrentTabControllerException:
77  logging.warning(self.__class__.__name__ + ": _expandToDepth() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._fillMenu (   self)
private
Fill specific menu.

Definition at line 38 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.startUp().

38 
39  def _fillMenu(self):
40  """ Fill specific menu.
41  """
42  self._viewMenu = self.application().createPluginMenu('&View')
43  self._expandAllAction = self.application().createAction('&Expand all', self._expandAll,"Ctrl+E")
44  self._viewMenu.addAction(self._expandAllAction)
45  self._expandToDepthAction = self.application().createAction('Expand to &depth...', self._expandToDepth, "Ctrl+Shift+E")
46  self._viewMenu.addAction(self._expandToDepthAction)
47  self._collapseAllAction = self.application().createAction('&Collapse all', self._collapseAll,"Ctrl+L")
48  self._viewMenu.addAction(self._collapseAllAction)
49  self._viewMenu.addSeparator()
50  self._filterAction = self.application().createAction('&Apply filter...', self.filterDialog, "Ctrl+P")
51  self._viewMenu.addAction(self._filterAction)
52  self._boxContentAction = self.application().createAction('Show &object details...', self._showBoxContentDialog, "Ctrl+B")
53  self._viewMenu.addAction(self._boxContentAction)
54  self._saveImageAction = self.application().createAction('&Save image...', self.saveImage, "Ctrl+I")
55  self._viewMenu.addAction(self._saveImageAction)
56  self._zoomAction = self.application().createAction('&Zoom...', self.zoomDialog, "Ctrl+Shift+Z")
57  self._viewMenu.addAction(self._zoomAction)
58  self._viewMenu.addSeparator()
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._showBoxContentDialog (   self)
private
Calls showBoxContentDialog() function of current tab controller.

Definition at line 94 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

94 
95  def _showBoxContentDialog(self):
96  """ Calls showBoxContentDialog() function of current tab controller.
97  """
98  try:
99  self.application().currentTabController().showBoxContentDialog()
100  except NoCurrentTabControllerException:
101  logging.warning(self.__class__.__name__ + ": showBoxContentDialog() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView (   self,
  viewClass,
  default = False,
  enabled = True 
)
add a View for the Center View

 selection: name is the menu entry, function the function to be
 added as action if the menu is selecteds

Definition at line 123 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._availableCenterViews, Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._defaultCenterViewId, Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._disabledCenterViewIds, Vispa.Main.VispaPlugin.VispaPlugin.application(), Vispa.Main.MainWindow.MainWindow.application(), Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.switchCenterViewSlot(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.viewClassId().

Referenced by Vispa.Plugins.EdmBrowser.EdmBrowserPlugin.EdmBrowserPlugin.startUp(), and Vispa.Plugins.ConfigEditor.ConfigEditorPlugin.ConfigEditorPlugin.startUp().

124  def addCenterView(self, viewClass, default=False, enabled=True):
125  """ add a View for the Center View
126 
127  selection: name is the menu entry, function the function to be
128  added as action if the menu is selecteds
129  """
130  logging.debug(__name__ + ": addCenterView")
131  if not issubclass(viewClass, AbstractView):
132  logging.error(self.__class__.__name__ + ": addCenterView() - Cannot add non views as view. Aborting...")
133  return
134  if viewClass in self._availableCenterViews:
135  logging.warning(self.__class__.__name__ + ": Already have a View of type "+ viewClass.__name__ +". Aborting...")
136  return
137  viewClassId=self.viewClassId(viewClass)
138  action = self.application().createAction(viewClass.LABEL, self.switchCenterViewSlot, "Ctrl+"+ str(len(self._availableCenterViews)))
139  action.setCheckable(True)
140  action.setEnabled(enabled)
141  if not enabled:
142  self._disabledCenterViewIds = [viewClassId]
143  action.setData(QVariant(viewClassId))
144  if default:
145  self._defaultCenterViewId = self.viewClassId(viewClass)
146  self._availableCenterViews.append(viewClass)
147  self._viewMenu.addAction(action)
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.availableCenterViews (   self)

Definition at line 35 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._availableCenterViews.

35 
36  def availableCenterViews(self):
37  return self._availableCenterViews
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.boxContentAction (   self)

Definition at line 182 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._boxContentAction.

183  def boxContentAction(self):
184  return self._boxContentAction
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.collapseAllAction (   self)

Definition at line 197 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._collapseAllAction.

def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.defaultCenterViewId (   self)

Definition at line 26 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._defaultCenterViewId.

26 
27  def defaultCenterViewId(self):
28  return self._defaultCenterViewId
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.disabledCenterViewIds (   self)

Definition at line 29 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._disabledCenterViewIds.

29 
30  def disabledCenterViewIds(self):
31  return self._disabledCenterViewIds
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.expandAllAction (   self)

Definition at line 191 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandAllAction.

192  def expandAllAction(self):
193  return self._expandAllAction
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.expandToDepthAction (   self)

Definition at line 194 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandToDepthAction.

195  def expandToDepthAction(self):
196  return self._expandToDepthAction
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.filterDialog (   self)
Calls filterDialog() function of current tab controller.

Definition at line 86 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

86 
87  def filterDialog(self):
88  """ Calls filterDialog() function of current tab controller.
89  """
90  try:
91  self.application().currentTabController().filterDialog()
92  except NoCurrentTabControllerException:
93  logging.warning(self.__class__.__name__ + ": filterDialog() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.newTab (   self)

Definition at line 179 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorPlugin.ConfigEditorPlugin.newFile(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.openFile().

180  def newTab(self):
181  raise NotImplementedError
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.openFile (   self,
  filename = None 
)
Open the requested file in a new tab.

This method is called when the user wants to open a file with an extension this plugin.
previously registered.

This methods overwrites openFile from VispaPlugin.

Definition at line 159 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._startUp, Vispa.Main.VispaPlugin.VispaPlugin.filetypes(), Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.newTab(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.startUp().

160  def openFile(self, filename=None):
161  """ Open the requested file in a new tab.
162 
163  This method is called when the user wants to open a file with an extension this plugin.
164  previously registered.
165 
166  This methods overwrites openFile from VispaPlugin.
167  """
168  logging.debug(__name__ + ": openFile " + filename)
169  if self._startUp:
170  self.startUp()
171  if filename == None:
172  return False
173  base = os.path.basename(filename)
174  ext = os.path.splitext(base)[1].lower().strip(".")
175  if ext in [ft.extension() for ft in self.filetypes()]:
176  tab = self.newTab()
177  return tab.controller().open(filename)
178  return False
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.saveImage (   self)
Calls saveImage() function of current tab controller.

Definition at line 110 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorTabController.ConfigEditorTabController.readFile().

111  def saveImage(self):
112  """ Calls saveImage() function of current tab controller.
113  """
114  try:
115  self.application().currentTabController().saveImage()
116  except NoCurrentTabControllerException:
117  logging.warning(self.__class__.__name__ + ": saveImage() - No tab controller found.")
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.saveImageAction (   self)

Definition at line 185 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._saveImageAction.

186  def saveImageAction(self):
187  return self._saveImageAction
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.setDisabledCenterViewIds (   self,
  ids 
)

Definition at line 32 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._disabledCenterViewIds.

32 
33  def setDisabledCenterViewIds(self,ids):
34  self._disabledCenterViewIds=ids
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.startUp (   self)

Definition at line 22 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._fillMenu(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._startUp.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorPlugin.ConfigEditorPlugin.newFile(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.openFile().

22 
23  def startUp(self):
24  self._startUp=False
25  self._fillMenu()
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.switchCenterViewSlot (   self)
Slot for center view menu entries.

It switches the tab's current center view to the selected view.

Definition at line 148 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), Vispa.Main.MainWindow.MainWindow.application(), data, and toolbox.toString().

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView().

149  def switchCenterViewSlot(self):
150  """ Slot for center view menu entries.
151 
152  It switches the tab's current center view to the selected view.
153  """
154  requestedViewClassId = self.sender().data().toString()
155  try:
156  self.application().currentTabController().switchCenterView(requestedViewClassId)
157  except NoCurrentTabControllerException:
158  logging.warning(self.__class__.__name__ + ": switchCenterViewSlot() - No tab controller found.")
std::string toString(const char *format,...)
Definition: xdaq_compat.cc:4
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.viewClassId (   self,
  viewClass 
)

Definition at line 118 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView().

119  def viewClassId(self, viewClass):
120  if not viewClass:# or not isinstance(viewClass, AbstractView):
121  return None
122  return str(viewClass) + str(viewClass.LABEL)
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.viewMenu (   self)

Definition at line 59 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._viewMenu.

59 
60  def viewMenu(self):
61  return self._viewMenu
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.zoomAction (   self)

Definition at line 188 of file BrowserPlugin.py.

References Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._zoomAction.

189  def zoomAction(self):
190  return self._zoomAction
def Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.zoomDialog (   self)
Calls zoomDialog() function of current tab controller.

Definition at line 102 of file BrowserPlugin.py.

References Vispa.Main.VispaPlugin.VispaPlugin.application(), and Vispa.Main.MainWindow.MainWindow.application().

103  def zoomDialog(self):
104  """ Calls zoomDialog() function of current tab controller.
105  """
106  try:
107  self.application().currentTabController().zoomDialog()
108  except NoCurrentTabControllerException:
109  logging.warning(self.__class__.__name__ + ": zoomDialog() - No tab controller found.")

Member Data Documentation

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._availableCenterViews
private

Definition at line 19 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.availableCenterViews().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._boxContentAction
private

Definition at line 51 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.boxContentAction().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._collapseAllAction
private

Definition at line 46 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.collapseAllAction().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._defaultCenterViewId
private

Definition at line 17 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.defaultCenterViewId().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._disabledCenterViewIds
private

Definition at line 18 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.addCenterView(), Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.disabledCenterViewIds(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.setDisabledCenterViewIds().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandAllAction
private

Definition at line 42 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.expandAllAction().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._expandToDepthAction
private

Definition at line 44 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.expandToDepthAction().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._filterAction
private

Definition at line 49 of file BrowserPlugin.py.

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._saveImageAction
private

Definition at line 53 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.saveImageAction().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._startUp
private

Definition at line 20 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.ConfigEditor.ConfigEditorPlugin.ConfigEditorPlugin.newFile(), Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.openFile(), and Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.startUp().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._viewMenu
private

Definition at line 41 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.viewMenu().

Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin._zoomAction
private

Definition at line 55 of file BrowserPlugin.py.

Referenced by Vispa.Plugins.Browser.BrowserPlugin.BrowserPlugin.zoomAction().