Sapphire Developer Guide > Releases > 0.7

Migration Guide for Sapphire 0.7

This documents covers changes that need to be made by Sapphire adopters as part of migrating to Sapphire 0.7 from a prior release. Only changes from the previous major release are covered.

Table of Contents

  1. AbsoluteFilePathBrowseActionHandler
  2. AbsoluteFolderPathBrowseActionHandler
  3. AbstractSlushBucketPropertyEditorRenderer
  4. ActionBridge
  5. ActionHandlerBridge
  6. ActionSystemPartBridge
  7. ActuatorDef
  8. ActuatorPart
  9. AdapterService
  10. BindingImpl
  11. BooleanPropertyEditorRenderer
  12. BundleImageDataFactory
  13. CheckBoxListPropertyEditorRenderer
  14. Color
  15. ColumnSortComparator
  16. CompactListPropertyEditorRenderer
  17. CompositeDef
  18. CompositePart
  19. ConditionalDef
  20. ConditionalPart
  21. ContentOutlineNodeState
  22. ContentOutlineState
  23. Context
  24. ConversionService
  25. CreateWorkspaceFileOp
  26. DateSerializationService
  27. DefaultListPropertyEditorRenderer
  28. DefaultValuePropertyEditorRenderer
  29. DependenciesAggregationService
  30. DialogDef
  31. DtdParser
  32. EclipseWorkspacePathPropertyEditorRenderer
  33. EditorPagePresentation
  34. ElementBindingImpl
  35. ElementProperty
  36. ElementValidationEvent
  37. Enabled Function
  38. EnumPropertyEditorRenderer
  39. Event
  40. FormComponentDef
  41. FormComponentPart
  42. FormDef
  43. FormEditorPage
  44. FormEditorPageDef
  45. FormEditorPagePart
  46. FormPart
  47. FunctionContext
  48. GenerateImpl
  49. GridLayoutUtil
  50. HtmlPanelDef
  51. HtmlPanelPart
  52. HyperlinkTable
  53. ImageData
  54. ImageService
  55. IDiagramEditorPageDef
  56. IExecutableModelElement
  57. IFormPartInclude
  58. IModelElement
  59. IModelParticle
  60. ImpliedElementProperty
  61. IPropertiesViewContributionDef
  62. IPropertiesViewContributionPageDef
  63. IPropertiesViewContributorDef
  64. IPropertiesViewContributorPart
  65. ISapphireCustomPartDef
  66. ISapphireGroupDef
  67. ISapphireLabelDef
  68. ISapphireStaticTextFieldDef
  69. JavaType
  70. LabelPart
  71. LayeredListBindingImpl
  72. LineSeparatorDef
  73. LineSeparatorPart
  74. ListBindingImpl
  75. ListProperty
  76. ListPropertyEditorRenderer
  77. LoggingService
  78. MasterDetailsContentNode
  79. MasterDetailsContentNodeChildDef
  80. MasterDetailsContentNodeDef
  81. MasterDetailsContentNodeFactoryCaseDef
  82. MasterDetailsContentNodeFactoryDef
  83. MasterDetailsContentNodeInclude
  84. MasterDetailsContentNodeList
  85. MasterDetailsContentOutline
  86. MasterDetailsEditorPage
  87. MasterDetailsEditorPageDef
  88. MasterDetailsEditorPagePart
  89. MasterDetailsEditorPageState
  90. ModelElementHandle
  91. ModelElementList
  92. ModelElementsTransfer
  93. ModelElementType
  94. ModelProperty
  95. NamedValuesPropertyEditorRenderer
  96. NLS
  97. PageBookDef
  98. PageBookExtDef
  99. PageBookKeyMapping
  100. PageBookPart
  101. PageBookPartControlMethod
  102. PossibleValuesService
  103. ProblemsTraversalService
  104. ProblemsTraversalServiceData
  105. ProgressMonitorBridge
  106. PropertiesViewContributionManager
  107. PropertiesViewContributionPagePart
  108. PropertiesViewContributionPart
  109. PropertyContentEvent
  110. PropertyEditorDef
  111. PropertyEditorPart
  112. PropertyEditorAssistContext
  113. PropertyEditorAssistContributor
  114. PropertyEditorRenderer
  115. PropertyEditorRendererFactory
  116. PropertyEnablementEvent
  117. PropertyEvent
  118. PropertyInitializationEvent
  119. PropertyValidationEvent
  120. ReferenceValue
  121. RelativePathBrowseActionHandler
  122. Resource
  123. SapphireActionHandler
  124. SapphireActionPresentation
  125. SapphireActionPresentationManager
  126. SapphireBrowseActionHandler
  127. SapphireDiagramEditorPagePart
  128. SapphireDialog
  129. SapphireDialogPart
  130. SapphireEditor
  131. SapphireEditorFormPage
  132. SapphireEnumControlledPageBook
  133. SapphireForm
  134. SapphireGroup
  135. SapphireHotSpotsActionPresentation
  136. SapphireJumpActionHandler
  137. SapphireKeyboardActionPresentation
  138. SapphireListControlledPageBook
  139. SapphireMenuActionPresentation
  140. SapphirePart
  141. SapphirePopup
  142. SapphirePropertyEditorActionHandler
  143. SapphirePropertyEditorCondition
  144. SapphirePropertyPage
  145. SapphirePropertySheetPage
  146. SapphireStaticTextField
  147. SapphireStatusDialog
  148. SapphireTextCellEditor
  149. SapphireTextPopup
  150. SapphireToolBarActionPresentation
  151. SapphireToolBarManagerActionPresentation
  152. SapphireToolTip
  153. SapphireWizard
  154. SapphireWizardPage
  155. SapphireWizardPagePart
  156. SapphireWizardPart
  157. ScalePropertyEditorRenderer
  158. SectionDef
  159. SectionPart
  160. SectionRef
  161. SeparatorDef
  162. SeparatorPart
  163. ServiceFactory
  164. SlushBucketPropertyEditor
  165. SplitFormBlockDef
  166. SplitFormBlockPart
  167. SplitFormDef
  168. SplitFormPart
  169. StandardXmlListBindingImpl
  170. SwtRendererUtil
  171. SwtResourceCache
  172. SwtUtil
  173. TabGroupDef
  174. TabGroupPageDef
  175. TabGroupPagePart
  176. TabGroupPart
  177. Transient
  178. TransientProperty
  179. TypeCast
  180. UrlResolver
  181. ValidationAggregationService
  182. ValidationService
  183. Value
  184. ValueBindingImpl
  185. ValueLabelProvider
  186. ValueProperty
  187. ValuePropertyEditorRenderer
  188. ValueSerializationMasterService
  189. ValueSerializationService
  190. WhitespaceSeparatorDef
  191. WhitespaceSeparatorPart
  192. WithDef
  193. WithPart
  194. WithPartImplied
  195. WizardDef
  196. WizardPageDef
  197. XmlDocumentSchemasCache
  198. XmlResource
  199. @Service
  200. SDEF

AbsoluteFilePathBrowseActionHandler

Before After
org.eclipse.sapphire.ui.swt.renderer.actions.AbsoluteFilePathBrowseActionHandler
org.eclipse.sapphire.ui.forms.swt.AbsoluteFilePathBrowseActionHandler

AbsoluteFolderPathBrowseActionHandler

Before After
org.eclipse.sapphire.ui.swt.renderer.actions.AbsoluteFolderPathBrowseActionHandler
org.eclipse.sapphire.ui.forms.swt.AbsoluteFolderPathBrowseActionHandler

AbstractSlushBucketPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.AbstractSlushBucketPropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.AbstractSlushBucketPropertyEditorPresentation

ActionBridge

Before After
org.eclipse.sapphire.ui.swt.ActionBridge
org.eclipse.sapphire.ui.forms.swt.ActionBridge

ActionHandlerBridge

Before After
org.eclipse.sapphire.ui.swt.ActionHandlerBridge
org.eclipse.sapphire.ui.forms.swt.ActionHandlerBridge

ActionSystemPartBridge

Before After
org.eclipse.sapphire.ui.swt.ActionSystemPartBridge
org.eclipse.sapphire.ui.forms.swt.ActionSystemPartBridge

