|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
com.japisoft.xmlpad.action.XMLAction
com.japisoft.xmlpad.action.xml.FormatAction
Action for formatting the XML content. If you don't want to have sorted
attributes, you must override the sortAttributes
method.
By default indentSize is equals to 4, but you can override it by calling
ActionModel.setProperty( Properties.INDENT_SIZE_PROPERTY, new Integer( 2 )
The same thing for the indent char calling
ActionModel.setProperty( Properties.INDENT_CHAR_PROPERTY, '\'' )
XMLAction
,
Serialized FormNested Class Summary |
Nested classes inherited from class com.japisoft.xmlpad.action.XMLAction |
XMLAction.EmptyIcon |
Field Summary | |
static boolean |
CANONICAL
|
static boolean |
DIALOG_ERROR
Mode for having a popup dialog when the formatting is impossible |
static java.lang.String |
ID
|
protected java.io.PrintWriter |
out
|
static java.lang.String |
PREF_APOSENTITY
Particular property inside the XMLContainer |
static boolean |
PRESERVE_EMPTY_ATTRIBUTE_VALUE
Preserve whitespaces string for attribute value |
Fields inherited from class com.japisoft.xmlpad.action.XMLAction |
AUTO_UI, container, editor, groupName, IMAGE_EXT, IMAGE_SIZE, INVALID_ACTION, param, RESOURCE_BUNDLE, VALID_ACTION |
Fields inherited from class javax.swing.AbstractAction |
changeSupport, enabled |
Fields inherited from interface com.japisoft.xmlpad.action.Features |
VALIDATING_FEATURE |
Fields inherited from interface com.japisoft.xmlpad.action.Properties |
FILE_ENCODING, INDENT_CHAR_PROPERTY, INDENT_SIZE_PROPERTY |
Fields inherited from interface javax.swing.Action |
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
FormatAction()
|
Method Summary | |
java.lang.String |
getMessageForError(XMLContainer container)
|
java.lang.Object |
getProperty(java.lang.String propertyName,
java.lang.Object defaultValue)
|
static java.lang.String |
getWriterEncoding()
|
boolean |
isReplaceAmp()
|
boolean |
isReplaceAPos()
|
boolean |
isReplaceGt()
|
boolean |
isReplaceLt()
|
boolean |
isReplaceQuote()
|
protected java.lang.String |
normalize(java.lang.String s,
boolean keepWhiteSpace)
Normalizes the given string. |
boolean |
notifyAction()
Notify action must be done. |
void |
print(int indent,
org.w3c.dom.Node node)
Prints the specified node, recursively. |
void |
print(org.w3c.dom.Node node)
|
void |
setProperty(java.lang.String propertyName,
java.lang.Object value)
Support for INDENT_CHAR_PROPERTY, INDENT_SIZE_PROPERTY properties |
void |
setReplaceAmp(boolean replaceAmp)
Resolve the amp character as entity. |
void |
setReplaceAPos(boolean replaceAPos)
Resolve the ' character as entity. |
void |
setReplaceGt(boolean replaceGt)
Resolved the gt character is resolved as entity. |
void |
setReplaceLt(boolean replaceLt)
Resolved the lt character as entity. |
void |
setReplaceQuote(boolean replaceQuote)
Resolved the " character as entity. |
protected org.w3c.dom.Attr[] |
sortAttributes(org.w3c.dom.NamedNodeMap attrs)
Returns a sorted list of attributes. |
Methods inherited from class com.japisoft.xmlpad.action.XMLAction |
actionPerformed, autoRequestFocus, dispose, getDefaultAccelerator, getDefaultIcon, getDefaultLabel, getDefaultMnemonic, getDefaultTooltip, getLabel, getName, getParam, getPopupGroup, getXMLContainer, getXMLEditor, hasFeature, installUIContent, isPopable, isToolbarable, notifyXMLContainer, notifyXMLEditor, setActionDelegate, setActionReferenceGroup, setActionReferenceIcon, setFeature, setParam, setPopable, setToolbarable, setXMLContainer, setXMLEditor |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String PREF_APOSENTITY
public static final java.lang.String ID
public static boolean CANONICAL
public static boolean DIALOG_ERROR
public static boolean PRESERVE_EMPTY_ATTRIBUTE_VALUE
protected java.io.PrintWriter out
Constructor Detail |
public FormatAction()
Method Detail |
public void setProperty(java.lang.String propertyName, java.lang.Object value)
setProperty
in class XMLAction
propertyName
- Property namevalue
- Property valuepublic java.lang.Object getProperty(java.lang.String propertyName, java.lang.Object defaultValue)
getProperty
in class XMLAction
XMLAction
has not overrided it a null
value will be returnedpublic boolean notifyAction()
XMLAction
notifyAction
in class XMLAction
public java.lang.String getMessageForError(XMLContainer container)
public static java.lang.String getWriterEncoding()
public void print(org.w3c.dom.Node node)
public void print(int indent, org.w3c.dom.Node node)
public boolean isReplaceAmp()
public void setReplaceAmp(boolean replaceAmp)
true
public boolean isReplaceAPos()
public void setReplaceAPos(boolean replaceAPos)
true
public boolean isReplaceGt()
public void setReplaceGt(boolean replaceGt)
true
public boolean isReplaceLt()
public void setReplaceLt(boolean replaceLt)
true
public boolean isReplaceQuote()
public void setReplaceQuote(boolean replaceQuote)
true
protected java.lang.String normalize(java.lang.String s, boolean keepWhiteSpace)
protected org.w3c.dom.Attr[] sortAttributes(org.w3c.dom.NamedNodeMap attrs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |