本文整理汇总了Java中org.zkoss.zul.Tabpanel类的典型用法代码示例。如果您正苦于以下问题:Java Tabpanel类的具体用法?Java Tabpanel怎么用?Java Tabpanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Tabpanel类属于org.zkoss.zul包,在下文中一共展示了Tabpanel类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addRoundTab
import org.zkoss.zul.Tabpanel; //导入依赖的package包/类
private Tab addRoundTab(Round r) {
Tab tab = new Tab(LangUtils.getMessage(LangEnum.ROUND)+" "+r.roundNumber);
tab.setId("round"+r.roundNumber+"Tab");
tab.setParent(singleTabbox.getTabs());
Tabpanel panel = new Tabpanel();
panel.setId("round"+r.roundNumber+"Panel");
panel.setParent(singleTabbox.getTabpanels());
Include inc = new Include("single_round.zul");
inc.setDynamicProperty("round", r);
inc.setId("round"+r.roundNumber+"Include");
inc.setParent(panel);
return tab;
}
示例2: createComponentTabs
import org.zkoss.zul.Tabpanel; //导入依赖的package包/类
/**
* Creates a components tabbox within the
* group for the specified element.
* @param group
* @param panel
*/
protected void createComponentTabs(Element[] arrTabs)
{
if ((config == null) || (arrTabs == null))
return;
// create the Tabs to accomodate the tab groups
for (int i = 0; i < arrTabs.length; i++)
{
// get the next 'group' iDOM Element
Element elementTab = arrTabs[i];
// create the tab that displays the group name
Tab tab = new Tab(elementTab.getAttribute("name"));
tabbox.getTabs().appendChild(tab);
// create a panel for the group tab
Tabpanel panel = new Tabpanel();
tabbox.getTabpanels().appendChild(panel);
// add the predefined visual components to the tab
addComponentsToTab(elementTab, panel);
}
}
示例3: agregarTab
import org.zkoss.zul.Tabpanel; //导入依赖的package包/类
/**
* Funcionalidad para agregar un tab al tabbcontrol
* @param titulo Titulo del tab
* @param id Identificador unico para no permitir mas de una instancia
* @param zul Uri del archivo zul
*/
private void agregarTab(String titulo, String id, String zul, Map<String, Object> arguments) {
if(arguments==null){
arguments = new HashMap<String, Object>();
}
Tabpanel tabpanel = new Tabpanel();
Tab tab = new Tab(titulo);
tab.setId(id);
//Validar que el tab no este instanciado
if(getTb_tabbox().hasFellow(id)){
Messagebox.show("Ya esta abierta la ventana!");
return;
}
tab.setClosable(true);
tab.setSelected(true);
if (getTb_tabbox().getTabs() == null){
getTb_tabbox().appendChild(new Tabs());
getTb_tabbox().appendChild(new Tabpanels());
}
getTb_tabbox().getTabs().appendChild(tab);
//Agrgar argumento para el id
arguments.put("tabularIndex", tab.getIndex());
getTb_tabbox().getTabpanels().appendChild(tabpanel);
getTb_tabbox().invalidate();
//Crear el nuevo tab y su respectivo panel
Executions.createComponents(zul, tabpanel, arguments);
}
示例4: addResultTab
import org.zkoss.zul.Tabpanel; //导入依赖的package包/类
private void addResultTab(Ranking ranking){
System.out.println("Adding result for round "+ranking.roundNumber);
Tab tab = new Tab(LangUtils.getMessage(LangEnum.RESULT)+" "+ranking.roundNumber);
tab.setId("ranking"+ranking.roundNumber+"Tab");
tab.setParent(resultTabbox.getTabs());
Tabpanel panel = new Tabpanel();
panel.setId("ranking"+ranking.roundNumber+"Panel");
panel.setParent(resultTabbox.getTabpanels());
Include inc = new Include("ranking.zul");
inc.setDynamicProperty("ranking", ranking);
inc.setId("ranking"+ranking.roundNumber+"Include");
inc.setParent(panel);
}
示例5: addComponentsToTab
import org.zkoss.zul.Tabpanel; //导入依赖的package包/类
/**
* Retrieves the predefined visual components
* declared within the iDOM and attaches them
* onto the specified tab panel
* @param elementTab The iDOM description of the
* tab element
* @param tabpanel The panel where the components
* will be attached to
*/
private void addComponentsToTab(Element domTab,
Tabpanel tabpanel)
{
if ((config == null) || (domTab == null) || (tabpanel == null))
return;
// get the components defined for this tab,
// directly from the iDOM document
Element[] arrComponents = config.getElements("component", domTab);
if (ArrayUtils.isEmpty(arrComponents))
return;
// create the list with components items
Listbox list = new Listbox();
list.setWidth("100%");
list.setHflex("1");
list.setVflex("1");
list.setDroppable("false");
// create the Tabs to accomodate the tab groups
for (int i = 0; i < arrComponents.length; i++)
{
try
{
// get the next 'group' iDOM Element
Element domComponent = arrComponents[i];
// get the <class>, <image> and <tooltip> values
// directly from the iDOM document
Element domClass = config.getElement("class", domComponent);
Element domImage = config.getElement("image32", domComponent);
Element domTooltip = config.getElement("tooltip", domComponent);
Element domName = config.getElement("name", domComponent);
if (domClass == null)
continue;
// create the component's image and attach it onto
// the panel, according to its iDOM description
ElementInfo component = new ElementInfo(domClass.getText(),
domName.getText(), domTooltip.getText(), domImage.getText());
ComponentListItem item = new ComponentListItem(component);
list.getItems().add(item);
}
catch (Exception e)
{
// if something is missing, just move on
continue;
}
}
tabpanel.appendChild(list);
}