< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/ScreenMenuPropertyListener.java

Print this page




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.laf;
  27 
  28 import java.beans.*;


  29 
  30 import javax.accessibility.*;
  31 import javax.swing.*;








  32 
  33 class ScreenMenuPropertyListener implements PropertyChangeListener {
  34     ScreenMenuPropertyHandler fMenu;
  35 
  36     ScreenMenuPropertyListener(final ScreenMenuPropertyHandler mc) {
  37         fMenu = mc;
  38     }
  39 
  40     /**
  41      * This method gets called when a bound property is changed.
  42      * @param e A PropertyChangeEvent object describing the event source
  43      *       and the property that has changed.
  44      */
  45     public void propertyChange(final PropertyChangeEvent e) {
  46         final String propertyName = e.getPropertyName();
  47 
  48         if ("enabled".equals(propertyName)) {
  49             fMenu.setEnabled(((Boolean)e.getNewValue()).booleanValue());
  50             return;
  51         }
  52 
  53         if (AccessibleContext.ACCESSIBLE_STATE_PROPERTY.equals(propertyName)) {




   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package com.apple.laf;
  27 
  28 import java.beans.PropertyChangeEvent;
  29 import java.beans.PropertyChangeListener;
  30 import java.io.Serializable;
  31 
  32 import javax.accessibility.AccessibleContext;
  33 import javax.accessibility.AccessibleState;
  34 import javax.swing.AbstractButton;
  35 import javax.swing.Icon;
  36 import javax.swing.JComponent;
  37 import javax.swing.JMenuItem;
  38 import javax.swing.KeyStroke;
  39 
  40 class ScreenMenuPropertyListener implements PropertyChangeListener, Serializable {
  41     private static final long serialVersionUID = -3236277050952156113L;
  42 

  43     ScreenMenuPropertyHandler fMenu;
  44 
  45     ScreenMenuPropertyListener(final ScreenMenuPropertyHandler mc) {
  46         fMenu = mc;
  47     }
  48 
  49     /**
  50      * This method gets called when a bound property is changed.
  51      * @param e A PropertyChangeEvent object describing the event source
  52      *       and the property that has changed.
  53      */
  54     public void propertyChange(final PropertyChangeEvent e) {
  55         final String propertyName = e.getPropertyName();
  56 
  57         if ("enabled".equals(propertyName)) {
  58             fMenu.setEnabled(((Boolean)e.getNewValue()).booleanValue());
  59             return;
  60         }
  61 
  62         if (AccessibleContext.ACCESSIBLE_STATE_PROPERTY.equals(propertyName)) {


< prev index next >