|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ephox.editlive.plugins.SafeLoadingPlugin
public abstract class SafeLoadingPlugin
An abstract base class useful for creating a plugin. This class performs standard plugin initialization work.
The editorInitialized method will be called on subclasses when the bean has been initialized.
It will do this in the constructor if the bean is already initialized, or during the TextEvent.LOADING_COMPLETE
event otherwise.
Please note that if you have fields that are initialized inline, the Java Language Specification (section 12.5) states that
fields are not initialized before a super call. Therefore these fields may be null when editorInitialized is called.
In addition, this class will also ensure that the version of EditLive! running is high enough to support the plugin. The performPreLoadingCompleteTasks method is called as soon as the version number is verified so that early-loading plugins can register custom document rendering.
In summary, if you are writing a plugin, you should consider extending from this class.
Constructor Summary | |
---|---|
SafeLoadingPlugin(ELJBean bean,
String requiredVersion,
String pluginName)
Standard constructor. |
Method Summary | |
---|---|
protected abstract void |
editorInitialized()
This is where you want to perform all initialization actions that require the editor to be loaded. |
ELJBean |
getBean()
The current ELJBean instance set via the constructor |
EphoxEditorPane |
getEditorPane()
Wrapper method to ELJBean.getEditorPane() that returns null if the bean isn't initialized. |
boolean |
isEnabled()
Returns the current enabled state of the plugin. |
protected void |
performPreLoadingCompleteTasks()
Method that will be called when the plugin is first loaded, before editorInitialized. |
void |
setEnabled(boolean enabled)
Sets the current enabled state of the plugin |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SafeLoadingPlugin(ELJBean bean, String requiredVersion, String pluginName)
bean
- instance of ELJBean this plugin will userequiredVersion
- minimum required EditLive! versionpluginName
- human readable name for this plugin (used for log messages)Method Detail |
---|
protected void performPreLoadingCompleteTasks()
NOTE: If you use this method, your plugin must be early loading otherwise there is no guarantee that your customisations will be registered in time for the document to use them.
public ELJBean getBean()
protected abstract void editorInitialized()
NOTE: As detailed in the class documentation your class fields may be null when this is called.
public EphoxEditorPane getEditorPane()
ELJBean.getEditorPane()
that returns null if the bean isn't initialized.
public void setEnabled(boolean enabled)
public boolean isEnabled()
|
Copyright (c) 2005-2012 Ephox Pty Ltd. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |