/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { return provideIcon(controller, configuration, forModel); } }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { return present(controller, configuration, null); }
private Object getDefaulValue(OperationData d, String attributeName) { return getNestedAttributeValue(d, "defaultValue"); }
private void setValue(OperationData attributeDefinition, String attributeRootPath, String attributeLogicalPath, OperationData forModel) { final String mc = getDynamicalColumnMapping(attributeDefinition); final String attributeName = attributeRootPath + "dyn_att_" + mc; final Object value = getModelAttribute(forModel, attributeName); label.setText("--"); if (value == null || StringUtils.isEmpty(String.valueOf(value))) { final Object o = getDefaulValue(attributeDefinition, attributeLogicalPath); if (o != null) { label.setText((String) o); } } else { label.setText((String) value); } }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { VLViewComponentXML dtf = configuration.getComponentById("DisplayFormat").orElse(null); if (dtf != null) { fullDisplayFormat = dtf.getPropertyValue("fullDisplayFormat") == null ? defaultFormat : dtf.getPropertyValue("fullDisplayFormat"); shortDisplayFormat = dtf.getPropertyValue("shortDisplayFormat") == null ? defaultFormat : dtf.getPropertyValue("fullDisplayFormat"); saveFormat = dtf.getPropertyValue("saveFormat"); } if (StringUtils.isNotBlank(saveFormat)) { String attributePath = configuration.getPropertyValue("attributePath"); String dataValue = getModelAttribute(controller, attributePath); setDate((AbstractViewController) controller, configuration, dataValue); } return label; }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { if (StringUtils.isEmpty(attributePath)) { attributePath = configuration.getPropertyValue("attributePath"); } String dataValue = getModelAttribute(controller, attributePath); initEnumeratedTypeTranslater(configuration); if (dataValue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running String realVal = enumeratedTypeTranslater.translate(controller, configuration, dataValue.toString()); label.setText(realVal); } else { label.setText(dataValue.toString()); } } return label; }
/** * @{inheritedDoc} */ @Override public Node presentTypeOf(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { type.setText(getTypeOf(null, null)); return type; } }
@Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { Label label = (Label) super.present(controller, configuration); String text = label.getText(); Platform.runLater(() -> { label.setText(text.toUpperCase()); String pc = StringUtils.replace(text, " ", "_"); PseudoClass cc = PseudoClass.getPseudoClass(pc.toLowerCase()); label.pseudoClassStateChanged(cc, true); }); return label; }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { final String attributePath = configuration.getPropertyValue("attributePath"); final Object datavalue = ReflectionUIUtils.invokeGetterOn(forModel, attributePath); initEnumeratedTypeTranslater(configuration); if (datavalue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running final String realVal = enumeratedTypeTranslater.translate(controller, configuration, datavalue.toString()); label.setText(realVal); } else { label.setText(datavalue.toString()); } } return label; }
@Bean @Named("GenericModelAttributetoTablePresenter") public GenericModelAttributetoTablePresenter GenericModelAttributetoTablePresenter() { return new GenericModelAttributetoTablePresenter(); }
@Bean @Named("DefaultEnumeratedValueTranslater") public DefaultEnumeratedValueTranslater DefaultEnumeratedValueTranslater() { return new DefaultEnumeratedValueTranslater(); }
@Bean @Named("ModelAttributePresenter") public com.nexitia.emaginplatform.jfx.core.engine.components.presenter.impl.ModelAttributePresenter ModelAttributePresenter() { return new com.nexitia.emaginplatform.jfx.core.engine.components.presenter.impl.ModelAttributePresenter(); }
@Bean @Named("ModelDateTimePresenter") public ModelDateTimePresenter ModelDateTimePresenter() { return new ModelDateTimePresenter(); }
private void translate(AbstractViewController controller, VLViewComponentXML configuration) { final Object datavalue = ReflectionUIUtils.invokeGetterOn(null, null); initEnumeratedTypeTranslater(configuration); if (datavalue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running final String realVal = enumeratedTypeTranslater.translate(controller, configuration, datavalue.toString()); label.setText(realVal); } else { label.setText(datavalue.toString()); } } }
public String setDate(AbstractViewController controller, VLViewComponentXML configuration, String dataValue) { if (StringUtils.isNotBlank(saveFormat)) { if (dataValue != null) { Date date = DateUtils.readFromString(dataValue, saveFormat); if (date == null) { label.setText("--"); return "--"; } if (isToday(date)) { df = new SimpleDateFormat(shortDisplayFormat); label.setText(df.format(date)); } else { df = new SimpleDateFormat(fullDisplayFormat); label.setText(df.format(date)); } } } return null; }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { VLViewComponentXML dtf = configuration.getComponentById("DisplayFormat").orElse(null); if (dtf != null) { fullDisplayFormat = dtf.getPropertyValue("fullDisplayFormat") == null ? defaultFormat : dtf.getPropertyValue("fullDisplayFormat"); shortDisplayFormat = dtf.getPropertyValue("shortDisplayFormat") == null ? defaultFormat : dtf.getPropertyValue("fullDisplayFormat"); saveFormat = dtf.getPropertyValue("saveFormat"); } if (StringUtils.isNotBlank(saveFormat)) { String attributePath = configuration.getPropertyValue("attributePath"); String dataValue = getModelAttribute((OperationData) forModel, attributePath); setDate((AbstractViewController) controller, configuration, dataValue); } return label; }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { if (StringUtils.isEmpty(attributePath)) { attributePath = configuration.getPropertyValue("attributePath"); } String dataValue = getModelAttribute((OperationData) forModel, attributePath); initEnumeratedTypeTranslater(configuration); if (dataValue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running String realVal = enumeratedTypeTranslater.translate(controller, configuration, dataValue.toString()); label.setText(realVal); } else { label.setText(dataValue.toString()); } } return label; }
/** * @{inheritedDoc} */ @Override public Node presentTypeOf(IEmaginController controller, VLViewComponentXML component) { SingleResult result = (SingleResult) controller.getModel(); type.setText(getTypeOf(controller, result.getData())); return type; }
@Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { Label label = (Label) super.present(controller, configuration, forModel); String text = label.getText(); Platform.runLater(() -> { label.setText(text.toUpperCase()); String pc = StringUtils.replace(text, " ", "_"); PseudoClass cc = PseudoClass.getPseudoClass(pc.toLowerCase()); label.pseudoClassStateChanged(cc, true); }); return label; } }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration) { final String attributePath = configuration.getPropertyValue("attributePath"); final IOperationResult model = (IOperationResult) controller.getModel(); if (model != null) { final OperationData data = (OperationData) model.rootData(); final Object datavalue = ReflectionUIUtils.invokeGetterOn(data, attributePath); initEnumeratedTypeTranslater(configuration); if (datavalue != null) { if (enumeratedTypeTranslater != null) { // TO DO Asunch if long running final String realVal = enumeratedTypeTranslater.translate(controller, configuration, datavalue.toString()); label.setText(realVal); } else { label.setText(datavalue.toString()); } } } return label; }