Java Doc for ExtFormatter.java in  » Swing-Library » abeille-forms-designer » org » netbeans » editor » ext » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Swing Library » abeille forms designer » org.netbeans.editor.ext 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.editor.Formatter
      org.netbeans.editor.ext.ExtFormatter

All known Subclasses:   org.netbeans.editor.ext.java.JavaFormatter,
ExtFormatter
public class ExtFormatter extends Formatter implements FormatLayer(Code)
Unlike the formatter class, the ExtFormatter concentrates on providing a support for the real formatting process. Each formatter (there's only one per each kit) can contain one or more formatting layers. The FormatLayer operates over the chain of the tokens provided by the FormatWriter. The formatting consist of changing the chain of the tokens until it gets the desired look. Each formatting requires a separate instance of FormatWriter but the same set of format-layers is used for all the format-writers. Although the base implementation is synchronized so that only one format-writer at time is processed by each format-writer, in general it's not necessary. The basic implementation processes all the format-layers sequentialy in the order they were added to the formatter but this can be redefined. The getSettingValue enables to get the up-to-date value for the particular setting.
author:
   Miloslav Metelka
version:
   1.00

Inner Class :public static class Simple extends ExtFormatter


Constructor Summary
public  ExtFormatter(Class kitClass)
    

Method Summary
protected  booleanacceptSyntax(Syntax syntax)
     Whether the formatter accepts the given syntax that will be used for parsing the text passed to the FormatWriter.
Parameters:
  syntax - syntax to be tested.
public synchronized  voidaddFormatLayer(FormatLayer layer)
     Add the new format layer to the layer hierarchy.
public  WritercreateWriter(Document doc, int offset, Writer writer)
     Create the indentation writer.
public synchronized  voidformat(FormatWriter fw)
    
public  IteratorformatLayerIterator()
     Get the iterator over the format layers.
public  StringgetName()
     Return the name of this formatter.
public  int[]getReformatBlock(JTextComponent target, String typedText)
     Get the block to be reformatted after keystroke was pressed.
Parameters:
  target - component to which the text was typed.
public  ObjectgetSettingValue(String settingName)
     Get the value of the given setting.
protected  booleanhasTextBefore(JTextComponent target, String typedText)
    
public  intindentLine(Document doc, int offset)
     Indents the current line.
public  intindentNewLine(Document doc, int offset)
     Inserts new line at given position and indents the new line with spaces.
protected  voidinitFormatLayers()
    
public  booleanisSimple()
     Whether do no formatting at all.
public  Writerreformat(BaseDocument doc, int startOffset, int endOffset, boolean indentOnly)
     Reformat a block of code.
Parameters:
  doc - document to work with
Parameters:
  startOffset - position at which the formatting starts
Parameters:
  endOffset - position at which the formatting ends
Parameters:
  indentOnly - whether just the indentation should be changed or regularformatting should be performed.
public  intreformat(BaseDocument doc, int startOffset, int endOffset)
    
public synchronized  voidremoveFormatLayer(String layerName)
     Remove the first layer which has the same name as the given one.
public synchronized  booleanreplaceFormatLayer(String layerName, FormatLayer layer)
     Replace the format-layer with the layerName with the the given layer.
public  voidsetSettingValue(String settingName, Object settingValue)
     This method allows to set a custom value to a setting thus overriding the value retrieved from the Settings.
public  voidsettingsChange(SettingsChangeEvent evt)
    


Constructor Detail
ExtFormatter
public ExtFormatter(Class kitClass)(Code)




Method Detail
acceptSyntax
protected boolean acceptSyntax(Syntax syntax)(Code)
Whether the formatter accepts the given syntax that will be used for parsing the text passed to the FormatWriter.
Parameters:
  syntax - syntax to be tested. true whether this formatter is able to process the tokens createdby the syntax or false otherwise.



addFormatLayer
public synchronized void addFormatLayer(FormatLayer layer)(Code)
Add the new format layer to the layer hierarchy.



createWriter
public Writer createWriter(Document doc, int offset, Writer writer)(Code)
Create the indentation writer.



format
public synchronized void format(FormatWriter fw)(Code)
Called by format-writer to do the format



formatLayerIterator
public Iterator formatLayerIterator()(Code)
Get the iterator over the format layers.



getName
public String getName()(Code)
Return the name of this formatter. By default it's the name of the kit-class for which it's created without the package name.



getReformatBlock
public int[] getReformatBlock(JTextComponent target, String typedText)(Code)
Get the block to be reformatted after keystroke was pressed.
Parameters:
  target - component to which the text was typed. Caaret position can bechecked etc.
Parameters:
  typedText - text (usually just one character) that the user has typed. block of the code to be reformatted or null if nothing shouldreformatted. It can return block containing just one character.The caller usually expands even one character to the whole linebecause less than the whole line usually doesn't provide enoughpossibilities for formatting.
See Also:    ExtKit.ExtDefaultKeyTypedAction.checkIndentHotChars()



getSettingValue
public Object getSettingValue(String settingName)(Code)
Get the value of the given setting.
Parameters:
  settingName - name of the setting to get.



hasTextBefore
protected boolean hasTextBefore(JTextComponent target, String typedText)(Code)



indentLine
public int indentLine(Document doc, int offset)(Code)
Indents the current line. Should not affect any other lines.
Parameters:
  doc - the document to work on
Parameters:
  offset - the offset of a character on the line new offset of the original character



indentNewLine
public int indentNewLine(Document doc, int offset)(Code)
Inserts new line at given position and indents the new line with spaces.
Parameters:
  doc - the document to work on
Parameters:
  offset - the offset of a character on the line new offset to place cursor to



initFormatLayers
protected void initFormatLayers()(Code)
Add the desired format-layers to the formatter



isSimple
public boolean isSimple()(Code)
Whether do no formatting at all. If this method returns true, the FormatWriter will simply write its input into the underlying writer.



reformat
public Writer reformat(BaseDocument doc, int startOffset, int endOffset, boolean indentOnly) throws BadLocationException, IOException(Code)
Reformat a block of code.
Parameters:
  doc - document to work with
Parameters:
  startOffset - position at which the formatting starts
Parameters:
  endOffset - position at which the formatting ends
Parameters:
  indentOnly - whether just the indentation should be changed or regularformatting should be performed. formatting writer. The text was already reformatted but thewriter can contain useful information.



reformat
public int reformat(BaseDocument doc, int startOffset, int endOffset) throws BadLocationException(Code)
Fix of #5620 - same method exists in Formatter (predecessor



removeFormatLayer
public synchronized void removeFormatLayer(String layerName)(Code)
Remove the first layer which has the same name as the given one.



replaceFormatLayer
public synchronized boolean replaceFormatLayer(String layerName, FormatLayer layer)(Code)
Replace the format-layer with the layerName with the the given layer. If there's no such layer with the same name, the layer is not replaced and false is returned.



setSettingValue
public void setSettingValue(String settingName, Object settingValue)(Code)
This method allows to set a custom value to a setting thus overriding the value retrieved from the Settings. Once done the value is no longer synchronized with the changes in Settings for the particular setting. There's a map holding the names of all the custom settings.



settingsChange
public void settingsChange(SettingsChangeEvent evt)(Code)



Methods inherited from org.netbeans.editor.Formatter
public void changeBlockIndent(BaseDocument doc, int startPos, int endPos, int shiftCnt) throws BadLocationException(Code)(Java Doc)
public void changeRowIndent(BaseDocument doc, int pos, int newIndent) throws BadLocationException(Code)(Java Doc)
public Writer createWriter(Document doc, int offset, Writer writer)(Code)(Java Doc)
public boolean expandTabs()(Code)(Java Doc)
public static synchronized Formatter getFormatter(Class kitClass)(Code)(Java Doc)
public String getIndentString(BaseDocument doc, int indent)(Code)(Java Doc)
public String getIndentString(int indent)(Code)(Java Doc)
public Class getKitClass()(Code)(Java Doc)
public int getShiftWidth()(Code)(Java Doc)
public int getSpacesPerTab()(Code)(Java Doc)
public int getTabSize()(Code)(Java Doc)
public int indentLine(Document doc, int offset)(Code)(Java Doc)
public int indentNewLine(Document doc, int offset)(Code)(Java Doc)
public void insertTabString(BaseDocument doc, int dotPos) throws BadLocationException(Code)(Java Doc)
public int reformat(BaseDocument doc, int startOffset, int endOffset) throws BadLocationException(Code)(Java Doc)
public void setExpandTabs(boolean expandTabs)(Code)(Java Doc)
public static synchronized void setFormatter(Class kitClass, Formatter formatter)(Code)(Java Doc)
public void setShiftWidth(int shiftWidth)(Code)(Java Doc)
public void setSpacesPerTab(int spacesPerTab)(Code)(Java Doc)
public void setTabSize(int tabSize)(Code)(Java Doc)
public void settingsChange(SettingsChangeEvent evt)(Code)(Java Doc)
public void shiftLine(BaseDocument doc, int dotPos, boolean right) throws BadLocationException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.