ponderToolkit.editor
Class TextFrame

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--ponderToolkit.editor.TextFrame
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.DocumentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants, java.awt.event.WindowListener

public class TextFrame
extends javax.swing.JFrame
implements java.awt.event.WindowListener, java.awt.event.MouseListener, javax.swing.event.DocumentListener

Function: Represents a Text-frame (Editor + Message Windows)

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Frame
java.awt.Frame.AccessibleAWTFrame
 
Inner classes inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class javax.swing.JFrame
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TextFrame(PonderEditor pe, ResourceStringMan str, java.util.Properties pr, DocumentManager doc, boolean newUseDB, boolean newUseHDB, ponderToolkit.domainBrowser.browserApplication.v3.DomainChooser newDomainChooser, ponderToolkit.domainBrowser.browserApplication.htv1.HtDomainChooser newHtDomainChooser)
          Constructor
 
Method Summary
 void applyProperties()
          Apply the properties to the textFrame
 void changedUpdate(javax.swing.event.DocumentEvent evt)
           
 void clear()
          Clear the editing area
 void clearAnalysisWin()
          Clear the build window
 void clearBuildWin()
          Clear the build window
 void clearCodeWin()
          Clear the code window
 void clearOutputWin()
          Clear the output window
 void CloseFindDialog(java.lang.String pat)
          Close the find dialog and keep track of the search pattern used.
 void CloseReplaceDialog(java.lang.String pat, java.lang.String rep)
          Close the replace dialog and keep track of the search and replace patterns used.
 void copy()
          Copy the selection
 void cut()
          Cut the editing area
 void disableAnalysisTab()
          Disable the Analysis tab
 void disableBuildTab()
           
 void disableCodeTab()
          Disable the Code tab
 void enableAnalysisTab()
          Enable the Analysis tab
 void enableBuildTab()
          Enable/Disable build tab
 void enableCodeTab()
          Enable the Code tab
 boolean find(java.lang.String pattern, boolean regex, boolean matchCase)
          Execute the find operation, given the search pattern, whether this is a regular expression and whether to match the case or not
 boolean findNext()
          Find the next occurence of the search pattern
 ActionDictionary getActionDictionary()
          Returns the action dictionary
 javax.swing.JEditorPane getAnalysisWin()
          Return the Analysis window
 javax.swing.JEditorPane getBuildWin()
          Return the build window
 javax.swing.JEditorPane getCodeWin()
          Return the code window
 DocInterface getDocument()
          Return the corresponding Document Manager for this textframe
 org.gjt.sp.jedit.textarea.JEditTextArea getEditor()
          Return the Editor Area
 java.io.File getFile()
          Returns the file currently edited
 java.lang.String getFileName()
          Returns the name of the file currently edited
 java.lang.String getMetaPolText()
          Returns the text of the meta policies panel
 javax.swing.JEditorPane getOutputWin()
          Return the output window
 java.awt.Point getPlace(java.awt.Dimension size)
          Return a place where a dialog box will be placed relative to the textFrame window
 int getSelectedTabIndex()
           
 java.lang.String getText()
          Returns the text of the editor
 javax.swing.undo.UndoManager getUndoManager()
          Returns the undo manager
 void gotoLine(int line)
          Goto the specified line
 void grabFocus()
          Give focus to the editor
 boolean hasFocus()
          Returns true if the editor has the focus.
 void insertText(java.lang.String text)
          Insert text at the current cursor position
 void insertUpdate(javax.swing.event.DocumentEvent evt)
          There was an insert update.
 boolean isFileOpened()
          Returns true if a file is opened.
 void lineNumberingToggle()
          Toggles line numbering on and off
 void mouseClicked(java.awt.event.MouseEvent event)
          Detect a mouse click on the output window.
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void openFile(java.io.File document)
          Open the given file
 void paste()
          Paste text in clipboard into the editing area
 void printFile()
          Calls the Document Manager to print the file
 void readOnlyToggle()
          Turn read-only on and off
 void redo()
          Redo last change
 void removeUpdate(javax.swing.event.DocumentEvent evt)
          There was a remove update.
 boolean replace(java.lang.String replaceStr)
          Set the replace string and replace all instances of selected string with that
 boolean replaceAll(java.lang.String searchStr, java.lang.String replaceStr, boolean regex, boolean matchCase)
          Replace all instances of search string with the replace string
 void selectAll()
          Select All
 void selectAnalysisWin()
          Select the analysisWin tab
 void selectBuildWin()
          Select the buildWin tab
 void selectOutputWin()
          Select the outputWin tab
 void setEnabled(boolean enabled)
          Turn editing on
 void setFrameSize(java.awt.Dimension size)
          Set the size of the text frame
 void setLine(int line)
           
 void setMessage(java.lang.String msg)
          Set the text of the message label
 void setText(java.lang.String text)
          Set the contents of the editor
 void setTitle(java.lang.String name)
          Add the filename to the window title and set the title of the frame
 void shiftLinesRight()
          Shifts the selected lines one tab to the right
 void showHideOutputWin()
          Show/hide the output window
 void showOutputWin()
          Make the output window visible if it is not
 void undo()
          Undo last change
 ponderToolkit.domainBrowser.browserApplication.v3.DomainChooser updateDomainChooser()
          Update the domainChooser if the parameters have changed.
 ponderToolkit.domainBrowser.browserApplication.htv1.HtDomainChooser updateHtDomainChooser()
          Update the htDomainChooser if the parameters have changed.
 PlainDomainChooser updatePlainDomainChooser()
          Update the plainDomainChooser if the parameters have changed.
 void windowActivated(java.awt.event.WindowEvent event)
           
 void windowClosed(java.awt.event.WindowEvent event)
           
 void windowClosing(java.awt.event.WindowEvent event)
          Ask the document manager to close the window
 void windowDeactivated(java.awt.event.WindowEvent event)
           
 void windowDeiconified(java.awt.event.WindowEvent event)
           
 void windowIconified(java.awt.event.WindowEvent event)
           
 void windowOpened(java.awt.event.WindowEvent event)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
