lexx.gui.editor
Class EditorPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--lexx.gui.editor.EditorPanel
All Implemented Interfaces:
javax.accessibility.Accessible, Closeable, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public final class EditorPanel
extends javax.swing.JPanel
implements Closeable

The text editor has the following options

  1. Undo / Redo capability
  2. Cut, Copy, Paste optiona
  3. Syntax highlighting (achieved either by lexx.oldversion package or by SATC)
  4. Creates two documentlisteners to enable auto completion

Copyright (c) 2002-2003

Since:
25/02/2003
Version:
1.0
Author:
Mohammed Imran
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
EditorPanel(Packages packagesClasses, ClassName name, java.lang.String javaname)
           
EditorPanel(Packages packagesClasses, java.io.File sourceFileName, java.lang.String name)
           
 
Method Summary
 boolean close()
          Closes does this panel, must ask user first if he/she was to save the work
 JavaAutoListener getAutoListener()
          Only required in automated testing
 java.io.File getFileName()
           
 java.lang.String getJavaName()
           
 Packages getPackage()
           
 JavaParserListener getParserListener()
          Only required in automated testing
 RedoAction getRedoAction()
           
(package private)  java.lang.String getSavedString()
           
 javax.swing.JTextPane getTextPane()
           
 javax.swing.undo.UndoManager getUndo()
           
 UndoAction getUndoAction()
           
 void gotoLine(int lineNum)
          Moves the screen to go to a specific line number
 boolean hasChanged()
          Tells you if the file has changed since you last saved it
 void saveFile()
          Saves the file that the user is currently editing
 void sendFileToServer()
          If the IDE is connected to a server it will send the file that it is currently editing to the server
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditorPanel

public EditorPanel(Packages packagesClasses,
                   java.io.File sourceFileName,
                   java.lang.String name)

EditorPanel

public EditorPanel(Packages packagesClasses,
                   ClassName name,
                   java.lang.String javaname)
Method Detail

getPackage

public final Packages getPackage()

getJavaName

public final java.lang.String getJavaName()
Returns:
returns the name of the file (short name excluding path and extension)

getTextPane

public final javax.swing.JTextPane getTextPane()

saveFile

public final void saveFile()
Saves the file that the user is currently editing


close

public final boolean close()
Closes does this panel, must ask user first if he/she was to save the work

Specified by:
close in interface Closeable
Returns:
return true if this class has closed down successfully

sendFileToServer

public final void sendFileToServer()
If the IDE is connected to a server it will send the file that it is currently editing to the server


hasChanged

public final boolean hasChanged()
Tells you if the file has changed since you last saved it

Returns:
Tells you if the file has changed since you last saved it

gotoLine

public final void gotoLine(int lineNum)
Moves the screen to go to a specific line number

Parameters:
lineNum - is the number you would like to go to

getFileName

public final java.io.File getFileName()
Returns:
return the name of the file that you are editing

getUndo

public final javax.swing.undo.UndoManager getUndo()
Returns:
return undo manager to work out if you can undo or redo

getUndoAction

public final UndoAction getUndoAction()
Returns:
return UndoAction to actually perform undo

getRedoAction

public final RedoAction getRedoAction()
Returns:
return RedoAction to actually perform redo

getParserListener

public final JavaParserListener getParserListener()
Only required in automated testing

Returns:
returns listerner for parsing code into AST

getAutoListener

public JavaAutoListener getAutoListener()
Only required in automated testing

Returns:
returns listerner for autocompletion

getSavedString

java.lang.String getSavedString()