Package org.gjt.sp.jedit.syntax
Class ModeProvider
- java.lang.Object
-
- org.gjt.sp.jedit.syntax.ModeProvider
-
public class ModeProvider extends java.lang.ObjectThis class works like a singleton, the instance is initialized by jEdit.- Since:
- jEdit 4.3pre10
-
-
Field Summary
Fields Modifier and Type Field Description static ModeProviderinstance
-
Constructor Summary
Constructors Constructor Description ModeProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMode(Mode mode)Do not call this method.voidaddUserMode(Mode mode, java.nio.file.Path target)Do not call this method.protected voiderror(java.lang.String file, java.lang.Throwable e)ModegetMode(java.lang.String name)Returns the edit mode with the specified name.ModegetModeForFile(java.lang.String filename, java.lang.String firstLine)Get the appropriate mode that must be used for the fileModegetModeForFile(java.lang.String filepath, java.lang.String filename, java.lang.String firstLine)Get the appropriate mode that must be used for the fileMode[]getModes()Returns an array of installed edit modes.voidloadMode(Mode mode)voidloadMode(Mode mode, XModeHandler xmh)voidremoveAll()booleanremoveMode(java.lang.String name)Will only remove user modes.
-
-
-
Field Detail
-
instance
public static ModeProvider instance
-
-
Method Detail
-
removeAll
public void removeAll()
-
removeMode
public boolean removeMode(java.lang.String name) throws java.io.IOExceptionWill only remove user modes.- Returns:
- true if the mode was removed, false otherwise.
- Throws:
java.io.IOException
-
getMode
public Mode getMode(java.lang.String name)
Returns the edit mode with the specified name.- Parameters:
name- The edit mode- Since:
- jEdit 4.3pre10
-
getModeForFile
public Mode getModeForFile(java.lang.String filename, java.lang.String firstLine)
Get the appropriate mode that must be used for the file- Parameters:
filename- the filenamefirstLine- the first line of the file- Returns:
- the edit mode, or null if no mode match the file
- Since:
- jEdit 4.3pre12
-
getModeForFile
public 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- Parameters:
filepath- the filepath, can benullfilename- the filename, can benullfirstLine- the first line of the file- Returns:
- the edit mode, or null if no mode match the file
- Since:
- jEdit 4.5pre1
-
getModes
public Mode[] getModes()
Returns an array of installed edit modes.- Since:
- jEdit 4.3pre10
-
addMode
public void addMode(Mode mode)
Do not call this method. It is only public so that classes in the org.gjt.sp.jedit.syntax package can access it.- Parameters:
mode- The edit mode- Since:
- jEdit 4.3pre10
- See Also:
reloadModes
-
addUserMode
public void addUserMode(Mode mode, java.nio.file.Path target) throws java.io.IOException
Do not call this method. It is only public so that classes in the org.gjt.sp.jedit.syntax package can access it.- Parameters:
mode- The edit mode- Throws:
java.io.IOException- Since:
- jEdit 4.3pre10
- See Also:
reloadModes
-
loadMode
public void loadMode(Mode mode, XModeHandler xmh)
-
loadMode
public void loadMode(Mode mode)
-
error
protected void error(java.lang.String file, java.lang.Throwable e)
-
-