Revision 42548 trunk/org.gvsig.desktop/org.gvsig.desktop.framework/org.gvsig.andami/src/main/java/org/gvsig/andami/ui/mdiFrame/DropDownButton.java
DropDownButton.java | ||
---|---|---|
65 | 65 |
public void add(final Action action) { |
66 | 66 |
this.actions.add(action); |
67 | 67 |
if (this.actions.size() == 1) { |
68 |
mainButton.setIcon((Icon) action.getValue(Action.SMALL_ICON)); |
|
69 |
if (showText) { |
|
70 |
mainButton.setText((String) action.getValue(Action.SHORT_DESCRIPTION)); |
|
71 |
} else { |
|
72 |
mainButton.setText(""); |
|
68 |
setMainButton(action); |
|
69 |
} |
|
70 |
} |
|
71 |
|
|
72 |
private void setMainButton(Action action){ |
|
73 |
mainButton.setIcon((Icon) action.getValue(Action.SMALL_ICON)); |
|
74 |
if (showText) { |
|
75 |
mainButton.setText((String) action.getValue(Action.SHORT_DESCRIPTION)); |
|
76 |
} else { |
|
77 |
mainButton.setText(""); |
|
78 |
} |
|
79 |
currentAction = action; |
|
80 |
} |
|
81 |
|
|
82 |
public void updateMainButton(){ |
|
83 |
for (Action action : actions) { |
|
84 |
if (action.isEnabled()){ |
|
85 |
setMainButton(action); |
|
86 |
return; |
|
73 | 87 |
} |
74 |
currentAction = action; |
|
75 | 88 |
} |
76 | 89 |
} |
77 | 90 |
|
Also available in: Unified diff