Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Sapphire » Property editor's property reference path is invalid.
Property editor's property reference path is invalid. [message #1695443] Thu, 14 May 2015 16:37 Go to next message
Uli B is currently offline Uli BFriend
Messages: 36
Registered: January 2012
Member
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 #1695445 is a reply to message #1695443] Thu, 14 May 2015 16:52 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
I see several issues here.

1. You are trying to hold IScheduler element in a value property. You can't do that.
2. In sdef, you are trying to access ScheduleType property, but your context is IDispatcher, which doesn't have that property, hence the error that you are seeing.
Re: Property editor's property reference path is invalid. [message #1696213 is a reply to message #1695445] Sat, 23 May 2015 07:17 Go to previous messageGo to next message
Uli B is currently offline Uli BFriend
Messages: 36
Registered: January 2012
Member
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 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
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.
Re: Property editor's property reference path is invalid. [message #1696504 is a reply to message #1696490] Tue, 26 May 2015 19:48 Go to previous messageGo to next message
Uli B is currently offline Uli BFriend
Messages: 36
Registered: January 2012
Member
Nice, with
  @Type( base = IScheduler.class )
  @XmlElementBinding( path = "scheduler" )
  @Required
 
  ImpliedElementProperty PROP_SCHEDULER = new ImpliedElementProperty( TYPE, "Scheduler" );
  ElementHandle<IScheduler> getScheduler();

it works.

Thank you very much.
Re: Property editor's property reference path is invalid. [message #1696505 is a reply to message #1696504] Tue, 26 May 2015 20:02 Go to previous message
Konstantin Komissarchik is currently offline Konstantin KomissarchikFriend
Messages: 1077
Registered: July 2009
Senior Member
Note that @Required has no effect in this case and the accessor should return just IScheduler instead of ElementHandle<IScheduler>.
Previous Topic:How to listen for tab selection changes
Next Topic:Bug in feature dependencies in 8.2
Goto Forum:
  


Current Time: Tue Mar 19 06:11:59 GMT 2024

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

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

Back to the top