зеркало из https://github.com/mozilla/pjs.git
Updateable menus (by Mauro)
This commit is contained in:
Родитель
7df73780ea
Коммит
7b267bbaed
|
@ -20,6 +20,7 @@
|
|||
*
|
||||
* Contributors: Jeff Galyan <talisman@anamorphic.com>
|
||||
* Giao Nguyen <grail@cafebabe.org>
|
||||
* Mauro Botelho <mabotelh@bellsouth.net>
|
||||
*/
|
||||
|
||||
package grendel.ui;
|
||||
|
@ -87,9 +88,7 @@ import calypso.util.Preferences;
|
|||
import calypso.util.PreferencesFactory;
|
||||
|
||||
import grendel.ui.ToolBarLayout;
|
||||
import grendel.widgets.Animation;
|
||||
import grendel.widgets.CollapsiblePanel;
|
||||
import grendel.widgets.GrendelToolBar;
|
||||
import grendel.widgets.*;
|
||||
|
||||
public class GeneralFrame extends JFrame
|
||||
{
|
||||
|
@ -271,8 +270,8 @@ public class GeneralFrame extends JFrame
|
|||
* @param file the XML file to build the menu from
|
||||
* @return a menubar built from the file
|
||||
*/
|
||||
protected JMenuBar buildMenu(String file, UIAction[] actions) {
|
||||
JMenuBar menubar = null;
|
||||
protected MenuBarCtrl buildMenu(String file, UIAction[] actions) {
|
||||
MenuBarCtrl menubar = null;
|
||||
URL url;
|
||||
XMLMenuBuilder builder =
|
||||
new XMLMenuBuilder(this, actions);
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
* The Initial Developer of the Original Code is Giao Nguyen
|
||||
* <grail@cafebabe.org>. Portions created by Giao Nguyen are Copyright
|
||||
* (C) 1999 Giao Nguyen. All Rights Reserved.
|
||||
*
|
||||
* Contributors: Mauro Botelho <mabotelh@bellsouth.net>
|
||||
*/
|
||||
|
||||
package grendel.widgets;
|
||||
|
@ -44,7 +46,7 @@ public class MenuBarCtrl extends JMenuBar {
|
|||
JMenuItem item = (JMenuItem)controls.get(name);
|
||||
|
||||
// if it's not a toplevel item, it must be in one of the submenus
|
||||
if (item != null) {
|
||||
if (item == null) {
|
||||
Enumeration e = controls.elements();
|
||||
|
||||
while (e.hasMoreElements()) {
|
||||
|
@ -52,7 +54,7 @@ public class MenuBarCtrl extends JMenuBar {
|
|||
|
||||
if (o instanceof MenuCtrl) {
|
||||
MenuCtrl c = (MenuCtrl)o;
|
||||
item = (JMenuItem)c.getItemByName(name);
|
||||
item = (JMenuItem)(c.getItemByName(name));
|
||||
if (item != null) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -15,6 +15,8 @@
|
|||
* The Initial Developer of the Original Code is Giao Nguyen
|
||||
* <grail@cafebabe.org>. Portions created by Giao Nguyen are Copyright
|
||||
* (C) 1999 Giao Nguyen. All Rights Reserved.
|
||||
*
|
||||
* Contributors: Mauro Botelho <mabotelh@bellsouth.net>
|
||||
*/
|
||||
|
||||
package grendel.widgets;
|
||||
|
@ -35,10 +37,10 @@ public class MenuCtrl extends JMenu {
|
|||
* @return the menu item
|
||||
*/
|
||||
public JMenuItem getItemByName(String name) {
|
||||
JMenuItem item = (JMenuItem)controls.get(name);
|
||||
JMenuItem item = (JMenuItem)(controls.get(name));
|
||||
|
||||
// if it's not a toplevel item, it must be in one of the submenus
|
||||
if (item != null) {
|
||||
if (item == null) {
|
||||
Enumeration e = controls.elements();
|
||||
|
||||
while (e.hasMoreElements()) {
|
||||
|
@ -46,7 +48,7 @@ public class MenuCtrl extends JMenu {
|
|||
|
||||
if (o instanceof MenuCtrl) {
|
||||
MenuCtrl c = (MenuCtrl)o;
|
||||
item = (JMenuItem)c.getItemByName(name);
|
||||
item = (JMenuItem)(c.getItemByName(name));
|
||||
if (item != null) {
|
||||
break;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче