Property editor's property reference path is invalid. [message #1695443] |
Thu, 14 May 2015 16:37  |
Eclipse User |
|
|
|
I have defined an Element like
public interface IScheduler extends Element {
ElementType TYPE = new ElementType( IScheduler.class );
//ScheduleType
@Type( base = ScheduleType.class )
@XmlBinding( path = "scheduletype" )
@DefaultValue( text = "once" )
@Label( standard = "type" )
@Required
ValueProperty PROP_SCHEDULE_TYPE = new ValueProperty( TYPE, "ScheduleType" );
Value<ScheduleType> getScheduleType();
void setScheduleType( String value );
void setScheduleType( ScheduleType value );
...
ScheduleType is just an enum and IScheduler is used in
@XmlBinding(path = "dispatcher")
public interface IDispatcher extends Element
{
ElementType TYPE = new ElementType(IDispatcher.class);
...
//Scheduler
@Type( base = IScheduler.class )
@XmlElementBinding( path = "scheduler" )
// @XmlBinding( path = "scheduler" )
// @XmlElementBinding(path = "scheduler") //mappings = {@XmlElementBinding.Mapping(element = "scheduler", type = IScheduler.class)})
@Label( standard = "type" )
@Required
ValueProperty PROP_SCHEDULER = new ValueProperty( TYPE, "Scheduler" );
Value<IScheduler> getScheduler();
...
I the .sdef file I refer to IScheduler in a composite (at least I believe so):
<composite>
<id>scheduler</id>
<content>
<property-editor>ScheduleType</property-editor>
...
</content>
</composite>
and use it later in the editor page for IDispatcher:
<editor-page>
<id>editor.page</id>
<page-name>general</page-name>
<outline-header-text>Dispatcher</outline-header-text>
<page-header-text>Test Tree</page-header-text>
<initial-selection>dispatcher</initial-selection>
<root-node>
<node>
...
<section>
<label>scheduler</label>
<content>
<include>scheduler</include>
</content>
<collapsible>true</collapsible>
</section>
</node>
</root-node>
<element-type>org.bricks.etml.etml.IDispatcher</element-type>
</editor-page>
I expect to appear that composite as a section within the page, using the IScheduler as the underlying object. However, when I start the editor, I get a runtime exception:
org.eclipse.sapphire.modeling.el.FunctionException: RuntimeException: Property editor's property reference path "ScheduleType" is invalid.
at org.eclipse.sapphire.modeling.el.FunctionResult.value(FunctionResult.java:232)
at org.eclipse.sapphire.ui.SapphirePart.visible(SapphirePart.java:515)
at org.eclipse.sapphire.ui.forms.MasterDetailsContentNodePart.computeValidation(MasterDetailsContentNodePart.java:735)
at org.eclipse.sapphire.ui.SapphirePart.refreshValidation(SapphirePart.java:453)
...
Caused by: java.lang.RuntimeException: Property editor's property reference path "ScheduleType" is invalid.
at org.eclipse.sapphire.ui.forms.PropertyEditorPart.init(PropertyEditorPart.java:135)
at org.eclipse.sapphire.ui.SapphirePart.initialize(SapphirePart.java:206)
at org.eclipse.sapphire.ui.forms.ContainerPart$Children.all(ContainerPart.java:191)
...
What is needed to get the correct reference?
|
|
|
|
Re: Property editor's property reference path is invalid. [message #1696213 is a reply to message #1695445] |
Sat, 23 May 2015 07:17   |
Eclipse User |
|
|
|
I changed the .sdef to use a with-directive in the composite:
<composite>
<id>scheduler</id>
<content>
<with>
<path>scheduler</path>
<case>
<element-type>IScheduler</element-type>
<content>
property-editors ...
</content>
</case>
<show-label>false</show-label>
</with>
</content>
</composite>
and changed the binding to @XmlElementBinding:
public interface IDispatcher extends Element
{
ElementType TYPE = new ElementType(IDispatcher.class);
...
//Scheduler
@Type( base = IScheduler.class )
@XmlElementBinding(path = "", mappings = {@XmlElementBinding.Mapping(element = "scheduler", type = IScheduler.class)})
@Required
ElementProperty PROP_SCHEDULER = new ElementProperty( TYPE, "Scheduler" );
ElementHandle<IScheduler> getScheduler();
...
This seems to work, but is this the right way? I did not find a description for the with-directive, and still have an issue with it:
The section in which the composite appears, starts now with a check-box coming from the "With". I do not want that. How can I remove it?
|
|
|
Re: Property editor's property reference path is invalid. [message #1696490 is a reply to message #1696213] |
Tue, 26 May 2015 16:59   |
Eclipse User |
|
|
|
There are two types of element properties. The regular kind and the implied kind. For a regular element property, the creation/deletion of the element is explicitly controlled, hence you get a checkbox in the UI when using the with construct. For an implied element property, the element is not explicitly created/deleted, so you would not see a checkbox when using the with construct. Search for examples of ImpliedElementProperty in the samples.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03684 seconds