|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
com.tecnick.jxhtmledit.JXHTMLedit
public class JXHTMLedit
WYSIWYG XHTML Editor
Java Applet to edit XHTML in WYSIWYG mode.
Copyright (c) 2002-2006 Tecnick.com S.r.l (www.tecnick.com) Via Ugo
Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com -
info@tecnick.com
Project homepage: http://jxhtmledit.sourceforge.net
License: http://www.gnu.org/copyleft/gpl.html GPL 2
Nested Class Summary | |
---|---|
(package private) class |
JXHTMLedit.RedoAction
class to handle REDO action |
(package private) class |
JXHTMLedit.tableIndex
Class to store caret position of table elements |
(package private) class |
JXHTMLedit.TabListener
Listener Class to switch between WYISWIG and HTML SOURCE tab editors |
(package private) class |
JXHTMLedit.UndoAction
class to handle UNDO action |
Nested classes/interfaces inherited from class javax.swing.JApplet |
---|
javax.swing.JApplet.AccessibleJApplet |
Nested classes/interfaces inherited from class java.applet.Applet |
---|
java.applet.Applet.AccessibleApplet |
Nested classes/interfaces inherited from class java.awt.Panel |
---|
java.awt.Panel.AccessibleAWTPanel |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private java.lang.String[] |
attribute_string_array
the following will contain the string attribute to attach on tag |
private boolean |
auto_li_enabled
enable auto |
private javax.swing.JCheckBox |
autobreak
checkbox to enable/disable the auto mode |
private javax.swing.JCheckBox |
autoListItem
checkbox to enable/disable the auto mode |
private boolean |
br_state_editor
remember auto settings for editor |
private boolean |
br_state_source
remember auto settings for source editor |
private java.util.ArrayList |
buttonActionListener
ActionListener array for buttons |
private java.lang.String |
buttons_images_path
Applet parameter (param_buttons_images_path): path to buttons images directory (relative to document base) |
private java.lang.String |
config_files_path
Applet parameter (param_config_files_path): path configuration files directory (relative to document base) |
private JXHTMLConfig |
configuration
Configuration data. |
private javax.swing.JEditorPane |
current_editor
Selected Editor |
(package private) java.lang.String |
current_html_code
HTML source code to edit |
private javax.swing.JEditorPane |
editor
WYSIWYG editor pane |
private javax.swing.JEditorPane |
editsource
Source editor pane |
private java.lang.String |
encoding_in
Applet parameter (param_page_encoding): input page charset encoding |
private java.lang.String |
encoding_out
Applet parameter (param_encoding): charset encoding |
private java.lang.String |
images_list
Applet parameter (param_images_list): list of images in images_path directory separted by ":" |
private java.lang.String |
images_path
Applet parameter (param_images_path): absolute URI of images directory |
(package private) boolean |
isStandalone
This is an applet |
private java.lang.String |
jarpath
path to jar file |
private java.lang.String |
jxhtmledit_version
Software Version |
private java.awt.event.ActionListener |
openManufacturerSite
open manufacturer site on a new browser window |
private java.lang.String |
param_callingfield
Applet parameter (param_callingfield): name of the calling html textarea form field |
private java.lang.String |
param_callingform
Applet parameter (param_callingform): name of the calling html form |
private boolean |
param_entities_off
Applet parameter (param_entities_off): when true convert htmlentities to extended chars |
private boolean |
param_hide_source
Applet parameter (param_hide_source): if true hide source edit panel |
private boolean |
param_indent
Applet parameter (param_indent): when true indent XHTML output code |
private java.lang.String |
param_lang
ISO 639 language identifier (a two- or three-letter code) used on TMX files |
private boolean |
param_separate_window
Applet parameter (param_separate_window): true if applet is loaded in a separate browser window respect one containing the calling form field |
private java.lang.String |
param_stylesheet
Applet parameter (param_stylesheet): name of the default CSS stylesheet file |
private boolean |
param_xhtml
Applet parameter (param_xhtml): if true export (save) as XHTML instead of HTML |
private java.util.Stack |
redo_stack
Redo stack |
private JXHTMLedit.RedoAction |
redoAction
redo action |
private static long |
serialVersionUID
serialVersionUID |
private boolean |
source_mode
Set current edit mode: WYSIWYG/source |
private java.lang.String |
text_to_search
remember last search |
(package private) java.applet.Applet |
this_applet
"this" applet |
private static int |
undo_size
max undo operation size |
private java.util.Stack |
undo_stack
Undo stack |
private JXHTMLedit.UndoAction |
undoAction
undo action |
Fields inherited from class javax.swing.JApplet |
---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
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 | |
---|---|
JXHTMLedit()
|
Method Summary | |
---|---|
void |
about_this_applet()
display this software information dialog window |
private javax.swing.JComponent |
attribute_input_component(int input_type,
int attribute_index,
java.lang.String attribute_name,
java.lang.String attribute_values,
java.lang.String default_value,
javax.swing.ImageIcon attribute_icon,
javax.swing.JTextField parent_component)
return input component for tag attributes |
private javax.swing.JComponent |
attribute_input_component2(int input_type,
int attribute_index,
java.lang.String attribute_name,
java.lang.String attribute_start,
java.lang.String attribute_end,
java.lang.String attribute_values,
java.lang.String default_value,
javax.swing.ImageIcon attribute_icon,
javax.swing.JTextField parent_component)
return input component for tag attributes |
private javax.swing.JLabel |
attribute_label_component(java.lang.String attribute_name,
java.lang.String attribute_description,
int attribute_status,
java.lang.String status_name,
java.lang.String status_description)
create label for attribute input |
private JXHTMLedit.tableIndex |
createTableIndex()
Create table index (find caret start positions of each table element) |
private javax.swing.JButton |
customButton(java.lang.String name,
java.lang.String description,
java.lang.String icon,
java.lang.String intag,
java.lang.String outtag,
int action_id,
int keystroke,
int keymodifier)
Create a custom TAG button |
java.lang.String |
getCode()
Convenience method to get html code from javascript. |
private java.lang.String |
getCodeOnForm()
Get HTML code from calling form |
private javax.swing.ImageIcon |
getImageIcon(java.lang.String imgpath)
Get the ImageIcon object from file. |
private java.lang.String |
getParameter(java.lang.String key,
java.lang.String def)
Get the applet parameters from applet call and set default values for void parameters |
private void |
getParameters()
set the applet parameters (param) |
private javax.swing.JPanel |
info_panel()
Create a JButton that display JXHTMLEDIT infos and open tecnick.com site |
void |
init()
Initialize applet |
private javax.swing.JLabel |
input_label_component(java.lang.String name,
java.lang.String description)
create a formatted label with tooltip |
private void |
insertTag(java.lang.String intag,
java.lang.String outtag)
Insert open and close tag around selection or at caret position |
private void |
removeTag()
Remove selected or adjacent tag |
private void |
replaceTag(java.lang.String search_tag,
java.lang.String replace_tag)
Replace HTML tag on selection |
private void |
searchText(java.lang.String text_to_search)
find first occurence of specified text from current caret position |
void |
setCode(java.lang.String code)
Convenience method to set html code from javascript. |
private void |
setHTMLCode(java.lang.String html,
boolean update_source,
boolean update_undo)
Set the HTML code in the current editor pane |
private void |
setRedo(java.lang.String txt)
Add text objects to redo stack. |
private void |
setUndo(java.lang.String txt)
Add text objects to undo stack. |
Methods inherited from class javax.swing.JApplet |
---|
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, remove, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.applet.Applet |
---|
destroy, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop |
Methods inherited from class java.awt.Panel |
---|
addNotify |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, 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 |
---|
private static final long serialVersionUID
private java.lang.String jxhtmledit_version
private JXHTMLConfig configuration
boolean isStandalone
java.applet.Applet this_applet
private static final int undo_size
private java.util.Stack undo_stack
private java.util.Stack redo_stack
private java.lang.String jarpath
private javax.swing.JEditorPane editor
private javax.swing.JEditorPane editsource
private javax.swing.JEditorPane current_editor
private java.lang.String encoding_out
private java.lang.String encoding_in
private java.lang.String param_lang
private java.lang.String param_callingform
private java.lang.String param_callingfield
private java.lang.String param_stylesheet
private boolean param_hide_source
private boolean param_xhtml
private boolean param_indent
private boolean param_entities_off
private java.lang.String buttons_images_path
private java.lang.String config_files_path
private java.lang.String images_path
private java.lang.String images_list
private boolean param_separate_window
java.lang.String current_html_code
private JXHTMLedit.UndoAction undoAction
private JXHTMLedit.RedoAction redoAction
private boolean source_mode
private java.lang.String[] attribute_string_array
private boolean br_state_editor
private boolean br_state_source
private java.lang.String text_to_search
private boolean auto_li_enabled
private javax.swing.JCheckBox autoListItem
private javax.swing.JCheckBox autobreak
private java.util.ArrayList buttonActionListener
private java.awt.event.ActionListener openManufacturerSite
Constructor Detail |
---|
public JXHTMLedit()
Method Detail |
---|
private java.lang.String getParameter(java.lang.String key, java.lang.String def)
key
- name of param to getdef
- default value for void param
private void getParameters()
private void setHTMLCode(java.lang.String html, boolean update_source, boolean update_undo)
html
- HTML source code to write on documentupdate_source
- if true, then update source editorpublic void setCode(java.lang.String code)
code
- public java.lang.String getCode()
private void insertTag(java.lang.String intag, java.lang.String outtag)
intag
- open tag <tagname> or ""outtag
- close tag </tagname> or ""private void removeTag()
private void replaceTag(java.lang.String search_tag, java.lang.String replace_tag)
search_tag
- tag to replacereplace_tag
- new tagprivate JXHTMLedit.tableIndex createTableIndex()
private void searchText(java.lang.String text_to_search)
text_to_search
- text to searchprivate java.lang.String getCodeOnForm()
private javax.swing.JPanel info_panel()
public void about_this_applet()
private javax.swing.ImageIcon getImageIcon(java.lang.String imgpath)
imgpath
- image file path (inside jar or external URL)
public void init()
init
in class java.applet.Applet
private void setUndo(java.lang.String txt)
txt
- text to add.private void setRedo(java.lang.String txt)
txt
- text to add.private javax.swing.JLabel attribute_label_component(java.lang.String attribute_name, java.lang.String attribute_description, int attribute_status, java.lang.String status_name, java.lang.String status_description)
attribute_name
- attribute nameattribute_description
- attribute descriptionattribute_status
- status of attribute (0-4) for displaying different colorsstatus_name
- status namestatus_description
- status description
private javax.swing.JComponent attribute_input_component(int input_type, int attribute_index, java.lang.String attribute_name, java.lang.String attribute_values, java.lang.String default_value, javax.swing.ImageIcon attribute_icon, javax.swing.JTextField parent_component)
input_type
- type of input: 0=inputttext; 1=checkbox; 2=textarea; 3=combobox; 4=colorchooser;attribute_index
- this attribute numberattribute_name
- this attribute nameattribute_values
- list of values separated by ":" for combobox (type 3)default_value
- default valueattribute_icon
- ImageIcon for colorchooser button (only for type 4)parent_component
- inputtext component where to store the colorchooser value (only for type 4)
private javax.swing.JComponent attribute_input_component2(int input_type, int attribute_index, java.lang.String attribute_name, java.lang.String attribute_start, java.lang.String attribute_end, java.lang.String attribute_values, java.lang.String default_value, javax.swing.ImageIcon attribute_icon, javax.swing.JTextField parent_component)
input_type
- type of input: 0=inputttext; 1=checkbox; 2=textarea; 3=combobox; 4=colorchooser;attribute_index
- this attribute numberattribute_name
- this attribute nameattribute_start
- this attribute start string (e.g: style=")attribute_end
- this attribute end string (e.g: ")attribute_values
- list of values separated by ":" for combobox (type 3)default_value
- default valueattribute_icon
- ImageIcon for colorchooser button (only for type 4)parent_component
- inputtext component where to store the colorchooser value (only for type 4)
private javax.swing.JLabel input_label_component(java.lang.String name, java.lang.String description)
name
- name of labeldescription
- text for tooltip
private javax.swing.JButton customButton(java.lang.String name, java.lang.String description, java.lang.String icon, java.lang.String intag, java.lang.String outtag, int action_id, int keystroke, int keymodifier)
name
- String button name (used if icon is null)description
- String description for tooltipicon
- String image filename (must be located inside the buttons_images_path)intag
- String the opening tag (e.g.: <h1>)outtag
- String the closing tag (e.g.: </h1>)action_id
- int ID of buttonsActionListenerkeystroke
- int keyboard key for KeyboardActionkeymodifier
- int keyboard modifier key for KeyboardAction
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |