Home » Eclipse Projects » Eclipse 4 » org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #654085] |
Mon, 14 February 2011 00:17  |
Eclipse User |
|
|
|
Hello,
I am using e4 (41) and Google WindowBuilder to generate my UI.
I have the following UI in plugin 'a' which are exported and imported for use in plugin 'b' ('com.epimss.shared)
NameTblViewer.xwt
NameTblViewer.java
<Composite
xmlns="http://www.eclipse.org/xwt/presentation"
xmlns:x="http://www.eclipse.org/xwt"
x:Class="com.epimss.reg.ui.viewers.NameTblViewer"
x:Name="root"
dataContext="{StaticResource names}"
xmlns:p1="clr-namespace:com.epimss.shared.ui.viewers"
xmlns:p2="clr-namespace:org.eclipse.nebula.widgets.pgroup"
xmlns:p3="clr-namespace:com.epimss.shared.ui.reg"
xmlns:p4="clr-namespace:com.epimss.shared.ui"
xmlns:p5="clr-namespace:org.eclipse.ui.forms.widgets" >
<Composite.layout>
<GridLayout/>
</Composite.layout>
<Composite.Resources>
<p1:Names x:Key="names"/>
</Composite.Resources>
<p2:PGroup text="Search Database By:">
<p2:PGroup.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</p2:PGroup.layoutData>
<p2:PGroup.layout>
<FillLayout/>
</p2:PGroup.layout>
<Composite>
<Composite.layout>
<GridLayout/>
</Composite.layout>
<Form>
<Form.body>
<Form.body.layout>
<GridLayout/>
</Form.body.layout>
</Form.body>
</Form>
<Section text="Medical Registration Number (MRN)" x:Style="Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED">
<Section.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Section.layoutData>
<Section.client>
<Composite>
<Composite.layout>
<GridLayout numColumns="3"/>
</Composite.layout>
<p3:MrnForm x:Name="mrnForm">
<p3:MrnForm.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</p3:MrnForm.layoutData>
</p3:MrnForm>
<p4:VLabelSeparator>
<p4:VLabelSeparator.layoutData>
<GridData grabExcessVerticalSpace="true" verticalAlignment="FILL"/>
</p4:VLabelSeparator.layoutData>
</p4:VLabelSeparator>
<Button text="Search" x:Name="searchByMrnBtn">
<Button.layoutData>
<GridData horizontalAlignment="CENTER" grabExcessVerticalSpace="true"/>
</Button.layoutData>
</Button>
</Composite>
</Section.client>
</Section>
<Section text="Date of Birth" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
<Section.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Section.layoutData>
<Section.client>
<Composite>
<Composite.layout>
<GridLayout numColumns="3"/>
</Composite.layout>
<p3:DobForm x:Name="dobForm">
<p3:DobForm.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</p3:DobForm.layoutData>
</p3:DobForm>
<p4:VLabelSeparator>
<p4:VLabelSeparator.layoutData>
<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true" horizontalAlignment="RIGHT"/>
</p4:VLabelSeparator.layoutData>
</p4:VLabelSeparator>
<Button text="Search" x:Name="searchByDobBtn"/>
</Composite>
</Section.client>
</Section>
<Section text="Name" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
<Section.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Section.layoutData>
<Section.client>
<Composite>
<Composite.layout>
<GridLayout numColumns="8"/>
</Composite.layout>
<Label text="First">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="firstNameTxt">
<Text.layoutData>
<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
</Text.layoutData>
</Text>
<Label text="Middle">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="middleNameTxt">
<Text.layoutData>
<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
</Text.layoutData>
</Text>
<Label text="Last">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="lastNameTxt">
<Text.layoutData>
<GridData horizontalAlignment="FILL" grabExcessHorizontalSpace="true"/>
</Text.layoutData>
</Text>
<p4:VLabelSeparator bounds="0, 0, 14, 25">
<p4:VLabelSeparator.layoutData>
<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true"/>
</p4:VLabelSeparator.layoutData>
</p4:VLabelSeparator>
<Button text="Search" x:Name="searchByNameBtn"/>
</Composite>
</Section.client>
</Section>
<Section text="Address" x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
<Section.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Section.layoutData>
<Section.client>
<Composite>
<Composite.layout>
<GridLayout numColumns="6"/>
</Composite.layout>
<Label text="Street">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="streetTxt">
<Text.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Text.layoutData>
</Text>
<Label text="State/Province">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Combo x:Name="stateProvinceCmbo">
<Combo.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Combo.layoutData>
</Combo>
<p4:VLabelSeparator size="14, 164">
<p4:VLabelSeparator.layoutData>
<GridData grabExcessVerticalSpace="true" verticalAlignment="FILL" verticalSpan="4"/>
</p4:VLabelSeparator.layoutData>
</p4:VLabelSeparator>
<Label/>
<Label text="City">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="cityTxt">
<Text.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Text.layoutData>
</Text>
<Label text="Region/Other"/>
<Text x:Style="BORDER" x:Name="regionOtherTxt">
<Text.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Text.layoutData>
</Text>
<Button text="Search" x:Name="searchByAddressBtn"/>
<Label text="Apt. #">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="aptNumTxt">
<Text.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Text.layoutData>
</Text>
<Label text="Country">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Combo x:Name="countryCmbo">
<Combo.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Combo.layoutData>
</Combo>
<Label/>
<Label text="Post Code">
<Label.layoutData>
<GridData horizontalAlignment="RIGHT"/>
</Label.layoutData>
</Label>
<Text x:Style="BORDER" x:Name="postCodeTxt">
<Text.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</Text.layoutData>
</Text>
<Label/>
<Label/>
<Label/>
</Composite>
</Section.client>
</Section>
</Composite>
</p2:PGroup>
<p4:HLabelSeparator>
<p4:HLabelSeparator.layoutData>
<GridData grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</p4:HLabelSeparator.layoutData>
</p4:HLabelSeparator>
<TableViewer x:Style="BORDER | FULL_SELECTION" input="{Binding Path=names}" x:Name="tableViewer">
<TableViewer.table headerVisible="true" linesVisible="true" x:Name="table">
<TableViewer.table.layoutData>
<GridData verticalAlignment="FILL" grabExcessVerticalSpace="true" grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
</TableViewer.table.layoutData>
</TableViewer.table>
<TableViewerColumn text="Title" width="50" displayMemberPath="title"/>
<TableViewerColumn text="Last" width="75"/>
<TableViewerColumn text="First" width="75" displayMemberPath="firstName"/>
<TableViewerColumn text="Middle" width="75"/>
</TableViewer>
</Composite>
package com.epimss.shared.ui.viewers;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.e4.xwt.IConstants;
import org.eclipse.e4.xwt.IXWTLoader;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Composite;
public class NameTblViewer extends Composite
{
//~ public -----------------------------------------------------------------
public NameTblViewer( Composite parent, int style )
{
super( parent, style );
setLayout( new FillLayout() );
// load XWT
String name = NameTblViewer.class.getSimpleName() + IConstants.XWT_EXTENSION_SUFFIX;
try
{
// URL url = NameTableViewer.class.getResource( name );
Map< String, Object > options = new HashMap< String, Object >();
options.put( IXWTLoader.CLASS_PROPERTY, this );
options.put( IXWTLoader.CONTAINER_PROPERTY, this );
// XWTForms.loadWithOptions( url, options );
}
catch( Throwable e )
{
throw( new Error( "Unable to load " + name, e ) );
} // end try-catch
} // end ctor NameTblViewer
} // end class NameTblViewer
I place the NameTblViewer in the e4 model under the following:
TrimmedWindow > Control > Sash > Part Stack.
When I run the plugin 'b' I now get the following:
ERROR: Unable to create class 'com.epimss.shared.ui.viewers.NameTblViewer' from bundle '578'
org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor in com.epimss.shared.ui.viewers.NameTb
lViewer
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(In jectorImpl.java:301)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorIm pl.java:219)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(Co ntextInjectionFactory.java:152)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.createFromBundle(ReflectionContributionFactory.ja
va:90)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.doCreate(ReflectionContributionFactory.java:64)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF actory.create(ReflectionContributionFactory.java:53)
at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRen derer.createWidget(ContributedPartRenderer.java:51)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createWidget(PartRenderingEngine.java:612)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:403)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.show Tab(StackRenderer.java:511)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer. postProcess(LazyStackRenderer.java:107)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:419)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRendere r.processContents(PerspectiveRenderer.java:59)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe nderer.showTab(PerspectiveStackRenderer.java:103)
at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer. postProcess(LazyStackRenderer.java:107)
at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe nderer.postProcess(PerspectiveStackRenderer.java:77)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:419)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr ocessContents(SWTPartRenderer.java:58)
at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.proces sContents(WBWRenderer.java:464)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:415)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .createGui(PartRenderingEngine.java:479)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine $4.run(PartRenderingEngine.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine .run(PartRenderingEngine.java:633)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu nUI(E4Workbench.java:106)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start (E4Application.java:127)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.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(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce ssorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe thodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
If I run the NameTblViewer as a JFace application, everything runs normally.
I would appreciate any help here.
Thanks
|
|
|
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #654088 is a reply to message #654085] |
Mon, 14 February 2011 01:49   |
Eclipse User |
|
|
|
If you use this as a part in e4 you:
a) have to annotate your constructor with @Inject
b) you have to remove the "int style" because e4 does not know what to
pass in for it
Tom
Am 14.02.11 06:19, schrieb St Clair Clarke:
> Hello,
>
> I am using e4 (41) and Google WindowBuilder to generate my UI.
>
> I have the following UI in plugin 'a' which are exported and imported
> for use in plugin 'b' ('com.epimss.shared)
> NameTblViewer.xwt
> NameTblViewer.java
>
>
> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
> xmlns:x="http://www.eclipse.org/xwt"
> x:Class="com.epimss.reg.ui.viewers.NameTblViewer" x:Name="root"
> dataContext="{StaticResource names}"
> xmlns:p1="clr-namespace:com.epimss.shared.ui.viewers"
> xmlns:p2="clr-namespace:org.eclipse.nebula.widgets.pgroup"
> xmlns:p3="clr-namespace:com.epimss.shared.ui.reg"
> xmlns:p4="clr-namespace:com.epimss.shared.ui"
> xmlns:p5="clr-namespace:org.eclipse.ui.forms.widgets" >
> <Composite.layout>
> <GridLayout/>
> </Composite.layout>
> <Composite.Resources>
> <p1:Names x:Key="names"/>
> </Composite.Resources>
> <p2:PGroup text="Search Database By:">
> <p2:PGroup.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </p2:PGroup.layoutData>
> <p2:PGroup.layout>
> <FillLayout/>
> </p2:PGroup.layout>
> <Composite>
> <Composite.layout>
> <GridLayout/>
> </Composite.layout>
> <Form>
> <Form.body>
> <Form.body.layout>
> <GridLayout/>
> </Form.body.layout>
> </Form.body>
> </Form>
> <Section text="Medical Registration Number (MRN)"
> x:Style="Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED">
> <Section.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </Section.layoutData>
> <Section.client>
> <Composite>
> <Composite.layout>
> <GridLayout numColumns="3"/>
> </Composite.layout>
> <p3:MrnForm x:Name="mrnForm">
> <p3:MrnForm.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </p3:MrnForm.layoutData>
> </p3:MrnForm>
> <p4:VLabelSeparator>
> <p4:VLabelSeparator.layoutData>
> <GridData grabExcessVerticalSpace="true"
> verticalAlignment="FILL"/>
> </p4:VLabelSeparator.layoutData>
> </p4:VLabelSeparator>
> <Button text="Search" x:Name="searchByMrnBtn">
> <Button.layoutData>
> <GridData horizontalAlignment="CENTER"
> grabExcessVerticalSpace="true"/>
> </Button.layoutData>
> </Button>
> </Composite>
> </Section.client>
> </Section>
> <Section text="Date of Birth"
> x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED |
> (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
> <Section.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </Section.layoutData>
> <Section.client>
> <Composite>
> <Composite.layout>
> <GridLayout numColumns="3"/>
> </Composite.layout>
> <p3:DobForm x:Name="dobForm">
> <p3:DobForm.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </p3:DobForm.layoutData>
> </p3:DobForm>
> <p4:VLabelSeparator>
> <p4:VLabelSeparator.layoutData>
> <GridData verticalAlignment="FILL"
> grabExcessVerticalSpace="true" horizontalAlignment="RIGHT"/>
> </p4:VLabelSeparator.layoutData>
> </p4:VLabelSeparator>
> <Button text="Search" x:Name="searchByDobBtn"/>
> </Composite>
> </Section.client>
> </Section>
> <Section text="Name" x:Style="(p5:Section).CLIENT_INDENT |
> (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
> <Section.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </Section.layoutData>
> <Section.client>
> <Composite>
> <Composite.layout>
> <GridLayout numColumns="8"/>
> </Composite.layout>
> <Label text="First">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="firstNameTxt">
> <Text.layoutData>
> <GridData horizontalAlignment="FILL"
> grabExcessHorizontalSpace="true"/>
> </Text.layoutData>
> </Text>
> <Label text="Middle">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="middleNameTxt">
> <Text.layoutData>
> <GridData horizontalAlignment="FILL"
> grabExcessHorizontalSpace="true"/>
> </Text.layoutData>
> </Text>
> <Label text="Last">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="lastNameTxt">
> <Text.layoutData>
> <GridData horizontalAlignment="FILL"
> grabExcessHorizontalSpace="true"/>
> </Text.layoutData>
> </Text>
> <p4:VLabelSeparator bounds="0, 0, 14, 25">
> <p4:VLabelSeparator.layoutData>
> <GridData verticalAlignment="FILL"
> grabExcessVerticalSpace="true"/>
> </p4:VLabelSeparator.layoutData>
> </p4:VLabelSeparator>
> <Button text="Search" x:Name="searchByNameBtn"/>
> </Composite>
> </Section.client>
> </Section>
> <Section text="Address" x:Style="(p5:Section).CLIENT_INDENT |
> (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
> <Section.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </Section.layoutData>
> <Section.client>
> <Composite>
> <Composite.layout>
> <GridLayout numColumns="6"/>
> </Composite.layout>
> <Label text="Street">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="streetTxt">
> <Text.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Text.layoutData>
> </Text>
> <Label text="State/Province">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Combo x:Name="stateProvinceCmbo">
> <Combo.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Combo.layoutData>
> </Combo>
> <p4:VLabelSeparator size="14, 164">
> <p4:VLabelSeparator.layoutData>
> <GridData grabExcessVerticalSpace="true"
> verticalAlignment="FILL" verticalSpan="4"/>
> </p4:VLabelSeparator.layoutData>
> </p4:VLabelSeparator>
> <Label/>
> <Label text="City">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="cityTxt">
> <Text.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Text.layoutData>
> </Text>
> <Label text="Region/Other"/>
> <Text x:Style="BORDER" x:Name="regionOtherTxt">
> <Text.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Text.layoutData>
> </Text>
> <Button text="Search" x:Name="searchByAddressBtn"/>
> <Label text="Apt. #">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="aptNumTxt">
> <Text.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Text.layoutData>
> </Text>
> <Label text="Country">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Combo x:Name="countryCmbo">
> <Combo.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Combo.layoutData>
> </Combo>
> <Label/>
> <Label text="Post Code">
> <Label.layoutData>
> <GridData horizontalAlignment="RIGHT"/>
> </Label.layoutData>
> </Label>
> <Text x:Style="BORDER" x:Name="postCodeTxt">
> <Text.layoutData>
> <GridData
> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
> </Text.layoutData>
> </Text>
> <Label/>
> <Label/>
> <Label/>
> </Composite>
> </Section.client>
> </Section>
> </Composite>
> </p2:PGroup>
> <p4:HLabelSeparator>
> <p4:HLabelSeparator.layoutData>
> <GridData grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </p4:HLabelSeparator.layoutData>
> </p4:HLabelSeparator>
> <TableViewer x:Style="BORDER | FULL_SELECTION" input="{Binding
> Path=names}" x:Name="tableViewer">
> <TableViewer.table headerVisible="true" linesVisible="true"
> x:Name="table">
> <TableViewer.table.layoutData>
> <GridData verticalAlignment="FILL"
> grabExcessVerticalSpace="true" grabExcessHorizontalSpace="true"
> horizontalAlignment="FILL"/>
> </TableViewer.table.layoutData>
> </TableViewer.table>
> <TableViewerColumn text="Title" width="50"
> displayMemberPath="title"/>
> <TableViewerColumn text="Last" width="75"/>
> <TableViewerColumn text="First" width="75"
> displayMemberPath="firstName"/>
> <TableViewerColumn text="Middle" width="75"/>
> </TableViewer>
> </Composite>
>
>
> package com.epimss.shared.ui.viewers;
>
>
> import java.util.HashMap;
> import java.util.Map;
>
> import org.eclipse.e4.xwt.IConstants;
> import org.eclipse.e4.xwt.IXWTLoader;
>
> import org.eclipse.swt.layout.FillLayout;
>
> import org.eclipse.swt.widgets.Composite;
>
>
> public class NameTblViewer extends Composite
> {
> //~ public
> ------------------------------------------------------------ -----
>
>
>
>
> public NameTblViewer( Composite parent, int style )
> {
> super( parent, style );
> setLayout( new FillLayout() );
>
> // load XWT
> String name = NameTblViewer.class.getSimpleName() +
> IConstants.XWT_EXTENSION_SUFFIX;
>
> try
> {
> // URL url = NameTableViewer.class.getResource( name );
> Map< String, Object > options = new HashMap< String, Object >();
> options.put( IXWTLoader.CLASS_PROPERTY, this );
> options.put( IXWTLoader.CONTAINER_PROPERTY, this );
> // XWTForms.loadWithOptions( url, options );
>
> }
> catch( Throwable e )
> {
> throw( new Error( "Unable to load " + name, e ) );
>
> } // end try-catch
>
> } // end ctor NameTblViewer
>
> } // end class NameTblViewer
>
> I place the NameTblViewer in the e4 model under the following:
> TrimmedWindow > Control > Sash > Part Stack.
>
> When I run the plugin 'b' I now get the following:
>
>
> ERROR: Unable to create class
> 'com.epimss.shared.ui.viewers.NameTblViewer' from bundle '578'
> org.eclipse.e4.core.di.InjectionException: Could not find satisfiable
> constructor in com.epimss.shared.ui.viewers.NameTb
> lViewer
> at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(In
> jectorImpl.java:301)
> at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorIm
> pl.java:219)
> at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(Co
> ntextInjectionFactory.java:152)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
> actory.createFromBundle(ReflectionContributionFactory.ja
> va:90)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
> actory.doCreate(ReflectionContributionFactory.java:64)
> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
> actory.create(ReflectionContributionFactory.java:53)
> at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRen
> derer.createWidget(ContributedPartRenderer.java:51)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createWidget(PartRenderingEngine.java:612)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:403)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.show
> Tab(StackRenderer.java:511)
> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.
> postProcess(LazyStackRenderer.java:107)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:419)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
> ocessContents(SWTPartRenderer.java:58)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:415)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
> ocessContents(SWTPartRenderer.java:58)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRendere
> r.processContents(PerspectiveRenderer.java:59)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:415)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe
> nderer.showTab(PerspectiveStackRenderer.java:103)
> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.
> postProcess(LazyStackRenderer.java:107)
> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe
> nderer.postProcess(PerspectiveStackRenderer.java:77)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:419)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
> ocessContents(SWTPartRenderer.java:58)
> at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.proces
> sContents(WBWRenderer.java:464)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:415)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .createGui(PartRenderingEngine.java:479)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> $4.run(PartRenderingEngine.java:679)
> at org.eclipse.core.databinding.observable.Realm.runWithDefault
> (Realm.java:332)
> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
> .run(PartRenderingEngine.java:633)
> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu
> nUI(E4Workbench.java:106)
> at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start
> (E4Application.java:127)
> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
> eAppHandle.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(EclipseS
> tarter.java:369)
> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
> tarter.java:179)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
> ssorImpl.java:39)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
> thodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>
> If I run the NameTblViewer as a JFace application, everything runs
> normally.
>
> I would appreciate any help here.
>
> Thanks
>
|
|
| | | | | | | |
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #658640 is a reply to message #654088] |
Wed, 09 March 2011 06:03   |
Eclipse User |
|
|
|
You should not load XWT in the constructor. I know WindowsBuilder generates
the codes in this way. It is not compatible with the strategy of XWT. We
need to work on this issue when the project WindowsBuilder gets started in
eclipse.
Regards
yves
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:ijaiti$ld1$1@news.eclipse.org...
> If you use this as a part in e4 you:
> a) have to annotate your constructor with @Inject
> b) you have to remove the "int style" because e4 does not know what to
> pass in for it
>
> Tom
>
> Am 14.02.11 06:19, schrieb St Clair Clarke:
>> Hello,
>>
>> I am using e4 (41) and Google WindowBuilder to generate my UI.
>>
>> I have the following UI in plugin 'a' which are exported and imported
>> for use in plugin 'b' ('com.epimss.shared)
>> NameTblViewer.xwt
>> NameTblViewer.java
>>
>>
>> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
>> xmlns:x="http://www.eclipse.org/xwt"
>> x:Class="com.epimss.reg.ui.viewers.NameTblViewer" x:Name="root"
>> dataContext="{StaticResource names}"
>> xmlns:p1="clr-namespace:com.epimss.shared.ui.viewers"
>> xmlns:p2="clr-namespace:org.eclipse.nebula.widgets.pgroup"
>> xmlns:p3="clr-namespace:com.epimss.shared.ui.reg"
>> xmlns:p4="clr-namespace:com.epimss.shared.ui"
>> xmlns:p5="clr-namespace:org.eclipse.ui.forms.widgets" >
>> <Composite.layout>
>> <GridLayout/>
>> </Composite.layout>
>> <Composite.Resources>
>> <p1:Names x:Key="names"/>
>> </Composite.Resources>
>> <p2:PGroup text="Search Database By:">
>> <p2:PGroup.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </p2:PGroup.layoutData>
>> <p2:PGroup.layout>
>> <FillLayout/>
>> </p2:PGroup.layout>
>> <Composite>
>> <Composite.layout>
>> <GridLayout/>
>> </Composite.layout>
>> <Form>
>> <Form.body>
>> <Form.body.layout>
>> <GridLayout/>
>> </Form.body.layout>
>> </Form.body>
>> </Form>
>> <Section text="Medical Registration Number (MRN)"
>> x:Style="Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED">
>> <Section.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </Section.layoutData>
>> <Section.client>
>> <Composite>
>> <Composite.layout>
>> <GridLayout numColumns="3"/>
>> </Composite.layout>
>> <p3:MrnForm x:Name="mrnForm">
>> <p3:MrnForm.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </p3:MrnForm.layoutData>
>> </p3:MrnForm>
>> <p4:VLabelSeparator>
>> <p4:VLabelSeparator.layoutData>
>> <GridData grabExcessVerticalSpace="true"
>> verticalAlignment="FILL"/>
>> </p4:VLabelSeparator.layoutData>
>> </p4:VLabelSeparator>
>> <Button text="Search" x:Name="searchByMrnBtn">
>> <Button.layoutData>
>> <GridData horizontalAlignment="CENTER"
>> grabExcessVerticalSpace="true"/>
>> </Button.layoutData>
>> </Button>
>> </Composite>
>> </Section.client>
>> </Section>
>> <Section text="Date of Birth"
>> x:Style="(p5:Section).CLIENT_INDENT | (p5:Section).EXPANDED |
>> (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
>> <Section.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </Section.layoutData>
>> <Section.client>
>> <Composite>
>> <Composite.layout>
>> <GridLayout numColumns="3"/>
>> </Composite.layout>
>> <p3:DobForm x:Name="dobForm">
>> <p3:DobForm.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </p3:DobForm.layoutData>
>> </p3:DobForm>
>> <p4:VLabelSeparator>
>> <p4:VLabelSeparator.layoutData>
>> <GridData verticalAlignment="FILL"
>> grabExcessVerticalSpace="true" horizontalAlignment="RIGHT"/>
>> </p4:VLabelSeparator.layoutData>
>> </p4:VLabelSeparator>
>> <Button text="Search" x:Name="searchByDobBtn"/>
>> </Composite>
>> </Section.client>
>> </Section>
>> <Section text="Name" x:Style="(p5:Section).CLIENT_INDENT |
>> (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
>> <Section.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </Section.layoutData>
>> <Section.client>
>> <Composite>
>> <Composite.layout>
>> <GridLayout numColumns="8"/>
>> </Composite.layout>
>> <Label text="First">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="firstNameTxt">
>> <Text.layoutData>
>> <GridData horizontalAlignment="FILL"
>> grabExcessHorizontalSpace="true"/>
>> </Text.layoutData>
>> </Text>
>> <Label text="Middle">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="middleNameTxt">
>> <Text.layoutData>
>> <GridData horizontalAlignment="FILL"
>> grabExcessHorizontalSpace="true"/>
>> </Text.layoutData>
>> </Text>
>> <Label text="Last">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="lastNameTxt">
>> <Text.layoutData>
>> <GridData horizontalAlignment="FILL"
>> grabExcessHorizontalSpace="true"/>
>> </Text.layoutData>
>> </Text>
>> <p4:VLabelSeparator bounds="0, 0, 14, 25">
>> <p4:VLabelSeparator.layoutData>
>> <GridData verticalAlignment="FILL"
>> grabExcessVerticalSpace="true"/>
>> </p4:VLabelSeparator.layoutData>
>> </p4:VLabelSeparator>
>> <Button text="Search" x:Name="searchByNameBtn"/>
>> </Composite>
>> </Section.client>
>> </Section>
>> <Section text="Address" x:Style="(p5:Section).CLIENT_INDENT |
>> (p5:Section).EXPANDED | (p5:Section).TWISTIE | (p5:Section).TITLE_BAR">
>> <Section.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </Section.layoutData>
>> <Section.client>
>> <Composite>
>> <Composite.layout>
>> <GridLayout numColumns="6"/>
>> </Composite.layout>
>> <Label text="Street">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="streetTxt">
>> <Text.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Text.layoutData>
>> </Text>
>> <Label text="State/Province">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Combo x:Name="stateProvinceCmbo">
>> <Combo.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Combo.layoutData>
>> </Combo>
>> <p4:VLabelSeparator size="14, 164">
>> <p4:VLabelSeparator.layoutData>
>> <GridData grabExcessVerticalSpace="true"
>> verticalAlignment="FILL" verticalSpan="4"/>
>> </p4:VLabelSeparator.layoutData>
>> </p4:VLabelSeparator>
>> <Label/>
>> <Label text="City">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="cityTxt">
>> <Text.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Text.layoutData>
>> </Text>
>> <Label text="Region/Other"/>
>> <Text x:Style="BORDER" x:Name="regionOtherTxt">
>> <Text.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Text.layoutData>
>> </Text>
>> <Button text="Search"
>> x:Name="searchByAddressBtn"/>
>> <Label text="Apt. #">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="aptNumTxt">
>> <Text.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Text.layoutData>
>> </Text>
>> <Label text="Country">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Combo x:Name="countryCmbo">
>> <Combo.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Combo.layoutData>
>> </Combo>
>> <Label/>
>> <Label text="Post Code">
>> <Label.layoutData>
>> <GridData horizontalAlignment="RIGHT"/>
>> </Label.layoutData>
>> </Label>
>> <Text x:Style="BORDER" x:Name="postCodeTxt">
>> <Text.layoutData>
>> <GridData
>> grabExcessHorizontalSpace="true" horizontalAlignment="FILL"/>
>> </Text.layoutData>
>> </Text>
>> <Label/>
>> <Label/>
>> <Label/>
>> </Composite>
>> </Section.client>
>> </Section>
>> </Composite>
>> </p2:PGroup>
>> <p4:HLabelSeparator>
>> <p4:HLabelSeparator.layoutData>
>> <GridData grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </p4:HLabelSeparator.layoutData>
>> </p4:HLabelSeparator>
>> <TableViewer x:Style="BORDER | FULL_SELECTION" input="{Binding
>> Path=names}" x:Name="tableViewer">
>> <TableViewer.table headerVisible="true" linesVisible="true"
>> x:Name="table">
>> <TableViewer.table.layoutData>
>> <GridData verticalAlignment="FILL"
>> grabExcessVerticalSpace="true" grabExcessHorizontalSpace="true"
>> horizontalAlignment="FILL"/>
>> </TableViewer.table.layoutData>
>> </TableViewer.table>
>> <TableViewerColumn text="Title" width="50"
>> displayMemberPath="title"/>
>> <TableViewerColumn text="Last" width="75"/>
>> <TableViewerColumn text="First" width="75"
>> displayMemberPath="firstName"/>
>> <TableViewerColumn text="Middle" width="75"/>
>> </TableViewer>
>> </Composite>
>>
>>
>> package com.epimss.shared.ui.viewers;
>>
>>
>> import java.util.HashMap;
>> import java.util.Map;
>>
>> import org.eclipse.e4.xwt.IConstants;
>> import org.eclipse.e4.xwt.IXWTLoader;
>>
>> import org.eclipse.swt.layout.FillLayout;
>>
>> import org.eclipse.swt.widgets.Composite;
>>
>>
>> public class NameTblViewer extends Composite
>> {
>> //~ public
>> ------------------------------------------------------------ -----
>>
>>
>>
>>
>> public NameTblViewer( Composite parent, int style )
>> {
>> super( parent, style );
>> setLayout( new FillLayout() );
>>
>> // load XWT
>> String name = NameTblViewer.class.getSimpleName() +
>> IConstants.XWT_EXTENSION_SUFFIX;
>>
>> try
>> {
>> // URL url = NameTableViewer.class.getResource( name );
>> Map< String, Object > options = new HashMap< String, Object
>> >();
>> options.put( IXWTLoader.CLASS_PROPERTY, this );
>> options.put( IXWTLoader.CONTAINER_PROPERTY, this );
>> // XWTForms.loadWithOptions( url, options );
>>
>> }
>> catch( Throwable e )
>> {
>> throw( new Error( "Unable to load " + name, e ) );
>>
>> } // end try-catch
>>
>> } // end ctor NameTblViewer
>>
>> } // end class NameTblViewer
>>
>> I place the NameTblViewer in the e4 model under the following:
>> TrimmedWindow > Control > Sash > Part Stack.
>>
>> When I run the plugin 'b' I now get the following:
>>
>>
>> ERROR: Unable to create class
>> 'com.epimss.shared.ui.viewers.NameTblViewer' from bundle '578'
>> org.eclipse.e4.core.di.InjectionException: Could not find satisfiable
>> constructor in com.epimss.shared.ui.viewers.NameTb
>> lViewer
>> at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(In
>> jectorImpl.java:301)
>> at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorIm
>> pl.java:219)
>> at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(Co
>> ntextInjectionFactory.java:152)
>> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
>> actory.createFromBundle(ReflectionContributionFactory.ja
>> va:90)
>> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
>> actory.doCreate(ReflectionContributionFactory.java:64)
>> at org.eclipse.e4.ui.internal.workbench.ReflectionContributionF
>> actory.create(ReflectionContributionFactory.java:53)
>> at org.eclipse.e4.ui.workbench.renderers.swt.ContributedPartRen
>> derer.createWidget(ContributedPartRenderer.java:51)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createWidget(PartRenderingEngine.java:612)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:403)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.show
>> Tab(StackRenderer.java:511)
>> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.
>> postProcess(LazyStackRenderer.java:107)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:419)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
>> ocessContents(SWTPartRenderer.java:58)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:415)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
>> ocessContents(SWTPartRenderer.java:58)
>> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveRendere
>> r.processContents(PerspectiveRenderer.java:59)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:415)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe
>> nderer.showTab(PerspectiveStackRenderer.java:103)
>> at org.eclipse.e4.ui.workbench.renderers.swt.LazyStackRenderer.
>> postProcess(LazyStackRenderer.java:107)
>> at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRe
>> nderer.postProcess(PerspectiveStackRenderer.java:77)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:419)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.pr
>> ocessContents(SWTPartRenderer.java:58)
>> at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.proces
>> sContents(WBWRenderer.java:464)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:415)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .createGui(PartRenderingEngine.java:479)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> $4.run(PartRenderingEngine.java:679)
>> at org.eclipse.core.databinding.observable.Realm.runWithDefault
>> (Realm.java:332)
>> at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine
>> .run(PartRenderingEngine.java:633)
>> at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRu
>> nUI(E4Workbench.java:106)
>> at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start
>> (E4Application.java:127)
>> at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips
>> eAppHandle.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(EclipseS
>> tarter.java:369)
>> at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS
>> tarter.java:179)
>> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:39)
>> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:25)
>> at java.lang.reflect.Method.invoke(Method.java:597)
>> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
>> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
>> at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
>> at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
>>
>> If I run the NameTblViewer as a JFace application, everything runs
>> normally.
>>
>> I would appreciate any help here.
>>
>> Thanks
>>
>
|
|
|
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #658649 is a reply to message #655155] |
Wed, 09 March 2011 06:07  |
Eclipse User |
|
|
|
"Tom Schindl" <tom.schindl@bestsolution.at> wrote in message
news:ijltiq$te7$1@news.eclipse.org...
> Am 18.02.11 14:36, schrieb St Clair Clarke:
>> Hello Tom,
>> Thanks for the reply.
>>
>> I have a few questions though. When I created a UI element with the XWT
>> Designer/Editor that is package with e4 it generates code similar to the
>> one I used below. For instance, the xwt src and the code-behind below
>> were genearated by XWT Designer
>>
>> <Composite xmlns="http://www.eclipse.org/xwt/presentation"
>> xmlns:x="http://www.eclipse.org/xwt"
>> xmlns:c="clr-namespace:de.vogella.e4.rcp.wizard.ui"
>> xmlns:j="clr-namespace:java.lang"
>> x:Class="de.vogella.e4.rcp.wizard.ui.Part1">
>> <Composite.layout>
>> <GridLayout numColumns="4" />
>> </Composite.layout>
>> </Composite>
>>
>> package de.vogella.e4.rcp.wizard.ui;
>>
>> import org.eclipse.swt.widgets.Composite;
>>
>> public class Part1 extends Composite {
>>
>> public Part1(Composite parent, int style) {
>> super(parent, style);
>> // TODO Auto-generated constructor stub
>> }
>>
>> }
>>
>> Could you please explain why a tool that comes with e4 does not generate
>> compatible code?
>>
>
> XWT is developed as part of e4 but not only applicable for use in 4.x
> but in fact I think it can even run in a plain SWT-Application (does not
> even need OSGi).
Yes, the code generated is for plain SWT-Application. If you want e4
inetegratuion UI, you should use the appropriate wizard to create XWTPart
for e4.
Regards
Yves
>
>> Do you know of any tool that will generate compatible code for e4?
>>
> > Is there any way to tweak XWT Designer to generate code that e4 will
>> understand?
>>
>> Google WindowBuilder generates code similar to XWT Designer.
>>
>
> Yes because they create UI-Code which is not designed to be directly
> referenced in the Application Model. My suggestion would be:
> a) you tweak the generated class
> b) you create delegating class
>
> public Part1Wrap {
> @Inject
> public Part1Wrap(Composite comp) {
> new Part1(comp,SWT.NONE);
> }
> }
>
> c) coolest thing but you need some more e4 knowledge
> a) You store the Path to your XWT-XML-File in the MPart element
> b) You write your own e4 integration class which would look similar
> to your Part1-Class but reads informations from the MPart injected
>
> => Naturally such a helper could be provided by XWT
>
> I'd suggest you use solution b) because its the easiest and naturally
> you could file an enhancement request for XWT to somehow tell it to
> generate a file directly useable as a contribution-class in e4.
>
> Please also note that I have less than no idea about XWT so it might be
> that c) is not doable at all but who knows.
>
> Tom
|
|
|
Goto Forum:
Current Time: Fri Jul 04 23:36:14 EDT 2025
Powered by FUDForum. Page generated in 0.12241 seconds
|