All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.editor.HTMLEditor

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----jp.kyasu.awt.KContainer
                           |
                           +----jp.kyasu.awt.EventProxyContainer
                                   |
                                   +----jp.kyasu.awt.TextComponent
                                           |
                                           +----jp.kyasu.editor.TextEditor
                                                   |
                                                   +----jp.kyasu.editor.RichTextEditor
                                                           |
                                                           +----jp.kyasu.editor.HTMLEditor

public class HTMLEditor
extends RichTextEditor
A HTMLEditor object is a multi-line area that displays text. It is suited for editing HTML documents. It is created with tool bar.

Version:
19 Dec 1998
Author:
Kazuki YASUMATSU

Variable Index

 o A_ANCHOR
 o A_BACKWARD
 o A_DOC_TITLE
 o A_FORWARD
 o A_LINK
 o A_OLIST
 o A_RELOAD
 o A_STOP
 o A_ULIST
 o I_LINK
 o I_OLIST
 o I_ULIST
 o L_FIXED
 o L_L_STYLE
 o L_M_STYLE
 o L_PARA_STYLE
 o L_S_STYLE
 o L_VARIABLE
 o L_VL_STYLE
 o MAX_HISTORY
 o P_BACKGROUND
 o P_FOREGROUND
 o P_TITLE
 o P_URL

Constructor Index

 o HTMLEditor()
Constructs a new html text area with tool bar.
 o HTMLEditor(boolean)
Constructs a new html text area with tool bar.
 o HTMLEditor(int, int)
Constructs a new html text area with tool bar, with the specified number of rows and columns.
 o HTMLEditor(int, int, boolean)
Constructs a new html text area with tool bar, with the specified number of rows and columns.
 o HTMLEditor(int, int, boolean, ActionListener, ActionListener, ActionListener)
Constructs a new html text area with tool bar, with the specified number of rows and columns.

Method Index

 o actionPerformed(ActionEvent)
Invoked when an action occurs.
 o backward_page()
Goes to the previouse page.
 o clear_list()
Clears the selected paragraph as a list.
 o clear_ordered_list()
Clears the selected paragraph as an ordered list.
 o decrease_indent()
Decreases the selected paragraph indentation.
 o delete_link()
Deletes a link from the selected text.
 o disableSubComps()
Disables sub components.
 o disableSubComps(boolean)
Disables sub components.
 o edit_document_property()
Edits the document property.
 o enableSubComps()
Enables sub components.
 o enableSubComps(boolean)
Enables sub components.
 o forward_page()
Goes to the next page.
 o getAllAnchorNames()
Returns the names of all target anchors (references) in this html document.
 o getAnchorIndex(String)
Returns the index of the specified target anchor (reference) in this html document.
 o getHTMLStyle()
Returns the html style of this text component.
 o getHTMLText()
Returns the html text of this text component.
 o getLinkColor()
Returns the link color of this text component.
 o getTitle()
Returns the title of this text component.
 o getURL()
Returns the url of this text component.
 o goto_page(ActionEvent)
Goes to the page with the specified url action.
 o goto_page(String)
Goes to the page with the specified url string.
 o goto_page(URL)
Goes to the page with the specified url.
 o increase_indent()
Increases the selected paragraph indentation.
 o insert_anchor()
Inserts an anchor.
 o insert_anchor(ActionEvent)
Inserts an anchor with the specified target event into the selected text.
 o insert_anchor(String)
Inserts an anchor with the specified target string.
 o insert_link()
Inserts a link into the selected text.
 o insert_link(ActionEvent)
Inserts a link with the specified url event into the selected text.
 o insert_link(String)
Inserts a link with the specified url string into the selected text.
 o itemStateChanged(ItemEvent)
Invoked when an item's state has been changed.
 o main(String[])
Executes the examples.
 o make_font_large()
Makes the selected text large.
 o make_font_small()
Makes the selected text small.
 o make_list()
Makes the selected paragraph as a list.
 o make_ordered_list()
Makes the selected paragraph as an ordered list.
 o open_file()
Opens the new file.
 o open_file(File)
Opens the specified file.
 o print_file()
Prints the file.
 o reload_page()
Reloads the current page.
 o save_file()
Saves the text into the file.
 o save_file_as(File)
Saves the text into the specified file.
 o saveAsHTML(File)
Saves the contents of this component as a HTML into the specified file.
 o set_paragraph_style(String)
Sets the paragraph style named by the specified name.
 o setBackground(Color)
Sets the background color of this text component to be the specified color.
 o setForeground(Color)
Sets the foreground color of this text component to be the specified color.
 o setHTMLStyle(HTMLStyle)
Sets the html style of this html document to be the specified style.
 o setHTMLText(HTMLText)
Sets the html text of this text component.
 o setLinkActionListener(ActionListener)
Sets the action listener for the link to the specified listener.
 o setLinkColor(Color)
Sets the link color of this text component to be the specified color.
 o setRichText(RichText)
Sets the html text of this text component.
 o setText(String)
Sets the string of this text component.
 o setTEXT(Text)
Sets the string of this text component.
 o setTitle(String)
Sets the title of this text component to be the specified string.
 o setURL(URL)
Sets the url of this text component to be the specified url.
 o stop_loading()
Stops the loading.
 o textPositionChanged(TextPositionEvent)
Invoked when the position of the text has changed.

Variables

 o MAX_HISTORY
 public static final int MAX_HISTORY
 o L_PARA_STYLE
 public static final String L_PARA_STYLE
 o L_VARIABLE
 public static final String L_VARIABLE
 o L_FIXED
 public static final String L_FIXED
 o L_S_STYLE
 public static final String L_S_STYLE
 o L_M_STYLE
 public static final String L_M_STYLE
 o L_L_STYLE
 public static final String L_L_STYLE
 o L_VL_STYLE
 public static final String L_VL_STYLE
 o I_LINK
 public static final String I_LINK
 o I_ULIST
 public static final String I_ULIST
 o I_OLIST
 public static final String I_OLIST
 o A_LINK
 public static final String A_LINK
 o A_ULIST
 public static final String A_ULIST
 o A_OLIST
 public static final String A_OLIST
 o A_ANCHOR
 public static final String A_ANCHOR
 o A_FORWARD
 public static final String A_FORWARD
 o A_BACKWARD
 public static final String A_BACKWARD
 o A_STOP
 public static final String A_STOP
 o A_RELOAD
 public static final String A_RELOAD
 o A_DOC_TITLE
 public static final String A_DOC_TITLE
 o P_URL
 public static final String P_URL
 o P_TITLE
 public static final String P_TITLE
 o P_BACKGROUND
 public static final String P_BACKGROUND
 o P_FOREGROUND
 public static final String P_FOREGROUND

Constructors

 o HTMLEditor
 public HTMLEditor()
Constructs a new html text area with tool bar. This html text area is created with vertical scroll bar.

 o HTMLEditor
 public HTMLEditor(boolean showToolBar)
Constructs a new html text area with tool bar. If showToolBar is true, then shows the tool bar initially; otherwise hides. This html text area is created with vertical scroll bar.

Parameters:
showToolBar - if true, then shows the tool bar initially; otherwise hides.
 o HTMLEditor
 public HTMLEditor(int rows,
                   int columns)
Constructs a new html text area with tool bar, with the specified number of rows and columns. This html text area is created with vertical scroll bar.

Parameters:
rows - the number of rows
columns - the number of columns.
 o HTMLEditor
 public HTMLEditor(int rows,
                   int columns,
                   boolean showToolBar)
Constructs a new html text area with tool bar, with the specified number of rows and columns. If showToolBar is true, then shows the tool bar initially; otherwise hidden. This html text area is created with vertical scroll bar.

Parameters:
rows - the number of rows
columns - the number of columns.
showToolBar - if true, then shows the tool bar initially; otherwise hides.
 o HTMLEditor
 public HTMLEditor(int rows,
                   int columns,
                   boolean showToolBar,
                   ActionListener openActionListener,
                   ActionListener saveActionListener,
                   ActionListener printActionListener)
Constructs a new html text area with tool bar, with the specified number of rows and columns. If showToolBar is true, then shows the tool bar initially; otherwise hidden. This html text area is created with vertical scroll bar.

Parameters:
rows - the number of rows
columns - the number of columns.
showToolBar - if true, then shows the tool bar initially; otherwise hides.
openActionListener - the action listener that receives action events from the open button in tool bar.
saveActionListener - the action listener that receives action events from the save button in tool bar.
printActionListener - the action listener that receives action events from the print button in tool bar.

Methods

 o setForeground
 public void setForeground(Color color)
Sets the foreground color of this text component to be the specified color.

Overrides:
setForeground in class TextComponent
 o setBackground
 public void setBackground(Color color)
Sets the background color of this text component to be the specified color.

Overrides:
setBackground in class TextComponent
 o setText
 public void setText(String str)
Sets the string of this text component. This operation is not allowed.

Overrides:
setText in class TextEditor
 o setTEXT
 public void setTEXT(Text text)
Sets the string of this text component. This operation is not allowed.

Overrides:
setTEXT in class TextEditor
 o setRichText
 public void setRichText(RichText rtext)
Sets the html text of this text component. This operation is not allowed.

Overrides:
setRichText in class TextEditor
 o setLinkActionListener
 public void setLinkActionListener(ActionListener l)
Sets the action listener for the link to the specified listener.

 o getHTMLText
 public HTMLText getHTMLText()
Returns the html text of this text component.

See Also:
setHTMLText
 o setHTMLText
 public void setHTMLText(HTMLText htmlText)
Sets the html text of this text component.

See Also:
getHTMLText
 o getHTMLStyle
 public HTMLStyle getHTMLStyle()
Returns the html style of this text component.

 o setHTMLStyle
 public void setHTMLStyle(HTMLStyle htmlStyle)
Sets the html style of this html document to be the specified style.

 o getURL
 public URL getURL()
Returns the url of this text component.

 o setURL
 public void setURL(URL url)
