if (!UserMotorBean.this.isSimpleMotorBeanGUI) {
propertyValue = UserMotorBean.this.deviceBundle
.getString("UserMotorBean.command.defineposition");
// - Define Position Command
tangoKey = UserMotorBean.this.generateCommandKey(propertyValue);
final IDataSourceProducer producer = UserMotorBean.this.getProducer();
if (producer != null) {
final boolean isCreatable = producer.isSourceCreatable(tangoKey);
// System.out.println("isCreatable=" +
// isCreatable);
if (isCreatable) {
UserMotorBean.this.setWidgetModel(
UserMotorBean.this.getDefinePositionViewer(),
UserMotorBean.this.stringBox, tangoKey);
UserMotorBean.this.getDefinePositionViewer().setText("<-|->");
}
UserMotorBean.this.getDefinePositionViewer()
.setVisible(isCreatable);
}
}
// SetModel for StateViewer
tangoKey = UserMotorBean.this.generateAttributeKey("State");
UserMotorBean.this.setStateModel();
// For some motor Backward and Forward Command does not exist XPSAxis
IDataSourceProducer producer = getProducer();
if (producer != null) {
propertyValue = deviceBundle
.getString("UserMotorBean.command.backward");
getBackwardButton().setVisible(false);
if (TangoCommandHelper.isCommandExist(model, propertyValue)) {
tangoKey = generateCommandKey(propertyValue);
try {
// Backward Command
backwardCmd = producer.createDataSource(tangoKey);
}
catch (final Exception e) {
// TODO: handle exception
}
getBackwardButton().setVisible(true);
}
propertyValue = deviceBundle.getString("UserMotorBean.command.forward");
getForwardButton().setVisible(false);
if (TangoCommandHelper.isCommandExist(model, propertyValue)) {
tangoKey = generateCommandKey(propertyValue);
try {
// Forward Command
forwardCmd = producer.createDataSource(tangoKey);
}
catch (final Exception e) {
// TODO: handle exception
}
getForwardButton().setVisible(true);