309 }
310 return null;
311 }
312 }
313
314 /**
315 * Returns showing submenu, if any
316 */
317 XMenuPeer getShowingSubmenu() {
318 synchronized(getMenuTreeLock()) {
319 return showingSubmenu;
320 }
321 }
322
323 /**
324 * Adds item to end of items vector.
325 * Note that this function does not perform
326 * check for adding duplicate items
327 * @param item item to add
328 */
329 public void addItem(MenuItem item) {
330 XMenuItemPeer mp = (XMenuItemPeer)item.getPeer();
331 if (mp != null) {
332 mp.setContainer(this);
333 synchronized(getMenuTreeLock()) {
334 items.add(mp);
335 }
336 } else {
337 if (log.isLoggable(PlatformLogger.Level.FINE)) {
338 log.fine("WARNING: Attempt to add menu item without a peer");
339 }
340 }
341 updateSize();
342 }
343
344 /**
345 * Removes item at the specified index from items vector.
346 * @param index the position of the item to be removed
347 */
348 public void delItem(int index) {
|
309 }
310 return null;
311 }
312 }
313
314 /**
315 * Returns showing submenu, if any
316 */
317 XMenuPeer getShowingSubmenu() {
318 synchronized(getMenuTreeLock()) {
319 return showingSubmenu;
320 }
321 }
322
323 /**
324 * Adds item to end of items vector.
325 * Note that this function does not perform
326 * check for adding duplicate items
327 * @param item item to add
328 */
329 @SuppressWarnings("deprecation")
330 public void addItem(MenuItem item) {
331 XMenuItemPeer mp = (XMenuItemPeer)item.getPeer();
332 if (mp != null) {
333 mp.setContainer(this);
334 synchronized(getMenuTreeLock()) {
335 items.add(mp);
336 }
337 } else {
338 if (log.isLoggable(PlatformLogger.Level.FINE)) {
339 log.fine("WARNING: Attempt to add menu item without a peer");
340 }
341 }
342 updateSize();
343 }
344
345 /**
346 * Removes item at the specified index from items vector.
347 * @param index the position of the item to be removed
348 */
349 public void delItem(int index) {
|