Java Doc for Mode.java in  » IDE » J » org » armedbear » j » 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 » IDE » J » org.armedbear.j 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.armedbear.j.Mode

All known Subclasses:   org.armedbear.j.VHDLMode,  org.armedbear.j.AsmMode,  org.armedbear.j.AutoconfMode,  org.armedbear.j.DirectoryMode,  org.armedbear.j.TclMode,  org.armedbear.j.SchemeMode,  org.armedbear.j.PythonMode,  org.armedbear.j.PHPMode,  org.armedbear.j.CMode,  org.armedbear.j.ImageMode,  org.armedbear.j.ListTagsMode,  org.armedbear.j.ShellScriptMode,  org.armedbear.j.CompilationMode,  org.armedbear.j.VerilogMode,  org.armedbear.j.ListRegistersMode,  org.armedbear.j.PerlMode,  org.armedbear.j.mail.MessageMode,  org.armedbear.j.ShellMode,  org.armedbear.j.jdb.JdbMode,  org.armedbear.j.mail.MailboxMode,  org.armedbear.j.WebMode,  org.armedbear.j.mail.SendMailMode,  org.armedbear.j.ListOccurrencesMode,  org.armedbear.j.XmlMode,  org.armedbear.j.mail.NewsGroupsMode,  org.armedbear.j.JavaMode,  org.armedbear.j.ArchiveMode,  org.armedbear.j.MakefileMode,  org.armedbear.j.RubyMode,  org.armedbear.j.CppMode,  org.armedbear.j.ObjCMode,  org.armedbear.j.DiffMode,  org.armedbear.j.LispShellMode,  org.armedbear.j.PlainTextMode,  org.armedbear.j.CSSMode,  org.armedbear.j.HtmlMode,  org.armedbear.j.LispMode,  org.armedbear.j.PropertiesMode,  org.armedbear.j.WordMode,  org.armedbear.j.CheckinMode,  org.armedbear.j.BinaryMode,  org.armedbear.j.JavaScriptMode,  org.armedbear.j.ManMode,  org.armedbear.j.AbstractMode,
Mode
public interface Mode (Code)
Mode is an interface for defining modes. A mode is a set of rules that define how the editor behaves. Different behaviors are desireable when editing different kinds of files. As an example, a user expects different behavior/functionality when editing a C++ file than what she expects when editing a Lisp file.

Users should not implement Mode directly, they should instead extend AbstractMode AbstractMode .
See Also:   AbstractMode





Method Summary
public  booleanaccepts(String filename)
     Returns whether or not this mode is willing to accept the given file name.
Parameters:
  filename - the name of the file that is to be checked forvalidity for this mode.
public  booleanacceptsLinePaste(Editor editor)
    
public  booleancanIndent()
     Returns whether or not this mode will potentially perform context sensitive indentation on a given Line in a given Buffer.
public  booleancanIndentPaste()
     Returns whether or not this mode will potentially perform context sensitive indentation for a paste operation.
public  booleanconfirmClose(Editor editor, Buffer buffer)
     Allows this mode to confirm the closing of a Buffer, and can cancel it by returning false.
public  BuffercreateBuffer(File file)
    
public  MenuBarcreateMenuBar(Frame frame)
     Returns the MenuBar that is to be used for this mode.
public  voiddeleteKeyMap()
    
public  PositionfindIdentifierStart(Line line, int offset)
     Returns the position of the start of the identifier at the specified line and offset.
public  charfixCase(Editor editor, char c)
     Examines c and returns the equivalent character but possibly with a different case (upper or lower) as the rules of this mode dictate.
public  booleangetBooleanProperty(Property property)
     Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found.
public  ColorgetColorProperty(Property property)
     Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found.
public  StringgetCommentEnd()
     Returns a string that signifies the end of a comment for the given mode, or null if the concept of comments is not applicable to this mode or the comment does not require an end token.
public  StringgetCommentStart()
     Returns a string that signifies the start of a comment for the given mode, or null if the concept of comments is not applicable to this mode.
public  JPopupMenugetContextMenu(Editor editor)
     Returns a context menu populated with entries specific to the given mode and the current location in the specified Editor.
public  StringgetContextString(Editor editor, boolean verbose)
     Returns a string that describes something about the current caret position that is suitable to be displayed in the StatusBar.
