org.jpop.jedit
Class JeditPoplog

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byorg.jpop.gui.ProcessConsole
                      extended byorg.jpop.jedit.JeditPoplog
All Implemented Interfaces:
javax.accessibility.Accessible, org.gjt.sp.jedit.EBComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JeditPoplog
extends ProcessConsole
implements org.gjt.sp.jedit.EBComponent

This class is what gets loaded into JEdit.

  // The following lot have to be filled in to manage jedit buffers instead of stdin & stdout
  // panes and use getIOControl to make jedit keep up-to-date. Probably the best way is to create
  // a new file on disk and write to it whatever we need, then use the methods interfacethe jEdit
  // class to make JEdit refresh its buffers. Also having the buffers stored here we can set them
  // as active when needed

Author:
ug57dsm
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String IMG_CLASSPATH
          The path to the images
static java.lang.String INIT_CLASSPATH
          The path to the images
static java.lang.String[] PROC_FILES
          The processes we need to run and related information
static java.lang.String[] PROC_NAMES
          The processes we need to run and related information
static java.lang.String PROPERTY_PREFIX
          The prefix of every property
static java.lang.String STDERR_FILENAME
          Names for the output files
static java.lang.String STDOUT_FILENAME
          Names for the output files
 
Fields inherited from class org.jpop.gui.ProcessConsole
STDERR, STDOUT
 
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.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
JeditPoplog(org.gjt.sp.jedit.View v)
          The constructor.
 
Method Summary
 void appendToStderr(java.lang.String s)
          DISABLED, any attempt at making this work kept messing up the Buffers whithin JEdit and sometimes even killed the process
 void appendToStdout(java.lang.String s)
          DISABLED, any attempt at making this work kept messing up the Buffers whithin JEdit and sometimes even killed the process
 void buttonMouseEntered(javax.swing.JButton jb)
          Called when a button has the mouse over it
 void buttonMouseExited(javax.swing.JButton jb)
          Called when a button has the mouse taken away from over it
 void clearScratchPadButtonActionPerformed()
          Event manager: When the clear scratchpad button is clicked
 void compileClipboardContentsButtonActionPerformed()
          Event manager: When the compile clipboard button is clicked
 void compileCurrentBufferButtonActionPerformed()
          Event manager: When the compile current buffer button is clicked
 void compileCurrentFileButtonActionPerformed()
          Event manager: When the compile current file button is clicked
 void compileCurrentLineButtonActionPerformed()
          Event manager: When the compile current line button is clicked
 void compileFileButtonActionPerformed()
          Event manager: When the compile file button is clicked
 void compileScratchPadButtonActionPerformed()
          Event manager: When the compile scratchpad button is clicked
 void compileSelectedTextButtonActionPerformed()
          Event manager: When the compile selected text button is clicked
 void debug(java.lang.String s)
          Creates a debugging message in the log window and file
 LogWindow getLogWindow()
          Gets the log window value of the JeditPoplog object
 java.io.BufferedReader getStderrReader()
          Gets the stderr reader value of the JeditPoplog object
 java.lang.String getStderrText()
          Gets the stderr text value of the JeditPoplog object
 java.io.BufferedReader getStdoutReader()
          Gets the stdout reader value of the JeditPoplog object
 java.lang.String getStdoutText()
          Gets the stdout text value of the JeditPoplog object
 void handleMessage(org.gjt.sp.jedit.EBMessage msg)
          This method deals with messages passed from JEdit via the EDitBus.
 void killProcessButtonActionPerformed()
          Event manager: When the kill process button is clicked
 org.gjt.sp.jedit.Buffer makeBuffer(java.io.File f, boolean ro)
          Make and display a buffer for a file
protected  void makeOutputPanes()
          Overriden to stop the program making output panes.
 void openDocBrowserButtonActionPerformed()
          Event manager: When the doc browser button is clicked
 void openHelpButtonActionPerformed()
          Event manager: When the help button is clicked
 void processKilled()
          Called when the process dies or is killed
 void processListActionPerformed()
          Event manager: When a selection is made from the processes list
 void processStarted()
          Event fired when the process is started
 void reloadProperties()
          Reloads the properties for the object
 void respawnProcessButtonActionPerformed()
          Event manager: When the respawn process button is clicked
 void sendClipboardContentsToScratchPadButtonActionPerformed()
          Event manager: When the send clipboard to scratchpad button is clicked
 void sendCurrentLineToScratchPadButtonActionPerformed()
          Event manager: When the send current line to scratchpad button is clicked
 void sendSelectedTextToScratchPadButtonActionPerformed()
          Event manager: When the send selected text to scratchpad button is clicked
 void setProcessName(java.lang.String proc)
          Sets the process to run
 void setStderrReader(java.io.BufferedReader br)
          Sets the stderr reader value of the JeditPoplog object
 void setStderrText(java.lang.String s)
          Sets the stderr text value of the JeditPoplog object
 void setStdoutReader(java.io.BufferedReader br)
          Sets the stdout reader value of the JeditPoplog object
 void setStdoutText(java.lang.String s)
          Sets the stdout text value of the JeditPoplog object
 void spawnProcessButtonActionPerformed()
          Event manager: When the spawn process button is clicked
 void stderrPaneRequestFocus()
          When the text of a buffer changes the stderrTextChanged() event calls this
 void stderrTextChanged()
          Event activated when the text in the stderr file is changed
 void stdinTextChanged()
          This event is fired when the stdin gets changed
 void stdoutPaneRequestFocus()
          When the text of a buffer changes the stdoutTextChanged() event calls this
 void stdoutTextChanged()
          Event activated when the text in the stdout file is changed
 
