public ScrollableContent() { super(); if(AbstractApplicationRunner.isDesktop()) { setStyle("-fx-spacing:64;-fx-alignment:CENTER;"); } else { setStyle("-fx-spacing:16;-fx-alignment:CENTER;"); } NodeHelper.setVgrow(this); currentContent.getChildren().add(NodeHelper.getProcessingIndicator()); }
if(AbstractApplicationRunner.isDesktop()) {
public static HBox horizontalViewActions(AbstractViewController controller, VLViewComponentXML actionsConfiguration, OperationData forModel) { HBox box = new HBox(); if(!AbstractApplicationRunner.isDesktop()) { NodeHelper.setHgrow(box); box.widthProperty().addListener(new ChangeListener<Number>() { @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); } }}); } box.getStyleClass().add("ep-view-actions-container"); NodeHelper.setStyleClass(box, actionsConfiguration, "styleClass", true); List<Node> actionPresenters = process(controller, actionsConfiguration, forModel); for(Node n : actionPresenters) { box.getChildren().add(n); if(!AbstractApplicationRunner.isDesktop()) { NodeHelper.setHgrow(n); } } return box; }
private void selectRadio(RadioButton radioButton, boolean goback) { Object v = isStaticValue ? radioButton.getUserData() : radioButton.selectedProperty().get(); List<IListFormValue> s = new ArrayList<>(); IListFormValue val = currentValues.get(0); val.setSavedValue(v); s.add(val); JsonObject query = new JsonObject(); query.addProperty("key", getKey()); query.addProperty("value", v != null ? v.toString() : ""); setPreferenceValueOperation.doOperation(query, res -> { processUpdate(s); if (goback) { SingleResult sr = (SingleResult) controller.getModel(); ParentItemPresenter parent = (ParentItemPresenter) sr.getData().getMeta().get("parentItem"); if (parent != null) { parent.updateDisplay(); } // call go back only if we are not in self mode and in desktop boolean desktopselfView = isSelfView(parent.getController()) && AbstractApplicationRunner.isDesktop(); if(!desktopselfView) NodeHelper.goBack(controller); if(desktopselfView) { StandardViewController c = (StandardViewController) parent.getController().getParent(); IViewLayoutManager m = c != null ? c.getLayoutManager() : null; if(m != null && m instanceof ViewForwardLayoutManager) { ((ViewForwardLayoutManager)m).popContent(); } } } }); }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); // NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); process("/Application"); if(AbstractApplicationRunner.isDesktop()) { // TODO HANDLE TOOLTIP b.setMaxWidth(400); b.setAlignment(Pos.CENTER_RIGHT); } inputComponentWrapper.currentInternalValueProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { //label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(newValue)); }); }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); // NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); process("/Application"); if(AbstractApplicationRunner.isDesktop()) { // TODO HANDLE TOOLTIP b.setMaxWidth(400); b.setAlignment(Pos.CENTER_RIGHT); } inputComponentWrapper.currentInternalValueProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { //label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(newValue)); }); }
icon.getStyleClass().add("item-presenter-goright-indicator"); if(AbstractApplicationRunner.isDesktop()) { box= new HBox(); box.getStyleClass().add("item-presenter-row-container");
NodeHelper.styleClassAddAll(this, configuration); if(!AbstractApplicationRunner.isDesktop()) { Button closeMenuAction = new Button(); IconUtils.setFontIcon("mdi-chevron-double-left:20", closeMenuAction);
/** * @{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)); } } }
if(AbstractApplicationRunner.isDesktop()) {
private void animateHidePrimaryMenu() { if (primaryMenuIsShowing) { // if screen is not maximized, no animation when closing. // because transalation will go out of the screen!! if (!AbstractApplicationRunner.isDesktop()) { final EasingInterpolator cme = new EasingInterpolator(EasingMode.OUT_EXPO); final TranslateTransition tte = NodeHelper.translateTo(0, -800, rootStructurePrimaryPane); tte.setDuration(Duration.millis(50)); tte.setInterpolator(cme); makeCentralPaneLighter(); tte.play(); } else { rootStructurePrimaryPane.setVisible(false); makeCentralPaneLighter(); } primaryMenuIsShowing = false; notificationsStack.setOnMouseClicked(null); } }
/** * Constructor */ public LoadMorePaginationBar() { super(); previousButton.getStyleClass().add("simple-pagination-button"); previousButton.setText("Less".toUpperCase()); previousButton.setTooltip(new Tooltip("Less")); previousButton.disableProperty().bind(Bindings.not(hasPrevious)); IconUtils.setFontIcon("fa-angle-up:18", previousButton); nextButton.setText("More".toUpperCase()); nextButton.setTooltip(new Tooltip("Load more data")); nextButton.disableProperty().bind(Bindings.not(hasNext)); IconUtils.setFontIcon("fa-angle-down:18", nextButton); if(AbstractApplicationRunner.isDesktop()) { layout.getChildren().addAll(NodeHelper.horizontalSpacer(),rowsPerPageLabel, itemsCount, rowsPerPageCombo, nextButton, NodeHelper.horizontalSpacer()); } else { layout.getChildren().addAll(NodeHelper.horizontalSpacer(), rowsPerPageLabel, nextButton); } }
/** * Process update of data */ private void processDataUpdate(IListFormValue item, boolean goback) { List<IListFormValue> s = new ArrayList<>(); for(IListFormValue e1: getListView().getItems()) { if (e1.selectedProperty().get()) { s.add(e1); } } item.preferenceItem().processUpdate(s); // if desktop self, pop layoutmanager AbstractViewController parent = controller.getParent(); boolean desktopselfView = isSelfView(parent) && AbstractApplicationRunner.isDesktop(); if(desktopselfView) { StandardViewController c = (StandardViewController) parent.getParent(); IViewLayoutManager m = c != null ? c.getLayoutManager() : null; if(m != null && m instanceof ViewForwardLayoutManager) { ((ViewForwardLayoutManager)m).popContent(); } } else { if (controller.getParent() != null && controller.getParent() instanceof StandardTabPaneController) { ((StandardTabPaneController) controller.getParent()).handle(new PopTabContentEvent()); } else if (goback) { NodeHelper.goBack(controller); } } }
@Override public Node present(IEmaginController controller, VLViewComponentXML configuration, Object forModel) { if (cell instanceof EpTableCell && controller instanceof FullTableViewController) { checkBox = new CheckBox(); checkBox.setSelected(false); ts = (AbstractTableStructure) ((FullTableViewController) controller).processedElement(); checkBox.visibleProperty().bind(ts.modifyingProperty()); EventHandler ev1 = this::handleRowSelection; EventHandler ev2 = this::handleRowSelection; // because when the chackbox is clicked, a row click is fired. if(AbstractApplicationRunner.isDesktop()) { checkBox.selectedProperty().addListener((ChangeListener<Boolean>) (observable, oldValue, newValue) -> selectRow(newValue)); } else { ((EpTableCell) cell).getTableRow().addEventFilter(MouseEvent.MOUSE_CLICKED, ev1); } // ((EpTableCell) cell).getTableRow().addEventFilter(TouchEvent.TOUCH_RELEASED, ev2); } return checkBox; }
/** * @{inheritedDoc} */ @Override public void build(IInputComponentWrapper inputComponentWrapper) { super.build(inputComponentWrapper); NodeHelper.styleClassAddAll(label, getConfiguration(), "viewStyleClass", "form-info-value"); label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(inputComponentWrapper.getCurrentInternalValue())); if(AbstractApplicationRunner.isDesktop()) { // TODO HANDLE TOOLTIP label.setMaxWidth(400); } inputComponentWrapper.currentInternalValueProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { label.setText(((StringConverter) inputComponentWrapper.getConverter()).toDisplay(newValue)); }); }
private void animateShowSecondaryRSContent(Node node) { if(!AbstractApplicationRunner.isDesktop()) { ((Pane) node).maxWidthProperty().unbind(); ((Pane) node).minWidthProperty().unbind(); ((Pane) node).maxWidthProperty().bind(((Pane) node).prefWidthProperty()); ((Pane) node).minWidthProperty().bind(((Pane) node).prefWidthProperty()); ((Pane) node).setPrefWidth(ViewStructure.instance().platformSceneWidth().get()); } //showSecondaryStrWrapper.setOnFinished(e -> { //secondaryRSWrapperScrollpane.getChildren().add(scrollPane); //secondaryRSWrapperScrollpane.getChildren().add(new StackPane()); secondaryRSWrapperScrollpane.getChildren().clear(); secondaryRSWrapperScrollpane.getChildren().add(node); //secondaryRSWrapperScrollpane.requestFocus(); // }); showSecondaryStrWrapper.play(); //ViewStructure.instance().displayInSecondaryWR((Pane) node); }
private void animateShowPrimaryMenu() { if (!primaryMenuIsShowing) { final EasingInterpolator ei = new EasingInterpolator(EasingMode.IN_EXPO); TranslateTransition tt; rootStructurePrimaryPane.setVisible(true); // if screen is not maximized, no animation when showing. // because transalation will start out of the screen!! if (!AbstractApplicationRunner.isDesktop()) { tt = NodeHelper.translateTo(-800, 0, rootStructurePrimaryPane); } else { tt = NodeHelper.translateTo(-1, 0, rootStructurePrimaryPane); } tt.setOnFinished(e -> { // hide menu on click on root pane notificationsStack.setOnMouseClicked(a -> { animateHidePrimaryMenu(); }); }); tt.setDuration(Duration.millis(50)); tt.setInterpolator(ei); primaryMenuIsShowing = true; makeCentralPaneDarker(); tt.play(); } }
this.configuration = configuration; if(!AbstractApplicationRunner.isDesktop()) {
private void initAnimations() { secondaryRootStructureWrapper.addEventFilter(KeyEvent.KEY_RELEASED, ev -> { if (secondaryRootStructureWrapper.isVisible() && ev.getCode() == KeyCode.ESCAPE) { animateHideSecondaryRSContent(); } }); secondaryRootStructureWrapper.setCache(true); secondaryRootStructureWrapper.setCacheHint(CacheHint.SPEED); final EasingInterpolator cme = new EasingInterpolator(EasingMode.IN_OUT_EXPO); if(!AbstractApplicationRunner.isDesktop()) { showSecondaryStrWrapper = NodeHelper.translateYTo(50, 20, secondaryRootStructureWrapper); } else { showSecondaryStrWrapper = NodeHelper.translateYTo(50, 0, secondaryRootStructureWrapper); } showSecondaryStrWrapper.setDuration(Duration.millis(100)); showSecondaryStrWrapper.setInterpolator(cme); final EasingInterpolator cme1 = new EasingInterpolator(EasingMode.OUT_ELASTIC); hideSecondaryStrWrapper = NodeHelper.translateYTo(400, 2000, secondaryRootStructureWrapper); hideSecondaryStrWrapper.setDuration(Duration.millis(300)); hideSecondaryStrWrapper.setInterpolator(cme1); hideSecondaryStrWrapper.setOnFinished(e -> { secondaryRSActionsWrapper.getChildren().clear(); if (secondaryRootStructureWrapper.isVisible()) { secondaryRootStructureWrapper.setVisible(false); } }); }
if (AbstractApplicationRunner.isDesktop()) {