KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > api > gui > frame > IFrameMediator


1 // The contents of this file are subject to the Mozilla Public License Version
2
// 1.1
3
//(the "License"); you may not use this file except in compliance with the
4
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
5
//
6
//Software distributed under the License is distributed on an "AS IS" basis,
7
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
8
//for the specific language governing rights and
9
//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.api.gui.frame;
19
20 import java.awt.event.MouseListener JavaDoc;
21
22 import javax.swing.JPanel JavaDoc;
23
24 import org.columba.api.gui.frame.event.IFrameMediatorListener;
25 import org.columba.api.plugin.IExtensionInterface;
26 import org.columba.api.selection.ISelectionManager;
27 import org.columba.core.context.semantic.api.ISemanticContext;
28 import org.columba.core.gui.search.api.ISearchPanel;
29
30 /**
31  * Mediator is reponsible for managing all the interaction between the
32  * components found in a {@link AbstractFrameView}.
33  * <p>
34  * Following an introduction in the Mediator Pattern:
35  * <p>
36  * When a program is made up of a number of classes, the logic and computation
37  * is divided logically among these classes. However, as more of these isolated
38  * classes are developed in a program, the problem of communication between
39  * these classes become more complex. The more each class needs to know about
40  * the methods of another class, the more tangled the class structure can
41  * become. This makes the program harder to read and harder to maintain.
42  * Further, it can become difficult to change the program, since any change may
43  * affect code in several other classes. <bre>The Mediator pattern addresses
44  * this problem by promoting looser coupling between these classes. Mediators
45  * accomplish this by being the only class that has detailed knowledge of the
46  * methods of other classes. Classes send inform the mediator when changes occur
47  * and the Mediator passes them on to any other classes that need to be
48  * informed.
49  *
50  * @author fdietz
51  */

52 public interface IFrameMediator extends IExtensionInterface {
53
54     public ISelectionManager getSelectionManager();
55
56     public IContainer getContainer();
57
58     /**
59      * TODO (@author fdietz): adapter only --> will be removed!
60      *
61      * @return
62      */

63     public IContainer getView();
64
65     public void setContainer(IContainer c);
66
67     String JavaDoc getString(String JavaDoc sPath, String JavaDoc sName, String JavaDoc sID);
68
69     public JPanel JavaDoc getContentPane();
70
71     public ISearchPanel getSearchPanel();
72     
73     public ISemanticContext getSemanticContext();
74     
75     public void savePositions();
76
77     public void loadPositions();
78     
79     
80     public boolean isInitialized();
81     
82     public String JavaDoc getId();
83     
84     
85     /************************* container callbacks **************/
86     
87     public abstract void extendMenu(IContainer container);
88     public abstract void extendToolBar(IContainer container);
89     public abstract void close(IContainer container);
90     public abstract void initFrame(IContainer container);
91     
92     /************************* frame eventing *******************/
93     
94     public abstract void addListener(IFrameMediatorListener l) ;
95
96     public abstract void removeListener(IFrameMediatorListener l);
97     
98     public abstract void fireTitleChanged(String JavaDoc title);
99     public abstract void fireStatusMessageChanged(String JavaDoc statusMessage);
100     public abstract void fireTaskStatusChanged();
101     public abstract void fireVisibilityChanged(boolean visible);
102     public abstract void fireLayoutChanged();
103     public abstract void fireClosed();
104     public abstract void fireToolBarVisibilityChanged(boolean visible);
105     public abstract void fireComponentChanged();
106     
107     /************************************************************/
108     
109     /**
110      * Get mouse tooltip handler. This is a MouseAdapter which is used by the
111      * menu to display menuitem tooltips on the statusbar when moving the mouse
112      * of an menuitem.
113      */

114     public abstract MouseListener JavaDoc getMouseTooltipHandler();
115
116 }
Popular Tags