KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > message > IMessageController


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.mail.gui.message;
19
20 import org.columba.core.context.semantic.api.IContextListener;
21 import org.columba.mail.command.IMailFolderCommandReference;
22 import org.columba.mail.folder.IMailbox;
23
24 /**
25  * @author fdietz
26  *
27  */

28 public interface IMessageController {
29
30     /**
31      * Show message in messages viewer.
32      * <p>
33      * Should be called in Command.execute() or in another background thread.
34      *
35      * @param folder
36      * selected folder
37      * @param uid
38      * selected message UID
39      * @throws Exception
40      */

41     void showMessage(IMailbox folder, Object JavaDoc uid) throws Exception JavaDoc;
42
43     /**
44      * Revalidate message viewer components.
45      * <p>
46      * Call this method after showMessage() to force a repaint():
47      *
48      */

49     void updateGUI() throws Exception JavaDoc;
50
51     public IMailFolderCommandReference getSelectedReference();
52
53     public IMailbox getSelectedFolder();
54
55     public Object JavaDoc getSelectedMessageId();
56
57     public void addMessageSelectionListener(IMessageSelectionListener l);
58
59     public void removeMessageSelectionListener(IMessageSelectionListener l);
60
61     public void clear();
62
63     /**
64      * Return text.
65      *
66      * @return
67      */

68     public String JavaDoc getText();
69
70     /**
71      * Return selected text
72      *
73      * @return
74      */

75     public String JavaDoc getSelectedText();
76
77     /**
78      * Sets the position of the text insertion caret for the TextComponent. Note
79      * that the caret tracks change, so this may move if the underlying text of
80      * the component is changed. If the document is null, does nothing. The
81      * position must be between 0 and the length of the component's text or else
82      * an exception is thrown.
83      *
84      * @param position
85      */

86     public void setCaretPosition(int position);
87
88     /**
89      * Moves the caret to a new position, leaving behind a mark defined by the
90      * last time setCaretPosition was called. This forms a selection. If the
91      * document is null, does nothing. The position must be between 0 and the
92      * length of the component's text or else an exception is thrown.
93      *
94      * @param position
95      */

96     public void moveCaretPosition(int position);
97
98 }
Popular Tags