ActuatorDef

Before After
org.eclipse.sapphire.ui.def.ActuatorDef
org.eclipse.sapphire.ui.forms.ActuatorDef

ActuatorPart

Before After
org.eclipse.sapphire.ui.ActuatorPart
org.eclipse.sapphire.ui.forms.ActuatorPart

AdapterService

Before After
public class ExampleAdapterService extends AdapterService
{
    @Override
    public <T> T adapt( Class<T> type )
    {
        if( type == IProject.class )
        {
            INewProjectFileOp op = context( INewProjectFileOp.class );
            return type.cast( op.getProject().resolve() );
        }

        return null;
    }
}
public class ExampleConversionService extends UniversalConversionService
{
    @Override
    public <T> T convert( Object object, Class<T> type )
    {
        if( object instanceof INewProjectFileOp && type == IProject.class )
        {
            INewProjectFileOp op = (INewProjectFileOp) object;
            return type.cast( op.getProject().resolve() );
        }

        return null;
    }
}
public class ExampleAdapterService extends AdapterService
{
    @Override
    public <T> T adapt( Class<T> type )
    {
        if( type == IProject.class )
        {
            INewProjectFileOp op = context( INewProjectFileOp.class );
            return type.cast( op.getProject().resolve() );
        }

        return null;
    }
}
public class ExampleConversionService extends ConversionService<INewProjectFileOp,IProject>
{
    public ExampleConversionService()
    {
        super( INewProjectFileOp.class, IProject.class );
    }

    @Override
    public IProject convert( INewProjectFileOp op )
    {
        return op.getProject().resolve();
    }
}

While extending from UniversalConversionService is a quicker migration, in most cases, better performance can be achieved by migrating to the typed ConversionService API. Conversions implemented in this manner are quicker for Sapphire to find.

BindingImpl

Before After
org.eclipse.sapphire.modeling.BindingImpl
org.eclipse.sapphire.PropertyBinding
binding.element()
binding.property().element()
binding.property()
binding.property().definition()
public class ExampleBinding extends BindingImpl
{
    @Override
    public void init( IModelElement pdef, ModelProperty property, String[] params )
    {
        ...
    }
}
public class ExampleBinding extends PropertyBinding
{
    @Override
    public void init( Property property )
    {
        Element element = property.element();
        PropertyDef pdef = property.definition();
        String[] params = pdef.getAnnotation( CustomXmlValueBinding.class ).params();
        
        ...
    }
}

Note that resource implementations should no longer call the binding init method. This
is now handled by Resource base class

BooleanPropertyEditorRenderer

This class is not longer available and no analog has been provided.

BundleImageDataFactory

This class is not longer available and no analog has been provided.

CheckBoxListPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.CheckBoxListPropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.CheckBoxListPropertyEditorPresentation

Color

Before After
import org.eclipse.sapphire.ui.Color
import org.eclipse.sapphire.Color
color.getRed()
color.red()
color.getGreen()
color.green()
color.getBlue()
color.blue()

ColumnSortComparator

This class is not longer available and no analog has been provided.

CompactListPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.CompactListPropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.CompactListPropertyEditorPresentation

CompositeDef

Before After
org.eclipse.sapphire.ui.def.CompositeDef
org.eclipse.sapphire.ui.forms.CompositeDef

CompositePart

Before After
org.eclipse.sapphire.ui.CompositePart
org.eclipse.sapphire.ui.forms.CompositePart

ConditionalDef

This class is not longer available and no analog has been provided.

ConditionalPart

This class is not longer available and no analog has been provided.

ContentOutlineNodeState

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.state.ContentOutlineNodeState
org.eclipse.sapphire.ui.forms.MasterDetailsNodeState

ContentOutlineState

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.state.ContentOutlineState
org.eclipse.sapphire.ui.forms.MasterDetailsOutlineState

Context

Before After
URL url = context.findResource( name );
InputStream stream = context.findResource( name );
List<URL> urls = context.findResources( name );

This facility has been removed and no analog has been provided.

ConversionService

Before After
public class ExampleConversionService extends ConversionService
{
    @Override
    public <T> T convert( Object object, Class<T> type )
    {
        if( object instanceof IFile && type == Resource.class )
        {
            ...
        }

        return null;
    }
}
public class ExampleConversionService extends UniversalConversionService
{
    @Override
    public <T> T convert( Object object, Class<T> type )
    {
        if( object instanceof IFile && type == Resource.class )
        {
            ...
        }

        return null;
    }
}
public class ExampleConversionService extends ConversionService
{
    @Override
    public <T> T convert( Object object, Class<T> type )
    {
        if( object instanceof IFile && type == Resource.class )
        {
            ...
        }

        return null;
    }
}
public class ExampleConversionService extends ConversionService<IFile,Resource>
{
    public ExampleConversionService()
    {
        super( IFile.class, Resource.class );
    }

    @Override
    public Resource convert( IFile file )
    {
        ...
    }
}

While extending from UniversalConversionService is a quicker migration, in most cases, better performance can be achieved by migrating to the new ConversionService API. Conversions implemented in this manner are quicker for Sapphire to find.

CreateWorkspaceFileOp

Before After
CreateWorkspaceFileOp.PROP_FILE_NAME
CreateWorkspaceFileOp.PROP_FILE
operation.getFileName()
operation.getFile()
operation.setFileName( ... )
operation.setFile( ... )
operation.getFileHandle()
operation.getFile().resolve()

DateSerializationService

Before After
@Type( base = Date.class )

@Service
(
    impl = DateSerializationService.class, 
    params =
    { 
        @Service.Param( name = "format-1", value = "yyyy-MM-dd" ), 
        @Service.Param( name = "format-2", value = "MM/dd/yyyy" )
    }
)

ValueProperty PROP_DATE = new ValueProperty( TYPE, "Date" );

Value<Date> getDate();
void setDate( String value );
void setDate( Date value );
@Type( base = Date.class )
@Serialization( primary = "yyyy-MM-dd", alternative = "MM/dd/yyyy" )

ValueProperty PROP_DATE = new ValueProperty( TYPE, "Date" );

