ClassCastException and NoSuchMethod exception for plugin

Oxygen general issues.
rwang
Posts: 1
Joined: Fri Apr 28, 2006 10:06 pm

ClassCastException and NoSuchMethod exception for plugin

Post by rwang »

Is there a plugin example comes with source code? I tried to create plugin, but I've got error ClassCastException, then, NoSuchMethod exception when I cut/paste plugin example code from the PDF. I don't know why
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

I compiled the Uppercase plugin source code (classes UppercasePlugin and UppercasePluginExtension) contained both in the PDF manual and in the instructions for writing and installing <oXygen/> plugins available on the Plugins page, I installed the jar file and the plugin.xml file for the plugin in the plugins subfolder of the <oXygen/> install folder, I restarted <oXygen/>. It worked without problems: I selected an area of text in the editor panel, I right clicked in the editor panel, in the popup menu I selected Plugins -> Uppercase and the selected text was changed to uppercase. Following the example of the Uppercase plugin documented in the manual and using the API documentation available on the Plugins page you should be able to develop any type of plugin for the standalone distribution of <oXygen/>: general plugin, selection plugin, document plugin, custom protocol plugin.

Regards,
Sorin
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

When you copy and paste the sample code make sure the package of the Java classes of the plugin, for example in UppercasePluginExtension.java:

Code: Select all

package ro.sync.sample.plugin.uppercase;
is the same as the package declared in the file plugin.xml:

Code: Select all

class="ro.sync.sample.plugin.uppercase.UppercasePluginExtension"
as the User Manual specifies.

Regards,
Sorin
Post Reply