public void configure() { final Optional<String> prompt = configuration.propertyValueOf(XMLConstants.PROMPT); final Optional<Boolean> isAttributeGenerated = configuration.booleanPropertyValueOf(XMLConstants.GENERATED); final Optional<Boolean> isFocused = configuration.booleanPropertyValueOf(XMLConstants.FOCUSED); // focus isFocused.filter(e -> e == Boolean.TRUE).flatMap(e -> { textField.requestFocus(); return Optional.empty(); }); // generated value isAttributeGenerated.filter(e -> e == Boolean.TRUE).flatMap(e -> { textField.setDisable(true); return Optional.empty(); }); // prompt prompt.ifPresent(e -> { final String val = controller.getLocalised(prompt.get()); textField.setPromptText(val); }); // process DisplayConfig final Optional<VLViewComponentXML> displayConfig = configuration.getComponentById(DISPLAY_CONFIG); displayConfig.ifPresent(e -> { e.booleanPropertyValueOf(XMLConstants.READ_ONLY).ifPresent(f -> { textField.setDisable(f.booleanValue()); }); }); processFormat(); }
/** * @param tabPaneCfg * @param controller */ public void buildFrom(VLViewComponentXML tabPaneCfg, AbstractViewController controller) { this.tabPaneCfg = tabPaneCfg; // build the first tab containing all others values final InfoVerticalTab firstTab = new InfoVerticalTab(this); firstTab.buildFrom(tabPaneCfg, controller); tabs.add(firstTab); getChildren().add(firstTab); if (tabPaneCfg != null && tabPaneCfg.hasSubComponent()) { for (final VLViewComponentXML tab : tabPaneCfg.getSubcomponents()) { final boolean visible = tab.booleanPropertyValueOf(XMLConstants.VISIBLE).orElse(true); if (visible) { final VerticalTab verticalTab = new VerticalTab(this); verticalTab.buildFrom(tab, controller); tabs.add(verticalTab); getChildren().add(verticalTab); } } } }
public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); final Optional<Boolean> isFocused = configuration.booleanPropertyValueOf(XMLConstants.FOCUSED); isFocused.filter(e -> e == Boolean.TRUE).flatMap(e -> { datePicker.requestFocus(); e.booleanPropertyValueOf(XMLConstants.READ_ONLY).ifPresent(f -> { datePicker.setDisable(f.booleanValue()); });
/** * Builds the footer */ private void buildHeader() { String headerImpl = configuration.getPropertyValue(HEADER_IMPL); boolean displayHeader = configuration.booleanPropertyValueOf("displayHeader").orElse(true); if (StringUtils.isEmpty(headerImpl)) { headerImpl = "WizardStepHeader"; } stepHeader = (IWizardStepHeader) Services.getBean(headerImpl); stepHeader.buildFrom(controller, configuration); if (displayHeader) { Node header = stepHeader.getDisplay(); getChildren().add(header); AnchorPane.setLeftAnchor(header, 0.); AnchorPane.setRightAnchor(header, 0.); AnchorPane.setTopAnchor(header, 0.); } }
@Override public Node process(IEmaginController controller, VLViewComponentXML tabpaneConfig) { final VBox allContainer = new VBox(); NodeHelper.setHVGrow(allContainer); allContainer.setStyle("-fx-background-color: #f1f1f1;" + "-fx-spacing:16"); if (tabpaneConfig.hasSubComponent()) { // For each tab for (final VLViewComponentXML tabCfg : tabpaneConfig.getSubcomponents()) { final boolean visibleInSummary = tabCfg.booleanPropertyValueOf(XMLConstants.CONTENT_VISIBLE_IN_SUMMARY).orElse(true); if (visibleInSummary) { IComponentProcessor processor = (IComponentProcessor) Services.getBean(tabCfg.getProcessor()); allContainer.getChildren().add(processor.process(controller, tabCfg)); } } } return allContainer; } }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { stepTopWrapper.managedProperty().bind(stepTopWrapper.visibleProperty()); stepLeftWrapper.managedProperty().bind(stepLeftWrapper.visibleProperty()); showSteps.set(configuration.booleanPropertyValueOf("showSteps").orElse(true)); stepLeftWrapper.visibleProperty().bind(showSteps); stepTopWrapper.visibleProperty().bind(showSteps); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); textArea.setPrefRowCount(2); // prompt prompt.ifPresent(e -> { final String val = controller.getLocalised(prompt.get()); textArea.setPromptText(val); }); // process wizardConfiguration final Optional<VLViewComponentXML> displayConfig = configuration.getComponentById(DISPLAY_CONFIG); displayConfig.ifPresent(d -> { d.booleanPropertyValueOf(XMLConstants.READ_ONLY).ifPresent(e -> { textArea.setDisable(e); }); d.intPropertyValueOf(XMLConstants.COUNTER).ifPresent(e -> { if (e > 0) { // !! not for validation, for counter // textArea.setMaxLength(e); } }); }); textArea.setText(owner.getCurrentInternalValue()); Bindings.bindBidirectional(textArea.textProperty(), owner.currentInternalValueProperty(), owner.getConverter()); }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); button.setDefaultButton(configuration.booleanPropertyValueOf(XMLConstants.DEFAULT).orElse(false)); ComponentToLabeledHelper.setTooltip(configuration, button, (AbstractViewController) controller); IconUtils.setIcon(button, configuration); NodeHelper.styleClassAddAll(button, configuration); button.getStyleClass().add("ep-button"); // content display final String upperCase = configuration.getPropertyValue("upperCase"); ComponentToLabeledHelper.setText(configuration, button, "true".equalsIgnoreCase(upperCase), (AbstractViewController) controller); if(AbstractApplicationRunner.isDesktop()) { final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE, "LEFT"); button.setContentDisplay(ContentDisplay.valueOf(displayMode)); } else { final String displayMode = configuration.getPropertyValue(XMLConstants.HYPERLINK_DISPLAY_MODE); if(StringUtils.isNotBlank(displayMode)) { button.setContentDisplay(ContentDisplay.valueOf(displayMode)); } } }
/** * Builds the content */ private void buildContent() { String contentImpl = configuration.getPropertyValue(CONTENT_IMPL); if (StringUtils.isEmpty(contentImpl)) { contentImpl = WIZARD_STEP_CONTENT; } stepContent = (IWizardStepContent) Services.getBean(contentImpl); stepContent.buildFrom(controller, configuration); Node setCenter = stepContent.getDisplay(); ScrollPane pane = new ScrollPane(); pane.setContent(setCenter); pane.setFitToHeight(true); pane.setFitToWidth(true); pane.setVbarPolicy(ScrollBarPolicy.NEVER); pane.setHbarPolicy(ScrollBarPolicy.NEVER); getChildren().add(pane); AnchorPane.setBottomAnchor(pane, 100.); AnchorPane.setLeftAnchor(pane, 0.); AnchorPane.setRightAnchor(pane, 0.); boolean displayHeader = configuration.booleanPropertyValueOf("displayHeader").orElse(true); if(displayHeader) { AnchorPane.setTopAnchor(pane, 120.); } else { AnchorPane.setTopAnchor(pane, 0.); } }
/** * @{inheritedDoc} */ @Override public void buildFrom(IEmaginController controller, VLViewComponentXML configuration) { super.buildFrom(controller, configuration); final String title = configuration.getPropertyValue(XMLConstants.LABEL); NodeHelper.setLabel(button, configuration, (AbstractViewController) controller); if (!StringUtils.isEmpty(title)) { // ad fake indicator to the button to occupy the place // so when the task is runned, the label do not move final ProgressIndicator fakewaiting = new ProgressIndicator(); fakewaiting.managedProperty().bind(fakewaiting.visibleProperty()); fakewaiting.setVisible(false); // fakewaiting.getStyleClass().add(BUTTON_PROCESSING_PROGRESS); fakewaiting.maxHeight(8); fakewaiting.maxWidth(8); button.setGraphic(fakewaiting); } button.setDefaultButton(configuration.booleanPropertyValueOf(XMLConstants.DEFAULT).orElse(false)); ComponentToLabeledHelper.setTooltip(configuration, button, (AbstractViewController) controller); NodeHelper.styleClassAddAll(button, configuration, XMLConstants.STYLE_CLASS); }
private void buildCollpaseExpandIndicator() { final boolean collapsible = blocConfig.booleanPropertyValueOf("collapsible").orElse(true); if (collapsible) { // action on the mouse event on the hbox only addEventFilter(MouseEvent.MOUSE_CLICKED, e -> onCollapseExpand()); buildCollapsedIcon(); buildExpandedcon(); final StackPane wrapper = new StackPane(); collpasedLabel.managedProperty().bind(Bindings.not(expanded)); collpasedLabel.getStyleClass().addAll(FORM_BLOC_TITLE_LABEL_COLLAPSE_ICON, "hand-hover"); collpasedLabel.visibleProperty().bind(collpasedLabel.managedProperty()); expandedLabel.managedProperty().bind(expanded); expandedLabel.getStyleClass().addAll(FORM_BLOC_TITLE_LABEL_COLLAPSE_ICON, "hand-hover"); expandedLabel.visibleProperty().bind(expandedLabel.managedProperty()); expanded.set(true); wrapper.getChildren().add(0, collpasedLabel); wrapper.getChildren().add(0, expandedLabel); wrapper.setStyle("-fx-max-width:28;-fx-min-width:28;"); internalLayout.getChildren().addAll( NodeHelper.horizontalSpacer(),wrapper); } }
displayNavigationBar.set(rootComp.booleanPropertyValueOf("displayNavigationBar").orElse(true)); final String initialView = initialView(); if (StringUtils.isNotBlank(initialView)) {