use of org.pentaho.di.ui.spoon.AbstractGraph in project pentaho-kettle by pentaho.
the class SpoonTabsDelegate method renameTabs.
/**
* Rename the tabs
*/
public void renameTabs() {
List<TabMapEntry> list = new ArrayList<TabMapEntry>(tabMap);
for (TabMapEntry entry : list) {
if (entry.getTabItem().isDisposed()) {
// this should not be in the map, get rid of it.
tabMap.remove(entry.getObjectName());
continue;
}
// TabItem before = entry.getTabItem();
// PDI-1683: need to get the String here, otherwise using only the "before" instance below, the reference gets
// changed and result is always the same
// String beforeText=before.getText();
//
Object managedObject = entry.getObject().getManagedObject();
if (managedObject != null) {
if (entry.getObject() instanceof AbstractGraph) {
AbstractMeta meta = (AbstractMeta) managedObject;
String tabText = makeTabName(meta, entry.isShowingLocation());
entry.getTabItem().setText(tabText);
String toolTipText = BaseMessages.getString(PKG, "Spoon.TabTrans.Tooltip", tabText);
if (entry.getObject() instanceof JobGraph) {
toolTipText = BaseMessages.getString(PKG, "Spoon.TabJob.Tooltip", tabText);
}
if (Const.isWindows() && !Utils.isEmpty(meta.getFilename())) {
toolTipText += Const.CR + Const.CR + meta.getFilename();
}
entry.getTabItem().setToolTipText(toolTipText);
}
}
}
spoon.setShellText();
}
use of org.pentaho.di.ui.spoon.AbstractGraph in project pentaho-kettle by pentaho.
the class SpoonTabsDelegate method tabSelected.
public void tabSelected(TabItem item) {
//
for (TabMapEntry entry : tabMap) {
boolean isAbstractGraph = (entry.getObject() instanceof AbstractGraph);
if (item.equals(entry.getTabItem())) {
if (isAbstractGraph) {
EngineMetaInterface meta = entry.getObject().getMeta();
if (meta != null) {
meta.setInternalKettleVariables();
}
if (spoon.getCoreObjectsState() != SpoonInterface.STATE_CORE_OBJECTS_SPOON) {
spoon.refreshCoreObjects();
}
((AbstractGraph) entry.getObject()).setFocus();
}
break;
}
}
// Also refresh the tree
spoon.refreshTree();
// calls also enableMenus() and markTabsChanged()
spoon.setShellText();
}
Aggregations