public class Jext
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BUILD
Last Jext's build date.
|
static boolean |
DEBUG
Debug mode(not final to avoid it being included in other .class files)
|
static boolean |
DELETE_OLD_SETTINGS
If true, Jext will delete user settings if this release is newer
|
static java.lang.String |
JEXT_HOME
Jext home directory.
|
static int |
JEXT_SERVER_PORT
Jext server base port number.
|
static java.util.ArrayList |
modes |
static java.util.ArrayList |
modesFileFilters |
static java.lang.String[] |
NEW_LINE
Available new lines characters
|
static java.lang.String |
RELEASE
Current Jext's release.
|
static java.lang.String |
SETTINGS_DIRECTORY
Settings directory.
|
static java.lang.String |
usrProps |
Constructor and Description |
---|
Jext() |
Modifier and Type | Method and Description |
---|---|
static void |
addAction(MenuAction action)
Add an action listener to the list.
|
static void |
addMode(Mode mode)
Adds a mode to Jext's syntax colorizing modes list
|
static void |
addPlugin(Plugin plugin)
Registers a plugin with the editor.
|
static void |
addPythonAction(java.lang.String name,
java.lang.String script,
boolean editAction)
Add a python action listener to the list.
|
static void |
assocPluginsToModes()
Makes each mode know what plugins to start when it is selected.
|
static void |
closeToQuit(JextFrame frame)
Close a
JextFrame by calling JextFrame.closeToQuit() and if it it the last window and we are not keeping the server open
we close Jext completely. |
static void |
closeWindow(JextFrame frame) |
static void |
executeScripts(JextFrame parent)
Execute scripts found in user home directory.
|
static void |
exit()
Exits Jext by closing all the windows.
|
static MenuAction |
getAction(java.lang.String action)
Returns a named action.
|
static boolean |
getBooleanProperty(java.lang.String name)
Returns true if the property value equals to "on" or "true"
|
static boolean |
getBooleanProperty(java.lang.String name,
java.lang.String def)
Returns true if the property value equals to "on" or "true"
|
static boolean |
getButtonsHighlight()
Returns true if highlight buttons should not be highlighted on mouse over.
|
static boolean |
getFlatMenus()
Returns true if menu should be flatened.
|
static java.lang.String |
getHomeDirectory()
Jext startup directory is saved during execution.
|
static DefaultInputHandler |
getInputHandler()
Returns the input handler.
|
static java.util.ArrayList |
getInstances()
Some external classes may need to notify
each instance of Jext.
|
static java.lang.String |
getLanguage()
Returns current selected language.
|
static java.io.InputStream |
getLanguageStream(java.io.InputStream in,
java.lang.String fileName)
Returns an input stream corresponding to selected language.
|
static Mode |
getMode(java.lang.String modeName)
Returns the mode according to its name.
|
static java.util.ArrayList |
getModes()
Returns modes list.
|
static java.awt.Toolkit |
getMyToolkit()
Many methods will need to use a
Toolkit . |
static Plugin |
getPlugin(java.lang.String name)
Returns a plugin by it's class name.
|
static Plugin[] |
getPlugins()
Returns an array of installed plugins.
|
static java.util.Properties |
getProperties()
The
XPropertiesHandler needs to get Jext's
Properties object to achieve its purpose. |
static java.lang.String |
getProperty(java.lang.String name)
If we store properties, we need to read them, too !
|
static java.lang.String |
getProperty(java.lang.String name,
java.lang.Object[] args)
Returns the property with the specified name, formatting it with
the
java.text.MessageFormat.format() method. |
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 SplashScreen |
getSplashScreen()
Returns splash screen
|
static int |
getWindowsCount()
Returns amount of opened Jext
|
static void |
initDirectories()
Creates the necessary directories.
|
static void |
initProperties()
Init the properties.
|
static boolean |
isDefaultKeepInMemory()
Returns true if the backgrounding is enabled.
|
static boolean |
isRunningBg()
As Jext can be runned in background mode, some operations may need to know wether
or not current instance is "up" or "crouched".
|
static boolean |
isServerEnabled()
Returns true if the server is enabled.
|
static void |
killSplashScreen()
Kills splash screen
|
static java.util.zip.ZipEntry |
languagePackContains(java.lang.String fileName) |
static void |
loadInSingleJVMInstance(java.lang.String[] args)
Attempts to load Jext in a single JVM instance only.
|
static void |
loadPlugins(java.lang.String directory)
Loads all plugins in a directory.
|
static void |
loadProps(java.io.InputStream in)
Deprecated.
Maintained only for plugins compliance. Use
loadXMLProps()
instead of this method. |
static void |
loadXMLActions(java.io.InputStream in,
java.lang.String fileName)
Load a set of actions from an XML file.
|
static void |
loadXMLOneClickActions(java.io.InputStream in,
java.lang.String fileName)
Load a set of actions from an XML file.
|
static void |
loadXMLProps(java.io.InputStream in,
java.lang.String fileName)
Load a set of properties from an XML file.
|
static void |
loadXMLProps(java.io.InputStream in,
java.lang.String fileName,
boolean toTranslate)
Load a set of properties from an XML file.
|
static void |
main(java.lang.String[] args)
Start method.
|
static JextFrame |
newWindow()
Opens a new window.
|
static JextFrame |
newWindow(java.lang.String[] args)
Opens a new window.
|
static void |
propertiesChanged()
Notify all instances of Jext and all properties listeners to reload properties.
|
static void |
recentChanged(JextFrame instance)
Notify all instances of Jext but the one which
saved the file to reload recent menu
|
static void |
saveProps()
Deprecated.
Use
saveXMLProps() instead |
static void |
saveXMLProps(java.lang.String description)
Saves the user's properties to a file using the XML specifications.
|
static void |
saveXMLProps(java.lang.String userProps,
java.lang.String description)
Saves the user's properties to a file using the XML specifications.
|
static void |
setDefaultKeepInMemory(boolean val) |
static void |
setLanguage(java.lang.String lang)
Sets the current selected language.
|
static void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property.
|
static void |
setServerEnabled(boolean on)
Used by security options panel to remember of the server status.
|
static void |
setSplashProgress(int val)
Set the splash screen progress value after
having checked if it isn't null (in case of a new window).
|
static void |
setSplashText(java.lang.String text)
Set the splash screen text value after having checked if it
isn't null (in case of a new window).
|
static void |
stopAutoCheck()
Stop the auto check function.
|
static void |
stopServer()
Stops the Jext server which loads every Jext instance in the same JVM.
|
static void |
unsetProperty(java.lang.String name)
Unsets (clears) a property.
|
public static java.lang.String RELEASE
public static java.lang.String BUILD
public static boolean DELETE_OLD_SETTINGS
public static boolean DEBUG
public static final java.lang.String[] NEW_LINE
public static final java.lang.String SETTINGS_DIRECTORY
public static final java.lang.String JEXT_HOME
public static final int JEXT_SERVER_PORT
public static java.util.ArrayList modes
public static java.util.ArrayList modesFileFilters
public static java.lang.String usrProps
public static boolean getButtonsHighlight()
public static boolean getFlatMenus()
public static void stopAutoCheck()
Thread
and then 'kill' it.public static DefaultInputHandler getInputHandler()
public static void addAction(MenuAction action)
action
- The action listenerpublic static void addPythonAction(java.lang.String name, java.lang.String script, boolean editAction)
name
- Internal action namescript
- The python source scripteditAction
- True if this is an edit actionpublic static MenuAction getAction(java.lang.String action)
action
- The actionpublic static void assocPluginsToModes()
public static void loadPlugins(java.lang.String directory)
directory
- The directorypublic static void addPlugin(Plugin plugin)
start()
method of the plugin.public static Plugin getPlugin(java.lang.String name)
name
- The plugin to returnpublic static Plugin[] getPlugins()
public static JextFrame newWindow(java.lang.String[] args)
args
- Parameters from command linepublic static JextFrame newWindow()
public static int getWindowsCount()
public static void propertiesChanged()
public static void recentChanged(JextFrame instance)
The
- instance which saved a filepublic static java.util.ArrayList getInstances()
ArrayList
containing all instances of Jextpublic static java.awt.Toolkit getMyToolkit()
Toolkit
.
This method simply avoid to write too many lines of
code.Toolkit
public static java.lang.String getHomeDirectory()
public static void saveProps()
saveXMLProps()
insteadpublic static void saveXMLProps(java.lang.String description)
description
- is a String
containing a little
description of the properties file. This String is stored on
topmost of the user's properties file. Can be set to
null
.public static void saveXMLProps(java.lang.String userProps, java.lang.String description)
userProps
- is the path to the file in which properties will
be stored. If it is set to null
, properties are not
saved at all.description
- is a String
containing a little
description of the properties file. This String is stored on
topmost of the user's properties file. Can be set to
null
.public static java.util.Properties getProperties()
XPropertiesHandler
needs to get Jext's
Properties
object to achieve its purpose.Properties
objectpublic static void loadXMLProps(java.io.InputStream in, java.lang.String fileName)
in
- An InputStream
is specified to load properties from a JAR filefileName
- The XML filenamepublic static void loadXMLProps(java.io.InputStream in, java.lang.String fileName, boolean toTranslate)
in
- An InputStream
is specified to load properties from a JAR filefileName
- The XML filenamepublic static void loadXMLActions(java.io.InputStream in, java.lang.String fileName)
in
- An InputStream
is specified to load properties from a JAR filefileName
- The XML filenamepublic static void loadXMLOneClickActions(java.io.InputStream in, java.lang.String fileName)
in
- An InputStream
is specified to load properties from a JAR filefileName
- The XML filenamepublic static java.io.InputStream getLanguageStream(java.io.InputStream in, java.lang.String fileName)
in
- The default streamfileName
- The requested filepublic static java.util.zip.ZipEntry languagePackContains(java.lang.String fileName)
public static void loadProps(java.io.InputStream in)
loadXMLProps()
instead of this method.in
- An InputStream
is specified to load properties from a JAR filepublic static void initDirectories()
public static void initProperties()
public static void setLanguage(java.lang.String lang)
lang
- The label of the languagepublic static java.lang.String getLanguage()
public static void executeScripts(JextFrame parent)
public static Mode getMode(java.lang.String modeName)
public static java.util.ArrayList getModes()
public static void addMode(Mode mode)
public static void setProperty(java.lang.String name, java.lang.String value)
name
- Property's namevalue
- The value to store as name
public static boolean getBooleanProperty(java.lang.String name)
name
- The name of the property to readpublic static boolean getBooleanProperty(java.lang.String name, java.lang.String def)
name
- The name of the property to readpublic static java.lang.String getProperty(java.lang.String name)
name
- The name of the property to readpublic 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)
java.text.MessageFormat.format()
method.name
- The propertyargs
- The positional parameterspublic static void unsetProperty(java.lang.String name)
name
- The propertypublic static void exit()
public static void closeToQuit(JextFrame frame)
JextFrame
by calling JextFrame.closeToQuit()
and if it it the last window and we are not keeping the server open
we close Jext completely.public static void closeWindow(JextFrame frame)
public static SplashScreen getSplashScreen()
public static void setSplashProgress(int val)
val
- The new valuepublic static void setSplashText(java.lang.String text)
text
- The new textpublic static void killSplashScreen()
public static void stopServer()
public static boolean isServerEnabled()
public static boolean isDefaultKeepInMemory()
public static void setDefaultKeepInMemory(boolean val)
public static void setServerEnabled(boolean on)
on
- If true, the server will be runned at next startpublic static void loadInSingleJVMInstance(java.lang.String[] args)
args
- The arguments of the new Jext windowpublic static boolean isRunningBg()
public static void main(java.lang.String[] args)
Copyright ? 2002 Romain Guy.