use of org.csstudio.swt.widgets.figures.TextInputFigure in project yamcs-studio by yamcs.
the class TextInputEditpart method doCreateFigure.
@Override
protected IFigure doCreateFigure() {
initFields();
if (shouldBeTextInputFigure()) {
TextInputFigure textInputFigure = (TextInputFigure) createTextFigure();
initTextFigure(textInputFigure);
setDelegate(new Draw2DTextInputEditpartDelegate(this, getWidgetModel(), textInputFigure));
} else {
setDelegate(new NativeTextEditpartDelegate(this, getWidgetModel()));
}
getPVWidgetEditpartDelegate().setUpdateSuppressTime(-1);
updatePropSheet();
return delegate.doCreateFigure();
}
use of org.csstudio.swt.widgets.figures.TextInputFigure in project yamcs-studio by yamcs.
the class Draw2DTextInputEditpartDelegate method registerPropertyChangeHandlers.
@Override
public void registerPropertyChangeHandlers() {
IWidgetPropertyChangeHandler selectorTypeHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((TextInputFigure) figure).setSelectorType(model.getSelectorType());
return false;
}
};
editpart.setPropertyChangeHandler(TextInputModel.PROP_SELECTOR_TYPE, selectorTypeHandler);
IWidgetPropertyChangeHandler dateTimeFormatHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((TextInputFigure) figure).setDateTimeFormat((String) newValue);
return false;
}
};
editpart.setPropertyChangeHandler(TextInputModel.PROP_DATETIME_FORMAT, dateTimeFormatHandler);
IWidgetPropertyChangeHandler fileSourceHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((TextInputFigure) figure).setFileSource(FileSource.values()[(Integer) newValue]);
return false;
}
};
editpart.setPropertyChangeHandler(TextInputModel.PROP_FILE_SOURCE, fileSourceHandler);
IWidgetPropertyChangeHandler fileReturnPartHandler = new IWidgetPropertyChangeHandler() {
@Override
public boolean handleChange(Object oldValue, Object newValue, IFigure figure) {
((TextInputFigure) figure).setFileReturnPart(FileReturnPart.values()[(Integer) newValue]);
return false;
}
};
editpart.setPropertyChangeHandler(TextInputModel.PROP_FILE_RETURN_PART, fileReturnPartHandler);
}
Aggregations