Parameters:
  editor - the Editor for context.
Parameters:
  verbose - whether or not to return more information.
public  intgetCorrectIndentation(Line line, Buffer buffer)
     Returns the amount of indentation (in columns) needed to indent the specified Line in the context of the given Buffer.
public  StringgetDisplayName()
     Returns the display name of this mode.
public  ExpressiongetExpressionAtDot(Editor editor, boolean exact)
     Returns the expression at the current location of the caret in the specified editor.
public  FormattergetFormatter(Buffer buffer)
     Returns a Formatter for the given Buffer.
public  intgetId()
     Returns the unique identifier of this mode.
public  StringgetIdentifier(Position pos)
     Returns the identifier at the specified position.
public  StringgetIdentifier(Line line, int offset)
     Returns the identifier at the specified line and offset.
public  intgetIntegerProperty(Property property)
     Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found.
public  KeyMapgetKeyMap()
     Returns a non-null KeyMap that may define custom KeyMappings for this Mode.
public  FilegetKeyMapFile()
     Returns the file that defines a custom KeyMap for this Mode, if any.
public  StringgetMenuName()
     Returns an identifier for the MenuBar that is to be used for this mode.
public  StringgetMouseMovedContextString(Editor editor, Position pos)
     Returns a string that describes something about the current mouse position that is suitable to be displayed in the StatusBar, or null if there is none.
Parameters:
  editor - the Editor for context.
public  NavigationComponentgetSidebarComponent(Editor editor)
     Returns a navigation component for the specified Editor, or null if there is no navigation component for this mode.
public  StringgetStringProperty(Property property)
     Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found.
public  SyntaxIteratorgetSyntaxIterator(Position pos)
     Returns a SyntaxIterator specific for this mode that is situated at the given Position.
Parameters:
  pos - where to situate the SyntaxIterator.
public  TaggergetTagger(SystemBuffer buffer)
     Most useful for programming language modes, this method returns either a Tagger for this mode, or null.
public  ToolBargetToolBar(Frame frame)
     Returns a ToolBar for the specified Frame.
public  StringgetToolTipText(Editor editor, MouseEvent e)
     Returns a string that describes something about the current mouse position that is suitable to be displayed as a tool tip, or null if there is none.
Parameters:
  editor - the Editor for context.
public  booleanhasQualifiedNames()
     Returns true if the mode's underlying programming language supports qualified names.
public  booleanisCommentLine(Line line)
     Returns whether or not the given Line is a comment.
Parameters:
  line - the Line to check to see if it is acomment.
public  booleanisIdentifierPart(char c)
     Checks the given character against a list of characters that are legal identifier parts (not the first character).
public  booleanisIdentifierStart(char c)
     Checks the given character against a list of characters that are legal identifier starts.
public  booleanisInComment(Buffer buffer, Position pos)
     Returns true if the specified position is inside a comment.
public  booleanisInQuote(Buffer buffer, Position pos)
     Returns true if the specified position is inside a quoted string.
public  booleanisKeyword(String s)
     Checks the given string against a list of keywords for this mode, and returns true if the string is on that list.
Parameters:
  s - the keyword to test.
public  booleanisQualifiedName(String s)
     Returns true if the string in question is a qualified name in the mode's underlying programming language.
public  booleanisTaggable()
     Returns whether or not this mode has a Tagger Tagger associated with it.
public  voidloadFile(Buffer buffer, File file)
     If this mode needs to do any special processing on a file in order to load it into the buffer, e.g.
public  voidpopulateMenu(Editor editor, Menu menu)
     Populates the given Menu with appropriate menu items.
public  voidpopulateModeMenu(Editor editor, Menu menu)
    
public  voidsetProperty(Property property, String value)
    
public  voidsetProperty(Property property, boolean value)
    
public  voidsetProperty(Property property, int value)
    
public  voiduseDefaultKeyMap()
    



Method Detail
accepts
public boolean accepts(String filename)(Code)
Returns whether or not this mode is willing to accept the given file name.
Parameters:
  filename - the name of the file that is to be checked forvalidity for this mode. true if the given filename can be handledby this mode.



acceptsLinePaste
public boolean acceptsLinePaste(Editor editor)(Code)



