Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Class EditorController  view EditorController download

  extended byopenfuture.editxml.applet.AbsController
      extended byopenfuture.editxml.applet.EditorController
All Implemented Interfaces:
java.awt.event.ActionListener, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.event.ItemListener, java.awt.event.KeyListener, javax.swing.event.ListSelectionListener

public class EditorController
extends AbsController
implements java.awt.event.KeyListener, javax.swing.event.ChangeListener

Controller for the XML editors.

Created: Sun Jul 08 21:24:03 2001

$Revision: 1.4 $

Field Summary
private  RootController parentController
private  MainPanel parentPanel
private  javax.swing.undo.UndoManager undo
Fields inherited from class openfuture.editxml.applet.AbsController
Constructor Summary
EditorController(MainPanel parentPanel, java.util.ResourceBundle resourceBundle, RootController parentController)
          Creates a new EditorController instance.
Method Summary
static java.lang.String extractHtmlBody(java.lang.String text)
          Extract the text from a HTML document contained inside the <body> tag.
 RootController getParentController()
          Get the value of parentController.
 MainPanel getParentPanel()
          Get the value of parentPanel.
(package private)  void handleEvents(java.util.EventObject event, java.lang.Object source, java.lang.String name)
          Central event handler.
protected  void insertHtml(java.lang.String text, int advance)
          Inserts an HTML fragment at the current selection.
 void keyPressed(java.awt.event.KeyEvent e)
          Does nothing.
 void keyReleased(java.awt.event.KeyEvent e)
          Refresh the display.
 void keyTyped(java.awt.event.KeyEvent e)
          Does nothing.
 void setParentController(RootController v)
          Set the value of parentController.
 void setParentPanel(MainPanel v)
          Set the value of parentPanel.
 void stateChanged(javax.swing.event.ChangeEvent ce)
          Recognize, if the panel selection changes.
protected  void updateHtmlEditor()
          Update the content of the HTML editor
protected  void updateTextEditor()
          Update the content of the text editor
protected  void wrapTag(java.lang.String tag, java.lang.String attributes)
          Wrap an HTML tag around the current selection.
Methods inherited from class openfuture.editxml.applet.AbsController
actionPerformed, focusGained, focusLost, getIgnoreEvents, getResourceBundle, getView, init, itemStateChanged, setIgnoreEvents, setResourceBundle, setView, showError, showError, showMessage, showMessage, valueChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


private RootController parentController


private MainPanel parentPanel


private javax.swing.undo.UndoManager undo
Constructor Detail


public EditorController(MainPanel parentPanel,
                        java.util.ResourceBundle resourceBundle,
                        RootController parentController)
Creates a new EditorController instance.

Method Detail


public void stateChanged(javax.swing.event.ChangeEvent ce)
Recognize, if the panel selection changes.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener


public void keyTyped(java.awt.event.KeyEvent e)
Does nothing.

Specified by:
keyTyped in interface java.awt.event.KeyListener


public void keyPressed(java.awt.event.KeyEvent e)
Does nothing.

Specified by:
keyPressed in interface java.awt.event.KeyListener


public void keyReleased(java.awt.event.KeyEvent e)
Refresh the display. Actually calls MainPanel.refreshView() 55

Specified by:
keyReleased in interface java.awt.event.KeyListener


void handleEvents(java.util.EventObject event,
                  java.lang.Object source,
                  java.lang.String name)
Central event handler. Handles all events from the task bar. All other events are redirected to getParentController() 55 .

Specified by:
handleEvents in class AbsController


public static java.lang.String extractHtmlBody(java.lang.String text)
Extract the text from a HTML document contained inside the <body> tag.


protected void updateHtmlEditor()
Update the content of the HTML editor


protected void updateTextEditor()
Update the content of the text editor


protected void wrapTag(java.lang.String tag,
                       java.lang.String attributes)
Wrap an HTML tag around the current selection. If nothing is selected, nothing happens. This action is applied to the text editor 55 of the main panel.


protected void insertHtml(java.lang.String text,
                          int advance)
Inserts an HTML fragment at the current selection. This action is applied to the text editor 55 of the main panel.


public RootController getParentController()
Get the value of parentController.


public void setParentController(RootController v)
Set the value of parentController.


public MainPanel getParentPanel()
Get the value of parentPanel.


public void setParentPanel(MainPanel v)
Set the value of parentPanel.