Value<Date> getDate();
void setDate( String value );
void setDate( Date value );
class ExampleDateSerializationService extends DateSerializationService
{
    @Override
    public List<? extends DateFormat> formats()
    {
        List <DateFormat> formats = new ArrayList<DateFormat>();
        
        formats.add( new SimpleDateFormat( "yyyy-MM-dd" );
        formats.add( new SimpleDateFormat( "MM/dd/yyyy" );
        
        return formats;
    }
}

@Type( base = Date.class )
@Service( impl = ExampleDateSerializationService.class ) 

ValueProperty PROP_DATE = new ValueProperty( TYPE, "Date" );

Value<Date> getDate();
void setDate( String value );
void setDate( Date value );
@Type( base = Date.class )
@Serialization( primary = "yyyy-MM-dd", alternative = "MM/dd/yyyy" )

ValueProperty PROP_DATE = new ValueProperty( TYPE, "Date" );

Value<Date> getDate();
void setDate( String value );
void setDate( Date value );

DefaultListPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.DefaultListPropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.TablePropertyEditorPresentation

DefaultValuePropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.DefaultValuePropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.TextFieldPropertyEditorPresentation

DependenciesAggregationService

As an optimization, the aggregation intermediary to DependenciesService has been removed.

Before After
Set<ModelPath> dependencies = property.service( DependenciesAggregationService.class ).dependencies();
Set<ModelPath> dependencies = new HashSet<ModelPath>();

for( DependenciesService service : property.services( DependenciesService.class ) )
{
    dependencies.addAll( service.dependencies() );
}

DialogDef

Before After
org.eclipse.sapphire.ui.def.DialogDef
org.eclipse.sapphire.ui.forms.DialogDef

DtdParser

Before After
DtdParser.parseFromString( dtd )
DtdParser.parse( dtd )
DtdParser.parseFromUrl( referer, location )
DtdParser.parse( new URL( location ) )

EclipseWorkspacePathPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.EclipseWorkspacePathPropertyEditorRenderer
org.eclipse.sapphire.workspace.ui.WorkspaceRelativePathPropertyEditorPresentation

EditorPagePresentation

Before After
org.eclipse.sapphire.ui.swt.EditorPagePresentation
org.eclipse.sapphire.ui.forms.swt.EditorPagePresentation

ElementBindingImpl

The removable method has been removed from ElementBindingImpl class.

Before After
org.eclipse.sapphire.modeling.ElementBindingImpl
org.eclipse.sapphire.ElementPropertyBinding
public class ExampleBinding extends ElementBindingImpl
{
    ...

    @Override
    public boolean removable()
    {
        ...
    }
}
public class ExampleBinding extends ElementPropertyBinding
{
    ...
}

ElementProperty

Before After
org.eclipse.sapphire.modeling.ElementProperty
org.eclipse.sapphire.ElementProperty

ElementValidationEvent

Before After
element.attach
(
    new FilteredListener<ElementValidationEvent>()
    {
        @Override
        protected void handleTypedEvent( ElementValidationEvent event )
        {
            ...
        }
    }
)
element.attach
(
    new FilteredListener<PropertyValidationEvent>()
    {
        @Override
        protected void handleTypedEvent( PropertyValidationEvent event )
        {
            ...
        }
    },
    "*"
)

ElementValidationEvent no longer exists. To get a similar effect, one
needs to listen on all PropertyValidationEvents.

Enabled Function

Before After
${ Enabled( 'FulfillmentDate' ) }
${ FulfillmentDate.Enabled }
${ Enabled( PurchaseOrder, 'FulfillmentDate' ) }
${ PurchaseOrder.FulfillmentDate.Enabled }

EnumPropertyEditorRenderer

This class is not longer available and no analog has been provided.

Event

Before After
Event.filter( listener, eventTypes )
new FilteringListenerWrapper( listener, eventTypes )

...

public class FilteringListenerWrapper extends Listener
{
    private final Listener listener;
    private final Class<?>[] eventTypes;

    public FilteringListenerWrapper( Listener listener, Class<?>[] eventTypes )
    {
        this.listener = listener;
        this.eventTypes = eventTypes;
    }

    @Override
    public void handle( Event event )
    {
        boolean ok = false;

        for( Class<?> type : this.eventTypes )
        {
            if( type.isInstance( event ) )
            {
                ok = true;
                break;
            }
        }

        if( ok )
        {
            this.listener.handle( event );
        }
    }

    @Override
    public boolean equals( Object obj )
    {
        if( obj instanceof FilteringListenerWrapper )
        {
            FilteringListenerWrapper x = (FilteringListenerWrapper) obj;
            return ( this.listener.equals( x.listener ) && Arrays.equals( this.eventTypes, x.eventTypes ) );
        }

        return false;
    }
        
    @Override
    public int hashCode()
    {
        int hashcode = this.listener.hashCode();

        for( Class<?> eventType : this.eventTypes )
        {
            hashcode = hashcode ^ eventType.hashCode();
        }

        return hashcode;
    }
}

FormComponentDef

Before After
org.eclipse.sapphire.ui.def.FormComponentDef
org.eclipse.sapphire.ui.def.FormComponentDef

FormComponentPart

Before After
org.eclipse.sapphire.ui.FormComponentPart
org.eclipse.sapphire.ui.forms.FormComponentPart

FormDef

Before After
org.eclipse.sapphire.ui.def.FormDef
org.eclipse.sapphire.ui.forms.FormDef

FormEditorPage

Before After
org.eclipse.sapphire.ui.FormEditorPage
org.eclipse.sapphire.ui.forms.swt.FormEditorPage

FormEditorPageDef

Before After
org.eclipse.sapphire.ui.def.FormEditorPageDef
org.eclipse.sapphire.ui.forms.FormEditorPageDef

FormEditorPagePart

Before After
org.eclipse.sapphire.ui.FormEditorPagePart
org.eclipse.sapphire.ui.forms.FormEditorPagePart

FormPart

Before After
org.eclipse.sapphire.ui.FormPart
org.eclipse.sapphire.ui.forms.FormPart

FunctionContext

Before After
public ExampleFunctionContext extends FunctionContext
{
    @Override
    public Function function( String name, List<Function> arguments )
    {
        ...
    }
}
Functions should be contributed through Sapphire extension system. Contributing a function in a FunctionContext implementation is no longer supported.

GenerateImpl

With the switch to on-demand element compilation, there is no longer a need to signal to the framework which elements should be compiled. Also, the developer no longer has control over the name of the generated implementation class. As such, the @GenerateImpl annotation has been removed and no direct equivalent has been provided. For further guidance, post a question on Sapphire Adopter Forum.

GridLayoutUtil

Before After
org.eclipse.sapphire.ui.swt.renderer.GridLayoutUtil
org.eclipse.sapphire.ui.forms.swt.GridLayoutUtil

HtmlPanelDef

Before After
org.eclipse.sapphire.ui.def.HtmlPanelDef
org.eclipse.sapphire.ui.forms.HtmlPanelDef

HtmlPanelPart

Before After
org.eclipse.sapphire.ui.HtmlPanelPart
org.eclipse.sapphire.ui.forms.HtmlPanelPart

HyperlinkTable

This class is not longer available and no analog has been provided.

ImageData

Before After
org.eclipse.sapphire.modeling.ImageData
org.eclipse.sapphire.ImageData
ImageData.readFromStream( stream )
ImageData.readFromStream( stream ).optional()
ImageData.readFromUrl( url )
ImageData.readFromUrl( url ).optional()
ImageData.readFromClassLoader( cl, path )
ImageData.readFromClassLoader( cl, path ).optional()
ImageData.createFromStream( stream )
ImageData.readFromStream( stream ).required()
ImageData.createFromUrl( url )
ImageData.readFromUrl( url ).required()
ImageData.createFromClassLoader( cl, path )
ImageData.readFromClassLoader( cl, path ).required()

ImageService

Before After
org.eclipse.sapphire.services.ImageService
org.eclipse.sapphire.ImageService
public class ExampleImageService extends ImageService
{
    @Override
    protected ImageServiceData compute()
    {
        ImageData image = ...
        
        return new ImageServiceData( image );
    }
}
public class ExampleImageService extends ImageService
{
    @Override
    protected ImageData compute()
    {
        ImageData image = ...
        
        return image;
    }
}

IDiagramEditorPageDef

Before After
org.eclipse.sapphire.ui.diagram.def.IDiagramEditorPageDef
org.eclipse.sapphire.ui.diagram.def.DiagramEditorPageDef

IExecutableModelElement

Before After
org.eclipse.sapphire.modeling.IExecutableModelElement
org.eclipse.sapphire.ExecutableElement

IFormPartInclude

Before After
org.eclipse.sapphire.ui.def.IFormPartInclude
org.eclipse.sapphire.ui.forms.FormComponentRef

IModelElement

Before After
org.eclipse.sapphire.modeling.IModelElement
org.eclipse.sapphire.Element
IModelParticle root = element.root()
Element root = element.root()
IModelParticle parent = element.parent()
Property parent = element.parent()
element.getParentProperty()
element.parent().definition()
List<ModelProperty> properties = element.properties()
SortedSet<PropertyDef> properties = element.type().properties()
element.property( "ExampleProperty" )
element.property( "ExampleProperty" ).definition()
element.read( "ExampleProperty" )
element.property( "ExampleProperty" )
element.read( ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE )
SortedSet<String> strings = element.read( path );
SortedSet<String> strings = new TreeSet<String>();

element.visit
(
    path,
    new PropertyVisitor()
    {
        @Override
        public boolean visit( Value<?> property )
        {
            strings.add( property.text() );
            return true;
        }
    }
);
SortedSet<String> strings = new TreeSet<String>();

element.read( path, strings );
SortedSet<String> strings = new TreeSet<String>();

element.visit
(
    path,
    new PropertyVisitor()
    {
        @Override
        public boolean visit( Value<?> property )
        {
            strings.add( property.text() );
            return true;
        }
    }
);
element.write( ExampleElement.PROP_VALUE, content )
element.property( ExampleElement.PROP_VALUE ).write( content )
element.write( ExampleElement.PROP_TRANSIENT, content )
element.property( ExampleElement.PROP_TRANSIENT ).write( content )
element.write( "ExampleProperty", content )
( (Value<?>) element.property( "ExampleProperty" ) ).write( content )

or

( (Transient<?>) element.property( "ExampleProperty" ) ).write( content )
element.refresh( force )

or

element.refresh( force, deep )
element.refresh()

The concepts of forcing a refresh and deep refresh are no longer supported.
element.refresh( "ExampleProperty" )

or

element.refresh( "ExampleProperty", force )

or

element.refresh( "ExampleProperty", force, deep )
element.property( "ExampleProperty" ).refresh()

The concepts of forcing a refresh and deep refresh are no longer supported.
element.refresh( ExampleElement.PROP_EXAMPLE )

or

element.refresh( ExampleElement.PROP_EXAMPLE, force )

or

element.refresh( ExampleElement.PROP_EXAMPLE, force, deep )
element.property( ExampleElement.PROP_EXAMPLE ).refresh()

The concepts of forcing a refresh and deep refresh are no longer supported.
element.service( "ExampleProperty", ExampleService.class )
element.property( "ExampleProperty" ).service( ExampleService.class )
element.service( ExampleElement.PROP_EXAMPLE, ExampleService.class )
element.property( ExampleElement.PROP_EXAMPLE ).service( ExampleService.class )
element.services( "ExampleProperty", ExampleService.class )
element.property( "ExampleProperty" ).services( ExampleService.class )
element.services( ExampleElement.PROP_EXAMPLE, ExampleService.class )
element.property( ExampleElement.PROP_EXAMPLE ).services( ExampleService.class )
element.enabled( "ExampleProperty" )
element.property( "ExampleProperty" ).enabled()
element.enabled( ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE ).enabled()
element.empty( "ExampleProperty" )
element.property( "ExampleProperty" ).empty()
element.empty( ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE ).empty()
element.validation( "ExampleProperty" )
element.property( "ExampleProperty" ).validation()
element.validation( ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE ).validation()
element.attach( listener, ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE ).attach( listener )
element.detach( listener, ExampleElement.PROP_EXAMPLE )
element.property( ExampleElement.PROP_EXAMPLE ).detach( listener )

IModelParticle

This interface has been removed and no direct analog has been provided. Reference Element and Property classes directly.

ImpliedElementProperty

Before After
org.eclipse.sapphire.modeling.ImpliedElementProperty
org.eclipse.sapphire.ImpliedElementProperty

IPropertiesViewContributionDef

Before After
org.eclipse.sapphire.ui.def.IPropertiesViewContributionDef
org.eclipse.sapphire.ui.forms.PropertiesViewContributionDef

IPropertiesViewContributionPageDef

Before After
org.eclipse.sapphire.ui.def.IPropertiesViewContributionPageDef
org.eclipse.sapphire.ui.forms.PropertiesViewPageDef

IPropertiesViewContributorDef

Before After
org.eclipse.sapphire.ui.def.IPropertiesViewContributorDef
org.eclipse.sapphire.ui.forms.PropertiesViewContributorDef

IPropertiesViewContributorPart

Before After
org.eclipse.sapphire.ui.IPropertiesViewContributorPart
org.eclipse.sapphire.ui.forms.PropertiesViewContributorPart

ISapphireCustomPartDef

Before After
org.eclipse.sapphire.ui.def.ISapphireCustomPartDef
org.eclipse.sapphire.ui.forms.CustomFormComponentDef

ISapphireGroupDef

Before After
org.eclipse.sapphire.ui.def.ISapphireGroupDef
org.eclipse.sapphire.ui.forms.GroupDef

ISapphireLabelDef

Before After
org.eclipse.sapphire.ui.def.ISapphireLabelDef
org.eclipse.sapphire.ui.forms.TextDef

ISapphireStaticTextFieldDef

Before After
org.eclipse.sapphire.ui.def.ISapphireStaticTextFieldDef
org.eclipse.sapphire.ui.forms.StaticTextFieldDef

JavaType

Before After
Class<?> cl = type.artifact();
Class<?> cl = (Class<?>) type.artifact();

LabelPart

Before After
org.eclipse.sapphire.ui.LabelPart
org.eclipse.sapphire.ui.forms.TextPart

LayeredListBindingImpl

Before After
org.eclipse.sapphire.modeling.LayeredListBindingImpl
org.eclipse.sapphire.LayeredListPropertyBinding

LineSeparatorDef

Before After
org.eclipse.sapphire.ui.def.LineSeparatorDef
org.eclipse.sapphire.ui.forms.LineSeparatorDef

LineSeparatorPart

Before After
org.eclipse.sapphire.ui.LineSeparatorPart
org.eclipse.sapphire.ui.forms.LineSeparatorPart

ListBindingImpl

Before After
org.eclipse.sapphire.modeling.ListBindingImpl
org.eclipse.sapphire.ListPropertyBinding

ListProperty

Before After
org.eclipse.sapphire.modeling.ListProperty
org.eclipse.sapphire.ListProperty

ListPropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.ListPropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.ListPropertyEditorPresentation
getList()
list()

LoggingService

Before After
org.eclipse.sapphire.modeling.LoggingService
org.eclipse.sapphire.LoggingService
LoggingService.log( ... )
Sapphire.service( LoggingService.class ).log( ... )

MasterDetailsContentNode

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsContentNode
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodePart

MasterDetailsContentNodeChildDef

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsContentNodeChildDef
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeChildDef

MasterDetailsContentNodeDef

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsContentNodeDef
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeDef

MasterDetailsContentNodeFactoryCaseDef

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsContentNodeFactoryCaseDef
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeFactoryCaseDef
property Type
property ElementType

MasterDetailsContentNodeFactoryDef

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsContentNodeFactoryDef
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeFactoryDef

MasterDetailsContentNodeInclude

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsContentNodeInclude
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeRef

MasterDetailsContentNodeList

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsContentNodeList
org.eclipse.sapphire.ui.forms.MasterDetailsContentNodeList

MasterDetailsContentOutline

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsContentOutline
org.eclipse.sapphire.ui.forms.MasterDetailsContentOutline

MasterDetailsEditorPage

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsEditorPage
org.eclipse.sapphire.ui.forms.swt.MasterDetailsEditorPage

MasterDetailsEditorPageDef

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.def.MasterDetailsEditorPageDef
org.eclipse.sapphire.ui.forms.MasterDetailsEditorPageDef

MasterDetailsEditorPagePart

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.MasterDetailsEditorPagePart
org.eclipse.sapphire.ui.forms.MasterDetailsEditorPagePart
MasterDetailsEditorPageState state = page.getState();
MasterDetailsEditorPageState state = page.state();

MasterDetailsEditorPageState

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.state.MasterDetailsEditorPageState
org.eclipse.sapphire.ui.forms.MasterDetailsEditorPageState

ModelElementHandle

Before After
org.eclipse.sapphire.modeling.ModelElementHandle
org.eclipse.sapphire.ElementHandle
IModelParticle root = handle.root()
Element root = handle.root()
IModelParticle parent = handle.parent()
Element parent = handle.element()
handle.adapt( Example.class )
handle.element().adapt( Example.class )
handle.getProperty()
handle.definition()
handle.element()
handle.content()
handle.element( createIfNecessary )
handle.content( createIfNecessary )
handle.element( createIfNecessary, type )
handle.content( createIfNecessary, type )
handle.remove()
handle.clear()
handle.removable()
handle.definition() instanceof ImplementElementProperty
Status validation = handle.validation()

or

Status validation = handle.validation( true )
Element property validation no longer includes validation of the child element.

Status.CompositeStatusFactory factory = Status.factoryForComposite();

factory.merge( handle.validation() );

Element child = handle.content();

if( child != null )
{
    factory.merge( child.validation() );
}

Status validation = factory.create();

ModelElementList

Before After
org.eclipse.sapphire.modeling.ModelElementList
org.eclipse.sapphire.ElementList
IModelParticle root = list.root()
Element root = list.root()
IModelParticle parent = list.parent()
Element parent = list.element()
list.adapt( Example.class )
list.element().adapt( Example.class )
list.getParentProperty()
list.definition()
Status validation = list.validation()
List property validation no longer includes validation of the child element.

Status.CompositeStatusFactory factory = Status.factoryForComposite();

factory.merge( list.validation() );

for( Element child : list )
{
    factory.merge( child.validation() );
}

Status validation = factory.create();

ModelElementsTransfer

This class is not longer available and no analog has been provided.

ModelElementType

With the switch to on-demand element compilation, the developer no longer has control over the name of the generated implementation class. As such, the following methods have been removed and no direct equivalents have been provided. For further guidance, post a question on Sapphire Adopter Forum.

ModelElementType
{
    Class getImplClass()
    String getImplClassName( Class elementTypeClass )
    String getImplClassName( String elementTypeClassName, GenerateImpl generateImplAnnotation )
    String getImplClassName( String elementTypeClassName, String preferredImplPackageName, String preferredImplClassName )
}
Before After
org.eclipse.sapphire.modeling.ModelElementType
org.eclipse.sapphire.ElementType
List<ModelProperty> properties = type.properties()
SortedSet<ModelProperty> properties = type.properties()
type.instantiate( element, pdef, resource )
type.instantiate( element.property( pdef ), resource )

ModelProperty

Before After
org.eclipse.sapphire.modeling.ModelProperty
org.eclipse.sapphire.PropertyDef
property.getName()
property.name()

NamedValuesPropertyEditorRenderer

This class is not longer available and no analog has been provided.

NLS

Before After
public final class Resources extends NLS 
{
    public static String title;
    public static String message;

    static 
    {
        initializeMessages( Resources.class.getName(), Resources.class );
    }
}
public final class Resources 
{
    public static LocalizableText title;
    public static LocalizableText message;

    static 
    {
        LocalizableText.init( Resources.class );
    }
}
String text = Resources.title;
String text = Resources.title.text();
String text = NLS.bind( Resources.message, x, y );
String text = Resources.message.format( x, y );

PageBookDef

Before After
org.eclipse.sapphire.ui.def.PageBookDef
org.eclipse.sapphire.ui.forms.PageBookDef
property Pages
property Cases
property DefaultPage

This property is not longer available and no analog has been provided.

PageBookExtDef

Before After
org.eclipse.sapphire.ui.def.PageBookExtDef
org.eclipse.sapphire.ui.forms.PageBookDef

PageBookKeyMapping

Before After
org.eclipse.sapphire.ui.def.PageBookKeyMapping
org.eclipse.sapphire.ui.forms.PageBookCaseDef
property Key
property ElementType

PageBookPart

Before After
org.eclipse.sapphire.ui.PageBookPart
org.eclipse.sapphire.ui.forms.PageBookPart

PageBookPartControlMethod

This class is not longer available and no analog has been provided.

PossibleValuesService

Before After
public class ExamplePossibleValuesService extends PossibleValuesService
{
    protected void fillPossibleValues( SortedSet<String> values )
    {
        ...
    }
}
public class ExamplePossibleValuesService extends PossibleValuesService
{
    protected void fillPossibleValues( Set<String> values )
    {
        ...
    }
}
SortedSet<String> values = possibleValuesService.values();
Set<String> values = possibleValuesService.values();

ProblemsTraversalService

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.ProblemsTraversalService
org.eclipse.sapphire.ui.forms.ProblemsTraversalService

ProblemsTraversalServiceData

Before After
org.eclipse.sapphire.ui.form.editors.masterdetails.ProblemsTraversalServiceData
org.eclipse.sapphire.ui.forms.ProblemsTraversalServiceData

ProgressMonitorBridge

Before After
org.eclipse.sapphire.ui.swt.ProgressMonitorBridge
org.eclipse.sapphire.platform.ProgressMonitorBridge

PropertiesViewContributionManager

Before After
org.eclipse.sapphire.ui.PropertiesViewContributionManager
org.eclipse.sapphire.ui.forms.PropertiesViewContributionManager

PropertiesViewContributionPagePart

Before After
org.eclipse.sapphire.ui.PropertiesViewContributionPagePart
org.eclipse.sapphire.ui.forms.PropertiesViewPagePart

PropertiesViewContributionPart

Before After
org.eclipse.sapphire.ui.PropertiesViewContributionPart
org.eclipse.sapphire.ui.forms.PropertiesViewContributionPart

PropertyContentEvent

Before After
org.eclipse.sapphire.modeling.PropertyContentEvent
org.eclipse.sapphire.PropertyContentEvent

PropertyEditorDef

Before After
org.eclipse.sapphire.ui.def.PropertyEditorDef
org.eclipse.sapphire.ui.forms.PropertyEditorDef
HINT_PREFER_COMBO
This hint has been replaced by Sapphire.PropertyEditor.PopUpListField style.
HINT_PREFER_RADIO_BUTTONS
This hint has been replaced by Sapphire.PropertyEditor.RadioButtonGroup style.
HINT_PREFER_VERTICAL_RADIO_BUTTONS
This hint has been replaced by Sapphire.PropertyEditor.RadioButtonGroup.Vertical style.

PropertyEditorPart

Before After
org.eclipse.sapphire.ui.PropertyEditorPart
org.eclipse.sapphire.ui.forms.PropertyEditorPart
getLabel( ... )
label( ... )
getShowLabel()
label() != null

PropertyEditorAssistContributor

Before After
public class ExampleContributor extends PropertyEditorAssistContributor
{
    @Override
    public void init( IModelElement element, ModelProperty property )
    {
        if( property != null )
        {
            ...
        }
    }
}
public class ExampleContributor extends PropertyEditorAssistContributor
{
    @Override
    public void init( SapphirePart part )
    {
        Element element = part.getLocalModelElement();
        
        if( part instanceof PropertyEditorPart )
        {
            PropertyDef property = ( (PropertyEditorPart) part ).property().definition();
            
            ...
        }
    }
}

PropertyEditorAssistContext

Before After
context.getModelElement()
context.getPart().getLocalModelElement()
context.getProperty()
( (PropertyEditorPart) context.getPart() ).property().definition()
context.isPropertyEditorReadOnly()
( (PropertyEditorPart) context.getPart() ).isReadOnly()

PropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.PropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.PropertyEditorPresentation

PropertyEditorRendererFactory

Before After
org.eclipse.sapphire.ui.renderers.swt.PropertyEditorRendererFactory
org.eclipse.sapphire.ui.forms.swt.PropertyEditorPresentationFactory
public class ExamplePropertyEditorRenderFactory extends PropertyEditorRendererFactory
{
    @Override
    public boolean isApplicableTo( PropertyEditorPart part ) 
    {
        ...
    }

    @Override
    public PropertyEditorRenderer create( SapphireRenderingContext context,
                                          PropertyEditorPart part ) 
    {
        return new ExamplePropertyEditorRender( context, part );
    }
}
public class ExamplePropertyEditorPresentationFactory extends PropertyEditorPresentationFactory
{
    private boolean isApplicableTo( PropertyEditorPart part ) 
    {
        ...
    }

    @Override
    public PropertyEditorPresentation create( PropertyEditorPart part, 
                                              SwtPresentation parent,
                                              Composite composite ) 
    {
        if( isApplicable( part ) )
        {
            return new ExamplePropertyEditorPresentation( part, parent, composite );
        }
        
        return null;
    }
}

PropertyEnablementEvent

Before After
org.eclipse.sapphire.modeling.PropertyEnablementEvent
org.eclipse.sapphire.PropertyEnablementEvent

PropertyEvent

Before After
org.eclipse.sapphire.modeling.PropertyEvent
org.eclipse.sapphire.PropertyEvent
event.element()
event.property().element()

PropertyInitializationEvent

As an optimization, property initialization events are no longer broadcast.

PropertyValidationEvent

Before After
org.eclipse.sapphire.modeling.PropertyValidationEvent
org.eclipse.sapphire.PropertyValidationEvent

ReferenceValue

Before After
org.eclipse.sapphire.modeling.ReferenceValue
org.eclipse.sapphire.ReferenceValue

RelativePathBrowseActionHandler

Before After
org.eclipse.sapphire.ui.swt.renderer.actions.RelativePathBrowseActionHandler
org.eclipse.sapphire.ui.forms.swt.RelativePathBrowseActionHandler

Resource

Before After
org.eclipse.sapphire.modeling.Resource
org.eclipse.sapphire.Resource
public class ExampleResource extends Resource
{
    @Override
    protected BindingImpl createBinding( ModelProperty pdef )
    {
        ...
    }
}
public class ExampleResource extends Resource
{
    @Override
    protected PropertyBinding createBinding( Property property )
    {
        PropertyDef pdef = property.definition();
        
        ...
    }
}

SapphireActionHandler

Before After
public class ExampleActionHandler extends SapphireActionHandler
{
    @Override
    protected Object run( SapphireRenderingContext context )
    {
        Shell shell = context.getShell();
        
        ...
    }
}
public class ExampleActionHandler extends SapphireActionHandler
{
    @Override
    protected Object run( Presentation context )
    {
        Shell shell = ( (SwtPresentation) context ).shell();
        
        ...
    }
}

SapphireActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireActionPresentation

SapphireActionPresentationManager

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireActionPresentationManager
org.eclipse.sapphire.ui.forms.swt.SapphireActionPresentationManager

SapphireBrowseActionHandler

Before After
org.eclipse.sapphire.ui.SapphireBrowseActionHandler
org.eclipse.sapphire.ui.forms.BrowseActionHandler
public class ExampleBrowseActionHandler extends SapphireBrowseActionHandler
{
    @Override
    protected String browse( SapphireRenderingContext context )
    {
        Shell shell = context.getShell();
        
        ...
    }
}
public class ExampleBrowseActionHandler extends BrowseActionHandler
{
    @Override
    protected String browse( Presentation context )
    {
        Shell shell = ( (SwtPresentation) context ).shell();
        
        ...
    }
}

SapphireDiagramEditorPagePart

Before After
DiagramEditorPageState state = page.getState();
DiagramEditorPageState state = page.state();

SapphireDialog

Before After
org.eclipse.sapphire.ui.swt.SapphireDialog
org.eclipse.sapphire.ui.forms.swt.SapphireDialog
public class CustomDialog extends SapphireDialog
{
    @Override
    protected void okPressed()
    {
        ...
        
        if( success )
        {
            super.okPressed();
        }
    }
}
public class CustomDialog extends SapphireDialog
{
    @Override
    protected boolean performOkOperation()
    {
        ...
        
        return success;
    }
}

SapphireDialogPart

Before After
org.eclipse.sapphire.ui.SapphireDialogPart
org.eclipse.sapphire.ui.forms.DialogPart

SapphireEditor

The following method has been removed and no direct equivalent have been provided. For further guidance, post a question on Sapphire Adopter Forum.

SapphireEditor
{
    File getDefaultStateStorageFile( SapphireEditorPagePart part )
}

SapphireEditorFormPage

Before After
org.eclipse.sapphire.ui.SapphireEditorFormPage
org.eclipse.sapphire.ui.forms.swt.SapphireEditorFormPage

SapphireEnumControlledPageBook

This class is not longer available and no analog has been provided.

SapphireForm

Before After
org.eclipse.sapphire.ui.swt.SapphireForm
org.eclipse.sapphire.ui.forms.swt.SapphireForm

SapphireGroup

Before After
org.eclipse.sapphire.ui.SapphireGroup
org.eclipse.sapphire.ui.forms.GroupPart

SapphireHotSpotsActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireHotSpotsActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireHotSpotsActionPresentation

SapphireJumpActionHandler

Before After
org.eclipse.sapphire.ui.SapphireJumpActionHandler
org.eclipse.sapphire.ui.forms.JumpActionHandler

SapphireKeyboardActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireKeyboardActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireKeyboardActionPresentation

SapphireListControlledPageBook

Before After
org.eclipse.sapphire.ui.SapphireListControlledPageBook
org.eclipse.sapphire.ui.forms.DetailSectionPart

SapphireMenuActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireMenuActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireMenuActionPresentation

SapphirePart

Before After
getParentPart()
parent()
getImageCache()
getSwtResourceCache()
public class ExamplePart extends SapphirePart
{
    @Override
    public void render( SapphireRenderingContext context )
    {
        ...
    }
}
public class ExamplePart extends FormComponentPart
{
    @Override
    public FormComponentPresentation createPresentation( SwtPresentation parent, Composite composite )
    {
        return new FormComponentPresentation( this, parent, composite )
        {
            @Override
            public void render()
            {
                ...
            }
        };
    }
}

SapphirePopup

Before After
org.eclipse.sapphire.ui.swt.SapphirePopup
org.eclipse.sapphire.ui.forms.swt.Popup

SapphirePropertyEditorActionHandler

Before After
org.eclipse.sapphire.ui.SapphirePropertyEditorActionHandler
org.eclipse.sapphire.ui.forms.PropertyEditorActionHandler
handler.getProperty()
handler.property().definition()

SapphirePropertyEditorCondition

Before After
org.eclipse.sapphire.ui.SapphirePropertyEditorCondition
org.eclipse.sapphire.ui.forms.PropertyEditorCondition

SapphirePropertyPage

Before After
org.eclipse.sapphire.ui.swt.SapphirePropertyPage
org.eclipse.sapphire.ui.forms.swt.SapphirePropertyPage

SapphirePropertySheetPage

This class is not longer available and no analog has been provided.

SapphireStaticTextField

Before After
org.eclipse.sapphire.ui.SapphireStaticTextField
org.eclipse.sapphire.ui.forms.StaticTextFieldPart

SapphireStatusDialog

This class is not longer available and no analog has been provided.

SapphireTextCellEditor

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireTextCellEditor
org.eclipse.sapphire.ui.forms.swt.SapphireTextCellEditor

SapphireTextPopup

This class is not longer available and no analog has been provided.

SapphireToolBarActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireToolBarActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireToolBarActionPresentation

SapphireToolBarManagerActionPresentation

Before After
org.eclipse.sapphire.ui.swt.renderer.SapphireToolBarManagerActionPresentation
org.eclipse.sapphire.ui.forms.swt.SapphireToolBarManagerActionPresentation

SapphireToolTip

This class is not longer available and no analog has been provided.

SapphireWizard

Before After
org.eclipse.sapphire.ui.swt.SapphireWizard
org.eclipse.sapphire.ui.forms.swt.SapphireWizard
setDefaultPageImageDescriptor( ... )
<wizard>
    <id>ExampleWizard</id>
    <label>example wizard</label>
    <image>...</image>
    <page>
        ...
    </page>
</wizard>
getShell()
getContainer().getShell()
public class ExampleWizard extends SapphireWizard<ExampleOp>
{
    @Override
    public void addPages()
    {
        super.addPages();
        
        addPage( new CustomWizardPage() );
    }
}
public class ExampleWizard extends SapphireWizard<ExampleOp>
{
    private IWizardPage customWizardPage;
    
    @Override
    public IWizardPage[] getPages()
    {
        final IWizardPage[] pages = super.getPages();
        final IWizardPage[] extended = new IWizardPage[ pages.length + 1 ];
        
        System.arraycopy( pages, 0, extended, 0, pages.length );
        
        if( this.customWizardPage == null )
        {
            this.customWizardPage = new CustomWizardPage();
            this.customWizardPage.setWizard( this );
        }
        
        extended[ pages.length ] = this.customWizardPage;
        
        return extended;
    }
}

SapphireWizardPage

Before After
org.eclipse.sapphire.ui.swt.SapphireWizardPage
org.eclipse.sapphire.ui.forms.swt.SapphireWizardPage

SapphireWizardPagePart

Before After
org.eclipse.sapphire.ui.SapphireWizardPagePart
org.eclipse.sapphire.ui.forms.WizardPagePart

SapphireWizardPart

Before After
org.eclipse.sapphire.ui.SapphireWizardPart
org.eclipse.sapphire.ui.forms.WizardPart

ScalePropertyEditorRenderer

This class is not longer available and no analog has been provided.

SectionDef

Before After
org.eclipse.sapphire.ui.def.SectionDef
org.eclipse.sapphire.ui.forms.SectionDef

SectionPart

Before After
org.eclipse.sapphire.ui.SectionPart
org.eclipse.sapphire.ui.forms.SectionPart

SectionRef

Before After
org.eclipse.sapphire.ui.def.SectionRef
org.eclipse.sapphire.ui.forms.SectionRef

SeparatorDef

Before After
org.eclipse.sapphire.ui.def.SeparatorDef
org.eclipse.sapphire.ui.forms.SeparatorDef

SeparatorPart

Before After
org.eclipse.sapphire.ui.SeparatorPart
org.eclipse.sapphire.ui.forms.SeparatorPart

ServiceFactory

Before After
public class CustomValidationServiceFactory extends ServiceFactory
{
    @Override
    public boolean applicable( ServiceContext context, Class<? extends Service> service )
    {
        ...
    }

    @Override
    public Service create( ServiceContext context, Class<? extends Service> service )
    {
        return new CustomValidationService();
    }
}
public class CustomValidationServiceCondition extends ServiceCondition
{
    @Override
    public boolean applicable( ServiceContext context )
    {
        ...
    }
}
<service>
    <id>CustomValidationService</id>
    <context>Sapphire.Property.Instance</context>
    <type>org.eclipse.sapphire.services.ValidationService</type>
    <factory>org.adopter.CustomValidationServiceFactory</factory>
</service>
<service>
    <id>CustomValidationService</id>
    <context>Sapphire.Property.Instance</context>
    <implementation>org.adopter.CustomValidationService</implementation>
    <condition>org.adopter.CustomValidationServiceCondition</condition>
</service>

SlushBucketPropertyEditor

Before After
org.eclipse.sapphire.ui.renderers.swt.SlushBucketPropertyEditor
org.eclipse.sapphire.ui.forms.swt.SlushBucketPropertyEditorPresentation

SplitFormBlockDef

Before After
org.eclipse.sapphire.ui.def.SplitFormBlockDef
org.eclipse.sapphire.ui.forms.SplitFormSectionDef

SplitFormBlockPart

Before After
org.eclipse.sapphire.ui.SplitFormBlockPart
org.eclipse.sapphire.ui.forms.SplitFormSectionPart

SplitFormDef

Before After
org.eclipse.sapphire.ui.def.SplitFormDef
org.eclipse.sapphire.ui.forms.SplitFormDef

SplitFormPart

Before After
org.eclipse.sapphire.ui.SplitFormPart
org.eclipse.sapphire.ui.forms.SplitFormPart

StandardXmlListBindingImpl

Before After

public class ExampleBinding extends StandardXmlListBindingImpl
{
    @Override
    protected void initBindingMetadata( IModelElement element, ModelProperty property, String[] params )
    {
        ...
    }
}

public class ExampleBinding extends StandardXmlListBindingImpl
{
    @Override
    protected void initBindingMetadata()
    {
        Element element = property().element();
        PropertyDef pdef = property().definition();
        String[] params = pdef.getAnnotation( CustomXmlListBinding.class ).params();
        
        ...
    }
}

SwtRendererUtil

Before After
org.eclipse.sapphire.ui.renderers.swt.SwtRendererUtil
org.eclipse.sapphire.ui.forms.swt.SwtUtil

SwtResourceCache

Before After
org.eclipse.sapphire.ui.swt.SwtResourceCache
org.eclipse.sapphire.ui.forms.swt.SwtResourceCache

SwtUtil

Before After
org.eclipse.sapphire.ui.swt.renderer.SwtUtil
org.eclipse.sapphire.ui.forms.swt.SwtUtil

TabGroupDef

Before After
org.eclipse.sapphire.ui.def.TabGroupDef
org.eclipse.sapphire.ui.forms.TabGroupDef

TabGroupPageDef

Before After
org.eclipse.sapphire.ui.def.TabGroupPageDef
org.eclipse.sapphire.ui.forms.TabGroupPageDef

TabGroupPagePart

Before After
org.eclipse.sapphire.ui.TabGroupPagePart
org.eclipse.sapphire.ui.forms.TabGroupPagePart

TabGroupPart

Before After
org.eclipse.sapphire.ui.TabGroupPart
org.eclipse.sapphire.ui.forms.TabGroupPart

Transient

Before After
org.eclipse.sapphire.modeling.Transient
org.eclipse.sapphire.Transient
IModelParticle root = transient.root()
Element root = transient.root()
transient.parent()
transient.element()
transient.adapt( Example.class )
transient.element().adapt( Example.class )
transient.property()
transient.definition()

TransientProperty

Before After
org.eclipse.sapphire.modeling.TransientProperty
org.eclipse.sapphire.TransientProperty

TypeCast

Before After
public class StringToVersionTypeCast extends TypeCast
{
    @Override
    public boolean applicable( FunctionContext context,
                               Function requestor,
                               Object value,
                               Class<?> target )
    {
        return ( target == Version.class && value instanceof String );
    }

    @Override
    public Object evaluate( FunctionContext context,
                            Function requestor,
                            Object value,
                            Class<?> target )
    {
        Version result = null;
        
        try
        {
            result = new Version( (String) value );
        }
        catch( IllegalArgumentException e )
        {
            // Intentionally ignored.
        }
        
        return null;
    }
}
public class StringToVersionConversionService extends ConversionService<String,Version>
{
    public StringToVersionConversionService()
    {
        super( String.class, Version.class );
    }

    @Override
    public Version convert( String string )
    {
        Version result = null;
        
        try
        {
            result = new Version( string );
        }
        catch( IllegalArgumentException e )
        {
            // Intentionally ignored.
        }
        
        return result;
    }
}
<extension>
    <type-cast>
        <source>java.lang.String</source>
        <target>org.eclipse.sapphire.Version</target>
        <impl>org.eclipse.sapphire.modeling.el.internal.StringToVersionTypeCast</impl>
    </type-cast>
</extension>
<extension>
    <service>
        <id>Sapphire.ConversionService.StringToVersion</id>
        <implementation>org.eclipse.sapphire.internal.StringToVersionConversionService</implementation>
        <context>Sapphire</context>
    </service>
</extension>

UrlResolver

Before After
UrlResolver.resolve( referer, location )
URIResolverPlugin.createResolver().resolve( referer, null, location )

ValidationAggregationService

As an optimization, the aggregation intermediary to ValidationService has been removed. Adopters should not use ValidationService directly. Instead, access validation using Property.validation() API. The property manages the interaction with ValidationService implementations.

Before After
Status validation = property.service( ValidationAggregationService.class ).validation();
Status validation = property.validation()

ValidationService

Before After
public class ExampleValidationService extends ValidationService
{
    @Override
    protected void init()
    {
        super.init();

        ...

        inside a listener
        {
            broadcast();
        }
    }
    
    @Override
    public Status validate()
    {
        ...
    }
}
public class ExampleValidationService extends ValidationService
{
    @Override
    protected void initValidationService()
    {
        ...

        inside a listener
        {
            refresh();
        }
    }
    
    @Override
    protected Status compute()
    {
        ...
    }
}

Value

Before After
org.eclipse.sapphire.modeling.Value
org.eclipse.sapphire.Value
IModelParticle root = value.root()
Element root = value.root()
IModelParticle parent = value.parent()
Element parent = value.element()
value.adapt( Example.class )
value.element().adapt( Example.class )
value.getProperty()
value.definition()
value.getText()
value.text()
value.getText( useDefaultValue )
value.text( useDefaultValue )
value.getLocalizedText()
value.localized()
value.getLocalizedText( useDefaultValue )
value.localized( useDefaultValue )
value.getLocalizedText( capitalizationType, includeMnemonic )
value.localized( capitalizationType, includeMnemonic )
value.getLocalizedText( useDefaultValue, capitalizationType, includeMnemonic )
value.localized( useDefaultValue, capitalizationType, includeMnemonic )
value.getContent()
value.content()
value.getContent( useDefaultValue )
value.content( useDefaultValue )
value.isDefault()
value.empty()
value.isMalformed()
value.malformed()

ValueBindingImpl

Before After
org.eclipse.sapphire.modeling.ValueBindingImpl
org.eclipse.sapphire.ValuePropertyBinding

ValueLabelProvider

This class is not longer available and no analog has been provided.

ValueProperty

Before After
org.eclipse.sapphire.modeling.ValueProperty
org.eclipse.sapphire.ValueProperty

ValuePropertyEditorRenderer

Before After
org.eclipse.sapphire.ui.renderers.swt.ValuePropertyEditorRenderer
org.eclipse.sapphire.ui.forms.swt.ValuePropertyEditorPresentation

ValueSerializationMasterService

Before After
Integer num = (Integer) element.service( prop, ValueSerializationMasterService.class ).decode( str );
Integer num = element.service( prop, MasterConversionService.class ).convert( str, Integer.class );
String str = element.service( prop, ValueSerializationMasterService.class ).encode( num );
String str = element.service( prop, MasterConversionService.class ).convert( num, String.class );

ValueSerializationService

Before After
Integer num = (Integer) element.service( prop, ValueSerializationService.class ).decode( str );
Integer num = element.service( prop, MasterConversionService.class ).convert( str, Integer.class );
String str = element.service( prop, ValueSerializationService.class ).encode( num );
String str = element.service( prop, MasterConversionService.class ).convert( num, String.class );
public class ExampleSerializationService extends ValueSerializationService
{
    @Override
    protected ExampleType decodeFromString( String value )
    {
        ...
    }

    public String encode( Object value )
    {
        ...
    }
}
public class StringToExampleTypeConversionService extends ConversionService<String,ExampleType>
{
    public ExampleConversionService()
    {
        super( String.class, ExampleType.class );
    }

    @Override
    public ExampleType convert( String value )
    {
        ...
    }
}

If the ValueSerializationService does not override the encode() method, then it is not necessary to supply a conversion to a string. Sapphire includes a ConversionService implementation for converting an Object to a String that uses object's toString() method. This matches the default implementation of the encode() method.

public class ExampleTypeToStringTypeConversionService extends ConversionService<ExampleType,String>
{
    public ExampleConversionService()
    {
        super( ExampleType.class, String.class );
    }

    @Override
    public String convert( ExampleType value )
    {
        ...
    }
}

WhitespaceSeparatorDef

Before After
org.eclipse.sapphire.ui.def.WhitespaceSeparatorDef
org.eclipse.sapphire.ui.forms.SpacerDef

WhitespaceSeparatorPart

Before After
org.eclipse.sapphire.ui.WhitespaceSeparatorPart
org.eclipse.sapphire.ui.forms.SpacerPart

WithDef

Before After
org.eclipse.sapphire.ui.def.WithDef
org.eclipse.sapphire.ui.forms.WithDef

WithPart

Before After
org.eclipse.sapphire.ui.WithPart
org.eclipse.sapphire.ui.forms.WithPart

WithPartImplied

Before After
org.eclipse.sapphire.ui.WithPartImplied
org.eclipse.sapphire.ui.forms.WithImpliedPart

WizardDef

Before After
org.eclipse.sapphire.ui.def.WizardDef
org.eclipse.sapphire.ui.forms.WizardDef

WizardPageDef

Before After
org.eclipse.sapphire.ui.def.WizardPageDef
org.eclipse.sapphire.ui.forms.WizardPageDef

XmlDocumentSchemasCache

Before After
XmlDocumentSchemasCache.getSchema( location, referer )
XmlDocumentSchemasCache.getSchema( referer, null, location )

XmlResource

Before After
XmlResource resource = ...
XmlResource parent = resource.parent();
XmlResource resource = ...
XmlResource parent = (XmlResource) resource.parent();
XmlResource resource = ...
RootXmlResource root = resource.root();
XmlResource resource = ...
RootXmlResource root = (RootXmlResource) resource.root();

@Service

Services registered with an @Service annotation on an element or a property will now be placed in either metamodel or instance context, instead of both. Instance context is default, which is the most common intention when using the @Service annotation. Registrations of services intended for the metamodel context will need an adjustment.

Before After
@Service( impl = ExampleService.class )
@Service( impl = ExampleService.class, context = Service.Context.METAMODEL )

SDEF

Before After
<if>
    <condition>${ ... }</condition>
    <then>
        ...
    </then>
    <else>
        ...
    </else>
</if>
<form>
    <visible-when>${ ... }</visible-when>
    <content>
        ...
    </content>
</form>
<form>
    <visible-when>${ ! ( ... ) }</visible-when>
    <content>
        ...
    </content>
</form>
<switching-panel>
    <enum-controller>
        <property>ExampleEnum</property>
    </enum-controller>
    <panel>
        <key>ExampleEnum.ITEM1</key>
        <content>
            ...
        </content>
    </panel>
    <panel>
        <key>ExampleEnum.ITEM2</key>
        <content>
            ...
        </content>
    </panel>
    <default-panel>
        <content>
            ...
        </content>
    </default-panel>
<switching-panel>
<form>
    <visible-when>${ ExampleEnum == "ITEM1" }</visible-when>
    <content>
        ...
    </content>
</form>
<form>
    <visible-when>${ ExampleEnum == "ITEM2" }</visible-when>
    <content>
        ...
    </content>
</form>
<form>
    <visible-when>${ ExampleEnum != "ITEM1" and ExampleEnum != "ITEM2" }</visible-when>
    <content>
        ...
    </content>
</form>

When comparing enum values in an expression, make sure to use strings as specified by @EnumSerialization annotations (if present) rather than names of enum items in Java.

<switching-panel>
    <list-selection-controller>
        <property>...</property>
    </list-selection-controller>
    <panel>
        <key>...</key>
        <content>
            ...
        </content>
    </panel>
    <panel>
        <key>...</key>
        <content>
            ...
        </content>
    </panel>
    <default-panel>
        <content>
            ...
        </content>
    </default-panel>
</switching-panel>
<detail-section>
    <property>...</property>
    <case>
        <element-type>...</element-type>
        <content>
            ...
        </content>
    </case>
    <case>
        <element-type>...</element-type>
        <content>
            ...
        </content>
    </case>
</detail-section>
<with>
    <path>...</path>
    <panel>
        <key>...</key>
        <content>
            ...
        </content>
    </panel>
    <panel>
        <key>...</key>
        <content>
            ...
        </content>
    </panel>
    <default-panel>
        <content>
            ...
        </content>
    </default-panel>
</with>
<with>
    <path>...</path>
    <case>
        <element-type>...</element-type>
        <content>
            ...
        </content>
    </case>
    <case>
        <element-type>...</element-type>
        <content>
            ...
        </content>
    </case>
</with>
<with>
    <path>...</path>
    <default-panel>
        <content>
            ...
        </content>
    </default-panel>
</with>
<with>
    <path>...</path>
    <case>
        <content>
            ...
        </content>
    </case>
</with>
<node-factory>
    <property>...</property>
    <case>
        <model-element-type>...</model-element-type>
        <label>...</label>
        <content>
            ...
        </content>
    </case>
</node-factory>
<node-factory>
    <property>...</property>
    <case>
        <element-type>...</element-type>
        <label>...</label>
        <content>
            ...
        </content>
    </case>
</node-factory>
<hint>
    <name>prefer.form.style</name>
    <value>true</value>
</hint>
<background-color>white</background-color>
<hint>
    <name>prefer.combo</name>
    <value>true</value>
</hint>
<style>Sapphire.PropertyEditor.PopUpListField</style>
<hint>
    <name>prefer.radio.buttons</name>
    <value>true</value>
</hint>
<style>Sapphire.PropertyEditor.RadioButtonGroup</style>
<hint>
    <name>prefer.vertical.radio.buttons</name>
    <value>true</value>
</hint>
<style>Sapphire.PropertyEditor.RadioButtonGroup.Vertical</style>
<hint>
    <name>factory</name>
    <value>CheckBoxListPropertyEditorRenderer$Factory</value>
</hint>
<hint>
    <name>factory</name>
    <value>CheckBoxListPropertyEditorPresentation$Factory</value>
</hint>
<import>
    <package>org.eclipse.sapphire.ui.renderers.swt</package>
</import>
<import>
    <package>org.eclipse.sapphire.ui.forms.swt</package>
</import>