On 8/14/2013 11:22 AM, Paul Bailey wrote:
Have a look at this article:
http://www.ibm.com/developerworks/websphere/library/techarticles/0605_casey/0605_casey.html
It's old, and is talking about RDz instead of RDi, but the majority of the steps are identical and it should be fairly clear what to do.
A hint for the final step, which appears to be different:
There are two locations that hold plugins, "plugins" in the SDP folder and "plugins" in the SDPShared folder. When exporting your plugin (or copying it, as suggested) do not copy into the shared folder as it just won't work.
It was fairly clear, especially the final sentence 'If all went well,
you should now have a working plug-in.'
Consistently getting the error Class
"com.kc2hiz.lpexextensions.ToPrefixArea" not found. Clearly, I'm doing
something wrong, but exactly what that might be is mysterious to this
plug-in beginner. I did follow a similar script in WDSC 6.0 but had a
snafu in 7.0 which put me off my feed. I thought I was probably
overthinking the problem and so tried it on 9.0.0.1.
Don't know what to post to have someone guide me down the road to a
working plug-in.
It compiles fine, creating
com.kc2hiz.lpexExtensions_1.0.0.201308141623.jar Inside that jar file is:
plugin.xml
/META_INF/MANIFEST.MF
/com/kc2hiz/lpexextensions.Activator.class
/com/kc2hiz/lpexextensions.ToPrefixArea.class
Here's the plugin.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="com.ibm.lpex.preload">
<preload
class="com.kc2hiz.lpexextensions.ToPrefixArea">
</preload>
</extension>
</plugin>
The MANIFEST.MF file:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LpexExtensions
Bundle-SymbolicName: com.kc2hiz.lpexExtensions;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.kc2hiz.lpexextensions.Activator
Bundle-Vendor: KC2HIZ
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.ibm.lpex;bundle-version="4.2.0"
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package:
com.kc2hiz.lpexextensions;uses:="com.ibm.lpex.core,org.eclipse.ui.plugin,org.osgi.framework"
Activator.java:
package com.kc2hiz.lpexextensions;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.kc2hiz.lpexExtensions";
//$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see
org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see
org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}
And ToPrefixArea.java:
package com.kc2hiz.lpexextensions;
import com.ibm.lpex.core.LpexAction;
import com.ibm.lpex.core.LpexView;
public class ToPrefixArea implements LpexAction {
@Override
public boolean available(LpexView view) {
// allow the action to run in any visible, writable document
return view.currentElement() != 0 && !view.queryOn("readonly");
}
@Override
public void doAction(LpexView view) {
// go to the beginning of the line
view.doDefaultCommand("home");
// and move cursor left into the prefix area
view.doDefaultCommand("left");
}
}
The .log file is throwing the following error, which is related to me
trying to do a 'Hello, World'. Which I gave up on, deleting the jar
file and project but apparently there's still something lingering behind.
!ENTRY org.eclipse.ui 4 4 2013-08-14 16:27:09.230
!MESSAGE Unable to find Action Set: com.kc2hiz.lpexextensions.actionSet
I have not a clue where to turn next.
--buck
As an Amazon Associate we earn from qualifying purchases.