Methods inherited from class org.jpop.gui.ProcessConsole
addTool, appendToStdin, close, execBufferedReader, execFile, getInputPanelSize, getInputPanePreferredSize, getIOControl, getOutputTabsPreferredSize, getOutputTabsSize, getPrinter, getProcessName, getStderrColor, getStdinColor, getStdinText, getStdoutColor, isRespawnable, isRunning, isVerticalSplit, kill, main, removeTool, respawn, setInputPanePreferredSize, setOutputTabsPreferredSize, setRespawnable, setSelectedTab, setStderrColor, setStdinColor, setStdinText, setStdoutColor, setVerticalSplit, spawn, stdinPaneRequestFocus
 
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
 

Field Detail

STDERR_FILENAME

public static final java.lang.String STDERR_FILENAME
Names for the output files

See Also:
Constant Field Values

STDOUT_FILENAME

public static final java.lang.String STDOUT_FILENAME
Names for the output files

See Also:
Constant Field Values

PROC_NAMES

public static final java.lang.String[] PROC_NAMES
The processes we need to run and related information


PROC_FILES

public static final java.lang.String[] PROC_FILES
The processes we need to run and related information


IMG_CLASSPATH

public static final java.lang.String IMG_CLASSPATH
The path to the images

See Also:
Constant Field Values

INIT_CLASSPATH

public static final java.lang.String INIT_CLASSPATH
The path to the images

See Also:
Constant Field Values

PROPERTY_PREFIX

public static java.lang.String PROPERTY_PREFIX
The prefix of every property

Constructor Detail

JeditPoplog

public JeditPoplog(org.gjt.sp.jedit.View v)
            throws java.io.IOException
The constructor. This just calls it's super constructor and sets the view given by jedit as its parent container

Parameters:
v - The View object passed from JEdit
Throws:
java.io.IOException
Method Detail

setStderrText

public void setStderrText(java.lang.String s)
Sets the stderr text value of the JeditPoplog object

Overrides:
setStderrText in class ProcessConsole
Parameters:
s - The new stderrText value

setStdoutText

public void setStdoutText(java.lang.String s)
Sets the stdout text value of the JeditPoplog object

Overrides:
setStdoutText in class ProcessConsole
Parameters:
s - The new stdoutText value

appendToStderr

public void appendToStderr(java.lang.String s)
DISABLED, any attempt at making this work kept messing up the Buffers whithin JEdit and sometimes even killed the process

Overrides:
appendToStderr in class ProcessConsole
Parameters:
s - The text to append

appendToStdout

public void appendToStdout(java.lang.String s)
DISABLED, any attempt at making this work kept messing up the Buffers whithin JEdit and sometimes even killed the process

Overrides:
appendToStdout in class ProcessConsole
Parameters:
s - The text to append

setStderrReader

public void setStderrReader(java.io.BufferedReader br)
Sets the stderr reader value of the JeditPoplog object

Overrides:
setStderrReader in class ProcessConsole
Parameters:
br - The new stderrReader value

setStdoutReader

public void setStdoutReader(java.io.BufferedReader br)
Sets the stdout reader value of the JeditPoplog object

Overrides:
setStdoutReader in class ProcessConsole
Parameters:
br - The new stdoutReader value

setProcessName

public void setProcessName(java.lang.String proc)
Sets the process to run

Overrides:
setProcessName in class ProcessConsole
Parameters:
proc - The new processName value

getStderrReader

public java.io.BufferedReader getStderrReader()
Gets the stderr reader value of the JeditPoplog object

Returns:
The stderrReader value

getStderrText

public java.lang.String getStderrText()
Gets the stderr text value of the JeditPoplog object

Overrides:
getStderrText in class ProcessConsole
Returns:
The stderrText value

getStdoutReader

public java.io.BufferedReader getStdoutReader()
Gets the stdout reader value of the JeditPoplog object

Returns:
The stdoutReader value

getStdoutText

public java.lang.String getStdoutText()
Gets the stdout text value of the JeditPoplog object

Overrides:
getStdoutText in class ProcessConsole
Returns:
The stdoutText value

getLogWindow

public LogWindow getLogWindow()
Gets the log window value of the JeditPoplog object

Returns:
The logWindow value

makeBuffer

