public VLViewRootMenuRowXML build() { return new VLViewRootMenuRowXML(this); } }
/** * @return */ public String getIcon() { return getPropertyValueByName("icon"); }
private void buildMenuAction() { EventHandler<MouseEvent> a = e -> { menu.deselectAll(); menu.select(menuItemConfig.getId()); if (StringUtils.isNotBlank(menuItemConfig.getRootStructure())) { MenuHelper.loadRootStructure(menuItemConfig.getRootStructure()); else if (StringUtils.isNotBlank(menuItemConfig.getLoadChildView())) { MenuHelper.loadChildView(menuItemConfig.getLink(), controller.getRootStructure()); String location = NodeHelper.location(menuItemConfig, controller); else if (StringUtils.isNotBlank(menuItemConfig.getSetRootviewContent())) { String location = NodeHelper.location(menuItemConfig, controller); MenuHelper.loadViewContent(location, menuItemConfig.getSetRootviewContent(), controller.getRootStructure()); else if (StringUtils.isNotEmpty(menuItemConfig.getAction())) { MenuHelper.doAction(menuItemConfig.getAction(), controller); else if (StringUtils.isNotEmpty(menuItemConfig.getShowWizardAction())) { MenuHelper.doShowWizardAction(menuItemConfig.getShowWizardAction(), controller); else if (StringUtils.isNotEmpty(menuItemConfig.updateRSContentTo())) { String location = NodeHelper.location(menuItemConfig, controller); MenuHelper.updateRSContentTo(location, menuItemConfig.updateRSContentTo(), controller);
protected void buildRowItem() { IconUtils.setIcon(label, menuItemConfig); // the tooltip final String tooltipKey = menuItemConfig.getToolTip(); if (StringUtils.isNotEmpty(tooltipKey)) { final String tooltip = controller.getLocalised(tooltipKey); label.setTooltip(new Tooltip(tooltip)); } // the title of the row menu boolean uppercase = menuItemConfig.getBooleanProperty("upperCase", false); final String title = uppercase ? controller.getLocalised(menuItemConfig.getLabel()).toUpperCase() : controller.getLocalised(menuItemConfig.getLabel()); label.setText(title); label.setWrapText(true); buildMenuAction(); getChildren().addAll(label); }
/** * @param data * @return */ public static VLViewRootMenuRowXML buildRow(OperationData data) { VLViewRootMenuRowXML row = new VLViewRootMenuRowXML(); VLViewPropertiesXML propertiesXML = new VLViewPropertiesXML(); row.setProperties(propertiesXML); VLViewPropertyXML translatedLabel = new VLViewPropertyXML(); translatedLabel.setName("translatedLabel"); translatedLabel.setValue((String) data.getAttributes().get("translatedLabel")); propertiesXML.getProperties().add(translatedLabel); VLViewPropertyXML icon = new VLViewPropertyXML(); icon.setName("icon"); icon.setValue((String) data.getAttributes().get("icon")); propertiesXML.getProperties().add(icon); return row; } }
protected void buildRow(VLViewRootMenuRowXML menuItemConfig, boolean hasNext) { final MenuRow menuItem = new MenuRow(menuItemConfig, menu, this, controller); if (!hasNext) { menuItem.pseudoClassStateChanged(PseudoClass.getPseudoClass("last"), true); } menuItem.setIndex(getChildren().indexOf(menuItem)); if (StringUtils.isNotBlank(menuRowsStyleClass)) { menuItem.setStyleClass(menuRowsStyleClass); } if (StringUtils.isNotBlank(menuLabelStyleClass)) { menuItem.setLabelStyle(menuLabelStyleClass); } // if (hasNext && menuItemConfig.addSeparatorAfter()) { if (menuItemConfig.addSeparatorAfter()) { menuRowsContainer.getChildren().add(new Separator()); } if (menuItemConfig.hasSubRows()) { final SubMenu subMenu = new SubMenu(menu, this); subMenu.build(menuItemConfig.getSubMenus(), menuItem); menuItem.setSubmenu(subMenu); } addRow(menuItem); if (!hasNext && menuItemConfig.addSeparatorAfter()) { menuItem.pseudoClassStateChanged(PseudoClass.getPseudoClass("last"), true); menuRowsContainer.getChildren().add(new Separator()); } }
/** * @param icon * @param configuration */ public static void setIcon(Labeled labeled, VLViewRootMenuRowXML configuration) { try { String ikonli = configuration.getIcon(); if (StringUtils.isNotBlank(ikonli)) { FontIcon icon = new FontIcon(ikonli); labeled.setGraphic(icon); String iconStyleClass = configuration.getIconStyleClass(); if (StringUtils.isNotBlank(iconStyleClass)) { icon.getStyleClass().addAll(iconStyleClass.split(",")); } } } catch (final Exception e1) { e1.printStackTrace(); // TODO try another method } }
public void select(String id, boolean fire) { select(id); if (fire) { for (final MenuRow row : minimizedMenu.rows) { if (id.equalsIgnoreCase(row.getMenuItemConfig().getId())) { row.fireAction(); } } } }
/** * @param id */ public void select(String id) { if (minimizedMenu != null) { for (final MenuRow row : minimizedMenu.rows) { if (id.equalsIgnoreCase(row.getMenuItemConfig().getId())) { row.setSelected(true); } } } if (maximizedMenu != null) { for (final MenuRow row : maximizedMenu.rows) { if (id.equalsIgnoreCase(row.getMenuItemConfig().getId())) { row.setSelected(true); } } } }
/** * @return */ public String getRootStructure() { return getPropertyValueByName("setRootStructure"); }
/** * @return */ public String getLoadChildView() { return getPropertyValueByName("loadChildView"); }
/** * @return */ public String getSetRootviewContent() { return getPropertyValueByName("setRootviewContent"); }
/** * @return */ public String getToolTip() { return getPropertyValueByName("tooltip"); }
/** * @return */ public String getIconStyleClass() { return getPropertyValueByName("iconStyleClass"); }
/** * @return */ public String getLink() { return getPropertyValueByName("link"); }
/** * @return */ public String updateRSContentTo() { return getPropertyValueByName("updateRSContentTo"); }
/** * @return */ public String getLabel() { return getPropertyValueByName("label"); }
/** * @return */ public String getLoadRootStructure() { return getPropertyValueByName("loadRootStructure"); }
/** * @return */ public String getAction() { return getPropertyValueByName("action"); }
public String getShowWizardAction() { return getPropertyValueByName("showWizardAction"); }