2

I have built an eclipse plugin which basically makes writing Java GUI applications as easy as using a 4GL programming language (Oracle Forms, Visual Basic etc). The plugin generates no GUI code but rather metadata which is parsed at runtime. I am building in a trial licence within the plugin but which will stop the plugin from working when the trial licence has run out. I am unsure of the best way to implement this. MAybe to stop one of the editors opening. I have managed to integrate my licensing software (Protection! from JProductivity), which will get called when the user tries to open on of my editors. But how can I stop an editor from opening?

Any help on this subject would be much appreciated!

Paul
  • 21
  • 1

1 Answers1

1

Editor and its type alway is contributed by extension. So there is no good way to remove this extension besides early startup your bundle. But I don't think it's a good practice.

So the better way is checking your license in EditorPart.init(IEditorSite, IEditorInput) or createPartControl, throw the exception in init call or not create any widget in createPartControl if the license is invalid or expired.

Kane
  • 8,035
  • 7
  • 46
  • 75
  • Hi Kane. Yes, I agree about not removing an extension, this was not my intention. I am displaying the error message regarding the license and then I was hoping to stop the editor from opening. If I throw an exception (partInitException) within the init of the editor, the editor will open with an ugly stacktrace being displayed as page contents. I tried to call the close() directly but this caused problems. I also put the close in a "run" so that it executed after the editor opened. The effect was that the user saw the editor open and then it closed immediately. Both not great options. – Paul Dec 01 '10 at 09:00
  • 1
    @Paul, you could allow users to open your editor. However the editor view displays some words to tell them the license is expired or invalid, and give a hyperlink of your support site. I think it would be friendly. – Kane Dec 01 '10 at 09:12