home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.awt.event.ActionEvent;
- import javax.swing.AbstractAction;
- import javax.swing.AbstractButton;
- import javax.swing.ButtonModel;
- import javax.swing.JButton;
- import javax.swing.JRootPane;
- import javax.swing.SwingUtilities;
-
- class BasicRootPaneUI$DefaultAction extends AbstractAction {
- JRootPane root;
- boolean press;
-
- BasicRootPaneUI$DefaultAction(JRootPane var1, boolean var2) {
- this.root = var1;
- this.press = var2;
- }
-
- public void actionPerformed(ActionEvent var1) {
- JButton var2 = this.root.getDefaultButton();
- if (var2 != null && SwingUtilities.getRootPane(var2) == this.root) {
- ButtonModel var3 = ((AbstractButton)var2).getModel();
- if (this.press) {
- var3.setArmed(true);
- var3.setPressed(true);
- } else {
- var3.setPressed(false);
- }
- }
-
- }
-
- public boolean isEnabled() {
- JButton var1 = this.root.getDefaultButton();
- return var1 != null && ((AbstractButton)var1).getModel().isEnabled();
- }
- }
-