/** * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { value = aValue; getConnectedSComponent().setValue(getActionText()); } }
public void removeUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } });
/** * {@inheritDoc} */ @Override public void writabilityChange() { super.writabilityChange(); getConnectedSComponent().setEditable(isWritable()); }
/** * Performs the action field action if the action field is not synchronized. */ public void performActionIfNeeded() { if (!getConnectedSComponent().isSynchronized()) { if (StringUtils.isEmpty(getConnectedSComponent().getActionText())) { setConnectorValue(null); } else { getConnectedSComponent().performAction(); } } }
/** * {@inheritDoc} */ @Override protected IView<SComponent> createBinaryPropertyView( IPropertyViewDescriptor propertyViewDescriptor, IActionHandler actionHandler, Locale locale) { IBinaryPropertyDescriptor propertyDescriptor = (IBinaryPropertyDescriptor) propertyViewDescriptor .getModelDescriptor(); SActionField viewComponent = createSActionField(false); SActionFieldConnector connector = new SActionFieldConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); IView<SComponent> propertyView = constructView(viewComponent, propertyViewDescriptor, connector); viewComponent.setActions(createBinaryActions(propertyView, actionHandler, locale)); adjustSizes(propertyViewDescriptor, viewComponent, null, null); return propertyView; }
/** * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { getConnectedSComponent().setValue(aValue); } }
/** * Constructs a new <code>SActionFieldConnector</code> instance. * * @param id * the id of the connector. * @param actionField * the connected SActionField. */ public SActionFieldConnector(String id, SActionField actionField) { super(id, actionField); if (!getConnectedSComponent().isShowingTextField()) { addValueChangeListener(new IValueChangeListener() { public void valueChange(ValueChangeEvent evt) { if (evt.getNewValue() instanceof byte[]) { getConnectedSComponent().setDecorated( ((byte[]) evt.getNewValue()).length > 0); } else { getConnectedSComponent().setDecorated(evt.getNewValue() != null); } } }); } }
/** * Constructs a new <code>SActionFieldConnector</code> instance. * * @param id * the id of the connector. * @param actionField * the connected SActionField. */ public SActionFieldConnector(String id, SActionField actionField) { super(id, actionField); if (!getConnectedSComponent().isShowingTextField()) { addConnectorValueChangeListener(new IConnectorValueChangeListener() { public void connectorValueChange(ConnectorValueChangeEvent evt) { if (evt.getNewValue() instanceof byte[]) { getConnectedSComponent().setDecorated( ((byte[]) evt.getNewValue()).length > 0); } else { getConnectedSComponent().setDecorated(evt.getNewValue() != null); } } }); } }
/** * {@inheritDoc} */ @Override public SReferenceFieldConnector clone(String newConnectorId) { SReferenceFieldConnector clonedConnector = (SReferenceFieldConnector) super .clone(newConnectorId); if (renderingConnector != null) { clonedConnector.renderingConnector = renderingConnector.clone(); } return clonedConnector; }
/** * {@inheritDoc} */ @Override protected String getActionText() { if (renderingConnector != null) { if (renderingConnector.getConnectorValue() == null) { return ""; } return renderingConnector.getConnectorValue().toString(); } return super.getActionText(); }
/** * {@inheritDoc} */ @Override public void updateState() { super.updateState(); getConnectedSComponent().setEditable(isWritable()); }
/** * Performs the action field action if the action field is not synchronized. */ public void performActionIfNeeded() { if (!getConnectedSComponent().isSynchronized()) { if (StringUtils.isEmpty(getConnectedSComponent().getActionText())) { setConnectorValue(null); } else { getConnectedSComponent().performAction(); } } }
private IView<SComponent> createBinaryPropertyView( IBinaryPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, Locale locale) { SActionField viewComponent = createSActionField(false); SActionFieldConnector connector = new SActionFieldConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); Action openAction = actionFactory.createAction( openFileAsBinaryPropertyAction, actionHandler, viewComponent, propertyDescriptor, connector, locale); Action saveAction = actionFactory.createAction( saveBinaryPropertyAsFileAction, actionHandler, viewComponent, propertyDescriptor, connector, locale); Action resetAction = actionFactory.createAction(resetPropertyAction, actionHandler, viewComponent, propertyDescriptor, connector, locale); Action infoAction = actionFactory.createAction(binaryPropertyInfoAction, actionHandler, viewComponent, propertyDescriptor, connector, locale); viewComponent.setActions(Arrays.asList(new Action[] {openAction, saveAction, resetAction, infoAction})); adjustSizes(viewComponent, null, null); return constructView(viewComponent, null, connector); }
/** * {@inheritDoc} */ @Override protected Object getConnecteeValue() { return getConnectedSComponent().getValue(); }
/** * {@inheritDoc} */ @Override public SReferenceFieldConnector clone(String newConnectorId) { SReferenceFieldConnector clonedConnector = (SReferenceFieldConnector) super .clone(newConnectorId); if (toStringPropertyConnector != null) { clonedConnector.toStringPropertyConnector = toStringPropertyConnector .clone(); } return clonedConnector; }
/** * {@inheritDoc} */ @Override protected void bindSComponent() { getConnectedSComponent().addTextFieldDocumentListener( new SDocumentListener() { public void changedUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } public void insertUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } public void removeUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } }); }
public void changedUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); }
/** * {@inheritDoc} */ @Override protected void bindSComponent() { getConnectedSComponent().addTextFieldDocumentListener( new SDocumentListener() { public void changedUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } public void insertUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } public void removeUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } }); }
public void removeUpdate(@SuppressWarnings("unused") SDocumentEvent e) { performActionIfNeeded(); } });
public void connectorValueChange(ConnectorValueChangeEvent evt) { if (evt.getNewValue() instanceof byte[]) { getConnectedSComponent().setDecorated( ((byte[]) evt.getNewValue()).length > 0); } else { getConnectedSComponent().setDecorated(evt.getNewValue() != null); } } });