canIndent
public boolean canIndent()(Code)
Returns whether or not this mode will potentially perform context sensitive indentation on a given Line in a given Buffer. This returns true if Mode.getCorrectIndentation(Line,Buffer) getCorrectIndentation() might return something other than zero, false otherwise. true if this mode supports context-sensitiveindentation.



canIndentPaste
public boolean canIndentPaste()(Code)
Returns whether or not this mode will potentially perform context sensitive indentation for a paste operation. This returns true if Mode.getCorrectIndentation(Line,Buffer) getCorrectIndentation() might return something other than zero, false otherwise. true if this mode supports context-sensitiveindentation of pasted text.



confirmClose
public boolean confirmClose(Editor editor, Buffer buffer)(Code)
Allows this mode to confirm the closing of a Buffer, and can cancel it by returning false. confirmClose allows for this mode to do things such as make sure the user wants to close a Buffer even though it has been modified.
Parameters:
  editor - the Editor for context.
Parameters:
  buffer - the Buffer that is to be closed. true to allow the Buffer toclose.



createBuffer
public Buffer createBuffer(File file)(Code)



createMenuBar
public MenuBar createMenuBar(Frame frame)(Code)
Returns the MenuBar that is to be used for this mode. Override to return a custom MenuBar for this mode. If this method is overriden, then you must also override Mode.getMenuName() getMenuName to return a unique identifier, otherwise the default is fine.
Parameters:
  frame - the frame that the MenuBar will beattached to a MenuBar for the specified frame



deleteKeyMap
public void deleteKeyMap()(Code)



findIdentifierStart
public Position findIdentifierStart(Line line, int offset)(Code)
Returns the position of the start of the identifier at the specified line and offset.
Parameters:
  line - the line
Parameters:
  offset - the offset the position of the start of the identifier at thespecified line and offset or null if noidentifier is found.
since:
   0.16.1



fixCase
public char fixCase(Editor editor, char c)(Code)
Examines c and returns the equivalent character but possibly with a different case (upper or lower) as the rules of this mode dictate. This is primarily used in programming language modes where the language is case-insensitive and the user wants certain identifiers to have a certain casing style (all upper, all lower).
Parameters:
  editor - the Editor for context.
Parameters:
  c - the character in question. the character represented by c as theproper case given the context of editorand the case rules of this mode.



getBooleanProperty
public boolean getBooleanProperty(Property property)(Code)
Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found. The property and preferences lists are searched in an manner which gives precedence in the following order: mode specific preferences, mode specific properties, global preferences.
Parameters:
  property - the key to look for with the default value to returnif the key is not found. the value of the given property, or the default in thegiven Property if the property's key isnot found.



getColorProperty
public Color getColorProperty(Property property)(Code)
Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found. The property and preferences lists are searched in an manner which gives precedence in the following order: mode specific preferences, mode specific properties, global preferences.
Parameters:
  property - the key to look for with the default value to returnif the key is not found. the value of the given property, or the default in thegiven Property if the property's key isnot found.



getCommentEnd
public String getCommentEnd()(Code)
Returns a string that signifies the end of a comment for the given mode, or null if the concept of comments is not applicable to this mode or the comment does not require an end token. the token to end a comment, or null if notapplicable.



getCommentStart
public String getCommentStart()(Code)
Returns a string that signifies the start of a comment for the given mode, or null if the concept of comments is not applicable to this mode. the token to start a comment, or null if notapplicable.



getContextMenu
public JPopupMenu getContextMenu(Editor editor)(Code)
Returns a context menu populated with entries specific to the given mode and the current location in the specified Editor.
Parameters:
  editor - the current Editor a menu filled with context sensitive goodies.



getContextString
public String getContextString(Editor editor, boolean verbose)(Code)
Returns a string that describes something about the current caret position that is suitable to be displayed in the StatusBar.
Parameters:
  editor - the Editor for context.
Parameters:
  verbose - whether or not to return more information. information relevant to the current caret position.



getCorrectIndentation
public int getCorrectIndentation(Line line, Buffer buffer)(Code)
Returns the amount of indentation (in columns) needed to indent the specified Line in the context of the given Buffer.

