Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sapphire-dev] New topic in forum Sapphire, called InitialValue vs DefaultValue and persistence, by Jason Pell

Title: Eclipse Community Forums
Subject: InitialValue vs DefaultValue and persistence Author: Jason Pell Date: Wed, 25 February 2015 19:49
Hi,

I have a field which is backed by an enumeration. It must have a value in the XML that gets written. I would like to ensure that a default value is specified in the UI and that even if no one changes that value it gets written out.

I tried using @InitialValue but it seems to have no impact on what is selected in the UI and also does not appear in the xml anyway.

This DuplicateConfig is referenced from the root element object:

@Label( standard = "Duplicate Config" )
@Type( base = DuplicateConfig.class )
@XmlBinding( path = "DuplicateConfig" )

ImpliedElementProperty PROP_DUPLICATE_CONFIG = new ImpliedElementProperty( TYPE, "DuplicateConfig" );
DuplicateConfig getDuplicateConfig();

Should I just use a @DefaultValue and a custom XML binder? Or is there something fundamental I am not understanding.

public interface DuplicateConfig extends Element {
ElementType TYPE = new ElementType(DuplicateConfig.class);

@Type( base = DuplicateMatching.class )
@XmlBinding(path = "duplicateMatching")
@Label(standard = "Duplicate Matching")
@InitialValue( text = "IgnoreNumericSuffix" )
ValueProperty PROP_DUPLICATE_MATCHING = new ValueProperty(TYPE, "DuplicateMatching");

Value<DuplicateMatching> getDuplicateMatching();
void setDuplicateMatching(String value);
void setDuplicateMatching(DuplicateMatching value);

@Label( standard = "Ignore Fqns" )
@XmlListBinding( path = "" )
@Type( base = IgnoreFqn.class )
ListProperty PROP_IGNORE_FQNS = new ListProperty( TYPE, "IgnoreFqns" );
ElementList<IgnoreFqn> getIgnoreFqns();
}
[ Reply ][ Quote ][ View Topic/Message ][ Unsubscribe from this forum ]

Back to the top