Search in sources :

Example 1 with SpoonSlave

use of org.pentaho.di.ui.spoon.SpoonSlave in project pentaho-kettle by pentaho.

the class SpoonSlaveDelegate method addSpoonSlave.

public void addSpoonSlave(SlaveServer slaveServer) {
    TabSet tabfolder = spoon.tabfolder;
    // See if there is a SpoonSlave for this slaveServer...
    String tabName = spoon.delegates.tabs.makeSlaveTabName(slaveServer);
    TabMapEntry tabMapEntry = spoon.delegates.tabs.findTabMapEntry(tabName, ObjectType.SLAVE_SERVER);
    if (tabMapEntry == null) {
        SpoonSlave spoonSlave = new SpoonSlave(tabfolder.getSwtTabset(), SWT.NONE, spoon, slaveServer);
        PropsUI props = PropsUI.getInstance();
        TabItem tabItem = new TabItem(tabfolder, tabName, tabName, props.getSashWeights());
        tabItem.setToolTipText("Status of slave server : " + slaveServer.getName() + " : " + slaveServer.getServerAndPort());
        tabItem.setControl(spoonSlave);
        tabMapEntry = new TabMapEntry(tabItem, null, tabName, null, null, spoonSlave, ObjectType.SLAVE_SERVER);
        spoon.delegates.tabs.addTab(tabMapEntry);
    }
    int idx = tabfolder.indexOf(tabMapEntry.getTabItem());
    tabfolder.setSelected(idx);
}
Also used : TabItem(org.pentaho.xul.swt.tab.TabItem) TabSet(org.pentaho.xul.swt.tab.TabSet) SpoonSlave(org.pentaho.di.ui.spoon.SpoonSlave) TabMapEntry(org.pentaho.di.ui.spoon.TabMapEntry) PropsUI(org.pentaho.di.ui.core.PropsUI)

Aggregations

PropsUI (org.pentaho.di.ui.core.PropsUI)1 SpoonSlave (org.pentaho.di.ui.spoon.SpoonSlave)1 TabMapEntry (org.pentaho.di.ui.spoon.TabMapEntry)1 TabItem (org.pentaho.xul.swt.tab.TabItem)1 TabSet (org.pentaho.xul.swt.tab.TabSet)1