org.pentaho.ui.xul.components.XulTab Java Examples

The following examples show how to use org.pentaho.ui.xul.components.XulTab. 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 vote down vote up
public XulTabAndPanel createTab() {

    try {
      XulTab tab = (XulTab) document.createElement( "tab" );
      XulTabpanel panel = (XulTabpanel) document.createElement( "tabpanel" );
      panel.setSpacing( 0 );
      panel.setPadding( 0 );

      tabs.addChild( tab );
      panels.addChild( panel );
      tabbox.setSelectedIndex( panels.getChildNodes().indexOf( panel ) );


      tab.addPropertyChangeListener( new PropertyChangeListener() {
        @Override public void propertyChange( PropertyChangeEvent evt ) {
          LogChannel.GENERAL.logBasic( "Property changed: " + evt.getPropertyName() + ", " + evt.toString() );
        }
      } );

      return new XulTabAndPanel( tab, panel );
    } catch ( XulException e ) {
      e.printStackTrace();
    }
    return null;
  }
 
Example #2
Source File: BeamPerspective.java    From kettle-beam with Apache License 2.0 6 votes vote down vote up
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: Neo4jPerspective.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 6 votes vote down vote up
public XulTabAndPanel createTab() {

    try {
      XulTab tab = (XulTab) document.createElement( "tab" );
      XulTabpanel panel = (XulTabpanel) document.createElement( "tabpanel" );
      panel.setSpacing( 0 );
      panel.setPadding( 0 );

      tabs.addChild( tab );
      panels.addChild( panel );
      tabbox.setSelectedIndex( panels.getChildNodes().indexOf( panel ) );


      tab.addPropertyChangeListener( new PropertyChangeListener() {
        @Override public void propertyChange( PropertyChangeEvent evt ) {
          LogChannel.GENERAL.logBasic( "Property changed: " + evt.getPropertyName() + ", " + evt.toString() );
        }
      } );

      return new XulTabAndPanel( tab, panel );
    } catch ( XulException e ) {
      e.printStackTrace();
    }
    return null;
  }
 
Example #4
Source File: Neo4jPerspective.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 6 votes vote down vote up
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 #5
Source File: StarModelerPerspective.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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 #6
Source File: StarModelerPerspective.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
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 #7
Source File: BeamPerspective.java    From kettle-beam with Apache License 2.0 4 votes vote down vote up
public XulTabAndPanel( XulTab tab, XulTabpanel panel ) {
  this.tab = tab;
  this.panel = panel;
}
 
Example #8
Source File: Neo4jPerspective.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 4 votes vote down vote up
public XulTabAndPanel( XulTab tab, XulTabpanel panel ) {
  this.tab = tab;
  this.panel = panel;
}
 
Example #9
Source File: StarModelerPerspective.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public XulTabAndPanel(XulTab tab, XulTabpanel panel){
  this.tab = tab;
  this.panel = panel;
}
 
Example #10
Source File: StarModelerPerspective.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void setMetaForTab(XulTab tab, EngineMetaInterface meta){
  metas.put(tab, meta);
}