/** * Constructs a new <code>SColorPicker</code> instance. */ public SColorPicker() { setLayout(new SBoxLayout(this, SBoxLayout.X_AXIS)); chooseButton = new SButton(); chooseButton.addActionListener(new ActionListener() { public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { showColorPickerDialog(); } }); chooseButton.setShowAsFormComponent(false); chooseButton.setPreferredSize(BUTTON_DIM); chooseButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); resetButton = new SButton(); resetButton.addActionListener(new ActionListener() { public void actionPerformed(@SuppressWarnings("unused") ActionEvent e) { setValue(resetValue); } }); resetButton.setShowAsFormComponent(false); resetButton.setPreferredSize(BUTTON_DIM); resetButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); add(chooseButton); add(resetButton); }
/** * Sets the action field action. * * @param actions * the action field actions. */ public void setActions(List<Action> actions) { if (!ObjectUtils.equals(this.actions, actions)) { buttonPanel.removeAll(); this.actions = actions; for (Action action : actions) { SButton actionButton = new SButton(); actionButton.setAction(action); actionButton.setDisabledIcon(actionButton.getIcon()); actionButton.setActionCommand("*"); actionButton.setText(null); actionButton.setShowAsFormComponent(false); actionButton.setBorder(SBorderFactory.createSLineBorder(Color.GRAY)); if (showTextField) { if (defaultAction == null) { defaultAction = action; textField.addActionListener(action); } } buttonPanel.add(actionButton); } } }
actionHandler, view, locale); SButton actionButton = createSButton(); actionButton.setShowAsFormComponent(false); actionButton.setAction(wingsAction); actionButton.setDisabledIcon(actionButton.getIcon());
actionHandler, view, locale); SButton actionButton = createSButton(); actionButton.setShowAsFormComponent(false); actionButton.setAction(wingsAction); if (action.getAcceleratorAsString() != null) {