954,554 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Plugins

If I want to add a plugin which I have designed after I have written the software ... how should I do it. Suppose I designed a word pad ... and then I designed a spell checker ... how should I add the spell checker to my word pad to get it working :?:

nanosani
Unauthenticated Liar
Team Colleague
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
 

Hey sani,

Have you used eclipse before? I wonder if you could leverage some of their plugin loading code. That would be awesome.

You could write your own plugin loading code rather easily. Have a plugin directory that your app will scan for plugins. Plugins can essentially be packaged java code. You can place plugins in a jar; they're easy to distribute.

Each plugin could have a very defined structure. For example if you wanted just a dumb simple single action for every plugin and have that single action listed in some plugin Menu in your wordpad app, then have every plugin define doAction(...) getActionName()... and so on. Then you can use reflection and the ClassLoader to load the classes dynamically at runtime.

You can ask me for more details if you don't find it easy to do... I do think that something like eclipse would be best if you can figure out how to get it working with your code.


Ed

If I want to add a plugin which I have designed after I have written the software ... how should I do it. Suppose I designed a word pad ... and then I designed a spell checker ... how should I add the spell checker to my word pad to get it working :?:
cosi
Junior Poster
153 posts since Aug 2004
Reputation Points: 17
Solved Threads: 1
 

Thanks for the great ideas ... I have started implementing like that ... I'll tell you if I get some difficulties.

nanosani
Unauthenticated Liar
Team Colleague
1,830 posts since Jul 2004
Reputation Points: 45
Solved Threads: 56
 

Hey sani,

Have you used eclipse before? I wonder if you could leverage some of their plugin loading code. That would be awesome.

You could write your own plugin loading code rather easily. Have a plugin directory that your app will scan for plugins. Plugins can essentially be packaged java code. You can place plugins in a jar; they're easy to distribute.

Each plugin could have a very defined structure. For example if you wanted just a dumb simple single action for every plugin and have that single action listed in some plugin Menu in your wordpad app, then have every plugin define doAction(...) getActionName()... and so on. Then you can use reflection and the ClassLoader to load the classes dynamically at runtime.

You can ask me for more details if you don't find it easy to do... I do think that something like eclipse would be best if you can figure out how to get it working with your code.

Ed

I am building a media player and i wish to add mp3 plugins to allow it to play more types of file but i don't know how to set my application up to except plugins.


Dennis

sethgeco
Newbie Poster
1 post since Nov 2008
Reputation Points: 10
Solved Threads: 0
 

I am building a media player and i wish to add mp3 plugins to allow it to play more types of file but i don't know how to set my application up to except plugins.

Dennis

after 4 years, nobody is still reading this thread.
but if you want to play .mp3 files, either check out the JMF or JavaZoom

stultuske
Posting Sensei
3,137 posts since Jan 2007
Reputation Points: 1,114
Solved Threads: 433
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You