addNotify, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, isResizable, remove, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState
 
Methods inherited from class java.awt.Window
addWindowListener, applyResourceBundle, applyResourceBundle, dispose, getFocusOwner, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isShowing, pack, postEvent, processEvent, removeWindowListener, setCursor, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setFont, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
 

Constructor Detail

TextFrame

public TextFrame(PonderEditor pe,
                 ResourceStringMan str,
                 java.util.Properties pr,
                 DocumentManager doc,
                 boolean newUseDB,
                 boolean newUseHDB,
                 ponderToolkit.domainBrowser.browserApplication.v3.DomainChooser newDomainChooser,
                 ponderToolkit.domainBrowser.browserApplication.htv1.HtDomainChooser newHtDomainChooser)
Constructor
Parameters:
pe - The main PonderEditor class
str - The resource-strings manager
pr - The properties to apply
doc - The DocumentManager responsible for this text frame
newUseDB - If true then the Domain browser will be used
newUseHDB - If true (and newUseDB is false) then the HT Domain browser will be used
newDomainChooser - The domain chooser to use if any
newHtDomainChooser - The HT domain chooser to use if any?
Method Detail

updateHtDomainChooser

public ponderToolkit.domainBrowser.browserApplication.htv1.HtDomainChooser updateHtDomainChooser()
Update the htDomainChooser if the parameters have changed.
Returns:
The htDomainChooser

updateDomainChooser

public ponderToolkit.domainBrowser.browserApplication.v3.DomainChooser updateDomainChooser()
Update the domainChooser if the parameters have changed.
Returns:
The domainChooser

updatePlainDomainChooser

public PlainDomainChooser updatePlainDomainChooser()
Update the plainDomainChooser if the parameters have changed.
Returns:
The plainDomainChooser

applyProperties

public void applyProperties()
Apply the properties to the textFrame

getActionDictionary

public ActionDictionary getActionDictionary()
Returns the action dictionary

getUndoManager

public javax.swing.undo.UndoManager getUndoManager()
Returns the undo manager

getSelectedTabIndex

public int getSelectedTabIndex()
Returns:
the index of the selected main-viewer tab

showOutputWin

public void showOutputWin()
Make the output window visible if it is not

showHideOutputWin

public void showHideOutputWin()
Show/hide the output window

clearOutputWin

public void clearOutputWin()
Clear the output window

selectOutputWin

public void selectOutputWin()
Select the outputWin tab

getOutputWin

public javax.swing.JEditorPane getOutputWin()
Return the output window

clearBuildWin

public void clearBuildWin()
Clear the build window

getBuildWin

public javax.swing.JEditorPane getBuildWin()
Return the build window

enableBuildTab

public void enableBuildTab()
Enable/Disable build tab

disableBuildTab

public void disableBuildTab()

selectBuildWin

public void selectBuildWin()
Select the buildWin tab

clearAnalysisWin

public void clearAnalysisWin()
Clear the build window

getAnalysisWin

public javax.swing.JEditorPane getAnalysisWin()
Return the Analysis window

enableAnalysisTab

public void enableAnalysisTab()
Enable the Analysis tab

disableAnalysisTab