If this mode does not support automatic context-sensitive indentation, that is if Mode.canIndent() canIndent() returns false, then this method returns zero.
Parameters:
  line - the line to be indented
Parameters:
  buffer - the buffer which contains the line the amount of indentation required, in columns.




getDisplayName
public String getDisplayName()(Code)
Returns the display name of this mode. All display names should be defined in Constants. the display name of this mode
See Also:   Constants



getExpressionAtDot
public Expression getExpressionAtDot(Editor editor, boolean exact)(Code)
Returns the expression at the current location of the caret in the specified editor.
Parameters:
  editor - the editor in question
Parameters:
  exact - a hint to the implementation: if true, return theexpression at the exact location of the caret; iffalse, look for a suitable expression on the same line the expression, or null if no expressionis found.
since:
   0.16.1



getFormatter
public Formatter getFormatter(Buffer buffer)(Code)
Returns a Formatter for the given Buffer.
Parameters:
  buffer - the Buffer that is to be formattedaccording to this mode a Formatter for the given mode.



getId
public int getId()(Code)
Returns the unique identifier of this mode. All identifiers should be defined in Constants. the unique identifier for this mode
See Also:   Constants



getIdentifier
public String getIdentifier(Position pos)(Code)
Returns the identifier at the specified position.
Parameters:
  pos - the position the identifier at the specified position, ornull if no identifier is found.
since:
   0.16.1



getIdentifier
public String getIdentifier(Line line, int offset)(Code)
Returns the identifier at the specified line and offset.
Parameters:
  line - the line
Parameters:
  offset - the offset the identifier at the specified line and offset, ornull if no identifier is found.
since:
   0.16.1



getIntegerProperty
public int getIntegerProperty(Property property)(Code)
Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found. The property and preferences lists are searched in an manner which gives precedence in the following order: mode specific preferences, mode specific properties, global preferences.
Parameters:
  property - the key to look for with the default value to returnif the key is not found. the value of the given property, or the default in thegiven Property if the property's key isnot found.



getKeyMap
public KeyMap getKeyMap()(Code)
Returns a non-null KeyMap that may define custom KeyMappings for this Mode. If there are no custom KeyMappings for this Mode, then an empty KeyMap is returned. a non-null KeyMap
See Also:   KeyMapping



getKeyMapFile
public File getKeyMapFile()(Code)
Returns the file that defines a custom KeyMap for this Mode, if any. the KeyMap file, or null if there isnone.
See Also:   Mode.getKeyMap
See Also:   KeyMap
See Also:   KeyMapping



getMenuName
public String getMenuName()(Code)
Returns an identifier for the MenuBar that is to be used for this mode. Override this method to return a unique name if you override Mode.createMenuBar(Frame) createMenuBar to have a custom menu. an identifier for the MenuBar that is returnedby calling createMenuBar.



getMouseMovedContextString
public String getMouseMovedContextString(Editor editor, Position pos)(Code)
Returns a string that describes something about the current mouse position that is suitable to be displayed in the StatusBar, or null if there is none.
Parameters:
  editor - the Editor for context. information relevant to the current mouse position.



getSidebarComponent
public NavigationComponent getSidebarComponent(Editor editor)(Code)
Returns a navigation component for the specified Editor, or null if there is no navigation component for this mode.

The navigation component appears in the lower pane of the sidebar.
Parameters:
  editor - the Editor the navigation component, or null




getStringProperty
public String getStringProperty(Property property)(Code)
Looks in all mode and non-mode specific properties/preferences and returns the value attached to the given key, or the default value given in property if the key is not found. The property and preferences lists are searched in an manner which gives precedence in the following order: mode specific preferences, mode specific properties, global preferences.
Parameters:
  property - the key to look for with the default value to returnif the key is not found. the value of the given property, or the default in thegiven Property if the property's key isnot found.



getSyntaxIterator
public SyntaxIterator getSyntaxIterator(Position pos)(Code)
Returns a SyntaxIterator specific for this mode that is situated at the given Position.
Parameters:
  pos - where to situate the SyntaxIterator. a SyntaxIterator for this mode.



