src/solaris/classes/sun/awt/X11/XMenuPeer.java

Print this page




  94         //and get rid of recursion
  95         resetTextMetrics();
  96 
  97         XMenuWindow menuWindow = getMenuWindow();
  98         if (menuWindow != null) {
  99             menuWindow.setItemsFont(font);
 100         }
 101 
 102         repaintIfShowing();
 103     }
 104 
 105     /*
 106      * From MenuPeer
 107      */
 108     /**
 109      * addSeparator routines are not used
 110      * in peers. Shared code invokes addItem("-")
 111      * for adding separators
 112      */
 113     public void addSeparator() {
 114         if (log.isLoggable(PlatformLogger.FINER)) {
 115             log.finer("addSeparator is not implemented");
 116         }
 117     }
 118 
 119     public void addItem(MenuItem item) {
 120         XMenuWindow menuWindow = getMenuWindow();
 121         if (menuWindow != null) {
 122             menuWindow.addItem(item);
 123         } else {
 124             if (log.isLoggable(PlatformLogger.FINE)) {
 125                 log.fine("Attempt to use XMenuWindowPeer without window");
 126             }
 127         }
 128     }
 129 
 130     public void delItem(int index) {
 131         XMenuWindow menuWindow = getMenuWindow();
 132         if (menuWindow != null) {
 133             menuWindow.delItem(index);
 134         } else {
 135             if (log.isLoggable(PlatformLogger.FINE)) {
 136                 log.fine("Attempt to use XMenuWindowPeer without window");
 137             }
 138         }
 139     }
 140 
 141     /************************************************
 142      *
 143      * Access to target's fields
 144      *
 145      ************************************************/
 146     Vector getTargetItems() {
 147         return AWTAccessor.getMenuAccessor().getItems((Menu)getTarget());
 148     }
 149 
 150     /************************************************
 151      *
 152      * Overriden behaviour
 153      *
 154      ************************************************/
 155     boolean isSeparator() {




  94         //and get rid of recursion
  95         resetTextMetrics();
  96 
  97         XMenuWindow menuWindow = getMenuWindow();
  98         if (menuWindow != null) {
  99             menuWindow.setItemsFont(font);
 100         }
 101 
 102         repaintIfShowing();
 103     }
 104 
 105     /*
 106      * From MenuPeer
 107      */
 108     /**
 109      * addSeparator routines are not used
 110      * in peers. Shared code invokes addItem("-")
 111      * for adding separators
 112      */
 113     public void addSeparator() {
 114         if (log.isLoggable(PlatformLogger.Level.FINER)) {
 115             log.finer("addSeparator is not implemented");
 116         }
 117     }
 118 
 119     public void addItem(MenuItem item) {
 120         XMenuWindow menuWindow = getMenuWindow();
 121         if (menuWindow != null) {
 122             menuWindow.addItem(item);
 123         } else {
 124             if (log.isLoggable(PlatformLogger.Level.FINE)) {
 125                 log.fine("Attempt to use XMenuWindowPeer without window");
 126             }
 127         }
 128     }
 129 
 130     public void delItem(int index) {
 131         XMenuWindow menuWindow = getMenuWindow();
 132         if (menuWindow != null) {
 133             menuWindow.delItem(index);
 134         } else {
 135             if (log.isLoggable(PlatformLogger.Level.FINE)) {
 136                 log.fine("Attempt to use XMenuWindowPeer without window");
 137             }
 138         }
 139     }
 140 
 141     /************************************************
 142      *
 143      * Access to target's fields
 144      *
 145      ************************************************/
 146     Vector getTargetItems() {
 147         return AWTAccessor.getMenuAccessor().getItems((Menu)getTarget());
 148     }
 149 
 150     /************************************************
 151      *
 152      * Overriden behaviour
 153      *
 154      ************************************************/
 155     boolean isSeparator() {