Java Doc for ODEEditorKit.java in  » Scripting » oscript-2.10.4 » oscript » swing » text » 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 » Scripting » oscript 2.10.4 » oscript.swing.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.swing.text.EditorKit
      javax.swing.text.DefaultEditorKit
         oscript.swing.text.ODEEditorKit

ODEEditorKit
public class ODEEditorKit extends DefaultEditorKit (Code)
An editor-kit for an ODE src code editor. The document used is just a plain-old PlainDocument . Rather than trying to integrate the parser with the Document 's Element structure, the parsed representation of the document is stored seperately as an array of tokens. We create a View for rendering the document that takes into account the token that overlays a section of text, and the AttributeSet which that token maps to, as it renders the text.

For performance reasons, parsing happens asynchronously, which means that whenever the document is mutated. So, when there is an insert, we update the (now out of date) tokens by increasing the end-offset of the current token, and the begin-offset and end-offset of all subsequent tokens by the number of characters inserted. When there is a remove, the process is essentially the reverse.

The script side of things handles creating the parsing thread, and it uses DocumentListener s to determine when reparsing is needed.
author:
   Rob Clark (rob@ti.com)
author:
  
version:
   1.10
See Also:   ODEEditorKit.createDefaultDocument


Inner Class :public class ODEDocument extends PlainDocument


Constructor Summary
public  ODEEditorKit()
     Class Constructor.

Method Summary
public  DocumentcreateDefaultDocument()
     Create a uninitialized document.
public synchronized  NodeTokengetToken(int off)
     Given an offset into the document, find the corresponding token.
public  ViewFactorygetViewFactory()
     Get a factory for producing View s for rendering Document s created by this editor-kit.
public  StringoffsetToNodeToken(int off)
    
public  voidsetAttributeSetTable(SymbolMap attrSetTable)
     Set the attribute set table.
Parameters:
  attrSetTable - the table that maps NodeToken.kind to an attributeset.
public static  voidsetDefaultFgColor(Color c)
    
public synchronized  voidsetNodeTokens(Vector v)
     Called from script code after parsing is completed.


Constructor Detail
ODEEditorKit
public ODEEditorKit()(Code)
Class Constructor.




Method Detail
createDefaultDocument
public Document createDefaultDocument()(Code)
Create a uninitialized document. The Document used by this editor kit is basically just a PlainDocument that has been extended to synchronously update the offsets of the tokens in response to document mutations (insert/remove). This is important to ensure that the token's offset maps to sensible positions in the document during the period between when the document is edited, and when the parser has finished re-parsing it an unitialized document



getToken
public synchronized NodeToken getToken(int off)(Code)
Given an offset into the document, find the corresponding token. This is the API used by everything else for accessing the tokens. The remaining methods are just used to implement this method.
Parameters:
  off - the offset into the document



getViewFactory
public ViewFactory getViewFactory()(Code)
Get a factory for producing View s for rendering Document s created by this editor-kit. the view-factory



offsetToNodeToken
public String offsetToNodeToken(int off)(Code)



setAttributeSetTable
public void setAttributeSetTable(SymbolMap attrSetTable)(Code)
Set the attribute set table.
Parameters:
  attrSetTable - the table that maps NodeToken.kind to an attributeset. This table is created and maintained from script code, butused here while rendering the text.



setDefaultFgColor
public static void setDefaultFgColor(Color c)(Code)



setNodeTokens
public synchronized void setNodeTokens(Vector v)(Code)
Called from script code after parsing is completed. For performance reasons the tokens are stored here, after they are generated by script.



