This documents covers code changes that need to be made by Sapphire adopters as part of migrating
to 0.6 release. Only changes from the previous release are covered.
Before |
After |
outline.refresh()
|
No direct equivalent has been provided. The outline will update itself without explicit refresh calls. For further guidance,
post a question on Sapphire Adopter Forum.
|
outline.attach
(
new Listener()
{
@Override
public void handle( Event event )
{
if( event instanceof MasterDetailsContentOutline.NodeUpdatedEvent )
{
...
}
}
}
)
|
node.attach
(
new Listener()
{
@Override
public void handle( Event event )
{
if( event instanceof SapphirePart.LabelChangedEvent ||
event instanceof SapphirePart.ImageChangedEvent )
{
...
}
}
}
)
Note that the equivalent events are on the nodes, not on the outline.
|
outline.attach
(
new Listener()
{
@Override
public void handle( Event event )
{
if( event instanceof MasterDetailsContentOutline.NodeStructureChangedEvent )
{
...
}
}
}
)
|
node.attach
(
new Listener()
{
@Override
public void handle( Event event )
{
if( event instanceof SapphirePart.VisibilityChangedEvent ||
event instanceof MasterDetailsContentNode.NodeListEvent )
{
...
}
}
}
)
Note that the equivalent events are on the nodes, not on the outline.
|
outline.notifyOfNodeUpdate( node )
|
No direct equivalent has been provided. The outline will update itself without explicit notify calls. For further guidance,
post a question on Sapphire Adopter Forum.
|
outline.notifyOfNodeStructureChange( node )
|
No direct equivalent has been provided. The outline will update itself without explicit notify calls. For further guidance,
post a question on Sapphire Adopter Forum.
|
Before |
After |
ReadOnlyListFactory
|
ListFactory
|
ReadOnlyListFactory.create()
|
ListFactory.start()
|
ReadOnlyListFactory.create( element )
|
ListFactory.singleton( element )
|
ReadOnlyListFactory.create( collection )
|
ListFactory.unmodifiable( collection )
|
ReadOnlyListFactory.create( array )
|
ListFactory.unmodifiable( array )
|
ReadOnlyListFactory.create().add( element ).export()
|
ListFactory.start().add( element ).result()
|
Before |
After |
ReadOnlySetFactory
|
SetFactory
|
ReadOnlySetFactory.create()
|
SetFactory.start()
|
ReadOnlySetFactory.create( element )
|
SetFactory.singleton( element )
|
ReadOnlySetFactory.create( collection )
|
SetFactory.unmodifiable( collection )
|
ReadOnlySetFactory.create( array )
|
SetFactory.unmodifiable( array )
|
ReadOnlySetFactory.create().add( element ).export()
|
SetFactory.start().add( element ).result()
|
SapphireModelCondition class has been removed as part of the transition from SapphireCondition architecture
to using Sapphire Expression Language. Depending on context, other sections of this migration
guide may provide more details on expected migration. For further guidance, post a question
on Sapphire Adopter Forum.
Before |
After |
part.visible()
|
SapphirePart has a new public final visible() method that is linked with the "visible when" feature in sdef. A custom part
implementation may be defining this method already, in which case the method will need to be renamed. For further guidance,
post a question on Sapphire Adopter Forum.
|
part.getValidationState()
|
part.validation()
|
part.computeValidationState()
|
part.computeValidation()
|
part.updateValidationState()
|
part.refreshValidation()
|
SapphirePart.ValidationChangedEvent
|
PartValidationEvent
|
SapphirePart.VisibilityChangedEvent
|
PartVisibilityEvent
|
SapphirePart.StructureChangedEvent
|
The StructureChangedEvent has been eliminated and its function subsumed by other events, such as PartVisibilityEvent
and PartChildrenEvent.
|
SapphirePropertyEnabledCondition class has been removed as part of the transition from SapphireCondition architecture
to using Sapphire Expression Language. Depending on context, other sections of this migration
guide may provide more details on expected migration. For further guidance, post a question
on Sapphire Adopter Forum.
Before |
After |
ISapphireUiDef def = SapphireUiDefFactory.load
(
"org.eclipse.sapphire.examples",
"org/eclipse/sapphire/examples/Examples.sdef"
);
|
DefinitionLoader.Reference<ISapphireUiDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.root();
try
{
ISapphireUiDef def = defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireUiDef def = SapphireUiDefFactory.load
(
sapphireUiDefinition,
"org/eclipse/sapphire/examples/Examples.sdef"
);
|
No direct equivalent has been provided. For further guidance, post a question
on Sapphire Adopter Forum.
|
ISapphireUiDef def = SapphireUiDefFactory.load
(
xmlResourceStore,
writable
);
|
No direct equivalent has been provided. For further guidance, post a question
on Sapphire Adopter Forum.
|
ISapphireCompositeDef def = SapphireUiDefFactory.getCompositeDef
(
"org.eclipse.sapphire.examples/org/eclipse/sapphire/examples/Examples.sdef!ExampleComposite"
);
|
DefinitionLoader.Reference<FormComponentDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.form( "ExampleComposite" );
try
{
CompositeDef def = (CompositeDef) defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireCompositeDef def = SapphireUiDefFactory.getCompositeDef
(
"org.eclipse.sapphire.examples",
"org/eclipse/sapphire/examples/Examples.sdef",
"ExampleComposite"
);
|
DefinitionLoader.Reference<FormComponentDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.form( "ExampleComposite" );
try
{
CompositeDef def = (CompositeDef) defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireDialogDef def = SapphireUiDefFactory.getDialogDef
(
"org.eclipse.sapphire.examples/org/eclipse/sapphire/examples/Examples.sdef!ExampleDialog"
);
|
DefinitionLoader.Reference<DialogDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.dialog( "ExampleDialog" );
try
{
DialogDef def = defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireDialogDef def = SapphireUiDefFactory.getDialogDef
(
"org.eclipse.sapphire.examples",
"org/eclipse/sapphire/examples/Examples.sdef",
"ExampleDialog"
);
|
DefinitionLoader.Reference<DialogDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.dialog( "ExampleDialog" );
try
{
DialogDef def = defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireWizardDef def = SapphireUiDefFactory.getWizardDef
(
"org.eclipse.sapphire.examples/org/eclipse/sapphire/examples/Examples.sdef!ExampleWizard"
);
|
DefinitionLoader.Reference<WizardDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.wizard( "ExampleWizard" );
try
{
WizardDef def = defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
ISapphireWizardDef def = SapphireUiDefFactory.getWizardDef
(
"org.eclipse.sapphire.examples",
"org/eclipse/sapphire/examples/Examples.sdef",
"ExampleWizard"
);
|
DefinitionLoader.Reference<WizardDef> defref = DefinitionLoader
.context( BundleBasedContext.adapt( "org.eclipse.sapphire.examples" ) )
.sdef( "org.eclipse.sapphire.examples.Examples" )
.wizard( "ExampleWizard" );
try
{
WizardDef def = defref.resolve();
}
finally
{
// Do not dispose the definition reference until the definition is not
// needed any longer.
defref.dispose();
}
|
The method of specifying visibility of a section in sdef has been converted to use Sapphire Expression Language instead
of a class implementing SapphireCondition.
The method of specifying visibility of a master-details content node in sdef has been converted to
use Sapphire Expression Language instead of a class implementing SapphireCondition.
The method of specifying visibility of a master-details content node factory in sdef has been converted to
use Sapphire Expression Language instead of a class implementing SapphireCondition.
The use cases covered by hide.if.disabled hint have been subsumed by the "visible when" feature.