protected void enableControls() { loggedEntityTable.setEnabled(false); entityNameField.setEditable(false); autoCheckBox.setEditable(true); manualCheckBox.setEditable(true); for (Component c : attributesBoxScroll.getComponents()) ((CheckBox) c).setEditable(true); actionsPaneLayout.setVisible(true); }
/** * Adds ESCAPE shortcut that invokes cancel() method. */ protected void initShortcuts() { ComponentContainer editBox = getEditBox(); if (editBox instanceof ShortcutNotifier) { ((ShortcutNotifier) editBox).addShortcutAction( new ShortcutAction(new KeyCombination(KeyCombination.Key.ESCAPE), shortcutTriggeredEvent -> cancel())); } }
@SuppressWarnings("unchecked") protected <T> T getValue(Component component) { if (component instanceof HasValue) { return (T) ((HasValue) component).getValue(); } else if (component instanceof ListComponent) { ListComponent list = (ListComponent) component; //noinspection unchecked return list.isMultiSelect() ? (T)list.getSelected() : (T)list.getSingleSelected(); } else { return null; } }
public void setControlVisible(boolean visible) { controlVisible = visible; operationLabel.setVisible(visible); allowChecker.setVisible(visible); allowChecker.setDescription(operationLabel.getValue()); denyChecker.setVisible(visible); denyChecker.setDescription(operationLabel.getValue()); }
public void setCategoryFieldEditable(boolean editable) { categoryField.setEditable(editable); FieldGroup newRuntime = (FieldGroup) getComponent("runtime"); if (newRuntime != null) { newRuntime.setEditable(editable); } } }
public ContainerShortcutActionWrapper(ShortcutAction action, ComponentContainer container, KeyCombination keyCombination) { super(null, keyCombination.getKey().getCode(), KeyCombination.Modifier.codes(keyCombination.getModifiers())); this.action = action; this.keyCombination = keyCombination; this.container = container; }
protected void applyPermissions(boolean editable) { if (!editable) { hideCheckBox.setEditable(false); showCheckBox.setEditable(false); readOnlyCheckBox.setEditable(false); addPermissionBtn.setEnabled(false); } }
/** * Enables or disables margins on all sides simultaneously. * * @param enable if true, enables margins on all sides. If false, disables margins on all sides. */ default void setOuterMargin(boolean enable) { setOuterMargin(new MarginInfo(enable, enable, enable, enable)); }
protected void attachAction(Action action) { if (action instanceof Action.HasTarget) { ((Action.HasTarget) action).setTarget(this); } action.refreshState(); }
protected void hideComponent(AbstractFrame parentFrame, String componentId) { Component component = parentFrame.getComponent(componentId); if (component != null) component.setVisible(false); }
@Override public void collectionChanged(CollectionDatasource.CollectionChangeEvent e) { for (Action action : actionsHolder.getActions()) { action.refreshState(); } }
@SuppressWarnings("unchecked") @Override public <X> X unwrap(Class<X> internalComponentClass) { if (getComponent() instanceof Component.Wrapper) { return (X) ((Component.Wrapper) frame).getComponent(); } return (X) frame; }
@Override public void accept(PickerField.FieldValueChangeEvent<E> event) { listener.actionPerformed(event.getText(), event.getPrevValue()); } }
@SuppressWarnings("unchecked") @Override public <X> X unwrapComposition(Class<X> internalCompositionClass) { if (getComposition() instanceof Component.Wrapper) { return (X) ((Component.Wrapper) frame).getComposition(); } return (X) frame; }
@Override public void accept(Table.CellClickEvent<E> cellClickEvent) { listener.onClick(cellClickEvent.getItem(), cellClickEvent.getColumnId()); } }
@Override public void accept(Table.ColumnCollapseEvent event) { listener.columnCollapsed(event.getColumn(), event.isCollapsed()); } }
protected void setCopyButtonVisible() { Component copyBtn = buttonsHbox.getComponent("copy"); if (copyBtn != null) { copyBtn.setVisible(true); } }
@Override public void accept(Timer.TimerStopEvent timerStopEvent) { listener.timerStopped(timerStopEvent.getSource()); } }
protected void disableControls() { entityNameField.setEditable(false); loggedEntityTable.setEnabled(true); autoCheckBox.setEditable(false); manualCheckBox.setEditable(false); for (Component c : attributesBoxScroll.getComponents()) ((CheckBox) c).setEditable(false); actionsPaneLayout.setVisible(false); }