getTagger
public Tagger getTagger(SystemBuffer buffer)(Code)
Most useful for programming language modes, this method returns either a Tagger for this mode, or null. If a Tagger is returned, then Mode.isTaggable() isTaggable() must return true. Otherwise it should return false.
Parameters:
  buffer - the current buffer a Tagger specific for this mode ornull if a Tagger is notapplicable.



getToolBar
public ToolBar getToolBar(Frame frame)(Code)
Returns a ToolBar for the specified Frame.
Parameters:
  frame - the Frame the ToolBar



getToolTipText
public String getToolTipText(Editor editor, MouseEvent e)(Code)
Returns a string that describes something about the current mouse position that is suitable to be displayed as a tool tip, or null if there is none.
Parameters:
  editor - the Editor for context. information relevant to the current mouse position.



hasQualifiedNames
public boolean hasQualifiedNames()(Code)
Returns true if the mode's underlying programming language supports qualified names. (For example, Java, C++ and Perl do; C does not.) true if the mode supports qualified names.
since:
   0.16.1



isCommentLine
public boolean isCommentLine(Line line)(Code)
Returns whether or not the given Line is a comment.
Parameters:
  line - the Line to check to see if it is acomment. true if line qualifies asa comment for this mode.



isIdentifierPart
public boolean isIdentifierPart(char c)(Code)
Checks the given character against a list of characters that are legal identifier parts (not the first character). Some languages have different requirements for the beginning of an identifier than the rest of that identifier. Such a case is Java which allows digits in an identifier part, but does not allow a digit to be the first character. char the character to be checked for validity. true if c is one of thelegal identifier parts for this mode.



isIdentifierStart
public boolean isIdentifierStart(char c)(Code)
Checks the given character against a list of characters that are legal identifier starts. Some languages have different requirements for the beginning of an identifier than the rest of that identifier. Such a case is Java which allows digits in an identifier name, but does not allow them to be the first character. char the character to be checked for validity. true if c is one of thelegal identifier start characters for this mode.



isInComment
public boolean isInComment(Buffer buffer, Position pos)(Code)
Returns true if the specified position is inside a comment.
Parameters:
  buffer - the Buffer containing the specifiedposition
Parameters:
  pos - the position true if pos is inside acomment.



isInQuote
public boolean isInQuote(Buffer buffer, Position pos)(Code)
Returns true if the specified position is inside a quoted string.
Parameters:
  buffer - the Buffer containing the specifiedposition
Parameters:
  pos - the position true if pos is inside aquoted string.



isKeyword
public boolean isKeyword(String s)(Code)
Checks the given string against a list of keywords for this mode, and returns true if the string is on that list.
Parameters:
  s - the keyword to test. true if s is a valid keywordfor this mode.



isQualifiedName
public boolean isQualifiedName(String s)(Code)
Returns true if the string in question is a qualified name in the mode's underlying programming language. true if the string is a qualified name.
since:
   0.16.1



isTaggable
public boolean isTaggable()(Code)
Returns whether or not this mode has a Tagger Tagger associated with it. This returns false if Mode.getTagger(SystemBuffer) getTagger() returns null, and true otherwise. Whether or not this mode is taggable. Which is the same aswhether or not getTagger returns null.



loadFile
public void loadFile(Buffer buffer, File file)(Code)
If this mode needs to do any special processing on a file in order to load it into the buffer, e.g. the file is an archive, that processing is to be done here. This method is called from the protected Buffer.loadFile(File) loadFile method in Buffer when loading a file. It is also called from the Buffer.reload reload method in Buffer.
Parameters:
  buffer - the Buffer that the file is to be loadedinto.
Parameters:
  file - the input source.



populateMenu
public void populateMenu(Editor editor, Menu menu)(Code)
Populates the given Menu with appropriate menu items. Unless there is a compelling reason not to, classes that override this method should call super.createMenuBar(editor, menu) when they are done putting in their own entries.
Parameters:
  editor - the current Editor.
Parameters:
  menu - the Menu that is to be populated withentries for this mode.



populateModeMenu
public void populateModeMenu(Editor editor, Menu menu)(Code)



setProperty
public void setProperty(Property property, String value)(Code)



setProperty
public void setProperty(Property property, boolean value)(Code)



setProperty
public void setProperty(Property property, int value)(Code)



useDefaultKeyMap
public void useDefaultKeyMap()(Code)



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