Dialog from Handler [message #724327] |
Mon, 12 September 2011 06:05 |
Missing name Mising name Messages: 10 Registered: September 2011 |
Junior Member |
|
|
Hello,
I want to show a Dialog from a Handler, but after I get a org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException .
This is my Handler:
public class PreferenceHandler {
@Execute
public void execute(IEclipseContext context, IWorkbench workbench) {
PreferenceDialog dialog = ContextInjectionFactory.make(PreferenceDialog.class, context);
dialog.open();
}
}
and this is my Dialog:
public class PreferenceDialog extends TitleAreaDialog {
@Inject
public PreferenceDialog(
@Named(IServiceConstants.ACTIVE_SHELL) Shell parentShell) {
super(parentShell);
}
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
getShell().setText("Connection informations");
return area;
}
}
My Enviroment:
windows 7
jdk 1.6.0_27 (32 bit)
Eclipse SDK 4.1.0
[Updated on: Mon, 12 September 2011 06:08] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Dialog from Handler [message #728368 is a reply to message #725345] |
Fri, 23 September 2011 06:51 |
Parvez Ahmad Ahmad Messages: 31 Registered: May 2010 |
Member |
|
|
I get the below error while while running the application(eclipse.exe) file generated using product export wizard on E4 platform. Can some body help me
Parvez
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.6.0_11
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86
!ENTRY org.eclipse.equinox.app 0 0 2011-09-23 11:07:50.609
!MESSAGE Product org.cord.client.dms.mainapp.e4.product could not be found.
!ENTRY org.eclipse.osgi 4 0 2011-09-23 11:07:50.625
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:126)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
[Updated on: Fri, 12 August 2022 16:44] Report message to a moderator
|
|
|
|
Re: Dialog from Handler [message #742297 is a reply to message #728385] |
Thu, 20 October 2011 11:15 |
Parvez Ahmad Ahmad Messages: 31 Registered: May 2010 |
Member |
|
|
Hello Tom
The problem got solved by adding plugins manually to exported product.
we are showing progress dialogs in non-ui code in classes.
for some code, i made below change:
I created a Shell shell
Showed a progress dialo
closed shell
code:
// PlatformUI.getWorkbench().getActiveWorkbenchWindow(); // old code
// Shell shell = win != null ? win.getShell() : null; / old code
Shell shell = new Shell();
if (showProgress) {
new ProgressMonitorDialog(shell).run(true, true, op);
} else {
op.run(null);
}
shell.close();
I do not want to create and close shell.
I do not feel that this may be good idea, to do it at every place in code.
So can we get E4 display/shell in non-UI code or just use Display.asyn....
Can we get the shell of running E4 plugin at run-time using any inject logic.
I searched google but no luck in that so far.
Please help
regards
Parvez Ahmad Hakim
[Updated on: Fri, 12 August 2022 16:43] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.06193 seconds