Search in sources :

Example 1 with ITabListener

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;
}
Also used : ITabListener(org.csstudio.swt.widgets.figures.TabFigure.ITabListener) AbstractWidgetModel(org.csstudio.opibuilder.model.AbstractWidgetModel) TabFigure(org.csstudio.swt.widgets.figures.TabFigure)

Aggregations

AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1 TabFigure (org.csstudio.swt.widgets.figures.TabFigure)1 ITabListener (org.csstudio.swt.widgets.figures.TabFigure.ITabListener)1