Java Code Examples for org.pentaho.ui.xul.components.XulTab#setLabel()
The following examples show how to use
org.pentaho.ui.xul.components.XulTab#setLabel() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BeamPerspective.java From kettle-beam with Apache License 2.0 | 6 votes |
public void setNameForTab( XulTab tab, String name ) { String tabName = name; List<String> usedNames = new ArrayList<String>(); for ( XulComponent c : tabs.getChildNodes() ) { if ( c != tab ) { usedNames.add( ( (SwtTab) c ).getLabel() ); } } if ( usedNames.contains( name ) ) { int num = 2; while ( true ) { tabName = name + " (" + num + ")"; if ( usedNames.contains( tabName ) == false ) { break; } num++; } } tab.setLabel( tabName ); }
Example 2
Source File: Neo4jPerspective.java From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 | 6 votes |
public void setNameForTab( XulTab tab, String name ) { String tabName = name; List<String> usedNames = new ArrayList<String>(); for ( XulComponent c : tabs.getChildNodes() ) { if ( c != tab ) { usedNames.add( ( (SwtTab) c ).getLabel() ); } } if ( usedNames.contains( name ) ) { int num = 2; while ( true ) { tabName = name + " (" + num + ")"; if ( usedNames.contains( tabName ) == false ) { break; } num++; } } tab.setLabel( tabName ); }
Example 3
Source File: StarModelerPerspective.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public XulTabAndPanel createTab(){ try { XulTab tab = (XulTab) document.createElement("tab"); if(name != null){ tab.setLabel(name); } XulTabpanel panel = (XulTabpanel) document.createElement("tabpanel"); panel.setSpacing(0); panel.setPadding(0); tabs.addChild(tab); panels.addChild(panel); tabbox.setSelectedIndex(panels.getChildNodes().indexOf(panel)); return new XulTabAndPanel(tab, panel); } catch (XulException e) { e.printStackTrace(); } return null; }
Example 4
Source File: StarModelerPerspective.java From pentaho-kettle with Apache License 2.0 | 6 votes |
public void setNameForTab(XulTab tab, String name){ String tabName = name; List<String> usedNames = new ArrayList<String>(); for(XulComponent c : tabs.getChildNodes()){ if(c != tab){ usedNames.add(((SwtTab) c).getLabel()); } } if(usedNames.contains(name)){ int num = 2; while(true){ tabName = name +" ("+num+")"; if(usedNames.contains(tabName) == false){ break; } num++; } } tab.setLabel(tabName); }