Search in sources :

Example 1 with NativeButtonModel

use of org.csstudio.opibuilder.widgets.model.NativeButtonModel in project yamcs-studio by yamcs.

the class NativeButtonEditPart method doCreateFigure.

/**
 * {@inheritDoc}
 */
@Override
protected IFigure doCreateFigure() {
    NativeButtonModel model = getWidgetModel();
    int style = SWT.None;
    style |= model.isToggleButton() ? SWT.TOGGLE : SWT.PUSH;
    style |= SWT.WRAP;
    final NativeButtonFigure buttonFigure = new NativeButtonFigure(this, style);
    button = buttonFigure.getSWTWidget();
    button.setText(model.getText());
    buttonFigure.setImagePath(model.getImagePath());
    updatePropSheet(model.isToggleButton());
    markAsControlPV(AbstractPVWidgetModel.PROP_PVNAME, AbstractPVWidgetModel.PROP_PVVALUE);
    return buttonFigure;
}
Also used : NativeButtonModel(org.csstudio.opibuilder.widgets.model.NativeButtonModel) NativeButtonFigure(org.csstudio.opibuilder.widgets.figures.NativeButtonFigure)

Aggregations

NativeButtonFigure (org.csstudio.opibuilder.widgets.figures.NativeButtonFigure)1 NativeButtonModel (org.csstudio.opibuilder.widgets.model.NativeButtonModel)1