/** * Accesses the underlying model property and gets its value. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { try { return accessor.getValue(getModelProvider().getModel()); } catch (IllegalAccessException ex) { throw new ConnectorBindingException(ex); } catch (InvocationTargetException ex) { if (ex.getCause() instanceof RuntimeException) { throw (RuntimeException) ex.getCause(); } throw new ConnectorBindingException(ex.getCause()); } catch (NoSuchMethodException ex) { // this may be a normal behaviour in case of polymorphism. // don't throw any exception. // throw new ConnectorBindingException(ex); return null; } }
/** * Accesses the underlying model property and sets its value. * <p> * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { if (!ObjectUtils.equals(aValue, getConnecteeValue())) { try { accessor.setValue(getModelProvider().getModel(), aValue); } catch (IllegalAccessException | NoSuchMethodException ex) { throw new ConnectorBindingException(ex); } catch (InvocationTargetException ex) { if (ex.getCause() instanceof RuntimeException) { throw (RuntimeException) ex.getCause(); } throw new ConnectorBindingException(ex.getCause()); } } } }
.getPropertyDescriptor(actualKey); if (propertyDescriptor == null) { throw new ConnectorBindingException("Property [" + actualKey + "] does not exist on {" + componentDescriptor.getName() + "}.");
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { // don't call getValue() due to bad focusevent delivery order of // SFormattedTextField. // return getConnectedSComponent().getValue(); try { if (getConnectedSComponent().getText() == null || getConnectedSComponent().getText().length() == 0) { return null; } return getConnectedSComponent().getFormatter().stringToValue( getConnectedSComponent().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object protectedGetConnecteeValue() { // don't call getValue() due to bad focus event delivery order of // JFormattedTextField. // return getConnectedJComponent().getValue(); try { if (getConnectedJComponent().getText() == null || getConnectedJComponent().getText().length() == 0) { return null; } return getConnectedJComponent().getFormatter().stringToValue( getConnectedJComponent().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { // don't call getValue() due to bad focusevent delivery order of // JFormattedTextField. // return getConnectedJComponent().getValue(); try { if (getConnectedJComponent().getText() == null || getConnectedJComponent().getText().length() == 0) { return null; } return getConnectedJComponent().getFormatter().stringToValue( getConnectedJComponent().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { // don't call getValue() due to bad focusevent delivery order of // SFormattedTextField. // return getConnectedSComponent().getValue(); try { if (getConnectedSComponent().getText() == null || getConnectedSComponent().getText().length() == 0) { return null; } return getConnectedSComponent().getFormatter().stringToValue( getConnectedSComponent().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object getConnecteeValue() { // don't call getValue() due to bad focusevent delivery order of // JFormattedTextField. // return getConnectedJComponent().getValue(); try { if (getConnectedJComponent().getFormattedTextField().getText() == null || getConnectedJComponent().getFormattedTextField().getText() .length() == 0) { return null; } return getConnectedJComponent().getFormattedTextField().getFormatter() .stringToValue( getConnectedJComponent().getFormattedTextField().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
/** * Gets the value out of the connector text after parsing the string * representation. * <p> * {@inheritDoc} */ @Override protected Object protectedGetConnecteeValue() { // don't call getValue() due to bad focus event delivery order of // JFormattedTextField. // return getConnectedJComponent().getValue(); try { if (getConnectedJComponent().getFormattedTextField().getText() == null || getConnectedJComponent().getFormattedTextField().getText() .length() == 0) { return null; } return getConnectedJComponent() .getFormattedTextField() .getFormatter() .stringToValue( getConnectedJComponent().getFormattedTextField().getText()); } catch (ParseException ex) { throw new ConnectorBindingException(ex); } }
@Override public void valueChange(ValueChangeEvent evt) { String mapContent = mapContentConnector.getConnectorValue(); if (mapContent != null) { try { JSONObject mapContentAsJson = new JSONObject(mapContent); JSONArray markers = mapContentAsJson.optJSONArray(MapHelper.MARKERS_KEY); if (markers != null && markers.length() > 0) { JSONArray marker = markers.getJSONArray(0); mapView.setCenter(marker.getDouble(1), marker.getDouble(0)); mapView.setVisible(true); } else { mapView.setVisible(false); } } catch (JSONException e) { throw new ConnectorBindingException(e, "Invalid Json map content"); } } else { mapView.setVisible(false); } } };
throw new ConnectorBindingException("Could not create child connector [" + id + "].");