001: // The contents of this file are subject to the Mozilla Public License Version
002: // 1.1
003: //(the "License"); you may not use this file except in compliance with the
004: //License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
005: //
006: //Software distributed under the License is distributed on an "AS IS" basis,
007: //WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
008: //for the specific language governing rights and
009: //limitations under the License.
010: //
011: //The Original Code is "The Columba Project"
012: //
013: //The Initial Developers of the Original Code are Frederik Dietz and Timo
014: // Stich.
015: //Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2003.
016: //
017: //All Rights Reserved.
018: package org.columba.api.gui.frame;
019:
020: import java.awt.event.MouseListener;
021:
022: import javax.swing.JPanel;
023:
024: import org.columba.api.gui.frame.event.IFrameMediatorListener;
025: import org.columba.api.plugin.IExtensionInterface;
026: import org.columba.api.selection.ISelectionManager;
027: import org.columba.core.context.semantic.api.ISemanticContext;
028: import org.columba.core.gui.search.api.ISearchPanel;
029:
030: /**
031: * Mediator is reponsible for managing all the interaction between the
032: * components found in a {@link AbstractFrameView}.
033: * <p>
034: * Following an introduction in the Mediator Pattern:
035: * <p>
036: * When a program is made up of a number of classes, the logic and computation
037: * is divided logically among these classes. However, as more of these isolated
038: * classes are developed in a program, the problem of communication between
039: * these classes become more complex. The more each class needs to know about
040: * the methods of another class, the more tangled the class structure can
041: * become. This makes the program harder to read and harder to maintain.
042: * Further, it can become difficult to change the program, since any change may
043: * affect code in several other classes. <bre>The Mediator pattern addresses
044: * this problem by promoting looser coupling between these classes. Mediators
045: * accomplish this by being the only class that has detailed knowledge of the
046: * methods of other classes. Classes send inform the mediator when changes occur
047: * and the Mediator passes them on to any other classes that need to be
048: * informed.
049: *
050: * @author fdietz
051: */
052: public interface IFrameMediator extends IExtensionInterface {
053:
054: public ISelectionManager getSelectionManager();
055:
056: public IContainer getContainer();
057:
058: /**
059: * TODO (@author fdietz): adapter only --> will be removed!
060: *
061: * @return
062: */
063: public IContainer getView();
064:
065: public void setContainer(IContainer c);
066:
067: String getString(String sPath, String sName, String sID);
068:
069: public JPanel getContentPane();
070:
071: public ISearchPanel getSearchPanel();
072:
073: public ISemanticContext getSemanticContext();
074:
075: public void savePositions();
076:
077: public void loadPositions();
078:
079: public boolean isInitialized();
080:
081: public String getId();
082:
083: /************************* container callbacks **************/
084:
085: public abstract void extendMenu(IContainer container);
086:
087: public abstract void extendToolBar(IContainer container);
088:
089: public abstract void close(IContainer container);
090:
091: public abstract void initFrame(IContainer container);
092:
093: /************************* frame eventing *******************/
094:
095: public abstract void addListener(IFrameMediatorListener l);
096:
097: public abstract void removeListener(IFrameMediatorListener l);
098:
099: public abstract void fireTitleChanged(String title);
100:
101: public abstract void fireStatusMessageChanged(String statusMessage);
102:
103: public abstract void fireTaskStatusChanged();
104:
105: public abstract void fireVisibilityChanged(boolean visible);
106:
107: public abstract void fireLayoutChanged();
108:
109: public abstract void fireClosed();
110:
111: public abstract void fireToolBarVisibilityChanged(boolean visible);
112:
113: public abstract void fireComponentChanged();
114:
115: /************************************************************/
116:
117: /**
118: * Get mouse tooltip handler. This is a MouseAdapter which is used by the
119: * menu to display menuitem tooltips on the statusbar when moving the mouse
120: * of an menuitem.
121: */
122: public abstract MouseListener getMouseTooltipHandler();
123:
124: }
|