Plugin Development: submit a customized form

Oxygen general issues.
thu
Posts: 12
Joined: Wed Jan 11, 2012 7:46 pm

Plugin Development: submit a customized form

Post by thu »

I need to gather input from the user, and I would like to gather the information via a form that has text fields and perhaps other swing elements like combo-boxes, etc... I would like the user to be able to access the form via the menu bar, and once they have filled out the form and click on a submit button it should then execute my custom logic.

From the documentation, it is clear that I should have a class that extends WorkspaceAccessPluginExtension so that I can customize the menu to include my new menu item. However, the documentation is not very clear on whether it would be possible to create a custom form with elements SWING like elements such as textfields, combo-boxes, and a submit button to gather user input and then run an Action upon submission of the form.

Any help and pointers to some existing examples would be great, thanks ahead of time.

---Thu
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Plugin Development: submit a customized form

Post by sorin_ristache »

Hello,

Yes, you need to create a WorkspaceAccessPlugin (full Plugins API is available here). There is an example of such plugin in the Plugins SDK from the Development Resources page, please unzip the Plugins SDK and look at the Java source code from directory samples/WorkspaceAccess/src. In the CustomWorkspaceAccessPluginExtension.applicationStarted() method the Oxygen menu bar and the editor popup menu are customized, etc. If you want to create a Swing dialog you should set the Oxygen frame window as parent of the dialog, which you can get with a call JFrame.getFrames()[0].


Regards,
Sorin
Post Reply