TangoKey key = null;
if (!isSimpleMotorBeanGUI) {
property = deviceBundle.getString("UserMotorBean.command.defineposition");
// - Define Position Command
key = generateCommandKey(property);
final IDataSourceProducer producer = getProducer();
if (producer != null) {
final boolean isCreatable = producer.isSourceCreatable(key);
// System.out.println("isCreatable=" + isCreatable);
if (isCreatable) {
setWidgetModel(getDefinePositionViewer(), stringBox, key);
getDefinePositionViewer().setText(DEFINE_POSITION_TEXT);
}
getDefinePositionViewer().setVisible(isCreatable);
}
}
// SetModel for StateViewer
key = UserMotorBean.this.generateAttributeKey("State");
UserMotorBean.this.setStateModel();
// For some motor Backward and Forward Command does not
// exist XPSAxis
final IDataSourceProducer producer = getProducer();
if (producer != null) {
property = deviceBundle.getString("UserMotorBean.command.backward");
if (TangoCommandHelper.isCommandExist(getModel(), property)) {
key = generateCommandKey(property);
try {
// Backward Command
backwardCmd = producer.createDataSource(key);
} catch (final Exception e) {
Logger.getLogger(Mediator.LOGGER_ACCESS).log(
Level.WARNING,
UserMotorBean.this.getClass().getSimpleName()
+ " failed to connect to backward command", e);
}
getBackwardButton().setVisible(true);
} else {
getBackwardButton().setVisible(false);
}
property = deviceBundle.getString("UserMotorBean.command.forward");
if (TangoCommandHelper.isCommandExist(getModel(), property)) {
key = generateCommandKey(property);
try {
// Forward Command
forwardCmd = producer.createDataSource(key);
} catch (final Exception e) {
Logger.getLogger(Mediator.LOGGER_ACCESS).log(
Level.WARNING,
UserMotorBean.this.getClass().getSimpleName()
+ " failed to connect to forward command", e);