public void disableAnalysisTab()
Disable the Analysis tab

selectAnalysisWin

public void selectAnalysisWin()
Select the analysisWin tab

clearCodeWin

public void clearCodeWin()
Clear the code window

getCodeWin

public javax.swing.JEditorPane getCodeWin()
Return the code window

enableCodeTab

public void enableCodeTab()
Enable the Code tab

disableCodeTab

public void disableCodeTab()
Disable the Code tab

getEditor

public org.gjt.sp.jedit.textarea.JEditTextArea getEditor()
Return the Editor Area

clear

public void clear()
Clear the editing area

copy

public void copy()
Copy the selection

cut

public void cut()
Cut the editing area

selectAll

public void selectAll()
Select All

paste

public void paste()
Paste text in clipboard into the editing area

gotoLine

public void gotoLine(int line)
Goto the specified line

undo

public void undo()
Undo last change

redo

public void redo()
Redo last change

grabFocus

public void grabFocus()
Give focus to the editor

setEnabled

public void setEnabled(boolean enabled)
Turn editing on
Overrides:
setEnabled in class java.awt.Component

setText

public void setText(java.lang.String text)
Set the contents of the editor

insertText

public void insertText(java.lang.String text)
Insert text at the current cursor position

hasFocus

public boolean hasFocus()
Returns true if the editor has the focus. False otherwise
Overrides:
hasFocus in class java.awt.Component

isFileOpened

public boolean isFileOpened()
Returns true if a file is opened. False otherwise

getText

public java.lang.String getText()
Returns the text of the editor

getMetaPolText

public java.lang.String getMetaPolText()
Returns the text of the meta policies panel

getFileName

public java.lang.String getFileName()
Returns the name of the file currently edited

getFile

public java.io.File getFile()
Returns the file currently edited

readOnlyToggle

public void readOnlyToggle()
Turn read-only on and off

lineNumberingToggle

public void lineNumberingToggle()
Toggles line numbering on and off

shiftLinesRight

public void shiftLinesRight()
Shifts the selected lines one tab to the right

printFile

public void printFile()
Calls the Document Manager to print the file

openFile

public void openFile(java.io.File document)
Open the given file

find

public boolean find(java.lang.String pattern,
                    boolean regex,
                    boolean matchCase)
Execute the find operation, given the search pattern, whether this is a regular expression and whether to match the case or not

findNext

public boolean findNext()
Find the next occurence of the search pattern

replace

public boolean replace(java.lang.String replaceStr)
Set the replace string and replace all instances of selected string with that

replaceAll

public boolean replaceAll(java.lang.String searchStr,
                          java.lang.String replaceStr,
                          boolean regex,
                          boolean matchCase)
Replace all instances of search string with the replace string

setFrameSize

public void setFrameSize(java.awt.Dimension size)
Set the size of the text frame

setLine

public void setLine(int line)

setMessage

public void setMessage(java.lang.String msg)
Set the text of the message label

getPlace

public java.awt.Point getPlace(java.awt.Dimension size)
Return a place where a dialog box will be placed relative to the textFrame window

setTitle

public void setTitle(java.lang.String name)
Add the filename to the window title and set the title of the frame
Overrides:
setTitle in class java.awt.Frame

CloseFindDialog

public void CloseFindDialog(java.lang.String pat)
Close the find dialog and keep track of the search pattern used. Ask the PonderEditor to do so

CloseReplaceDialog

public void CloseReplaceDialog(java.lang.String pat,
                               java.lang.String rep)
Close the replace dialog and keep track of the search and replace patterns used. Ask the PonderEditor to do so

windowClosing

public void windowClosing(java.awt.event.WindowEvent event)
Ask the document manager to close the window
Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent event)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent event)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowActivated

public void windowActivated(java.awt.event.WindowEvent event)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent event)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent event)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent event)
Specified by:
windowClosed in interface java.awt.event.WindowListener

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent event)
Detect a mouse click on the output window. If the click is on a line that contains an error, move the cursor to that line in the editor
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

getDocument

public DocInterface getDocument()
Return the corresponding Document Manager for this textframe

removeUpdate

public void removeUpdate(javax.swing.event.DocumentEvent evt)
There was a remove update. Update the length counter
Specified by:
removeUpdate in interface javax.swing.event.DocumentListener

insertUpdate

public void insertUpdate(javax.swing.event.DocumentEvent evt)
There was an insert update. Update the length counter
Specified by:
insertUpdate in interface javax.swing.event.DocumentListener

changedUpdate

public void changedUpdate(javax.swing.event.DocumentEvent evt)
Specified by:
changedUpdate in interface javax.swing.event.DocumentListener