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.FINER)) {
127 log.finer("addSeparator is not implemented");
128 }
129 }
130
131 /*
132 * From PopupMenuPeer
133 */
134 public void show(Event e) {
135 target = (Component)e.target;
136 // Get menus from the target.
137 Vector targetItemVector = getMenuTargetItems();
138 if (targetItemVector != null) {
139 reloadItems(targetItemVector);
140 //Fix for 6287092: JCK15a: api/java_awt/interactive/event/EventTests.html#EventTest0015 fails, mustang
141 Point tl = target.getLocationOnScreen();
142 Point pt = new Point(tl.x + e.x, tl.y + e.y);
143 //Fixed 6266513: Incorrect key handling in XAWT popup menu
144 //No item should be selected when showing popup menu
145 if (!ensureCreated()) {
146 return;
326 * Overriden XWindow general-purpose functions
327 *
328 ************************************************/
329 void ungrabInputImpl() {
330 hide();
331 }
332
333 /************************************************
334 *
335 * Overriden XWindow keyboard processing
336 *
337 ************************************************/
338
339 /*
340 * In previous version keys were handled in handleKeyPress.
341 * Now we override this function do disable F10 explicit
342 * processing. All processing is done using KeyEvent.
343 */
344 public void handleKeyPress(XEvent xev) {
345 XKeyEvent xkey = xev.get_xkey();
346 if (log.isLoggable(PlatformLogger.FINE)) {
347 log.fine(xkey.toString());
348 }
349 if (isEventDisabled(xev)) {
350 return;
351 }
352 final Component currentSource = (Component)getEventSource();
353 handleKeyPress(xkey);
354 }
355
356 }
|
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 public void show(Event e) {
135 target = (Component)e.target;
136 // Get menus from the target.
137 Vector targetItemVector = getMenuTargetItems();
138 if (targetItemVector != null) {
139 reloadItems(targetItemVector);
140 //Fix for 6287092: JCK15a: api/java_awt/interactive/event/EventTests.html#EventTest0015 fails, mustang
141 Point tl = target.getLocationOnScreen();
142 Point pt = new Point(tl.x + e.x, tl.y + e.y);
143 //Fixed 6266513: Incorrect key handling in XAWT popup menu
144 //No item should be selected when showing popup menu
145 if (!ensureCreated()) {
146 return;
326 * Overriden XWindow general-purpose functions
327 *
328 ************************************************/
329 void ungrabInputImpl() {
330 hide();
331 }
332
333 /************************************************
334 *
335 * Overriden XWindow keyboard processing
336 *
337 ************************************************/
338
339 /*
340 * In previous version keys were handled in handleKeyPress.
341 * Now we override this function do disable F10 explicit
342 * processing. All processing is done using KeyEvent.
343 */
344 public void handleKeyPress(XEvent xev) {
345 XKeyEvent xkey = xev.get_xkey();
346 if (log.isLoggable(PlatformLogger.Level.FINE)) {
347 log.fine(xkey.toString());
348 }
349 if (isEventDisabled(xev)) {
350 return;
351 }
352 final Component currentSource = (Component)getEventSource();
353 handleKeyPress(xkey);
354 }
355
356 }
|