Fields inherited from javax.swing.text.DefaultEditorKit
final public static String EndOfLineStringProperty(Code)(Java Doc)
final public static String backwardAction(Code)(Java Doc)
final public static String beepAction(Code)(Java Doc)
final public static String beginAction(Code)(Java Doc)
final public static String beginLineAction(Code)(Java Doc)
final public static String beginParagraphAction(Code)(Java Doc)
final public static String beginWordAction(Code)(Java Doc)
final public static String copyAction(Code)(Java Doc)
final public static String cutAction(Code)(Java Doc)
final public static String defaultKeyTypedAction(Code)(Java Doc)
final public static String deleteNextCharAction(Code)(Java Doc)
final public static String deleteNextWordAction(Code)(Java Doc)
final public static String deletePrevCharAction(Code)(Java Doc)
final public static String deletePrevWordAction(Code)(Java Doc)
final public static String downAction(Code)(Java Doc)
final public static String endAction(Code)(Java Doc)
final public static String endLineAction(Code)(Java Doc)
final public static String endParagraphAction(Code)(Java Doc)
final public static String endWordAction(Code)(Java Doc)
final public static String forwardAction(Code)(Java Doc)
final public static String insertBreakAction(Code)(Java Doc)
final public static String insertContentAction(Code)(Java Doc)
final public static String insertTabAction(Code)(Java Doc)
final public static String nextWordAction(Code)(Java Doc)
final public static String pageDownAction(Code)(Java Doc)
final public static String pageUpAction(Code)(Java Doc)
final public static String pasteAction(Code)(Java Doc)
final public static String previousWordAction(Code)(Java Doc)
final public static String readOnlyAction(Code)(Java Doc)
final public static String selectAllAction(Code)(Java Doc)
final public static String selectLineAction(Code)(Java Doc)
final public static String selectParagraphAction(Code)(Java Doc)
final public static String selectWordAction(Code)(Java Doc)
final public static String selectionBackwardAction(Code)(Java Doc)
final public static String selectionBeginAction(Code)(Java Doc)
final public static String selectionBeginLineAction(Code)(Java Doc)
final public static String selectionBeginParagraphAction(Code)(Java Doc)
final public static String selectionBeginWordAction(Code)(Java Doc)
final public static String selectionDownAction(Code)(Java Doc)
final public static String selectionEndAction(Code)(Java Doc)
final public static String selectionEndLineAction(Code)(Java Doc)
final public static String selectionEndParagraphAction(Code)(Java Doc)
final public static String selectionEndWordAction(Code)(Java Doc)
final public static String selectionForwardAction(Code)(Java Doc)
final public static String selectionNextWordAction(Code)(Java Doc)
final public static String selectionPreviousWordAction(Code)(Java Doc)
final public static String selectionUpAction(Code)(Java Doc)
final public static String upAction(Code)(Java Doc)
final public static String writableAction(Code)(Java Doc)

Methods inherited from javax.swing.text.DefaultEditorKit
public Caret createCaret()(Code)(Java Doc)
public Document createDefaultDocument()(Code)(Java Doc)
public Action[] getActions()(Code)(Java Doc)
public String getContentType()(Code)(Java Doc)
public ViewFactory getViewFactory()(Code)(Java Doc)
public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc)
public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc)
public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc)
public void write(Writer out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc)

Methods inherited from javax.swing.text.EditorKit
public Object clone()(Code)(Java Doc)
abstract public Caret createCaret()(Code)(Java Doc)
abstract public Document createDefaultDocument()(Code)(Java Doc)
public void deinstall(JEditorPane c)(Code)(Java Doc)
abstract public Action[] getActions()(Code)(Java Doc)
abstract public String getContentType()(Code)(Java Doc)
abstract public ViewFactory getViewFactory()(Code)(Java Doc)
public void install(JEditorPane c)(Code)(Java Doc)
abstract public void read(InputStream in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc)
abstract public void read(Reader in, Document doc, int pos) throws IOException, BadLocationException(Code)(Java Doc)
abstract public void write(OutputStream out, Document doc, int pos, int len) throws IOException, BadLocationException(Code)(Java Doc)
abstract public void write(Writer out, Document doc, int pos, int len) throws IOException, 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.