public void changeComponentsTreeVisibility() { if (componentsTreeBox.isVisible()) { componentsTreeBox.setVisible(false); componentsTreeBtn.setDescription(getMessage("componentsTree.show")); } else if (StringUtils.isNotBlank(screenFilter.getValue())) { componentsTreeBox.setVisible(true); componentsTreeBtn.setDescription(getMessage("componentsTree.hide")); } }
protected Button createActionBtn(String actionName, List<String> options) { if (!isActionAllowed(actionName)) { return null; } Button button = uiComponents.create(Button.class); button.setAction(filterActions.get(actionName)); if (options.contains("no-caption")) { button.setCaption(null); button.setDescription(filterActions.get(actionName).getCaption()); } if (options.contains("no-icon")) { button.setIcon(null); } return button; }
@Override public void actionPerform(Component component) { editField.setEnabled(!editField.isEnabled()); if (!editField.isEnabled()) { if (editField instanceof ListEditor) { editField.setValue(Collections.EMPTY_LIST); } else { editField.setValue(null); } setIcon("icons/edit.png"); clearButton.setDescription(getMessage("bulk.editAttribute")); } else { setIcon("icons/trash.png"); clearButton.setDescription(getMessage("bulk.clearAttribute")); } } };
@Override public void addCopyButton(ComponentContainer container, String description, String successMessage, String failMessage, String cubaCopyLogContentClass, UiComponents uiComponents) { if (CubaCopyButtonExtension.browserSupportCopy()) { Button copyButton = uiComponents.create(Button.class); copyButton.setIconFromSet(CubaIcon.CLIPBOARD); copyButton.setId("copy"); copyButton.setVisible(false); copyButton.setDescription(description); com.vaadin.ui.Button button = copyButton.unwrap(com.vaadin.ui.Button.class); CubaCopyButtonExtension copyExtension = CubaCopyButtonExtension.copyWith(button, cubaCopyLogContentClass + " textarea"); copyExtension.addCopyListener(event -> Notification.show(event.isSuccess() ? successMessage : failMessage, Notification.Type.TRAY_NOTIFICATION)); container.add(copyButton); } } }
clearButton.setDescription(getMessage("bulk.clearAttribute"));
protected void addRow(Object value, ComponentContainer parent, boolean isReadOnly) { BoxLayout row = componentsFactory.createComponent(HBoxLayout.class); row.setSpacing(true); row.setWidthFull(); TextField valueField = componentsFactory.createComponent(TextField.class); valueField.setValue(value); valueField.setEditable(!isReadOnly); row.add(valueField); row.expand(valueField); Button btnRemove = componentsFactory.createComponent(Button.class); btnRemove.setIconFromSet(CubaIcon.TIMES); btnRemove.setDescription(messages.getMessage(getClass(), "editAttribute.array.btnRemove")); Action removeRowAction = new BaseAction("removeRow") .withCaption("") .withHandler(actionPerformedEvent -> parent.remove(row) ); removeRowAction.setEnabled(!isReadOnly); btnRemove.setAction(removeRowAction); row.add(btnRemove); parent.add(row); }
)); downloadButton.setDescription("CTRL-SHIFT-D"); showTailButton.setDescription("CTRL-SHIFT-S");
btnAdd.setDescription(messages.getMessage(getClass(), "editAttribute.array.btnAdd")); layout.add(btnAdd);
searchBtn.setCaption(getMainMessage("filter.search")); searchBtn.setIcon("icons/search.png"); searchBtn.setDescription(getMainMessage("filter.searchBtn.description")); searchBtn.addClickListener(e -> apply(false)