KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > columba > mail > gui > message > util > MessageViewerText


1 //The contents of this file are subject to the Mozilla Public License Version 1.1
2
//(the "License"); you may not use this file except in compliance with the
3
//License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
4
//
5
//Software distributed under the License is distributed on an "AS IS" basis,
6
//WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
7
//for the specific language governing rights and
8
//limitations under the License.
9
//
10
//The Original Code is "The Columba Project"
11
//
12
//The Initial Developers of the Original Code are Frederik Dietz and Timo Stich.
13
//Portions created by Frederik Dietz and Timo Stich are Copyright (C) 2006.
14
//
15
//All Rights Reserved.
16

17 /**
18  * This is an implementation of the IViewableText for the MessageController.
19  * The functions do the same as in the JTextPane class.
20  * @author Dmytro Podalyuk
21  */

22 package org.columba.mail.gui.message.util;
23
24 import org.columba.core.util.IViewableText;
25 import org.columba.mail.gui.message.MessageController;
26
27 public class MessageViewerText implements IViewableText {
28     MessageController controller;
29
30     public MessageViewerText(MessageController controller) {
31         this.controller = controller;
32     }
33
34     public void setCaretPosition(int position) {
35         controller.setCaretPosition(position);
36     }
37
38     public void moveCaretPosition(int position) {
39         controller.moveCaretPosition(position);
40     }
41
42     public String JavaDoc getText() {
43         return controller.getText();
44     }
45
46     public void grabFocus() {
47         controller.grabFocus();
48     }
49 }
50
Popular Tags