I want to define an extension point in my plugin.xml which is not available in my target platform. This is fine for me, because I want to take advantage of it only if it's available .
However ,when I add it Eclipse flags it with an error
Unknown extension point: 'org.eclipse.ui.trace.traceComponents'
Can I somehow mark this extension point as optional? I know that I can reduce the Unresolved extension points severity per-workspace or per-project, but I'd rather not do that for just one error.
The complete plugin.xml is
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
id="org.apache.sling.slingclipse.preferences"
name="Slingclipse Preferences"
point="org.eclipse.ui.preferencePages">
<page
name="Slingclipse"
class="org.apache.sling.slingclipse.preferences.SlingclipsePreferencePage"
id="org.apache.sling.slingclipse.preferences.defaultPreferences">
</page>
</extension>
<extension
point="org.eclipse.core.runtime.preferences">
<initializer
class="org.apache.sling.slingclipse.preferences.PreferenceInitializer">
</initializer>
</extension>
<extension
point="org.eclipse.ui.startup">
<startup
class="org.apache.sling.slingclipse.SlingclipseStrartup">
</startup>
</extension>
<extension
point="org.eclipse.ui.importWizards">
<category
id="org.apache.sling.slingclipse.ui.wizards.sampleCategory"
name="Sling">
</category>
<wizard
category="org.apache.sling.slingclipse.ui.wizards.sampleCategory"
class="org.apache.sling.slingclipse.ui.wizards.ImportWizard"
icon="icons/sample.gif"
id="org.apache.sling.slingclipse.ui.wizards.ImportWizard"
name="Import from Repository">
<description>
Import a file from the local file system into the workspace.
</description>
</wizard>
</extension>
<extension
point="org.eclipse.ui.trace.traceComponents">
<component
id="org.eclipse.ui.trace.tracingPrefPage"
label="Slingclipse">
<bundle
name="org.apache.sling.slingclipse"></bundle>
</component>
</extension>
</plugin>
You are mixing two concepts here: Development time versus runtime.
Extension points are dependencies declared at development time. Therefore you should have the plugin defining that extension point in your target platform at development time. But you are right, you can generally write the manifest XML for extending that extension point without it being available. In practice this does not work well because many extension points require to implement an interface which itself is also defined in the (non existing) plugin.
To make the functionality be optional for a user (and to not force him to have the defining plugin), you need to make the installation of your plugin optional. But that is not related to the manifest and the use of extension points at all. E.g. you have to declare a feature containing your plugin and make that feature depend on the feature containing the plugin defining the extension point.
Related
Currently trying to get my Eclipse RAP application to work with a custom styling. The documentation is giving me one headache after another and it's really hard getting into it.
Following their docs and trying to extend the default theme, I have set up my plugin.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.rap.ui.entrypoint">
<entrypoint
applicationId="org.______.rap.branding.application"
id="org.______.rap.branding.entrypoint"
brandingId="______"
path="/rap">
</entrypoint>
</extension>
<extension
id="org.______.rap.branding.application"
point="org.eclipse.core.runtime.applications">
<application
cardinality="singleton-global"
thread="main"
visible="true">
<run
class="org.______.rap.branding.Application">
</run>
</application>
</extension>
<extension
point="org.eclipse.ui.perspectives">
<perspective
class="org.______.rap.branding.Perspective"
id="org.______.rap.branding.perspective"
name="name">
</perspective>
</extension>
<extension
point="org.eclipse.rap.ui.branding">
<branding
id="______"
themeId="org.eclipse.rap.rwt.theme"
title="______ Theme">
</branding>
</extension>
<extension
point="org.eclipse.rap.ui.themes">
<themeContribution
file="theme/______.css"
themeId="org.eclipse.rap.rwt.theme" />
</extension>
</plugin>
I've blanked out some parts, just asume they're all the same keyword, lowercase letters only.
My .css-File is as simple as it could be to see, if the hook works:
* {
background: red !Important;
}
But it just loads the default theme, no changes whatsoever and I can't detect the injection anywhere on the page.
Appears the hook itself is correct, but RAP couldn't handle the background-property. Changing it to background-color instead did the trick.
In my eclipse based RCP Application, I want to hide unwanted help contents.
The help content is added via the org.eclipse.help.toc extension point from other plug-ins.
<extension point="org.eclipse.help.toc">
<toc file="help/toc.xml" primary="true">
</toc>
</extension>
I tried to disable it by activities:
<extension point="org.eclipse.ui.activities">
<activity id="disable" name="Disable">
</activity>
<activityPatternBinding activityId="disable"
pattern=".*/org.eclipse.help.toc">
</activityPatternBinding>
</extension>
But no success.
Help content contributions cannot be controlled by activities.
You simply need to exclude the help plug-ins (e.g. org.eclipse.jdt.doc.* for JDT documentation) from the runtime and the corresponding TOC entries will vanish.
I had the same issue and found the solution. You have to set the content to be hidden with HELP_DATA (link).
Here's my helpData.xml content:
<extensions>
<hidden>
<toc id="/org.eclipse.platform.doc.user/toc.xml"/>
</hidden>
</extensions>
and then refer to it in plugin_customization.ini:
org.eclipse.help/HELP_DATA = helpData.xml
and reference your plugin_customization.ini in your eclipse.ini or in the vm arguments of your launch config as
-Declipse.pluginCustomization=${workspace_loc}/com.castortech.iris.vision/plugin_customization.ini
I am developing a plugin in eclipse . Currently we are using "org.eclipse.ui.bindings" extension point for providing shortcut keys . But it's a static option for providing shortcut key for action . Our user's face some difficulty to using my plugin without shortcut keys . Is there any option to add a shortcut keys on runtime via eclipse plugin ?.
<extension
point="org.eclipse.ui.commands">
<category
name="ZMedia Shortcuts Category"
id="com.zmedia.viewer.commands.category">
</category>
<command
name="Update Zmedia Deployable Instances"
categoryId="com.zmedia.viewer.commands.category"
id="com.zmedia.viewer.commands.UpdateZmediaDeployableInstances">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
class="com.zmedia.viewer.handlers.UpdateZmediaDeployableInstances"
commandId="com.zmedia.viewer.commands.UpdateZmediaDeployableInstances">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
commandId="com.zmedia.viewer.commands.UpdateZmediaDeployableInstances"
sequence="M1+M2+ESC">
</key>
</extension>
The extension point description explicitly denies that:
API Information:
There is no public API for defining bindings. To try to achieve stability for the user, bindings are only defined through the extension points. If you are an RCP application, you should be able to override this behaviour in the WorkbenchAdvisor.
JUnit does the same, and I just can't figure out how...
I guess thats because of this entry in the Properties > Java Build Path > Libraries > Add Library wizard:
How can I do the same and include my library in this wizard from my plugin, i.e. make it available to a user in workspace?
OK, there are three different extension points you need to look at. The easiest way is to look at the JUnit plugin itself (there are four)
org.eclipse.jdt.junit: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.git
org.eclipse.jdt.junit.core: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.core.git
org.eclipse.jdt.junit.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit.runtime.git
org.eclipse.jdt.junit4.runtime: git://dev.eclipse.org/org.eclipse.jdt/org.eclipse.jdt.junit4.runtime.git
So, you can investigate the JUnit plugins, but these are the extension points you'll need:
For the Add Library, look at the extension point org.eclipse.jdt.ui.classpathContainerPage. From the JUnit plugin.xml:
<extension point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage
name="%JUnitContainerName"
class="org.eclipse.jdt.internal.junit.buildpath.JUnitContainerWizardPage"
id="org.eclipse.jdt.junit.JUNIT_CONTAINER">
</classpathContainerPage>
</extension>
So this is implemented as JUnitContainerWizardPage. This extends IClasspathContainerPage and IClasspathContainerPageExtension.
For the quickfix and classpathfix see the extension points org.eclipse.jdt.ui.quickFixProcessors and org.eclipse.jdt.ui.classpathFixProcessors. From the JUnit plugin.xml again:
<extension point="org.eclipse.jdt.ui.quickFixProcessors">
<quickFixProcessor
name="%junitQuickFixProcessor"
class="org.eclipse.jdt.internal.junit.ui.JUnitQuickFixProcessor"
id="org.eclipse.jdt.junit.JUnitQuickFixProcessor">
</quickFixProcessor>
</extension>
<extension point="org.eclipse.jdt.ui.classpathFixProcessors">
<classpathFixProcessor
name="%junitClasspathFixProcessor"
class="org.eclipse.jdt.internal.junit.ui.JUnitClasspathFixProcessor"
id="org.eclipse.jdt.junit.JUnitClasspathFixProcessor">
<overrides id="org.eclipse.jdt.ui.text.correction.DefaultClasspathFixProcessor">
</overrides>
</classpathFixProcessor>
</extension>
In addition to the extension points that are already mentioned in the thread:
The logic that initializes the container is in org.eclipse.jdt.junit.core plugin.
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.eclipse.jdt.internal.junit.buildpath.JUnitContainerInitializer"
id="org.eclipse.jdt.junit.JUNIT_CONTAINER">
</classpathContainerInitializer>
</extension>
I’m trying to write a custom p2 provisioning action to execute my own code when installing feature. Doing so with installHandler for Update Manager was easy, but as for p2, there’s absolutely no docs on this topic in the web, most of the time eclispe just silently ignores me (even in a log), and the only example I’ve found is not working.
So, if somebody can point me at a working example of custom provisioning action, that would help me understand the whole thing.
Thanks.
Finally, I’ve got it working somehow:
example_plugin:
plugin.xml:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.5"?>
<plugin>
<extension point="org.eclipse.equinox.p2.engine.touchpoints" id="example" name="Eclipse Touchpoint">
<touchpoint type="com.company.example.plugin" class="org.eclipse.equinox.internal.p2.touchpoint.eclipse.EclipseTouchpoint" version="1.0"/>
</extension>
<extension point="org.eclipse.equinox.p2.engine.actions">
<action
class="com.company.example.plugin.CustomAction"
name="do_custom_action"
touchpointType="com.company.example.plugin"
touchpointVersion="1.0"
version="1.0">
</action>
</extension>
</plugin>
META-INF\p2.xml:
provides.0.namespace=com.company.example.plugin
provides.0.name=do_custom_action
provides.0.version=1.0
example_feature:
feature.xml:
<?xml version="1.0" encoding="UTF-8"?>
<feature id="com.company.example.feature" label="Maven installer feature" version="2.2.1.qualifier">
<description url="http://www.example.com/description">[Enter Feature Description here.]</description>
<copyright url="http://www.example.com/copyright">[Enter Copyright Description here.]</copyright>
<license url="http://www.example.com/license">[Enter License Description here.]</license>
<requires>
<import plugin="com.company.example.plugin"/>
</requires>
<plugin
id="com.company.example.plugin"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
p2.inf:
metaRequirements.0.namespace=com.company.example.plugin
metaRequirements.0.name=do_custom_action
metaRequirements.0.range=1.0
instructions.configure = com.company.example.plugin.do_custom_action();
General comments:
Custom touchpoint action is stored in a plugin as a regular class.
Update site must contain proper artifacts.jar/content.jar (don’t know why, took a lot of time to debug this).
If you want to let your touch point action working, there are two approaches,
install your plug-in firstly that provides the new touchpoint action. Then install the contents from the repository using the new touchpoint action.
the iu depending on the new touchpoint action need require the bundle provides the new touchpoint action, it exactly likes what you found. See the example code attached by Simon Kaegi