public class EditorPlugin
extends org.eclipse.ui.plugin.AbstractUIPlugin
implements com.oxygenxml.editor.license.LicenseListener, com.oxygenxml.editor.editors.EditorIDsAndConstants
PLUGIN_PREFERENCE_SCOPE, PREFERENCES_DEFAULT_OVERRIDE_BASE_NAME, PREFERENCES_DEFAULT_OVERRIDE_FILE_NAME
ARCHIVES_EDITOR, AUTHOR_EXTENSION_PREFIX, AUTHOR_OPTIONS_TAG, AUTHOR_PLUGIN_ID, BRACKET_ANNOTATION, COM_AUTHOR_EDITOR_PREFIX, COM_OXYGENXML_EDITOR_PREFIX, COM_OXYGENXML_PREFIX, COMMAND_SCOPE_ALL, COMMAND_SCOPE_CSS, COMMAND_SCOPE_DTD, COMMAND_SCOPE_JS, COMMAND_SCOPE_NVDL, COMMAND_SCOPE_RNC, COMMAND_SCOPE_RNG, COMMAND_SCOPE_TRANSFORMATION, COMMAND_SCOPE_WSDL, COMMAND_SCOPE_XML, COMMAND_SCOPE_XML_COMMONS, COMMAND_SCOPE_XSL, CSS_EDITOR, DEBUGGER_CI_ANNOTATION, DECLARATION_ANNOTATION, DEVELOPER_OPTIONS_TAG, DEVELOPER_PLUGIN_ID, DTD_EDITOR, EDITOR_UTILITIES_3X_CLASS_NAME, EDITOR_UTILITIES_4X_CLASS_NAME, EDITORS_PREFIX, EPUB_EDITOR, JS_EDITOR, JSON_EDITOR, LANGUAGE_PACK, LIGHT_BULB_ANNOTATION, NEXAWEB_PLUGIN_ID, NVDL_EDITOR, NVDL_FILE_CONTENT_TYPE, NVDL_TEXT_EDITOR, OXYGEN_OPTIONS_TAG, OXYGEN_PLUGIN_ID, PREVIEW_PROBLEM_ANNOTATION, PY_EDITOR, REFERENCE_ANNOTATION, REGEXP_MATCH_ANNOTATION, RNC_EDITOR, RNG_EDITOR, RNG_FILE_CONTENT_TYPE, RNG_TEXT_EDITOR, SAME_LINE_ANNOTATION, SCH_EDITOR, SCH_FILE_CONTENT_TYPE, SCH_TEXT_EDITOR, SPELL_CHECK_ANNOTATION, SQL_EDITOR, SQL_FILE_CONTENT_TYPE, TAG_END_ANNOTATION, TAG_START_ANNOTATION, WSDL_EDITOR, WSDL_FILE_CONTENT_TYPE, WSDL_TEXT_EDITOR, XHTML_EDITOR, XHTML_FILE_CONTENT_TYPE, XML_EDITOR, XML_EDITOR_COMMAND_CATEGORY, XML_FILE_EDITOR_CONTENT_TYPE, XML_FILE_GENERIC_CONTENT_TYPE, XML_RELATED_CONTENT_TYPES, XML_TEXT_EDITOR, XPATH_ERROR_ANNOTATION, XPROC_EDITOR, XPROC_FILE_CONTENT_TYPE, XPROC_TEXT_EDITOR, XQUERY_DEBUGGER_CONTEXT_ID, XQUERY_EDITOR, XQUERY_FILE_CONTENT_TYPE, XSD_EDITOR, XSD_FILE_CONTENT_TYPE, XSD_TEXT_EDITOR, XSL_EDITOR, XSL_TEXT_EDITOR, XSLT_DEBUGGER_CONTEXT_ID, XSLT_FILE_CONTENT_TYPE
Constructor and Description |
---|
EditorPlugin()
The editor plugin constructor.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
computePreferencesPageID(java.lang.String suffix)
Compute the ID of the preferences page.
|
static void |
executeAfterWorkbenchCreation(java.lang.Runnable runnable)
Execute the runnable's content after the workbench is successfully initialized.
|
static org.eclipse.ui.IWorkbenchWindow |
getActiveWorkbenchWindow()
Get the active Workbench window.
|
static java.lang.String |
getApplicationDisplayName()
Get the application name.
|
static java.lang.String |
getApplicationVersion()
Get the current application version as described in plugin.xml
|
static EditorPlugin |
getDefault()
Returns the shared instance if it has been previously initialized.
|
org.eclipse.jface.dialogs.IDialogSettings |
getDialogSettingsSection(java.lang.String name)
Returns a section in the ui.editors plugin's dialog settings.
|
static int |
getEclipseMajorVersion()
Find the Eclipse major version from the "org.eclipse.platform_pluginVersionNumber" folder.
|
static int |
getEclipseMinorVersion()
Find the Eclipse first minor version from the "org.eclipse.platform_pluginVersionNumber" folder.
|
static java.lang.String |
getEclipseVersion()
Find the Eclipse version from the "org.eclipse.platform_pluginVersionNumber" folder.
|
org.eclipse.core.runtime.IExtension[] |
getPluginExtensions(java.lang.String extensionPointId)
Get all extensions of the oXygen extension point with the ID
extensionPointId by searching in all the current
Eclipse workspace. |
static java.lang.String |
getPluginID()
Get the plugin's ID.
|
static boolean |
includesAuthor()
Checks if the current plugin version includes Author specific editors and views.
|
static boolean |
isAuthor() |
static boolean |
isDeveloper() |
void |
licenseChanged(ro.sync.licensemanager.LicenseInformation licInfo) |
void |
start(org.osgi.framework.BundleContext context)
Startup the plugin.
|
void |
stop(org.osgi.framework.BundleContext context)
Shutdown the plugin.
|
boolean |
supportProtocol(java.lang.String protocol)
Check if the protocol is supported by our plugin.
|
createImageRegistry, getDialogSettings, getImageRegistry, getPreferenceStore, getWorkbench, imageDescriptorFromPlugin, initializeDefaultPluginPreferences, initializeDefaultPreferences, initializeImageRegistry, loadDialogSettings, loadPreferenceStore, refreshPluginActions, saveDialogSettings, savePreferenceStore, shutdown, startup
public boolean supportProtocol(java.lang.String protocol)
protocol
- The protocol to be checked.true
if our plugin supports this protocol, false
otherwise.public static java.lang.String getPluginID()
public static boolean isAuthor()
public static boolean isDeveloper()
public static java.lang.String getApplicationDisplayName()
public static java.lang.String getApplicationVersion()
public static boolean includesAuthor()
true
if Author should be included.public static EditorPlugin getDefault()
public static java.lang.String getEclipseVersion()
public static int getEclipseMajorVersion() throws ro.sync.util.NumberFormatException
ro.sync.util.NumberFormatException
public static int getEclipseMinorVersion() throws ro.sync.util.NumberFormatException
ro.sync.util.NumberFormatException
public void start(org.osgi.framework.BundleContext context) throws java.lang.Exception
start
in interface org.osgi.framework.BundleActivator
start
in class org.eclipse.ui.plugin.AbstractUIPlugin
java.lang.Exception
Plugin.start(BundleContext)
public org.eclipse.jface.dialogs.IDialogSettings getDialogSettingsSection(java.lang.String name)
name
- the name of the sectionpublic static org.eclipse.ui.IWorkbenchWindow getActiveWorkbenchWindow()
public static void executeAfterWorkbenchCreation(java.lang.Runnable runnable)
runnable
- The runnable to execute.public void stop(org.osgi.framework.BundleContext context) throws java.lang.Exception
stop
in interface org.osgi.framework.BundleActivator
stop
in class org.eclipse.ui.plugin.AbstractUIPlugin
org.eclipse.core.runtime.CoreException
java.lang.Exception
Plugin.stop(BundleContext)
public org.eclipse.core.runtime.IExtension[] getPluginExtensions(java.lang.String extensionPointId)
extensionPointId
by searching in all the current
Eclipse workspace.
The oXygen extension point with the ID extensionPointId
is declared in the file plugin.xml, for example for "extPoint1" there
is an entry in oXygen's plugin.xml
<extension-point id="extPoint1" name="Name of extension point"/>
A plugin that provides an extension must define it in its plugin.xml file with an XML element that respects the content model accepted by oXygen for that extension point.
Currently oXygen supports the following content models for extensions:
<!ELEMENT extension (action*)>
<!ATTLIST extension
point (com.oxygenxml.editor.toolbarActions) #REQUIRED
>
<!ELEMENT action EMPTY>
<!ATTLIST action
id CDATA #REQUIRED
class CDATA #REQUIRED
label CDATA #REQUIRED
>
where:
<!ELEMENT extension (action*)>
<!ATTLIST extension
point (com.oxygenxml.editor.outlineMenuAdditions) #REQUIRED
>
<!ELEMENT action EMPTY>
<!ATTLIST action
id CDATA #REQUIRED
class CDATA #REQUIRED
label CDATA #REQUIRED
icon CDATA #REQUIRED
>
where:
<!ELEMENT extension (group*)>
<!ATTLIST extension
point (com.oxygenxml.editor.contextMenuAdditions) #REQUIRED
>
<!ELEMENT group (action*)>
<!ATTLIST group
id CDATA #REQUIRED
>
<!ELEMENT action EMPTY>
<!ATTLIST action
id CDATA #REQUIRED
class CDATA #REQUIRED
label CDATA #REQUIRED
icon CDATA #REQUIRED
>
where:
<!ELEMENT extension (delimiters)>
<!ATTLIST extension
point (com.oxygenxml.editor.outlineDelimiters) #REQUIRED
>
<!ELEMENT delimiters EMPTY>
<!ATTLIST delimiters
start CDATA #REQUIRED
end CDATA #REQUIRED
>
where:
extensionPointId
- The extension point that we want the extensions.- a base class for
extensions for toolbarActions and contextMenuAdditions.
,
- a base class for
extension for outlineMenuAdditions.
public void licenseChanged(ro.sync.licensemanager.LicenseInformation licInfo)
licenseChanged
in interface com.oxygenxml.editor.license.LicenseListener
LicenseListener.licenseChanged(ro.sync.licensemanager.LicenseInformation)
public static java.lang.String computePreferencesPageID(java.lang.String suffix)
suffix
- The suffix (last page ID variable part)© Copyright Syncro Soft SRL 2002 - 2014.