Sets the url of this text component to be the specified url.

 o getTitle
 public String getTitle()
Returns the title of this text component.

 o setTitle
 public void setTitle(String title)
Sets the title of this text component to be the specified string.

 o getLinkColor
 public Color getLinkColor()
Returns the link color of this text component.

 o setLinkColor
 public void setLinkColor(Color color)
Sets the link color of this text component to be the specified color.

 o getAllAnchorNames
 public String[] getAllAnchorNames()
Returns the names of all target anchors (references) in this html document.

 o getAnchorIndex
 public int getAnchorIndex(String name)
Returns the index of the specified target anchor (reference) in this html document.

Parameters:
name - the name of the target anchor (reference).
Returns:
the index of the target anchor (reference); or -1 if the target anchor (reference) does not exist.
 o disableSubComps
 public void disableSubComps()
Disables sub components.

Overrides:
disableSubComps in class TextEditor
See Also:
enableSubComps, disableSubComps
 o disableSubComps
 public synchronized void disableSubComps(boolean withStop)
Disables sub components.

Parameters:
withStop - if true, updates the stop button state.
See Also:
disableSubComps
 o enableSubComps
 public void enableSubComps()
Enables sub components.

Overrides:
enableSubComps in class TextEditor
See Also:
disableSubComps, enableSubComps
 o enableSubComps
 public synchronized void enableSubComps(boolean withStop)
Enables sub components.

Parameters:
withStop - if true, updates the stop button state.
See Also:
enableSubComps
 o actionPerformed
 public void actionPerformed(ActionEvent e)
Invoked when an action occurs.

Overrides:
actionPerformed in class RichTextEditor
See Also:
ActionListener
 o itemStateChanged
 public void itemStateChanged(ItemEvent e)
Invoked when an item's state has been changed.

Overrides:
itemStateChanged in class RichTextEditor
See Also:
ItemListener
 o textPositionChanged
 public void textPositionChanged(TextPositionEvent te)
Invoked when the position of the text has changed.

Overrides:
textPositionChanged in class TextEditor
See Also:
TextPositionListener
 o print_file
 public void print_file()
Prints the file.

Overrides:
print_file in class TextEditor
 o insert_link
 public void insert_link()
Inserts a link into the selected text.

 o insert_link
 public void insert_link(String urlString)
Inserts a link with the specified url string into the selected text.

 o insert_link
 public void insert_link(ActionEvent e)
Inserts a link with the specified url event into the selected text.

 o delete_link
 public void delete_link()
Deletes a link from the selected text.

 o make_font_large
 public void make_font_large()
Makes the selected text large.

Overrides:
make_font_large in class RichTextEditor
 o make_font_small
 public void make_font_small()
Makes the selected text small.

Overrides:
make_font_small in class RichTextEditor
 o set_paragraph_style
 public void set_paragraph_style(String name)
Sets the paragraph style named by the specified name.

 o make_list
 public void make_list()
Makes the selected paragraph as a list.

 o clear_list
 public void clear_list()
Clears the selected paragraph as a list.

 o make_ordered_list
 public void make_ordered_list()
Makes the selected paragraph as an ordered list.

 o clear_ordered_list
 public void clear_ordered_list()
Clears the selected paragraph as an ordered list.

 o increase_indent
 public void increase_indent()
Increases the selected paragraph indentation.

 o decrease_indent
 public void decrease_indent()
Decreases the selected paragraph indentation.

 o insert_anchor
 public void insert_anchor()
Inserts an anchor.

 o insert_anchor
 public void insert_anchor(String target)
Inserts an anchor with the specified target string.

 o insert_anchor
 public void insert_anchor(ActionEvent e)
Inserts an anchor with the specified target event into the selected text.

 o goto_page
 public void goto_page(URL url)
Goes to the page with the specified url.

 o goto_page
 public void goto_page(String urlString)
Goes to the page with the specified url string.

 o goto_page
 public void goto_page(ActionEvent e)
Goes to the page with the specified url action.

 o reload_page
 public void reload_page()
Reloads the current page.

 o forward_page
 public void forward_page()
Goes to the next page.

 o backward_page
 public void backward_page()
Goes to the previouse page.

 o stop_loading
 public void stop_loading()
Stops the loading.

 o edit_document_property
 public void edit_document_property()
Edits the document property.

 o open_file
 public void open_file()
Opens the new file.

Overrides:
open_file in class TextEditor
 o open_file
 public void open_file(File file)
Opens the specified file.

Overrides:
open_file in class TextEditor
 o save_file
 public void save_file()
Saves the text into the file.

Overrides:
save_file in class TextEditor
 o save_file_as
 public void save_file_as(File file)
Saves the text into the specified file.

Overrides:
save_file_as in class TextEditor
 o saveAsHTML
 public boolean saveAsHTML(File file)
Saves the contents of this component as a HTML into the specified file.

Parameters:
file - the file to be saved into.
Returns:
true if the saving was succeeded.
 o main
 public static void main(String args[])
Executes the examples.


All Packages  Class Hierarchy  This Package  Previous  Next  Index