java - How to customize text and buttons for the About entry under the Help Menu in a Eclipse 3.8.1 RCP application -
i trying customize help->about menu entry on eclipse 3.8.1. tried 2 3.x friendly methods since eclipse 4.0 works differently.
---> tried extends aboutaction (org.eclipse.ui.internal.dialogs.aboutdialog) can add 1 line dialogarea text , add scrollable dialog gui when license button clicked.but methods protected in api see says user can use not override (same dialog class)
---> tried extending default abstracthandler , in execute method creating dialog object want add things need 1 one. issue can not work on dialog object in execute method because remains null reference until end of execute method not able add things without nullpointerexception bugging me.
---> tried adding <property>
plugin.xml itself. seems 4.x feature. description field under menu did not work write text in dialog text area
@suppresswarnings("restriction") public class aboutactionstablehandler extends abstracthandler { public object execute(executionevent event) throws executionexception { helpdialog = new aboutdialog(handlerutil.getactiveshellchecked(event)); helpdialog.open(); //helpdialog.getdialogarea(); shell aboutshell = helpdialog.getshell(); aboutshell.setlayout(new gridlayout()); label version = new label(aboutshell, swt.none); version.settext(platform.getproduct().getdefiningbundle().getversion().tostring()); version.setlayoutdata(griddatabuilder.create(). grabexcesshorizontalspace(true). widthhint(500). heighthint(5). horizontalalignment(swt.fill).build()); return null; }
so end getting runtime error when click on gui java.lang.nullpointerexception @ com.magic.gui.commands.aboutactionstablehandler.execute(aboutactionstablehandler.java:28) @ org.eclipse.ui.internal.handlers.handlerproxy.execute(handlerproxy.java:290) @ org.eclipse.core.commands.command.executewithchecks(command.java:499) @ org.eclipse.core.commands.parameterizedcommand.executewithchecks(parameterizedcommand.java:508) @ org.eclipse.ui.internal.handlers.handlerservice.executecommand(handlerservice.java:169) @ org.eclipse.ui.internal.handlers.slavehandlerservice.executecommand(slavehandlerservice.java:241) @ org.eclipse.ui.menus.commandcontributionitem.handlewidgetselection(commandcontributionitem.java:829) @ org.eclipse.ui.menus.commandcontributionitem.access$19(commandcontributionitem.java:815) @ org.eclipse.ui.menus.commandcontributionitem$5.handleevent(commandcontributionitem.java:805) @ org.eclipse.swt.widgets.eventtable.sendevent(eventtable.java:84) @ org.eclipse.swt.widgets.widget.sendevent(widget.java:1053) @ org.eclipse.swt.widgets.display.rundeferredevents(display.java:4169) @ org.eclipse.swt.widgets.display.readanddispatch(display.java:3758) @ org.eclipse.ui.internal.workbench.runeventloop(workbench.java:2701) @ org.eclipse.ui.internal.workbench.runui(workbench.java:2665) @ org.eclipse.ui.internal.workbench.access$4(workbench.java:2499) @ org.eclipse.ui.internal.workbench$7.run(workbench.java:679) @ org.eclipse.core.databinding.observable.realm.runwithdefault(realm.java:332) @ org.eclipse.ui.internal.workbench.createandrunworkbench(workbench.java:668) @ org.eclipse.ui.platformui.createandrunworkbench(platformui.java:149) @ com.magic.rcp.application.start(application.java:87) @ org.eclipse.equinox.internal.app.eclipseapphandle.run(eclipseapphandle.java:196) @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.runapplication(eclipseapplauncher.java:110) @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.start(eclipseapplauncher.java:79) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:353) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:180) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.eclipse.equinox.launcher.main.invokeframework(main.java:629) @ org.eclipse.equinox.launcher.main.basicrun(main.java:584) @ org.eclipse.equinox.launcher.main.run(main.java:1438) @ org.eclipse.equinox.launcher.main.main(main.java:1414)
calling helpdialog.open()
displays dialog , not return until closed when late modify it.
you call helpdialog.create()
create dialog, , call open()
later.
but aboutdialog
internal class attempting modify violating eclipse api rules of engagement why have had suppress restriction warning. there no way aboutdialog
can modified officially. if want different dialog should write own dialog.
Comments
Post a Comment