use of org.csstudio.swt.widgets.figures.TabFigure.ITabListener in project yamcs-studio by yamcs.
the class TabEditPart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
TabFigure tabFigure = new TabFigure();
tabFigure.setHorizontal(getWidgetModel().isHorizontal());
tabFigure.setMinimumTabHeight(getWidgetModel().getMinimumTabHeight());
tabFigure.addTabListener(new ITabListener() {
@Override
public void activeTabIndexChanged(int oldIndex, int newIndex) {
for (AbstractWidgetModel child : getWidgetModel().getChildren()) child.setPropertyValue(AbstractWidgetModel.PROP_VISIBLE, false);
getWidgetModel().getChildren().get(newIndex).setPropertyValue(AbstractWidgetModel.PROP_VISIBLE, true);
// if (getExecutionMode() == ExecutionMode.RUN_MODE)
// setPropertyValue(TabModel.PROP_ACTIVE_TAB, newIndex);
}
});
return tabFigure;
}
Aggregations