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
-
A_ANCHOR
-
-
A_BACKWARD
-
-
A_DOC_TITLE
-
-
A_FORWARD
-
-
A_LINK
-
-
A_OLIST
-
-
A_RELOAD
-
-
A_STOP
-
-
A_ULIST
-
-
I_LINK
-
-
I_OLIST
-
-
I_ULIST
-
-
L_FIXED
-
-
L_L_STYLE
-
-
L_M_STYLE
-
-
L_PARA_STYLE
-
-
L_S_STYLE
-
-
L_VARIABLE
-
-
L_VL_STYLE
-
-
MAX_HISTORY
-
-
P_BACKGROUND
-
-
P_FOREGROUND
-
-
P_TITLE
-
-
P_URL
-
-
HTMLEditor()
- Constructs a new html text area with tool bar.
-
HTMLEditor(boolean)
- Constructs a new html text area with tool bar.
-
HTMLEditor(int, int)
- Constructs a new html text area with tool bar, with the specified
number of rows and columns.
-
HTMLEditor(int, int, boolean)
- Constructs a new html text area with tool bar, with the specified
number of rows and columns.
-
HTMLEditor(int, int, boolean, ActionListener, ActionListener, ActionListener)
- Constructs a new html text area with tool bar, with the specified
number of rows and columns.
-
actionPerformed(ActionEvent)
- Invoked when an action occurs.
-
backward_page()
- Goes to the previouse page.
-
clear_list()
- Clears the selected paragraph as a list.
-
clear_ordered_list()
- Clears the selected paragraph as an ordered list.
-
decrease_indent()
- Decreases the selected paragraph indentation.
-
delete_link()
- Deletes a link from the selected text.
-
disableSubComps()
- Disables sub components.
-
disableSubComps(boolean)
- Disables sub components.
-
edit_document_property()
- Edits the document property.
-
enableSubComps()
- Enables sub components.
-
enableSubComps(boolean)
- Enables sub components.
-
forward_page()
- Goes to the next page.
-
getAllAnchorNames()
- Returns the names of all target anchors (references) in this html
document.
-
getAnchorIndex(String)
- Returns the index of the specified target anchor (reference) in this
html document.
-
getHTMLStyle()
- Returns the html style of this text component.
-
getHTMLText()
- Returns the html text of this text component.
-
getLinkColor()
- Returns the link color of this text component.
-
getTitle()
- Returns the title of this text component.
-
getURL()
- Returns the url of this text component.
-
goto_page(ActionEvent)
- Goes to the page with the specified url action.
-
goto_page(String)
- Goes to the page with the specified url string.
-
goto_page(URL)
- Goes to the page with the specified url.
-
increase_indent()
- Increases the selected paragraph indentation.
-
insert_anchor()
- Inserts an anchor.
-
insert_anchor(ActionEvent)
- Inserts an anchor with the specified target event into the selected text.
-
insert_anchor(String)
- Inserts an anchor with the specified target string.
-
insert_link()
- Inserts a link into the selected text.
-
insert_link(ActionEvent)
- Inserts a link with the specified url event into the selected text.
-
insert_link(String)
- Inserts a link with the specified url string into the selected text.
-
itemStateChanged(ItemEvent)
- Invoked when an item's state has been changed.
-
main(String[])
- Executes the examples.
-
make_font_large()
- Makes the selected text large.
-
make_font_small()
- Makes the selected text small.
-
make_list()
- Makes the selected paragraph as a list.
-
make_ordered_list()
- Makes the selected paragraph as an ordered list.
-
open_file()
- Opens the new file.
-
open_file(File)
- Opens the specified file.
-
print_file()
- Prints the file.
-
reload_page()
- Reloads the current page.
-
save_file()
- Saves the text into the file.
-
save_file_as(File)
- Saves the text into the specified file.
-
saveAsHTML(File)
- Saves the contents of this component as a HTML into the specified file.
-
set_paragraph_style(String)
- Sets the paragraph style named by the specified name.
-
setBackground(Color)
- Sets the background color of this text component to be the specified
color.
-
setForeground(Color)
- Sets the foreground color of this text component to be the specified
color.
-
setHTMLStyle(HTMLStyle)
- Sets the html style of this html document to be the specified style.
-
setHTMLText(HTMLText)
- Sets the html text of this text component.
-
setLinkActionListener(ActionListener)
- Sets the action listener for the link to the specified listener.
-
setLinkColor(Color)
- Sets the link color of this text component to be the specified color.
-
setRichText(RichText)
- Sets the html text of this text component.
-
setText(String)
- Sets the string of this text component.
-
setTEXT(Text)
- Sets the string of this text component.
-
setTitle(String)
- Sets the title of this text component to be the specified string.
-
setURL(URL)
- Sets the url of this text component to be the specified url.
-
stop_loading()
- Stops the loading.
-
textPositionChanged(TextPositionEvent)
- Invoked when the position of the text has changed.
MAX_HISTORY
public static final int MAX_HISTORY
L_PARA_STYLE
public static final String L_PARA_STYLE
L_VARIABLE
public static final String L_VARIABLE
L_FIXED
public static final String L_FIXED
L_S_STYLE
public static final String L_S_STYLE
L_M_STYLE
public static final String L_M_STYLE
L_L_STYLE
public static final String L_L_STYLE
L_VL_STYLE
public static final String L_VL_STYLE
I_LINK
public static final String I_LINK
I_ULIST
public static final String I_ULIST
I_OLIST
public static final String I_OLIST
A_LINK
public static final String A_LINK
A_ULIST
public static final String A_ULIST
A_OLIST
public static final String A_OLIST
A_ANCHOR
public static final String A_ANCHOR
A_FORWARD
public static final String A_FORWARD
A_BACKWARD
public static final String A_BACKWARD
A_STOP
public static final String A_STOP
A_RELOAD
public static final String A_RELOAD
A_DOC_TITLE
public static final String A_DOC_TITLE
P_URL
public static final String P_URL
P_TITLE
public static final String P_TITLE
P_BACKGROUND
public static final String P_BACKGROUND
P_FOREGROUND
public static final String P_FOREGROUND
HTMLEditor
public HTMLEditor()
- Constructs a new html text area with tool bar.
This html text area is created with vertical scroll bar.
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.
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.
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.
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.
setForeground
public void setForeground(Color color)
- Sets the foreground color of this text component to be the specified
color.
- Overrides:
- setForeground in class TextComponent
setBackground
public void setBackground(Color color)
- Sets the background color of this text component to be the specified
color.
- Overrides:
- setBackground in class TextComponent
setText
public void setText(String str)
- Sets the string of this text component.
This operation is not allowed.
- Overrides:
- setText in class TextEditor
setTEXT
public void setTEXT(Text text)
- Sets the string of this text component.
This operation is not allowed.
- Overrides:
- setTEXT in class TextEditor
setRichText
public void setRichText(RichText rtext)
- Sets the html text of this text component.
This operation is not allowed.
- Overrides:
- setRichText in class TextEditor
setLinkActionListener
public void setLinkActionListener(ActionListener l)
- Sets the action listener for the link to the specified listener.
getHTMLText
public HTMLText getHTMLText()
- Returns the html text of this text component.
- See Also:
- setHTMLText
setHTMLText
public void setHTMLText(HTMLText htmlText)
- Sets the html text of this text component.
- See Also:
- getHTMLText
getHTMLStyle
public HTMLStyle getHTMLStyle()
- Returns the html style of this text component.
setHTMLStyle
public void setHTMLStyle(HTMLStyle htmlStyle)
- Sets the html style of this html document to be the specified style.
getURL
public URL getURL()
- Returns the url of this text component.
setURL
public void setURL(URL url)
- Sets the url of this text component to be the specified url.
getTitle
public String getTitle()
- Returns the title of this text component.
setTitle
public void setTitle(String title)
- Sets the title of this text component to be the specified string.
getLinkColor
public Color getLinkColor()
- Returns the link color of this text component.
setLinkColor
public void setLinkColor(Color color)
- Sets the link color of this text component to be the specified color.
getAllAnchorNames
public String[] getAllAnchorNames()
- Returns the names of all target anchors (references) in this html
document.
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.
disableSubComps
public void disableSubComps()
- Disables sub components.
- Overrides:
- disableSubComps in class TextEditor
- See Also:
- enableSubComps, disableSubComps
disableSubComps
public synchronized void disableSubComps(boolean withStop)
- Disables sub components.
- Parameters:
- withStop - if true, updates the stop button state.
- See Also:
- disableSubComps
enableSubComps
public void enableSubComps()
- Enables sub components.
- Overrides:
- enableSubComps in class TextEditor
- See Also:
- disableSubComps, enableSubComps
enableSubComps
public synchronized void enableSubComps(boolean withStop)
- Enables sub components.
- Parameters:
- withStop - if true, updates the stop button state.
- See Also:
- enableSubComps
actionPerformed
public void actionPerformed(ActionEvent e)
- Invoked when an action occurs.
- Overrides:
- actionPerformed in class RichTextEditor
- See Also:
- ActionListener
itemStateChanged
public void itemStateChanged(ItemEvent e)
- Invoked when an item's state has been changed.
- Overrides:
- itemStateChanged in class RichTextEditor
- See Also:
- ItemListener
textPositionChanged
public void textPositionChanged(TextPositionEvent te)
- Invoked when the position of the text has changed.
- Overrides:
- textPositionChanged in class TextEditor
- See Also:
- TextPositionListener
print_file
public void print_file()
- Prints the file.
- Overrides:
- print_file in class TextEditor
insert_link
public void insert_link()
- Inserts a link into the selected text.
insert_link
public void insert_link(String urlString)
- Inserts a link with the specified url string into the selected text.
insert_link
public void insert_link(ActionEvent e)
- Inserts a link with the specified url event into the selected text.
delete_link
public void delete_link()
- Deletes a link from the selected text.
make_font_large
public void make_font_large()
- Makes the selected text large.
- Overrides:
- make_font_large in class RichTextEditor
make_font_small
public void make_font_small()
- Makes the selected text small.
- Overrides:
- make_font_small in class RichTextEditor
set_paragraph_style
public void set_paragraph_style(String name)
- Sets the paragraph style named by the specified name.
make_list
public void make_list()
- Makes the selected paragraph as a list.
clear_list
public void clear_list()
- Clears the selected paragraph as a list.
make_ordered_list
public void make_ordered_list()
- Makes the selected paragraph as an ordered list.
clear_ordered_list
public void clear_ordered_list()
- Clears the selected paragraph as an ordered list.
increase_indent
public void increase_indent()
- Increases the selected paragraph indentation.
decrease_indent
public void decrease_indent()
- Decreases the selected paragraph indentation.
insert_anchor
public void insert_anchor()
- Inserts an anchor.
insert_anchor
public void insert_anchor(String target)
- Inserts an anchor with the specified target string.
insert_anchor
public void insert_anchor(ActionEvent e)
- Inserts an anchor with the specified target event into the selected text.
goto_page
public void goto_page(URL url)
- Goes to the page with the specified url.
goto_page
public void goto_page(String urlString)
- Goes to the page with the specified url string.
goto_page
public void goto_page(ActionEvent e)
- Goes to the page with the specified url action.
reload_page
public void reload_page()
- Reloads the current page.
forward_page
public void forward_page()
- Goes to the next page.
backward_page
public void backward_page()
- Goes to the previouse page.
stop_loading
public void stop_loading()
- Stops the loading.
edit_document_property
public void edit_document_property()
- Edits the document property.
open_file
public void open_file()
- Opens the new file.
- Overrides:
- open_file in class TextEditor
open_file
public void open_file(File file)
- Opens the specified file.
- Overrides:
- open_file in class TextEditor
save_file
public void save_file()
- Saves the text into the file.
- Overrides:
- save_file in class TextEditor
save_file_as
public void save_file_as(File file)
- Saves the text into the specified file.
- Overrides:
- save_file_as in class TextEditor
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.
main
public static void main(String args[])
- Executes the examples.
All Packages Class Hierarchy This Package Previous Next Index