Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
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 05:17 Go to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
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 06:49 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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 #655140 is a reply to message #654085] Fri, 18 February 2011 13:36 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
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?

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.

Thanks for your help.
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655155 is a reply to message #655140] Fri, 18 February 2011 13:58 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
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).

> 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
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655834 is a reply to message #655155] Tue, 22 February 2011 18:49 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Thanks Tom,

I can now see my UI in the e4 model.

But another problem in the same .xwt source appears - Caused by: org.eclipse.e4.xwt.XWTException: Cannot load org.eclipse.nebula.widgets.pgroup.PGroup

e4 cannot load the nebual PGroup.

Yet when I try e4.1 stream the PGroup is loaded. I am in a spot because I use Groovy extensively. My current e4 handles Groovy, but there is no Groovy package for e4.1 hence I am caught between these 2 e4 versions.

I appreciate any help I can get.

Thanks
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655835 is a reply to message #655834] Tue, 22 February 2011 18:55 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
I'm not sure what you are trying to say me below. What does it mean that
there's no groovy package for e4?

The reason the PGroup can't be found is most likely that you are:
a) Have not a dependency in your MANIFEST.MF
b) Have not added the PGroup to your launch config

Tom

Am 22.02.11 19:49, schrieb St Clair Clarke:
> Thanks Tom,
>
> I can now see my UI in the e4 model.
>
> But another problem in the same .xwt source appears - Caused by:
> org.eclipse.e4.xwt.XWTException: Cannot load
> org.eclipse.nebula.widgets.pgroup.PGroup
>
> e4 cannot load the nebual PGroup.
>
> Yet when I try e4.1 stream the PGroup is loaded. I am in a spot because
> I use Groovy extensively. My current e4 handles Groovy, but there is no
> Groovy package for e4.1 hence I am caught between these 2 e4 versions.
>
> I appreciate any help I can get.
>
> Thanks
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655849 is a reply to message #655155] Tue, 22 February 2011 20:09 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello Tom,

>> I'm not sure what you are trying to say me below. What does >>it mean that there's no groovy package for e4?

Sorry I did not explain in properly. Groovy from SpringSource has no current plugin for current e4.1 downloadable, so I cannot use it in current workspace as my Groovy files will not be compiled.

>> The reason the PGroup can't be found is most likely that you >>are:
>>a) Have not a dependency in your MANIFEST.MF
>>b) Have not added the PGroup to your launch config
a)There is a dependency in the manifest
b) I never had to use a custom lauch configuration before. When I use e4.1 Jan 28 release, everything renders without any problem, but I cannot use this because of the lack of Groovy support from spring source at present. So there must be something different between e4 updated from http://download.eclipse.org/e4/updates/2010 and e4.1 downloaded from http://download.eclipse.org/e4/sdk/ that works as is.

Is there an update site which would allow me to get the packages from http://download.eclipse.org/e4/sdk/ so I can use it in my eclipse 3.6 environment?

Thanks
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655850 is a reply to message #655849] Tue, 22 February 2011 20:29 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Ok. So your groovy files have been compiled into .class-File right?

Well I think it is possible to use 3.6 to develop Eclipse 4.0
applications by simply setting the target to the Eclipse 4.0 SDK, I've
made fixes to the ModelEditor this week that would make it possible to
run under 3.x as well so all tooling you need should be there (at least
in the latest N-builds).

There's no dedicated update site though to install the Eclipse 4.0
Tooling on a 3.x install so you'd have to check out things manually and
run them in an Inner 3.x :-(

Out of curiosity does that mean there's no groovy plugin available for
3.7? Anything running on 3.7 should run on Eclipse 4.1 as well (as long
as it is API-clean of course :-)

Tom

Am 22.02.11 21:09, schrieb St Clair Clarke:
> Hello Tom,
>
>>> I'm not sure what you are trying to say me below. What does >>it mean
>>> that there's no groovy package for e4?
>
> Sorry I did not explain in properly. Groovy from SpringSource has no
> current plugin for current e4.1 downloadable, so I cannot use it in
> current workspace as my Groovy files will not be compiled.
>
>>> The reason the PGroup can't be found is most likely that you >>are:
>>>a) Have not a dependency in your MANIFEST.MF
>>>b) Have not added the PGroup to your launch config
> a)There is a dependency in the manifest
> b) I never had to use a custom lauch configuration before. When I use
> e4.1 Jan 28 release, everything renders without any problem, but I
> cannot use this because of the lack of Groovy support from spring source
> at present. So there must be something different between e4 updated from
> http://download.eclipse.org/e4/updates/2010 and e4.1 downloaded from
> http://download.eclipse.org/e4/sdk/ that works as is.
>
> Is there an update site which would allow me to get the packages from
> http://download.eclipse.org/e4/sdk/ so I can use it in my eclipse 3.6
> environment?
>
> Thanks
>
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #655943 is a reply to message #655155] Wed, 23 February 2011 13:03 Go to previous messageGo to next message
St Clair Clarke is currently offline St Clair ClarkeFriend
Messages: 118
Registered: March 2010
Senior Member
Hello Tom,
Good morning.

>>Ok. So your groovy files have been compiled into .class-File right?
That is correct.

>>Well I think it is possible to use 3.6 to develop Eclipse 4.0
applications by simply setting the target to the Eclipse 4.0 SDK, I've
made fixes to the ModelEditor this week that would make it possible to
run under 3.x as well so all tooling you need should be there (at least
in the latest N-builds).

the latest N-builds referred to will be 4.0 or 4.1? 4.0 is already completed so I am supposing it is 4.1. Please correct me. The only N-stream I am seeing is for 3.7 for Feb 22

>>Out of curiosity does that mean there's no groovy plugin available for
3.7? Anything running on 3.7 should run on Eclipse 4.1 as well (as long
as it is API-clean of course Smile

No Tom, there is no Groovy plugin for 3.7 as yet. When I attempt to update from the Groovy 3.6 site it complains about the JDT feature patch.
Re: org.eclipse.e4.core.di.InjectionException: Could not find satisfiable constructor [message #658640 is a reply to message #654088] Wed, 09 March 2011 11:03 Go to previous messageGo to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
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 11:07 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
"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
Previous Topic:XWT Source Code and extending query
Next Topic:How to add property in existing SWT component
Goto Forum:
  


Current Time: Thu Mar 28 18:46:00 GMT 2024

Powered by FUDForum. Page generated in 0.03139 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top