01: package org.columba.core.gui.htmlviewer.api;
02:
03: import javax.swing.JComponent;
04:
05: import org.columba.api.plugin.IExtensionInterface;
06:
07: /**
08: * HTML Viewer interface.
09: *
10: * @author Frederik Dietz
11: */
12: public interface IHTMLViewerPlugin extends IExtensionInterface {
13:
14: /**
15: * View HTML page using the source string.
16: *
17: * @param htmlSource HTML source string
18: */
19: void view(String body);
20:
21: String getText();
22:
23: /**
24: * Get selected text.
25: *
26: * @return selected text
27: */
28: String getSelectedText();
29:
30: /**
31: * Check if HTML viewer was initialized correctly.
32: *
33: * @return true, if initialized correctly. False, otherwise.
34: *
35: */
36: boolean initialized();
37:
38: /**
39: * Return embedded view.
40: *
41: * @return view
42: */
43: JComponent getComponent();
44:
45: /**
46: * Return container.
47: *
48: * @return
49: */
50: JComponent getContainer();
51:
52: /**
53: * Sets the position of the text insertion caret for the TextComponent. Note
54: * that the caret tracks change, so this may move if the underlying text of
55: * the component is changed. If the document is null, does nothing. The
56: * position must be between 0 and the length of the component's text or else
57: * an exception is thrown.
58: *
59: * @param position
60: */
61: public void setCaretPosition(int position);
62:
63: /**
64: * Moves the caret to a new position, leaving behind a mark defined by the
65: * last time setCaretPosition was called. This forms a selection. If the
66: * document is null, does nothing. The position must be between 0 and the
67: * length of the component's text or else an exception is thrown.
68: *
69: * @param position
70: */
71: public void moveCaretPosition(int position);
72:
73: }
|