/** * @param newValue */ protected void setData(Object newValue) { ReflectionUIUtils.setPropertyValue(newValue, this, "attributes.name", "name"); ReflectionUIUtils.setPropertyValue(newValue, this, "attributes.description", "description"); ReflectionUIUtils.setDateFromStringPropertyValue(newValue, this, "attributes.createDate", "creationDate", TRANSFERTDATEFORMAT); ReflectionUIUtils.setDateFromStringPropertyValue(newValue, this, "attributes.lastModifiedDate", "lastModificationDate", TRANSFERTDATEFORMAT); ReflectionUIUtils.setPropertyValue(newValue, this, "attributes.lastModifiedBy", "modifiedBy"); ReflectionUIUtils.setPropertyValue(newValue, this, "attributes.createdBy", "createdBy"); }
@SuppressWarnings("rawtypes") @Override protected Skin createDefaultSkin() { Object[] argsValues = new Object[] {this}; Skin skin = (Skin) ReflectionUIUtils.newInstance("com.nexitia.emaginplatform.jfx.core.components.list.utils.FixedSizeListViewSkin", argsValues, ListView.class); return skin; } }
/** * Set the given property on the target from the value readen from source * * @param source * @param target * @param propertyName */ public static void setPropertyValue(Object source, Object target, String propertyName) { Object val = invokeGetterOn(source, propertyName); invokeSetterOn(target, propertyName, val); }
/** * @{inheritedDoc} */ @Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object item) { final OperationData opd = (OperationData) item; final String mimetype = (String) opd.getAttributes().get("mimeType"); final Label label = new Label(); IconUtils.setFontIcon(MimeTyPeUtils.getFontIcon(mimetype, "20"), label); return label; } }
private String getTypeOf(IEmaginController controller, OperationData data) { return (String) ReflectionUIUtils.invokeGetterOn(data, "businessType.displayName"); }
/** * @{inheritedDoc} */ @Override public void initFromConfiguration(IEmaginController controller, VLViewComponentXML listConfiguration) { dataKey = listConfiguration.getPropertyValue("dataKey"); rootData = ComponentUtils.resolveModel((AbstractViewController) controller, dataKey); }
protected void buildDefaultActions() { if (defaultActionsConfiguration != null && defaultActionsConfiguration.hasSubComponent()) { defaultActions = ComponentUtils.resolveAndGenerate(controller, defaultActionsConfiguration.getSubcomponents()); } }
public void afterPropertiesSet() throws Exception { Locale locale = LocaleResolver.getLocale(); if (StringUtils.isNotBlank(errorMessageKey)) { //this.errorMessage = ms.getMessage(errorMessageKey, null, locale); } }
private double getSvgHeight(WebEngine webEngine) { final Object result = getSvgDomProperty(webEngine, "offsetHeight"); //$NON-NLS-1$ if (result instanceof Integer) { return (Integer) result; } return -1; }
public static String getFontIcon(String mimeType) { return getFontIcon(mimeType, "32"); } }
public static SVGUtils newInstance(Callback<ImageView, Void> callback) { return new SVGUtils(callback); }
/** * @{inheritedDoc} */ @Override protected void setData(Object newValue) { super.setData(newValue); ReflectionUIUtils.setPropertyValue(newValue, this, "key"); ReflectionUIUtils.setPropertyValue(newValue, this, "value"); ReflectionUIUtils.setPropertyValue(newValue, this, "owner"); }
/** * Add a {@link ChangeListener} to a property. * * @param changerListener * @param propertyName */ public void addChangeListener(String propertyName, ChangeListener<? super Object> changerListener) { try { ReflectionUIUtils.addPropertyChangeListener(this, propertyName, changerListener); } catch (Exception e) { e.printStackTrace(); } }
protected void buildToolbar() { if (toolbarConfiguration != null) { toolbar = ToolbarUtils.buildToolbar(controller, this).orElse(null); } }
/** * Set the given property on the target from the value readen from source. Source and target have * the same data type for the property but different names. * * @param source * @param target * @param spropertyName * @param tpropertyName */ public static void setPropertyValue(Object source, Object target, String spropertyName, String tpropertyName) { try { Object val = invokeGetterOn(source, spropertyName); invokeSetterOn(target, tpropertyName, val); } catch (IllegalArgumentException e) { // TODO: handle exception } }
public String getModelAttribute(OperationData data, String name) { if (data != null) { Object o = ReflectionUIUtils.invokeGetterOn(data, name); return o != null ? o.toString() : ""; } return ""; }
/** * @param key * @param args * @return */ public String getLocalised(String key, Object... args) { if(messageSource == null) { return "__I18N__"; } final Locale locale = LocaleResolver.getLocale(); return messageSource.getOrDefault(key,"__I18N__" ,locale); }
@SuppressWarnings({"rawtypes"}) @Override protected Skin createDefaultSkin() { Object[] argsValues = new Object[] {this}; Skin skin = (Skin) ReflectionUIUtils.newInstance("com.nexitia.emaginplatform.jfx.core.engine.components.list.utils.FixedSizeListViewSkin", argsValues, ListView.class); //skin.setScrollableVertically(false); return skin; } }
private double getSvgWidth(WebEngine webEngine) { final Object result = getSvgDomProperty(webEngine, "offsetWidth"); //$NON-NLS-1$ if (result instanceof Integer) { return (Integer) result; } return -1; }
@Override public void afterPropertiesSet() throws Exception { Locale locale = LocaleResolver.getLocale(); if (StringUtils.isNotBlank(errorMessageKey)) { Object[] args = {length}; //this.errorMessage = ms.getMessage(errorMessageKey, args, locale); } }