01: // The contents of this file are subject to the Mozilla Public License Version
02: // 1.1
03: //(the "License"); you may not use this file except in compliance with the
04: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
05: //
06: //Software distributed under the License is distributed on an "AS IS" basis,
07: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
08: //for the specific language governing rights and
09: //limitations under the License.
10: //
11: //The Original Code is "The Columba Project"
12: //
13: //The Initial Developers of the Original Code are Frederik Dietz and Timo
14: // Stich.
15: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
16: //
17: //All Rights Reserved.
18: package org.columba.core.gui.menu;
19:
20: import java.awt.Component;
21: import java.util.Enumeration;
22:
23: import javax.swing.JMenuItem;
24:
25: public interface IMenuElement {
26:
27: public static final int TYPE_ACTION = 0;
28: public static final int TYPE_MENUITEM = 1;
29: public static final int TYPE_COMPONENT = 2;
30: public static final int TYPE_SEPARATOR = 3;
31: public static final int TYPE_PLACEHOLDER = 4;
32: public static final int TYPE_MENU = 5;
33:
34: public boolean isSeparator();
35:
36: public boolean isAction();
37:
38: public boolean isPlaceholder();
39:
40: public boolean isMenu();
41:
42: public boolean isComponent();
43:
44: public JMenuItem getMenuItem();
45:
46: public Component getComponent();
47:
48: public IMenuElement getParent();
49:
50: public void setParent(IMenuElement parent);
51:
52: public Enumeration getChildren();
53:
54: public void add(IMenuElement child);
55:
56: public void insert(IMenuElement child, int position);
57:
58: public void remove(IMenuElement child);
59:
60: public void remove(int index);
61:
62: public int indexOf(IMenuElement child);
63: }
|