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

The following examples show how to use org.pentaho.ui.xul.components.XulTab. These examples are extracted from open source projects. 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 Project: kettle-beam   Source File: BeamPerspective.java    License: 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 Project: kettle-beam   Source File: BeamPerspective.java    License: 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
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
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 Project: pentaho-kettle   Source File: StarModelerPerspective.java    License: 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 Project: pentaho-kettle   Source File: StarModelerPerspective.java    License: 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 Project: kettle-beam   Source File: BeamPerspective.java    License: Apache License 2.0 4 votes vote down vote up
public XulTabAndPanel( XulTab tab, XulTabpanel panel ) {
  this.tab = tab;
  this.panel = panel;
}
 
Example 8
public XulTabAndPanel( XulTab tab, XulTabpanel panel ) {
  this.tab = tab;
  this.panel = panel;
}
 
Example 9
Source Project: pentaho-kettle   Source File: StarModelerPerspective.java    License: 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 Project: pentaho-kettle   Source File: StarModelerPerspective.java    License: Apache License 2.0 4 votes vote down vote up
public void setMetaForTab(XulTab tab, EngineMetaInterface meta){
  metas.put(tab, meta);
}