| java.lang.Object org.armedbear.j.AbstractMode
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.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.DiffMode, org.armedbear.j.CSSMode, org.armedbear.j.PlainTextMode, 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.ManMode,
AbstractMode | abstract public class AbstractMode implements Constants,Mode(Code) | |
AbstractMode provides an interface for implementing specific modes. A mode
is a set of rules to define the way that the editor behaves. This includes
key mappings, menu generation, context menu handling, toolbar generation, a
sidebar component, tooltips, colors, indentation, and general properties.
All modes should extend AbstractMode and are encouraged to override the
methods that are pertinent to that mode. The default implementation given
in AbstractMode will suffice for the rest.
Any class extending AbstractMode must add its id and displayName to the
Constants class.
More on overriding AbstractMode goes here***
See Also: Constants |
Method Summary | |
final public boolean | accepts(String filename) | public boolean | acceptsLinePaste(Editor editor) | protected JMenuItem | addContextMenuItem(String text, String command, JPopupMenu popup, Dispatcher dispatcher) | protected void | addDefaultContextMenuItems(Editor editor, JPopupMenu popup) | public boolean | canIndent() The default is false . | public boolean | canIndentPaste() The default is false . | public boolean | confirmClose(Editor editor, Buffer buffer) | public Buffer | createBuffer(File file) Creates a Buffer for the given File . | public MenuBar | createMenuBar(Frame frame) | final public synchronized void | deleteKeyMap() | public Position | findIdentifierStart(Line line, int offset) | public char | fixCase(Editor editor, char c) The default is to return the original character. | public boolean | getBooleanProperty(Property property) | public Color | getColorProperty(Property property) | public String | getCommentEnd() The default is null . | public String | getCommentStart() The default is null . | public JPopupMenu | getContextMenu(Editor editor) | public String | getContextString(Editor editor, boolean verbose) The default is to return the tag before the cursor position, if the
buffer has tags. | public int | getCorrectIndentation(Line line, Buffer buffer) The default is 0. | protected ToolBar | getCustomToolBar(Frame frame) | protected ToolBar | getDefaultToolBar(Frame frame) | protected Object | getDefaultValue(Property property) Returns the default value for the given Property .
Parameters: property - the Property to get the default value for. | final public String | getDisplayName() Returns the display name of this mode. | public Expression | getExpressionAtDot(Editor editor, boolean exact) | public Formatter | getFormatter(Buffer buffer) Returns a Formatter for the given Buffer .
Parameters: buffer - The Buffer that is to be formattedaccording to this mode. | protected String | getFullKey(String key) | final public int | getId() Returns the unique identifier of this mode. | final public String | getIdentifier(Position pos) | final public String | getIdentifier(Line line, int offset) | public int | getIntegerProperty(Property property) | final public synchronized KeyMap | getKeyMap() | public File | getKeyMapFile() | public String | getMenuName() | public String | getMouseMovedContextString(Editor editor, Position pos) The default is null . | public NavigationComponent | getSidebarComponent(Editor editor) | public String | getStringProperty(Property property) | public SyntaxIterator | getSyntaxIterator(Position pos) The default is to return an instance of
DefaultSyntaxIterator DefaultSyntaxIterator . | public Tagger | getTagger(SystemBuffer buffer) The default is null . | public ToolBar | getToolBar(Frame frame) | public String | getToolTipText(Editor editor, MouseEvent e) The default is null . | public boolean | hasQualifiedNames() The default is false . | public boolean | isCommentLine(Line line) The default is false . | public boolean | isIdentifierPart(char c) The default is the result of Character.isJavaIdentifierPart(char). | public boolean | isIdentifierStart(char c) The default is the result of Character.isJavaIdentifierStart(char). | public boolean | isInComment(Buffer buffer, Position pos) The default is false . | public boolean | isInQuote(Buffer buffer, Position pos) The default implementation considers both single and double quotes
(which is wrong for Lisp) and only looks at the current line (which
is wrong for C and C++). | public boolean | isKeyword(String s) | public boolean | isQualifiedName(String s) The default is true if s contains either
a period '.' or a double colon "::". | public boolean | isTaggable() The default is false . | public void | loadFile(Buffer buffer, File file) The default is to do nothing. | public void | populateLispMenu(Editor editor, Menu menu) | public void | populateMenu(Editor editor, Menu menu) | public void | populateModeMenu(Editor editor, Menu menu) | protected void | populateSearchMenu(Editor editor, Menu menu) | protected void | setKeyMapDefaults(KeyMap km) | public void | setProperty(Property property, String value) Sets the given property name to the given property value. | public void | setProperty(Property property, boolean value) Sets the given property name to the given property value. | public void | setProperty(Property property, int value) Sets the given property name to the given property value. | final public String | toString() Returns the display name for this mode. | final public synchronized void | useDefaultKeyMap() |
AbstractMode | protected AbstractMode(int id, String displayName)(Code) | | |
acceptsLinePaste | public boolean acceptsLinePaste(Editor editor)(Code) | | |
canIndent | public boolean canIndent()(Code) | | The default is false .
|
canIndentPaste | public boolean canIndentPaste()(Code) | | The default is false .
|
deleteKeyMap | final public synchronized void deleteKeyMap()(Code) | | |
fixCase | public char fixCase(Editor editor, char c)(Code) | | The default is to return the original character.
Parameters: editor - Parameters: c - |
getBooleanProperty | public boolean getBooleanProperty(Property property)(Code) | | |
getCommentEnd | public String getCommentEnd()(Code) | | The default is null .
|
getCommentStart | public String getCommentStart()(Code) | | The default is null .
|
getContextString | public String getContextString(Editor editor, boolean verbose)(Code) | | The default is to return the tag before the cursor position, if the
buffer has tags.
Parameters: editor - Parameters: verbose - |
getCorrectIndentation | public int getCorrectIndentation(Line line, Buffer buffer)(Code) | | The default is 0.
Parameters: line - Parameters: buffer - |
getDefaultValue | protected Object getDefaultValue(Property property)(Code) | | Returns the default value for the given Property .
Parameters: property - the Property to get the default value for. the default value. |
getDisplayName | final public String getDisplayName()(Code) | | Returns the display name of this mode. Display names should be defined
in Constants .
The display name of this mode. See Also: Constants |
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.(The default is a PlainTextFormatter.) |
getId | final public int getId()(Code) | | Returns the unique identifier of this mode. All ids should be defined
in Constants .
The unique identifier of this mode. See Also: Constants |
getIntegerProperty | public int getIntegerProperty(Property property)(Code) | | |
getMouseMovedContextString | public String getMouseMovedContextString(Editor editor, Position pos)(Code) | | The default is null .
Parameters: editor - Parameters: pos - |
hasQualifiedNames | public boolean hasQualifiedNames()(Code) | | The default is false .
|
isCommentLine | public boolean isCommentLine(Line line)(Code) | | The default is false .
Parameters: line - |
isIdentifierPart | public boolean isIdentifierPart(char c)(Code) | | The default is the result of Character.isJavaIdentifierPart(char).
|
isIdentifierStart | public boolean isIdentifierStart(char c)(Code) | | The default is the result of Character.isJavaIdentifierStart(char).
|
isInComment | public boolean isInComment(Buffer buffer, Position pos)(Code) | | The default is false .
Parameters: buffer - Parameters: pos - |
isInQuote | public boolean isInQuote(Buffer buffer, Position pos)(Code) | | The default implementation considers both single and double quotes
(which is wrong for Lisp) and only looks at the current line (which
is wrong for C and C++).
Parameters: buffer - Parameters: pos - |
isQualifiedName | public boolean isQualifiedName(String s)(Code) | | The default is true if s contains either
a period '.' or a double colon "::".
Parameters: s - |
isTaggable | public boolean isTaggable()(Code) | | The default is false .
|
loadFile | public void loadFile(Buffer buffer, File file)(Code) | | The default is to do nothing.
Parameters: buffer - Parameters: file - |
populateSearchMenu | protected void populateSearchMenu(Editor editor, Menu menu)(Code) | | |
setKeyMapDefaults | protected void setKeyMapDefaults(KeyMap km)(Code) | | |
setProperty | public void setProperty(Property property, String value)(Code) | | Sets the given property name to the given property value. The property
can then be accessed by calling
getStringProperty(Property) getStringProperty .
Parameters: property - the property to set. Parameters: value - the value to set it to. |
setProperty | public void setProperty(Property property, boolean value)(Code) | | Sets the given property name to the given property value. The property
can then be accessed by calling
getBooleanProperty(Property) getBooleanProperty .
Parameters: property - the property to set. Parameters: value - the value to set it to. |
setProperty | public void setProperty(Property property, int value)(Code) | | Sets the given property name to the given property value. The property
can then be accessed by calling
getIntegerProperty(Property) getIntegerProperty .
Parameters: property - the property to set. Parameters: value - the value to set it to. |
toString | final public String toString()(Code) | | Returns the display name for this mode.
The display name for this mode. |
useDefaultKeyMap | final public synchronized void useDefaultKeyMap()(Code) | | |
|
|