@Override public void actionPerformed(ActionEvent e) { for (LafParameterStorage storage : LafParameterStorage.values()) { if (storage.name().equals(e.getActionCommand())) { setValueToEditor(storage); } } }
private void initStorage( LafParameterStorage storage, String label, TableLayoutBuilder tbllayStorage) { if (LafParameterProvider.getInstance().isStorageAllowed(parameter, storage)) { JRadioButton jrb = new JRadioButton(label); jrb.setActionCommand(storage.name()); jrb.addActionListener(this); bgStorages.add(jrb); tbllayStorage.newRow(); tbllayStorage.add(jrb); if (this.storage == null) { jrb.setSelected(true); setValueToEditor(storage); } } }
public static void installPopup(JComponent c, LafParameter<?> parameter, Long entityId) { boolean changeAllowed = false; for (LafParameterStorage storage : LafParameterStorage.values()) { if (LafParameterProvider.getInstance().isStorageAllowed(parameter, storage)) { changeAllowed = true; } } if (changeAllowed) { JPopupMenu pm = c.getComponentPopupMenu(); if (pm == null) { pm = new JPopupMenu(); c.setComponentPopupMenu(pm); } pm.add(new LafParameterAction(parameter, entityId, c)); } }