Beispiel #1
0
				if pathList[1] in ["list"] or (pathList[1] == "edit" and len(pathList) > 2):
					return (True)
		return (False)

	def handleInitialHash(self, pathList, params):
		assert self.canHandleInitialHash(pathList, params)
		if pathList[1] == "list":
			self.addWidget(HierarchyWidget(self.moduleName))
			self.focus()
		elif pathList[1] in ["edit", "clone"] and len(pathList) > 2:
			pane = Pane(translate("Edit"), closeable=True,
			            iconClasses=["module_%s" % self.moduleName, "apptype_hierarchy", "action_edit"])
			edwg = EditWidget(self.moduleName, EditWidget.appHierarchy, key=pathList[2], hashArgs=(params or None), clone=pathList[1] == "clone")
			pane.addWidget(edwg)
			conf["mainWindow"].addPane(pane, parentPane=self)
			pane.focus()

	@staticmethod
	def canHandle(moduleName, moduleInfo):
		return moduleInfo["handler"] == "hierarchy" or moduleInfo["handler"].startswith("hierarchy.")

	def onClick(self, *args, **kwargs):
		conf["theApp"].setPath(self.moduleName + "/list")

		if not len(self.widgetsDomElm._children):
			self.addWidget(HierarchyWidget(self.moduleName))
		super(HierarchyHandler, self).onClick(*args, **kwargs)


HandlerClassSelector.insert(3, HierarchyHandler.canHandle, HierarchyHandler)
Beispiel #2
0
    def canHandleInitialHash(self, pathList, params):
        if len(pathList) > 1:
            if pathList[0] == self.moduleName and pathList[1] == "edit":
                return True

        return False

    def handleInitialHash(self, pathList, params):
        assert self.canHandleInitialHash(pathList, params)

        self.addWidget(
            EditWidget(self.moduleName,
                       EditWidget.appSingleton,
                       hashArgs=(params or None)))
        self.focus()

    @staticmethod
    def canHandle(moduleName, moduleInfo):
        return moduleInfo["handler"] == "singleton" or moduleInfo[
            "handler"].startswith("singleton.")

    def onClick(self, *args, **kwargs):
        if not self.widgetsDomElm.children():
            self.addWidget(EditWidget(self.moduleName,
                                      EditWidget.appSingleton))

        super(SingletonHandler, self).onClick(*args, **kwargs)


HandlerClassSelector.insert(3, SingletonHandler.canHandle, SingletonHandler)
Beispiel #3
0
			self._buildViewPanes(self.moduleInfo["views"])
			self.unlock()
		'''

        if self.requestedViews is None and "views.request" in self.moduleInfo:
            self.lock()

            NetworkService.request(
                self.moduleName,
                self.moduleInfo["views.request"],
                successHandler=self._onRequestViewsAvailable)

        super(ListHandler, self).onClick(*args, **kwargs)

    def _onRequestViewsAvailable(self, req):
        self.requestedViews = NetworkService.decode(req)
        self._buildViewPanes(self.requestedViews,
                             register=True,
                             requested=True)

        self.unlock()

        if not self.isExpanded:
            if self.mode == "normal":
                super(ListHandler, self).onClick()
            elif self.childPanes:
                self.childPanes[0].onClick()


HandlerClassSelector.insert(1, ListHandler.canHandle, ListHandler)
Beispiel #4
0
                            "action_edit"
                        ])
            edwg = EditWidget(self.moduleName,
                              EditWidget.appTree,
                              key=pathList[3],
                              skelType=pathList[2],
                              hashArgs=(params or None),
                              clone=pathList[1] == "clone")
            pane.addWidget(edwg)
            conf["mainWindow"].addPane(pane, parentPane=self)
            pane.focus()

    @staticmethod
    def canHandle(moduleName, moduleInfo):
        return moduleInfo["handler"] == "tree" or moduleInfo[
            "handler"].startswith("tree.")

    def onClick(self, *args, **kwargs):
        conf["theApp"].setPath(self.moduleName + "/list")

        if not len(self.widgetsDomElm._children):
            wdg = displayDelegateSelector.select(self.moduleName,
                                                 self.moduleInfo)
            assert wdg is not None, "Got no handler for %s" % self.moduleName
            self.addWidget(wdg(self.moduleName))

        super(TreeHandler, self).onClick(*args, **kwargs)


HandlerClassSelector.insert(3, TreeHandler.canHandle, TreeHandler)