Skip to content

Commit

Permalink
Common,B,JideToggleSplitButton,Fixed the SELECTED_KEY is not updated …
Browse files Browse the repository at this point in the history
…correctly when the selection state changed in JideToggleSplitButton,,no
  • Loading branch information
Wenjie Qiao committed Jan 25, 2019
1 parent cf414a5 commit ab28f00
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/jidesoft/swing/JideToggleSplitButton.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ protected void configurePropertiesFromAction(Action action) {
if (selected != isSelected()) {
// This won't notify ActionListeners, but that should be
// ok as the change is coming from the Action.
setSelected(selected);
setButtonSelected(selected);
// Make sure the change actually took effect
if (!selected && isSelected()) {
if (!selected && isButtonSelected()) {
if (getModel() instanceof DefaultButtonModel) {
ButtonGroup group = (ButtonGroup)
((DefaultButtonModel) getModel()).getGroup();
Expand Down Expand Up @@ -158,7 +158,7 @@ private void updateSelectedKey() {
if (shouldUpdateSelectedStateFromAction()) {
Action action = getAction();
if (action != null) {
boolean selected = isSelected();
boolean selected = isButtonSelected();
Object existingKey = action.getValue(Action.SELECTED_KEY);
if (existingKey == null || Boolean.TRUE.equals(existingKey) != selected) {
action.putValue(Action.SELECTED_KEY, selected);
Expand Down

0 comments on commit ab28f00

Please sign in to comment.