001: /*
002: * TextEditor.java
003: *
004: * Copyright (C) 2002, 2003, 2004, 2005, 2006 Takis Diakoumis
005: *
006: * This program is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU General Public License
008: * as published by the Free Software Foundation; either version 2
009: * of the License, or any later version.
010: *
011: * This program is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014: * GNU General Public License for more details.
015: *
016: * You should have received a copy of the GNU General Public License
017: * along with this program; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
019: *
020: */
021:
022: package org.executequery.gui.text;
023:
024: import javax.swing.text.JTextComponent;
025:
026: import org.executequery.print.PrintFunction;
027: import org.executequery.gui.SaveFunction;
028:
029: /* ----------------------------------------------------------
030: * CVS NOTE: Changes to the CVS repository prior to the
031: * release of version 3.0.0beta1 has meant a
032: * resetting of CVS revision numbers.
033: * ----------------------------------------------------------
034: */
035:
036: /**
037: * Defines a panel with a text component that may
038: * be manipulated - print, cut, copy, change case etc.
039: *
040: * @author Takis Diakoumis
041: * @version $Revision: 1.4 $
042: * @date $Date: 2006/05/14 06:56:52 $
043: */
044: public interface TextEditor extends PrintFunction, SaveFunction {
045:
046: /**
047: * Returns the text component's text.
048: *
049: * @return the text component text
050: */
051: public String getEditorText();
052:
053: /**
054: * Returns the actual text component.
055: *
056: * @return the text component
057: */
058: public JTextComponent getEditorTextComponent();
059:
060: /**
061: * Cuts the selected text from the text component.
062: */
063: public void cut();
064:
065: /**
066: * Copies the selected text from the text component.
067: */
068: public void copy();
069:
070: /**
071: * Pastes text into the text component at the cursor position.
072: */
073: public void paste();
074:
075: /**
076: * Disables/enables updates on the text component. This is designed
077: * to add remove some of the heavier listeners such as document
078: * change and caret listeners.
079: *
080: * @param disable - true | false
081: */
082: public void disableUpdates(boolean disable);
083:
084: /**
085: * Return whether the text component defined by this interface
086: * may be text searched.
087: *
088: * @return true | false
089: */
090: public boolean canSearch();
091:
092: public void changeSelectionCase(boolean upper);
093:
094: public void deleteLine();
095:
096: public void deleteWord();
097:
098: public void deleteSelection();
099:
100: public void insertFromFile();
101:
102: public void insertLineAfter();
103:
104: public void insertLineBefore();
105:
106: public void selectAll();
107:
108: public void selectNone();
109:
110: }
|