/** * @param param tree item * @return the data represented by the tree item */ public final ObservableValue<T> getComputedValue(CellDataFeatures<S, T> param) { Object rowObject = param.getValue().getValue(); if (rowObject instanceof RecursiveTreeObject) { RecursiveTreeObject<?> item = (RecursiveTreeObject<?>) rowObject; if (item.getGroupedColumn() == this) { return new ReadOnlyObjectWrapper(item.getGroupedValue()); } } return null; }
public final ReadOnlyObjectProperty<TextField> editorProperty() { if (editor == null) { editor = new ReadOnlyObjectWrapper<>(this, "editor"); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); } return editor.getReadOnlyProperty(); }
@Override public ObservableValue<File> getObservableValue(SelectionTableRowData data) { return new ReadOnlyObjectWrapper<>(data.descriptor().getFile()); }
/** Location: TOP_LEFT, TOP_RIGHT, BOTTOM_RIGHT, BOTTOM_LEFT */ public ReadOnlyObjectProperty<Location> locationProperty() { return new ReadOnlyObjectWrapper<Location>(this, "location").getReadOnlyProperty(); } final private SimpleObjectProperty<Location> locationObjectProperty = new SimpleObjectProperty<Location>(this, "location", Location.TOP_LEFT);
@Override public ReadOnlyObjectProperty<Long> fileSizeProperty() { if (this.fileSize == null) { try { this.fileSize = new ReadOnlyObjectWrapper<>(this, "fileSize", Long.valueOf(Files.size(this.path)));//$NON-NLS-1$ } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return this.fileSize.getReadOnlyProperty(); } }
@Override public ReadOnlyObjectProperty<Long> fileSizeProperty() { if (this.fileSize == null) { try { this.fileSize = new ReadOnlyObjectWrapper<>(this, "fileSize", Long.valueOf(Files.size(this.path)));//$NON-NLS-1$ } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } return this.fileSize.getReadOnlyProperty(); } }
@SuppressWarnings("null") @Override public ReadOnlyObjectProperty<@NonNull LocalDateTime> lastModifiedProperty() { if (this.lastModified == null) { try { FileTime t = Files.getLastModifiedTime(this.path); this.lastModified = new ReadOnlyObjectWrapper<>( this, "lastModified", LocalDateTime.ofInstant(t.toInstant(), ZoneId.systemDefault())); //$NON-NLS-1$ } catch (IOException e) { throw new RuntimeException(e); } } return this.lastModified.getReadOnlyProperty(); }
@SuppressWarnings("unchecked") @Override public ObservableValue<T> call(TableColumn.CellDataFeatures<TableModelRow<S>, T> cdf) { TableModelRow<S> row = cdf.getValue(); T valueAt = (T) row.get(_columnIndex); return valueAt instanceof ObservableValue ? ((ObservableValue<T>) valueAt) : new ReadOnlyObjectWrapper<>(valueAt); } }
@SuppressWarnings("null") @Override public ReadOnlyObjectProperty<@NonNull LocalDateTime> lastModifiedProperty() { if (this.lastModified == null) { try { FileTime t = Files.getLastModifiedTime(this.path); this.lastModified = new ReadOnlyObjectWrapper<>( this, "lastModified", LocalDateTime.ofInstant(t.toInstant(), ZoneId.systemDefault())); //$NON-NLS-1$ } catch (IOException e) { throw new RuntimeException(e); } } return this.lastModified.getReadOnlyProperty(); }
public FlowHandler(Flow flow, ViewFlowContext flowContext, ViewConfiguration viewConfiguration, ExceptionHandler exceptionHandler) { this.flowWrapper = new ReadOnlyObjectWrapper<>(flow); this.viewConfiguration = viewConfiguration; this.exceptionHandler = exceptionHandler; controllerHistory = FXCollections.observableArrayList(); currentViewWrapper = new ReadOnlyObjectWrapper<>(); containerWrapper = new ReadOnlyObjectWrapper<>(); flowContextWrapper = new ReadOnlyObjectWrapper<>(flowContext); currentViewMetadataWrapper = new ReadOnlyObjectWrapper<>(); flowContextWrapper.get().currentViewContextProperty().addListener((e) -> currentViewMetadataWrapper.set(flowContextWrapper.get().getCurrentViewContext().getMetadata())); flowContextWrapper.get().register(new FlowActionHandler(this)); }
/** * Creates the cell value for a given row object. * * @param cdf the cell data features * @return the cell value to display */ protected ObservableValue<T> createCellValue(CellDataFeatures<S, T> cdf) { if (binding == null) { throw new FxRuntimeException("missing binding for " + this); } binding.setBoundRootObject(cdf.getValue()); return new ReadOnlyObjectWrapper<>(binding.getModelValue()); }
/** * @param param tree item * @return the data represented by the tree item */ public final ObservableValue<T> getComputedValue(CellDataFeatures<S, T> param) { Object rowObject = param.getValue().getValue(); if (rowObject instanceof RecursiveTreeObject) { RecursiveTreeObject<?> item = (RecursiveTreeObject<?>) rowObject; if (item.getGroupedColumn() == this) { return new ReadOnlyObjectWrapper(item.getGroupedValue()); } } return null; }
public final ReadOnlyObjectProperty<TextField> editorProperty() { if (editor == null) { editor = new ReadOnlyObjectWrapper<>(this, "editor"); final FakeFocusJFXTextField editorNode = new FakeFocusJFXTextField(); this.focusedProperty().addListener((obj, oldVal, newVal) -> { if (getEditor() != null) { editorNode.setFakeFocus(newVal); } }); editorNode.activeValidatorWritableProperty().bind(activeValidatorProperty()); editor.set(editorNode); } return editor.getReadOnlyProperty(); }
fileColumn.setCellValueFactory((TreeTableColumn.CellDataFeatures<N, N> callback) -> { N node = callback.getValue().getValue(); return new ReadOnlyObjectWrapper<>(node); }); fileColumn.setCellFactory(new Callback<TreeTableColumn<N, N>, TreeTableCell<N, N>>() { N node = p.getValue().getValue(); if (!treeModel.isFolder(node)) { return new ReadOnlyObjectWrapper<>(node);
typeCol.setCellValueFactory(new PropertyValueFactory("type")); TableColumn<Var, ScriptValue> valueCol = new TableColumn("Value"); valueCol.setCellValueFactory(c -> new ReadOnlyObjectWrapper(c.getValue().getValue())); valueCol.setCellFactory(c -> new VarValueCell()); table.getColumns().addAll(nameCol, typeCol, valueCol);