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

Quick Search    Search Deep

com.port80.eclipse.xml.editors
Class XMLAutoIndentStrategy  view XMLAutoIndentStrategy download XMLAutoIndentStrategy.java

java.lang.Object
  extended byorg.eclipse.jface.text.DefaultAutoIndentStrategy
      extended bycom.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy
          extended bycom.port80.eclipse.xml.editors.XMLAutoIndentStrategy
All Implemented Interfaces:
org.eclipse.jface.text.IAutoEditStrategy, org.eclipse.jface.text.IAutoIndentStrategy

public class XMLAutoIndentStrategy
extends com.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy

Perform XML auto-indent.


Field Summary
static java.lang.String[] CDATA_PARTITIONS
           
static java.lang.String[] ESCAPED_PARTITIONS
          Escaped partitions.
private static java.lang.String NAME
           
static java.lang.String[] PREFORMATTED_PARTITIONS
          Preformatted partitions.
 
Fields inherited from class com.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy
fConfig, fTab, fTabWidth, fViewer, isUsingTab
 
Constructor Summary
XMLAutoIndentStrategy(XMLEditorConfiguration cf, org.eclipse.jface.text.source.ISourceViewer viewer)
          Constructor for XMLAutoIndentStrategy.
 
Method Summary
protected  int findMatchingOpenTagBefore(int end, org.eclipse.jface.text.IDocument doc)
           
protected  java.lang.String[] getEscapedPartitions()
           
protected  java.lang.String[] getPreformattedPartitions()
           
protected  int getTagCount(org.eclipse.jface.text.IDocument document, int start, int end, boolean skip)
          Count number of open tags-close tags in the given range.
protected  boolean isInsideEscapedPartitions(int offset, org.eclipse.jface.text.IDocument doc)
          Escaped partitions, eg.
protected  boolean isInsidePreformattedPartitions(int offset, org.eclipse.jface.text.IDocument doc)
          Preformatted partitions, eg.
 
Methods inherited from class com.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy
customizeDocumentCommand, endsWithDelimiter, findOpenBracketBefore, getIndentOfLine, getIndentString, getNonBlankLineAbove, getStringEnd, getStringStart, indent, initPreferences, isBlankLine, isEndTag, isStartOfLine, sameIndentAs, smartIndentAfterNewLine, smartIndentOnBackspace, smartIndentOnQuote, smartIndentOnTab, smartIndentOnTagClose, startsWithDelimiter, unIndent, unIndentOnTagEnd
 
Methods inherited from class org.eclipse.jface.text.DefaultAutoIndentStrategy
findEndOfWhiteSpace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

private static final java.lang.String NAME
See Also:
Constant Field Values

PREFORMATTED_PARTITIONS

public static final java.lang.String[] PREFORMATTED_PARTITIONS
Preformatted partitions. No tag counting, simple indent strategy.


ESCAPED_PARTITIONS

public static final java.lang.String[] ESCAPED_PARTITIONS
Escaped partitions. No tag counting.


CDATA_PARTITIONS

public static final java.lang.String[] CDATA_PARTITIONS
Constructor Detail

XMLAutoIndentStrategy

public XMLAutoIndentStrategy(XMLEditorConfiguration cf,
                             org.eclipse.jface.text.source.ISourceViewer viewer)
Constructor for XMLAutoIndentStrategy.

Method Detail

getEscapedPartitions

protected java.lang.String[] getEscapedPartitions()

getPreformattedPartitions

protected java.lang.String[] getPreformattedPartitions()

isInsideEscapedPartitions

protected boolean isInsideEscapedPartitions(int offset,
                                            org.eclipse.jface.text.IDocument doc)
Description copied from class: com.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy
Escaped partitions, eg. inside comment, where tags should not be counted.


isInsidePreformattedPartitions

protected boolean isInsidePreformattedPartitions(int offset,
                                                 org.eclipse.jface.text.IDocument doc)
Description copied from class: com.port80.eclipse.editors.util.AbstractXMLAutoIndentStrategy
Preformatted partitions, eg. inside quoted string, may not have correct indent and should not be auto-indented.


findMatchingOpenTagBefore

protected int findMatchingOpenTagBefore(int end,
                                        org.eclipse.jface.text.IDocument doc)

getTagCount

protected int getTagCount(org.eclipse.jface.text.IDocument document,
                          int start,
                          int end,
                          boolean skip)
                   throws org.eclipse.jface.text.BadLocationException
Count number of open tags-close tags in the given range. NOTE: No white space in char. sequences '</' and '/>' allowed here.