|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.jedit.Mode
public class Mode
An edit mode defines specific settings for editing some type of file. One instance of this class is created for each supported edit mode.
Field Summary | |
---|---|
protected TokenMarker |
marker
|
protected java.lang.String |
name
|
protected java.util.Map<java.lang.String,java.lang.Object> |
props
|
Constructor Summary | |
---|---|
Mode(java.lang.String name)
Creates a new edit mode. |
Method Summary | |
---|---|
boolean |
accept(java.lang.String fileName,
java.lang.String firstLine)
Returns true if the edit mode is suitable for editing the specified file. |
boolean |
acceptFilename(java.lang.String fileName)
Returns true if the buffer name matches the file name glob. |
boolean |
acceptFirstLine(java.lang.String firstLine)
Returns true if the first line matches the first line glob. |
boolean |
getBooleanProperty(java.lang.String key)
Returns the value of a boolean property. |
boolean |
getIgnoreWhitespace()
|
java.util.List<IndentRule> |
getIndentRules()
|
java.lang.String |
getName()
Returns the internal name of this edit mode. |
java.lang.Object |
getProperty(java.lang.String key)
Returns a mode property. |
TokenMarker |
getTokenMarker()
Returns the token marker for this mode. |
void |
init()
Initializes the edit mode. |
boolean |
isElectricKey(char ch)
|
void |
loadIfNecessary()
Loads the mode from disk if it hasn't been loaded already. |
void |
setProperties(java.util.Map props)
Should only be called by XModeHandler . |
void |
setProperty(java.lang.String key,
java.lang.Object value)
Sets a mode property. |
void |
setTokenMarker(TokenMarker marker)
Sets the token marker for this mode. |
java.lang.String |
toString()
Returns a string representation of this edit mode. |
void |
unsetProperty(java.lang.String key)
Unsets a mode property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.util.Map<java.lang.String,java.lang.Object> props
protected TokenMarker marker
Constructor Detail |
---|
public Mode(java.lang.String name)
name
- The name used in mode listings and to query mode
propertiesgetProperty(String)
Method Detail |
---|
public void init()
public TokenMarker getTokenMarker()
public void setTokenMarker(TokenMarker marker)
marker
- The new token markerpublic void loadIfNecessary()
public java.lang.Object getProperty(java.lang.String key)
key
- The property namepublic boolean getBooleanProperty(java.lang.String key)
key
- The property namepublic void setProperty(java.lang.String key, java.lang.Object value)
key
- The property namevalue
- The property valuepublic void unsetProperty(java.lang.String key)
key
- The property namepublic void setProperties(java.util.Map props)
XModeHandler
.
public boolean accept(java.lang.String fileName, java.lang.String firstLine)
fileName
- The buffer's namefirstLine
- The first line of the bufferpublic boolean acceptFilename(java.lang.String fileName)
fileName
- The buffer's name
public boolean acceptFirstLine(java.lang.String firstLine)
firstLine
- The first line of the buffer
public java.lang.String getName()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean getIgnoreWhitespace()
public java.util.List<IndentRule> getIndentRules()
public boolean isElectricKey(char ch)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |