|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gjt.sp.jedit.jEdit
public class jEdit
The main class of the jEdit text editor.
Method Summary | |
---|---|
static void |
_closeBuffer(View view,
Buffer buffer)
Closes the buffer, even if it has unsaved changes. |
static Buffer |
_getBuffer(java.lang.String path)
Returns the buffer with the specified path name. |
static void |
addActionSet(ActionSet actionSet)
Adds a new action set to jEdit's list. |
static void |
addMode(Mode mode)
Do not call this method. |
static void |
addPluginJAR(java.lang.String path)
Loads the plugin JAR with the specified path. |
static void |
backupSettingsFile(java.io.File file)
Backs up the specified file in the settings directory. |
static void |
checkBufferStatus(View view)
Checks each buffer's status on disk and shows the dialog box informing the user that buffers changed on disk, if necessary. |
static boolean |
closeAllBuffers(View view)
Closes all open buffers. |
static boolean |
closeAllBuffers(View view,
boolean isExiting)
Closes all open buffers. |
static boolean |
closeBuffer(View view,
Buffer buffer)
Closes a buffer. |
static void |
closeView(View view)
Closes a view. |
static void |
commitTemporary(Buffer buffer)
Adds a temporary buffer to the buffer list. |
static void |
exit(View view,
boolean reallyExit)
Exits cleanly from jEdit, prompting the user if any unsaved files should be saved first. |
static EditAction |
getAction(java.lang.String name)
Returns the specified action. |
static ActionContext |
getActionContext()
Returns the action context used to store editor actions. |
static java.lang.String[] |
getActionNames()
Returns all registered action names. |
static EditAction[] |
getActions()
Deprecated. Call getActionNames() instead |
static ActionSet |
getActionSetForAction(EditAction action)
Deprecated. Use the form that takes a String instead |
static ActionSet |
getActionSetForAction(java.lang.String action)
Returns the action set that contains the specified action. |
static ActionSet[] |
getActionSets()
Returns all registered action sets. |
static View |
getActiveView()
Returns the currently focused view. |
static boolean |
getBooleanProperty(java.lang.String name)
Returns the value of a boolean property. |
static boolean |
getBooleanProperty(java.lang.String name,
boolean def)
Returns the value of a boolean property. |
static Buffer |
getBuffer(java.lang.String path)
Returns the buffer with the specified path name. |
static int |
getBufferCount()
Returns the number of open buffers. |
static Buffer[] |
getBuffers()
Returns an array of open buffers. |
static java.lang.String |
getBuild()
Returns the internal version. |
static ActionSet |
getBuiltInActionSet()
Returns the set of commands built into jEdit. |
static java.awt.Color |
getColorProperty(java.lang.String name)
Returns the value of a color property. |
static java.awt.Color |
getColorProperty(java.lang.String name,
java.awt.Color def)
Returns the value of a color property. |
static double |
getDoubleProperty(java.lang.String name,
double def)
|
static EditServer |
getEditServer()
Returns the edit server instance. |
static Buffer |
getFirstBuffer()
Returns the first buffer. |
static View |
getFirstView()
Returns the first view. |
static java.awt.Font |
getFontProperty(java.lang.String name)
Returns the value of a font property. |
static java.awt.Font |
getFontProperty(java.lang.String name,
java.awt.Font def)
Returns the value of a font property. |
static InputHandler |
getInputHandler()
Returns the current input handler (key binding to action mapping) |
static int |
getIntegerProperty(java.lang.String name,
int def)
Returns the value of an integer property. |
static java.lang.String |
getJARCacheDirectory()
Returns the directory where plugin cache files are stored. |
static java.lang.String |
getJEditHome()
Returns the jEdit install directory. |
static Buffer |
getLastBuffer()
Returns the last buffer. |
static View |
getLastView()
Returns the last view. |
static Mode |
getMode(java.lang.String name)
Returns the edit mode with the specified name. |
static Mode[] |
getModes()
Returns an array of installed edit modes. |
static java.lang.String[] |
getNotLoadedPluginJARs()
Returns a list of plugin JARs that are not currently loaded by examining the user and system plugin directories. |
static EditPlugin |
getPlugin(java.lang.String name)
Returns the plugin with the specified class name. |
static EditPlugin |
getPlugin(java.lang.String name,
boolean loadIfNecessary)
Returns the plugin with the specified class name. |
static PluginJAR |
getPluginJAR(java.lang.String path)
Returns the JAR with the specified path name. |
static PluginJAR[] |
getPluginJARs()
Returns an array of installed plugins. |
static EditPlugin[] |
getPlugins()
Returns an array of installed plugins. |
static java.util.Properties |
getProperties()
Returns the properties object which contains all known jEdit properties. |
static java.lang.String |
getProperty(java.lang.String name)
Fetches a property, returning null if it's not defined. |
static java.lang.String |
getProperty(java.lang.String name,
java.lang.Object[] args)
Returns the property with the specified name. |
static java.lang.String |
getProperty(java.lang.String name,
java.lang.String def)
Fetches a property, returning the default value if it's not defined. |
static java.lang.String |
getSettingsDirectory()
Returns the path of the directory where user-specific settings are stored. |
static java.lang.String |
getVersion()
Returns the jEdit version as a human-readable string. |
static int |
getViewCount()
Returns the number of open views. |
static View[] |
getViews()
Returns an array of all open views. |
static boolean |
isBackgroundModeEnabled()
Returns true if jEdit was started with the -background
command-line switch. |
static boolean |
isMainThread()
Returns true if the currently running thread is the main thread. |
static void |
main(java.lang.String[] args)
The main method of the jEdit application. |
static Buffer |
newFile(View view)
Creates a new `untitled' file. |
static Buffer |
newFile(View view,
java.lang.String dir)
Creates a new `untitled' file. |
static View |
newView(View view)
Creates a new view. |
static View |
newView(View view,
Buffer buffer)
Creates a new view of a buffer. |
static View |
newView(View view,
Buffer buffer,
boolean plainView)
Creates a new view of a buffer. |
static View |
newView(View view,
Buffer buffer,
View.ViewConfig config)
Creates a new view. |
static Buffer |
openFile(View view,
java.lang.String path)
Opens a file. |
static Buffer |
openFile(View view,
java.lang.String parent,
java.lang.String path,
boolean readOnly,
boolean newFile)
Deprecated. The openFile() forms with the readOnly parameter should not be used. The readOnly prameter is no longer supported. |
static Buffer |
openFile(View view,
java.lang.String parent,
java.lang.String path,
boolean readOnly,
boolean newFile,
java.util.Hashtable props)
Deprecated. The openFile() forms with the readOnly parameter should not be used. The readOnly prameter is no longer supported. |
static Buffer |
openFile(View view,
java.lang.String parent,
java.lang.String path,
boolean newFile,
java.util.Hashtable props)
Opens a file. |
static Buffer |
openFiles(View view,
java.lang.String parent,
java.lang.String[] args)
Opens the file names specified in the argument array. |
static Buffer |
openTemporary(View view,
java.lang.String parent,
java.lang.String path,
boolean newFile)
Opens a temporary buffer. |
static void |
propertiesChanged()
Reloads various settings from the properties. |
static void |
reloadAllBuffers(View view,
boolean confirm)
Reloads all open buffers. |
static void |
reloadModes()
Reloads all edit modes. |
static void |
removeActionSet(ActionSet actionSet)
Removes an action set from jEdit's list. |
static void |
removePluginJAR(PluginJAR jar,
boolean exit)
Unloads the given plugin JAR with the specified path. |
static void |
resetProperty(java.lang.String name)
Resets a property to its default value. |
static void |
saveAllBuffers(View view)
Saves all open buffers. |
static void |
saveAllBuffers(View view,
boolean confirm)
Saves all open buffers. |
static void |
saveSettings()
Saves all user preferences to disk. |
static void |
setBooleanProperty(java.lang.String name,
boolean value)
Sets a boolean property. |
static void |
setColorProperty(java.lang.String name,
java.awt.Color value)
Sets the value of a color property. |
static void |
setDoubleProperty(java.lang.String name,
double value)
|
static void |
setFontProperty(java.lang.String name,
java.awt.Font value)
Sets the value of a font property. |
static void |
setIntegerProperty(java.lang.String name,
int value)
Sets the value of an integer property. |
static void |
setProperty(java.lang.String name,
java.lang.String value)
Sets a property to a new value. |
static void |
setTemporaryProperty(java.lang.String name,
java.lang.String value)
Sets a property to a new value. |
static void |
showMemoryDialog(View view)
Performs garbage collection and displays a dialog box showing memory status. |
static void |
unsetProperty(java.lang.String name)
Unsets (clears) a property. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getVersion()
public static java.lang.String getBuild()
public static void main(java.lang.String[] args)
args
- The command line argumentspublic static final java.util.Properties getProperties()
public static final java.lang.String getProperty(java.lang.String name)
name
- The propertypublic static final java.lang.String getProperty(java.lang.String name, java.lang.String def)
name
- The propertydef
- The default valuepublic static final java.lang.String getProperty(java.lang.String name, java.lang.Object[] args)
The elements of the args
array are substituted
into the value of the property in place of strings of the
form {n}
, where n
is an index
in the array.
You can find out more about this feature by reading the
documentation for the format
method of the
java.text.MessageFormat
class.
name
- The propertyargs
- The positional parameterspublic static final boolean getBooleanProperty(java.lang.String name)
name
- The propertypublic static final boolean getBooleanProperty(java.lang.String name, boolean def)
name
- The propertydef
- The default valuepublic static final int getIntegerProperty(java.lang.String name, int def)
name
- The propertydef
- The default valuepublic static double getDoubleProperty(java.lang.String name, double def)
public static final java.awt.Font getFontProperty(java.lang.String name)
name
property, the font size is stored
in the namesize
property, and the font style is
stored in namestyle
. For example, if
name
is view.gutter.font
, the
properties will be named view.gutter.font
,
view.gutter.fontsize
, and
view.gutter.fontstyle
.
name
- The propertypublic static final java.awt.Font getFontProperty(java.lang.String name, java.awt.Font def)
name
property, the font size is stored
in the namesize
property, and the font style is
stored in namestyle
. For example, if
name
is view.gutter.font
, the
properties will be named view.gutter.font
,
view.gutter.fontsize
, and
view.gutter.fontstyle
.
name
- The propertydef
- The default valuepublic static java.awt.Color getColorProperty(java.lang.String name)
name
- The property namepublic static java.awt.Color getColorProperty(java.lang.String name, java.awt.Color def)
name
- The property namedef
- The default valuepublic static void setColorProperty(java.lang.String name, java.awt.Color value)
name
- The property namevalue
- The valuepublic static final void setProperty(java.lang.String name, java.lang.String value)
name
- The propertyvalue
- The new valuepublic static final void setTemporaryProperty(java.lang.String name, java.lang.String value)
name
- The propertyvalue
- The new valuepublic static final void setBooleanProperty(java.lang.String name, boolean value)
name
- The propertyvalue
- The valuepublic static final void setIntegerProperty(java.lang.String name, int value)
name
- The propertyvalue
- The valuepublic static final void setDoubleProperty(java.lang.String name, double value)
public static final void setFontProperty(java.lang.String name, java.awt.Font value)
name
property, the font size is stored
in the namesize
property, and the font style is
stored in namestyle
. For example, if
name
is view.gutter.font
, the
properties will be named view.gutter.font
,
view.gutter.fontsize
, and
view.gutter.fontstyle
.
name
- The propertyvalue
- The valuepublic static final void unsetProperty(java.lang.String name)
name
- The propertypublic static final void resetProperty(java.lang.String name)
name
- The propertypublic static void propertiesChanged()
public static java.lang.String[] getNotLoadedPluginJARs()
public static EditPlugin getPlugin(java.lang.String name)
public static EditPlugin getPlugin(java.lang.String name, boolean loadIfNecessary)
loadIfNecessary
is true, the plugin will be activated in
case it has not yet been started.
public static EditPlugin[] getPlugins()
public static PluginJAR[] getPluginJARs()
public static PluginJAR getPluginJAR(java.lang.String path)
path
- The path namepublic static void addPluginJAR(java.lang.String path)
PluginJAR.checkDependencies()
method.
path
- The JAR file pathpublic static void removePluginJAR(PluginJAR jar, boolean exit)
jar
- The PluginJAR
instanceexit
- Set to true if jEdit is exiting; enables some
shortcuts so the editor can close faster.public static ActionContext getActionContext()
public static void addActionSet(ActionSet actionSet)
public static void removeActionSet(ActionSet actionSet)
public static ActionSet getBuiltInActionSet()
public static ActionSet[] getActionSets()
public static EditAction getAction(java.lang.String name)
name
- The action namepublic static ActionSet getActionSetForAction(java.lang.String action)
action
- The actionpublic static ActionSet getActionSetForAction(EditAction action)
public static EditAction[] getActions()
public static java.lang.String[] getActionNames()
public static void reloadModes()
public static Mode getMode(java.lang.String name)
name
- The edit modepublic static Mode[] getModes()
public static Buffer openFiles(View view, java.lang.String parent, java.lang.String[] args)
parent
- The parent directoryargs
- The file names to openpublic static Buffer openFile(View view, java.lang.String path)
view
- The view to open the file inpath
- The file pathpublic static Buffer openFile(View view, java.lang.String parent, java.lang.String path, boolean readOnly, boolean newFile)
public static Buffer openFile(View view, java.lang.String parent, java.lang.String path, boolean readOnly, boolean newFile, java.util.Hashtable props)
public static Buffer openFile(View view, java.lang.String parent, java.lang.String path, boolean newFile, java.util.Hashtable props)
view
- The view to open the file inparent
- The parent directory of the filepath
- The path name of the filenewFile
- True if the file should not be loaded from disk
be prompted if it should be reloadedprops
- Buffer-local properties to set in the bufferpublic static Buffer openTemporary(View view, java.lang.String parent, java.lang.String path, boolean newFile)
view
- The view to open the file inparent
- The parent directory of the filepath
- The path name of the filenewFile
- True if the file should not be loaded from diskpublic static void commitTemporary(Buffer buffer)
buffer
- The bufferpublic static Buffer newFile(View view)
view
- The view to create the file inpublic static Buffer newFile(View view, java.lang.String dir)
view
- The view to create the file indir
- The directory to create the file inpublic static boolean closeBuffer(View view, Buffer buffer)
view
- The viewbuffer
- The buffer
public static void _closeBuffer(View view, Buffer buffer)
view
- The view, may be nullbuffer
- The buffer
java.lang.NullPointerException
- if the buffer is nullpublic static boolean closeAllBuffers(View view)
view
- The viewpublic static boolean closeAllBuffers(View view, boolean isExiting)
view
- The viewisExiting
- This must be false unless this method is
being called by the exit() methodpublic static void saveAllBuffers(View view)
view
- The viewpublic static void saveAllBuffers(View view, boolean confirm)
view
- The viewconfirm
- If true, a confirmation dialog will be shown firstpublic static void reloadAllBuffers(View view, boolean confirm)
view
- The viewconfirm
- If true, a confirmation dialog will be shown first
if any buffers are dirtypublic static Buffer _getBuffer(java.lang.String path)
path
- The path nameMiscUtilities.constructPath(String,String)
,
MiscUtilities.resolveSymlinks(String)
,
getBuffer(String)
public static Buffer getBuffer(java.lang.String path)
_getBuffer(String)
instead.
path
- The path nameMiscUtilities.constructPath(String,String)
,
MiscUtilities.resolveSymlinks(String)
public static Buffer[] getBuffers()
public static int getBufferCount()
public static Buffer getFirstBuffer()
public static Buffer getLastBuffer()
public static void checkBufferStatus(View view)
view
- The viewpublic static InputHandler getInputHandler()
InputHandler
public static View newView(View view)
view
- An existing viewpublic static View newView(View view, Buffer buffer)
view
- An existing viewbuffer
- The bufferpublic static View newView(View view, Buffer buffer, boolean plainView)
view
- An existing viewbuffer
- The bufferplainView
- If true, the view will not have dockable windows or
tool bars.public static View newView(View view, Buffer buffer, View.ViewConfig config)
view
- An existing viewbuffer
- A buffer to display, or nullconfig
- Encapsulates the view geometry, split configuration
and if the view is a plain viewpublic static void closeView(View view)
public static View[] getViews()
public static int getViewCount()
public static View getFirstView()
public static View getLastView()
public static View getActiveView()
public static boolean isMainThread()
public static boolean isBackgroundModeEnabled()
-background
command-line switch.
public static void showMemoryDialog(View view)
view
- The viewpublic static java.lang.String getJEditHome()
public static java.lang.String getSettingsDirectory()
null
if jEdit was
started with the -nosettings
command-line switch; do not
blindly use this method without checking for a null
return value first.
public static java.lang.String getJARCacheDirectory()
public static void backupSettingsFile(java.io.File file)
file
- The filepublic static void saveSettings()
public static void exit(View view, boolean reallyExit)
view
- The view from which this exit was calledreallyExit
- If background mode is enabled and this parameter
is true, then jEdit will close all open views instead of exiting
entirely.public static EditServer getEditServer()
public static void addMode(Mode mode)
mode
- The edit mode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |