private String getTypeOf(IEmaginController controller, OperationData data) { return (String) ReflectionUIUtils.invokeGetterOn(data, "businessType.displayName"); }
/** * 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(); } }
/** * 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); }
/** * @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.engine.components.list.utils.FixedSizeListViewSkin", argsValues, ListView.class); //skin.setScrollableVertically(false); return skin; } }
/** * */ private void setCenter(Node centerNode) { this.centerAreaSection.getChildren().clear(); this.centerAreaSection.getChildren().add(centerNode); NodeHelper.setHgrow(centerNode); try { ReflectionUIUtils.bind(centerNode, "prefWidth", centerAreaSection, "width"); } catch (Exception ex) { ex.printStackTrace(); } }
/** * Commit/cancel modifications. Commit: Set initial value to current value Cancel: Set current value * to initial value */ @Override public void cancelModification() { currentInternalValue.set(initialInternalValue.get()); ReflectionUIUtils.invokeSetterOn(controller.getModel(), getAttributePath(), getInitialInternalValue()); }
/** * @{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"); }
@Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { double d = newValue.doubleValue() / box.getChildren().size(); for(Node node: box.getChildren()) { ReflectionUIUtils.setPrefWidth(node, d); } }}); }
for (final String methodName : methodNames) { CompletableFuture.runAsync(() -> { ReflectionUIUtils.callControllerMethod(controller, methodName, event); }, AbstractApplicationRunner.pool);
@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; } }
/** * */ private void setCenter(Node centerNode) { centerAreaSection.getChildren().clear(); centerAreaSection.getChildren().add(centerNode); NodeHelper.setHgrow(centerNode); try { ReflectionUIUtils.bind(centerNode, "prefWidth", centerAreaSection, "width"); } catch (final Exception ex) { ex.printStackTrace(); } }
public void commitModification(boolean introspect) { final String valToCommit = StringUtils.isEmpty(currentInternalValue.get()) ? defaultInternalValueProperty().get() : currentInternalValue.get(); initialInternalValue.set(valToCommit); if (introspect) { ReflectionUIUtils.invokeSetterOn(controller.getModel(), getAttributePath(), getInitialInternalValue()); } } // @formatter:on
public String getModelAttribute(OperationData data, String name) { if (data != null) { Object o = ReflectionUIUtils.invokeGetterOn(data, name); return o != null ? o.toString() : ""; } return ""; }
/** * 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 } }
/** * Set the selectedCallbackFuntion * * @param selectedCallbackFuntion the selectedCallbackFuntion to set */ @SuppressWarnings("rawtypes") public void setSelectedCallbackFuntion(Function<T, Boolean> selectedCallbackFuntion) { this.itemSelectedFunction = selectedCallbackFuntion; proposalListView.setCellFactory(param -> { final VLAutoCompleteListCell<T> cell = (VLAutoCompleteListCell<T>) ReflectionUIUtils.newInstance(proposalListCell); cell.setSelectedCallBack(t -> { final T item = (T) t.getItem(); proposalListView.getItems().remove(item); selectedCallbackFuntion.apply(item); return true; }); return cell; }); }
public void setCenter(Node node) { Platform.runLater(() -> { centerFixedAreaSection.getChildren().clear(); centerFixedAreaSection.getChildren().add(node); NodeHelper.setHgrow(node); try { ReflectionUIUtils.bind(node, "prefWidth", centerFixedAreaSection, "width"); } catch (final Exception ex) { ex.printStackTrace(); } }); }
/** * * @param data * @param filter * @return */ public default boolean isDisplayable(OperationData data, String filter) { if (data == null) { return true; } if (filter == null) { return true; } final String attr = getMasterAttributePath(); final String d = (String) ReflectionUIUtils.invokeGetterOn(data, attr); if (d == null) { return true; } return d.toLowerCase().contains(filter.toLowerCase()); }
/** * Object source holds date in string value. Cibling object holds LocalDateTime. * * @param source * @param target * @param spropertyName * @param tpropertyName * @param sDatformat */ public static void setDateFromStringPropertyValue(Object source, Object target, String spropertyName, String tpropertyName, String sDatformat) { Object val = invokeGetterOn(source, spropertyName); LocalDateTime ldt = DateUtils.fromString_3((String) val, sDatformat); invokeSetterOn(target, tpropertyName, ldt); }
if (attachmentLoaderClass != null) { try { final IAttachmentsListLoader loader = (IAttachmentsListLoader) ReflectionUIUtils.newInstance(attachmentLoaderClass); final String content = loader.getPrimaryAttachment(controller.getModel()); final Label text = new Label(content);