| Running a sapphire application in a simple java main method [message #759906] |
Wed, 30 November 2011 09:30  |
Eclipse User |
|
|
|
Hello,
I have the following simple interface
package snippets.sapphire.model;
import org.eclipse.sapphire.modeling.ModelElementType;
import org.eclipse.sapphire.modeling.Value;
import org.eclipse.sapphire.modeling.ValueProperty;
import org.eclipse.sapphire.modeling.annotations.Label;
import org.eclipse.sapphire.modeling.xml.annotations.XmlBinding;
public interface IName
{
ModelElementType TYPE = new ModelElementType( IName.class );
// title
@XmlBinding( path = "title" )
@Label( standard = "&title" )
ValueProperty PROP_TITLE = new ValueProperty( TYPE, "Title" );
Value< String > getTitle();
void setTitle( String value );
// first name
@XmlBinding( path = "firstName" )
@Label( standard = "&firstName" )
ValueProperty PROP_FIRST = new ValueProperty( TYPE, "FirstName" );
Value< String > getFirstName();
void setFirstName( String value );
}
My NameUI.sdef file ( probably incorrect) is shown below:
<?xml version="1.0" encoding="UTF-8"?>
<definition>
<import>
<package>snippets.sapphire.model</package>
<definition>IName</definition>
</import>
<composite>
<content>
<property-editor>Title</property-editor>
<property-editor>First</property-editor>
</content>
</composite>
</definition>
At this point all I would like to do as a beginner is to execute it so I can see the UI and play with these properties.
My attempt to instantiate the above is shown below - of course it does not work - hence where I am stuck.
package snippets.sapphire.ui;
import javax.inject.Inject;
import org.eclipse.e4.core.contexts.Active;
import org.eclipse.swt.widgets.Shell;
import snippets.sapphire.model.IName;
public class NameApp
{
@Inject
@Active
Shell shell;
public static void main( String[] args )
{
IName name = IName.TYPE.instantiate();
// WHAT DO I PUT HERE
}
}
I am using eclipse 4.3 (Juno) stable release with its sapphire 0.4 downloaded from the update site.
Thanks for any help.
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04136 seconds