public class ModeProvider
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static ModeProvider |
instance |
Constructor and Description |
---|
ModeProvider() |
Modifier and Type | Method and Description |
---|---|
void |
addMode(Mode mode)
Do not call this method.
|
void |
addUserMode(Mode mode,
java.nio.file.Path target)
Do not call this method.
|
protected void |
error(java.lang.String file,
java.lang.Throwable e) |
Mode |
getMode(java.lang.String name)
Returns the edit mode with the specified name.
|
Mode |
getModeForFile(java.lang.String filename,
java.lang.String firstLine)
Get the appropriate mode that must be used for the file
|
Mode |
getModeForFile(java.lang.String filepath,
java.lang.String filename,
java.lang.String firstLine)
Get the appropriate mode that must be used for the file
|
Mode[] |
getModes()
Returns an array of installed edit modes.
|
void |
loadMode(Mode mode) |
void |
loadMode(Mode mode,
XModeHandler xmh) |
void |
removeAll() |
boolean |
removeMode(java.lang.String name)
Will only remove user modes.
|
public static ModeProvider instance
public void removeAll()
public boolean removeMode(java.lang.String name) throws java.io.IOException
java.io.IOException
public Mode getMode(java.lang.String name)
name
- The edit modepublic Mode getModeForFile(java.lang.String filename, java.lang.String firstLine)
filename
- the filenamefirstLine
- the first line of the filepublic Mode getModeForFile(java.lang.String filepath, java.lang.String filename, java.lang.String firstLine)
filepath
- the filepath, can be null
filename
- the filename, can be null
firstLine
- the first line of the filepublic Mode[] getModes()
public void addMode(Mode mode)
mode
- The edit modereloadModes
public void addUserMode(Mode mode, java.nio.file.Path target) throws java.io.IOException
mode
- The edit modejava.io.IOException
reloadModes
public void loadMode(Mode mode, XModeHandler xmh)
public void loadMode(Mode mode)
protected void error(java.lang.String file, java.lang.Throwable e)