1 /*
2 * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
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
81 */
82 public void setFont(Font f) {
83 resetMapping();
84 setItemsFont(f);
85 postPaintEvent();
86 }
87
88 /*
89 * From MenuItemPeer
90 */
91 public void setLabel(String label) {
92 resetMapping();
93 postPaintEvent();
94 }
95
96
97 public void setEnabled(boolean enabled) {
98 postPaintEvent();
99 }
100
101 /**
102 * DEPRECATED: Replaced by setEnabled(boolean).
103 * @see java.awt.peer.MenuItemPeer
104 */
105 public void enable() {
106 setEnabled( true );
107 }
108
109 /**
110 * DEPRECATED: Replaced by setEnabled(boolean).
111 * @see java.awt.peer.MenuItemPeer
112 */
113 public void disable() {
114 setEnabled( false );
115 }
116
117 /*
118 * From MenuPeer
119 */
120 /**
121 * addSeparator routines are not used
122 * in peers. Shared code invokes addItem("-")
123 * for adding separators
124 */
125 public void addSeparator() {
126 if (log.isLoggable(PlatformLogger.Level.FINER)) {
127 log.finer("addSeparator is not implemented");
128 }
129 }
130
131 /*
132 * From PopupMenuPeer
133 */
134 @SuppressWarnings("deprecation")
135 public void show(Event e) {
136 target = (Component)e.target;
|
1 /*
2 * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this
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
81 */
82 public void setFont(Font f) {
83 resetMapping();
84 setItemsFont(f);
85 postPaintEvent();
86 }
87
88 /*
89 * From MenuItemPeer
90 */
91 public void setLabel(String label) {
92 resetMapping();
93 postPaintEvent();
94 }
95
96
97 public void setEnabled(boolean enabled) {
98 postPaintEvent();
99 }
100
101 /*
102 * From MenuPeer
103 */
104 /**
105 * addSeparator routines are not used
106 * in peers. Shared code invokes addItem("-")
107 * for adding separators
108 */
109 public void addSeparator() {
110 if (log.isLoggable(PlatformLogger.Level.FINER)) {
111 log.finer("addSeparator is not implemented");
112 }
113 }
114
115 /*
116 * From PopupMenuPeer
117 */
118 @SuppressWarnings("deprecation")
119 public void show(Event e) {
120 target = (Component)e.target;
|