public org.gjt.sp.jedit.Buffer makeBuffer(java.io.File f,
                                          boolean ro)
                                   throws java.io.IOException
Make and display a buffer for a file

Parameters:
f - The file
ro - true when file should be read only
Returns:
A Buffer for the file
Throws:
java.io.IOException - when something goes wrong

debug

public void debug(java.lang.String s)
Creates a debugging message in the log window and file

Specified by:
debug in class ProcessConsole
Parameters:
s - The message to log

reloadProperties

public void reloadProperties()
Reloads the properties for the object


handleMessage

public void handleMessage(org.gjt.sp.jedit.EBMessage msg)
This method deals with messages passed from JEdit via the EDitBus. This is used to keep stdout.p and stderr.p open at all times.

Specified by:
handleMessage in interface org.gjt.sp.jedit.EBComponent
Parameters:
msg - The message passed from JEdit

stdinTextChanged

public void stdinTextChanged()
This event is fired when the stdin gets changed

Specified by:
stdinTextChanged in class ProcessConsole

processKilled

public void processKilled()
Called when the process dies or is killed

Specified by:
processKilled in class ProcessConsole

processStarted

public void processStarted()
Event fired when the process is started

Specified by:
processStarted in class ProcessConsole

stderrPaneRequestFocus

public void stderrPaneRequestFocus()
When the text of a buffer changes the stderrTextChanged() event calls this

Overrides:
stderrPaneRequestFocus in class ProcessConsole

stderrTextChanged

public void stderrTextChanged()
Event activated when the text in the stderr file is changed

Specified by:
stderrTextChanged in class ProcessConsole

stdoutPaneRequestFocus

public void stdoutPaneRequestFocus()
When the text of a buffer changes the stdoutTextChanged() event calls this

Overrides:
stdoutPaneRequestFocus in class ProcessConsole

stdoutTextChanged

public void stdoutTextChanged()
Event activated when the text in the stdout file is changed

Specified by:
stdoutTextChanged in class ProcessConsole

buttonMouseEntered

public void buttonMouseEntered(javax.swing.JButton jb)
Called when a button has the mouse over it

Parameters:
jb - The button in question

buttonMouseExited

public void buttonMouseExited(javax.swing.JButton jb)
Called when a button has the mouse taken away from over it

Parameters:
jb - The button in question

processListActionPerformed

public void processListActionPerformed()
Event manager: When a selection is made from the processes list


spawnProcessButtonActionPerformed

public void spawnProcessButtonActionPerformed()
Event manager: When the spawn process button is clicked


respawnProcessButtonActionPerformed

public void respawnProcessButtonActionPerformed()
Event manager: When the respawn process button is clicked


killProcessButtonActionPerformed

public void killProcessButtonActionPerformed()
Event manager: When the kill process button is clicked


compileScratchPadButtonActionPerformed

public void compileScratchPadButtonActionPerformed()
Event manager: When the compile scratchpad button is clicked


compileSelectedTextButtonActionPerformed

public void compileSelectedTextButtonActionPerformed()
Event manager: When the compile selected text button is clicked


compileCurrentLineButtonActionPerformed

public void compileCurrentLineButtonActionPerformed()
Event manager: When the compile current line button is clicked


compileFileButtonActionPerformed

public void compileFileButtonActionPerformed()
Event manager: When the compile file button is clicked


compileCurrentFileButtonActionPerformed

public void compileCurrentFileButtonActionPerformed()
Event manager: When the compile current file button is clicked


compileCurrentBufferButtonActionPerformed

public void compileCurrentBufferButtonActionPerformed()
Event manager: When the compile current buffer button is clicked


compileClipboardContentsButtonActionPerformed

public void compileClipboardContentsButtonActionPerformed()
Event manager: When the compile clipboard button is clicked


clearScratchPadButtonActionPerformed

public void clearScratchPadButtonActionPerformed()
Event manager: When the clear scratchpad button is clicked


openHelpButtonActionPerformed

public void openHelpButtonActionPerformed()
Event manager: When the help button is clicked


openDocBrowserButtonActionPerformed

public void openDocBrowserButtonActionPerformed()
Event manager: When the doc browser button is clicked


sendSelectedTextToScratchPadButtonActionPerformed

public void sendSelectedTextToScratchPadButtonActionPerformed()
Event manager: When the send selected text to scratchpad button is clicked


sendCurrentLineToScratchPadButtonActionPerformed

public void sendCurrentLineToScratchPadButtonActionPerformed()
Event manager: When the send current line to scratchpad button is clicked


sendClipboardContentsToScratchPadButtonActionPerformed

public void sendClipboardContentsToScratchPadButtonActionPerformed()
Event manager: When the send clipboard to scratchpad button is clicked


makeOutputPanes

protected void makeOutputPanes()
Overriden to stop the program making output panes. Could contain the code to create the JEdit buffers, but the problem with that is that this gets called way before the Buffers are made

Overrides:
makeOutputPanes in class ProcessConsole