from Sink import Sink, SinkInfo from pyjamas.ui.TabPanel import TabPanel from pyjamas.ui.VerticalPanel import VerticalPanel from pyjamas.ui.HTML import HTML from SfaData import ViniData from NodePanel import NodePanel from LinkPanel import LinkPanel from SliverPanel import SliverPanel from SubmitPanel import SubmitPanel from HelpPanel import VINIHelpPanel class VINITabs(TabPanel): def __init__(self): TabPanel.__init__(self) self.data = ViniData() self.data.refreshRSpec() nodetab = NodePanel(self.data) linktab = LinkPanel(self.data) slivertab = SliverPanel(self.data) submittab = SubmitPanel(self.data) helptab = VINIHelpPanel() self.add(nodetab, "Nodes") self.add(linktab, "Links") self.add(slivertab, "Slivers") self.add(submittab, "Submit") self.add(HTML("force tabs to right"), None) self.add(helptab, "Help") self.selectTab(0) def onTabSelected(self, sender, index): tab = self.getWidget(index) tab.refresh() TabPanel.onTabSelected(self, sender, index) class VINI(Sink): def __init__(self): Sink.__init__(self) self.tabs = VINITabs() self.tabs.setWidth("100%") self.tabs.setHeight("100%") self.initWidget(self.tabs) def init(): return SinkInfo("VINI", "Specify VINI Resources", VINI)