Module jEdit

Class ModeProvider

java.lang.Object
org.gjt.sp.jedit.syntax.ModeProvider

public class ModeProvider extends Object
This class works like a singleton, the instance is initialized by jEdit.
Since:
jEdit 4.3pre10
Version:
$Id: Buffer.java 8190 2006-12-07 07:58:34Z kpouer $
Author:
Matthieu Casanova
  • Field Details

  • Constructor Details

    • ModeProvider

      public ModeProvider()
  • Method Details

    • removeAll

      public void removeAll()
    • removeMode

      public boolean removeMode(String name) throws IOException
      Will only remove user modes.
      Returns:
      true if the mode was removed, false otherwise.
      Throws:
      IOException
    • getMode

      public Mode getMode(String name)
      Returns the edit mode with the specified name.
      Parameters:
      name - The edit mode
      Since:
      jEdit 4.3pre10
    • getModeForFile

      public Mode getModeForFile(String filename, String firstLine)
      Get the appropriate mode that must be used for the file
      Parameters:
      filename - the filename
      firstLine - 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(String filepath, String filename, String firstLine)
      Get the appropriate mode that must be used for the file
      Parameters:
      filepath - the filepath, can be null
      filename - the filename, can be null
      firstLine - 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:
    • addUserMode

      public void addUserMode(Mode mode, Path target) throws 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:
      IOException
      Since:
      jEdit 4.3pre10
      See Also:
    • loadMode

      public void loadMode(Mode mode, XModeHandler xmh)
    • loadMode

      public void loadMode(Mode mode)
    • error

      protected void error(String file, Throwable e)