Sapphire Developer Guide > Extension System

Sapphire Extensions

Model Element Services

Service Type Class Service Factory Class
org.eclipse.sapphire.modeling.ImageService org.eclipse.sapphire.modeling.internal.StaticImageService$Factory

Model Property Services

Service Type Class Service Factory Class
org.eclipse.sapphire.modeling.ReferenceService org.eclipse.sapphire.sdk.internal.SdkJavaTypeReferenceServiceForSdef$Factory
org.eclipse.sapphire.modeling.ReferenceService org.eclipse.sapphire.java.internal.StandardJavaTypeReferenceService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.java.internal.JavaTypeValidationService$Factory
org.eclipse.sapphire.modeling.ReferenceService org.eclipse.sapphire.java.jdt.internal.JdtJavaTypeReferenceService$Factory
org.eclipse.sapphire.modeling.serialization.ValueSerializationService org.eclipse.sapphire.modeling.serialization.internal.ValueSerializationServiceFactory
org.eclipse.sapphire.modeling.DefaultValueService org.eclipse.sapphire.modeling.internal.DefaultValueServiceFactory
org.eclipse.sapphire.modeling.DerivedValueService org.eclipse.sapphire.modeling.internal.DerivedValueServiceFactory
org.eclipse.sapphire.modeling.PossibleValuesService org.eclipse.sapphire.modeling.internal.PossibleValuesServiceFactory
org.eclipse.sapphire.modeling.PossibleValuesService org.eclipse.sapphire.modeling.internal.EnumPossibleValuesService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.CountConstraintValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.RequiredPropertyValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.UniqueValueValidationServiceFactory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.ReferenceValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.AbsolutePathValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.RelativePathValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.MalformedValueValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.PossibleValuesValidationService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.modeling.validation.internal.NumericRangeValidationService$Factory
org.eclipse.sapphire.modeling.EnablementService org.eclipse.sapphire.modeling.internal.ParentBasedEnablementService$Factory
org.eclipse.sapphire.modeling.EnablementService org.eclipse.sapphire.modeling.internal.FunctionBasedEnablementService$Factory
org.eclipse.sapphire.modeling.ValueNormalizationService org.eclipse.sapphire.modeling.internal.StandardValueNormalizationServiceFactory
org.eclipse.sapphire.modeling.RelativePathService org.eclipse.sapphire.modeling.internal.ModelRelativePathService$Factory
org.eclipse.sapphire.modeling.ValueLabelService org.eclipse.sapphire.modeling.internal.DefaultValueLabelService$Factory
org.eclipse.sapphire.modeling.ValueLabelService org.eclipse.sapphire.modeling.internal.EnumValueLabelService$Factory
org.eclipse.sapphire.modeling.ValueImageService org.eclipse.sapphire.modeling.internal.DefaultValueImageService$Factory
org.eclipse.sapphire.modeling.ValueImageService org.eclipse.sapphire.modeling.internal.EnumValueImageService$Factory
org.eclipse.sapphire.services.FileExtensionsService org.eclipse.sapphire.services.internal.DeclarativeFileExtensionsService$Factory
org.eclipse.sapphire.services.DependenciesService org.eclipse.sapphire.services.internal.DeclarativeDependenciesService$Factory
org.eclipse.sapphire.services.DependenciesService org.eclipse.sapphire.services.internal.UniqueValueDependenciesService$Factory
org.eclipse.sapphire.services.DependenciesAggregationService org.eclipse.sapphire.services.internal.DependenciesAggregationServiceFactory
org.eclipse.sapphire.modeling.ReferenceService org.eclipse.sapphire.ui.def.internal.JavaTypeReferenceServiceForSdef$Factory
org.eclipse.sapphire.modeling.RelativePathService org.eclipse.sapphire.workspace.internal.ProjectRelativePathService$Factory
org.eclipse.sapphire.modeling.RelativePathService org.eclipse.sapphire.workspace.internal.WorkspaceRelativePathService$Factory
org.eclipse.sapphire.modeling.ModelPropertyValidationService org.eclipse.sapphire.workspace.internal.ProjectRelativePathValidationService$Factory

Value Serialization Services

Type Class Implementation Class
org.eclipse.sapphire.java.JavaTypeName org.eclipse.sapphire.java.internal.JavaTypeNameSerializationService
org.eclipse.sapphire.java.JavaPackageName org.eclipse.sapphire.java.internal.JavaPackageNameSerializationService
java.lang.Enum org.eclipse.sapphire.modeling.serialization.internal.EnumSerializationService
java.lang.Boolean org.eclipse.sapphire.modeling.serialization.internal.BooleanSerializationService
java.lang.Byte org.eclipse.sapphire.modeling.serialization.internal.ByteSerializationService
java.lang.Short org.eclipse.sapphire.modeling.serialization.internal.ShortSerializationService
java.lang.Integer org.eclipse.sapphire.modeling.serialization.internal.IntegerSerializationService
java.lang.Long org.eclipse.sapphire.modeling.serialization.internal.LongSerializationService
java.lang.Float org.eclipse.sapphire.modeling.serialization.internal.FloatSerializationService
java.lang.Double org.eclipse.sapphire.modeling.serialization.internal.DoubleSerializationService
java.math.BigInteger org.eclipse.sapphire.modeling.serialization.internal.BigIntegerSerializationService
java.math.BigDecimal org.eclipse.sapphire.modeling.serialization.internal.BigDecimalSerializationService
java.util.Date org.eclipse.sapphire.modeling.serialization.DateSerializationService
java.net.URL org.eclipse.sapphire.modeling.serialization.internal.UrlSerializationService
org.eclipse.sapphire.modeling.Path org.eclipse.sapphire.modeling.serialization.internal.PathSerializationService
org.eclipse.sapphire.modeling.el.Function org.eclipse.sapphire.modeling.el.internal.FunctionSerializationService
org.eclipse.sapphire.ui.Color org.eclipse.sapphire.ui.internal.ColorSerializationService

Functions

Name Description Implementation Class
Concat Concatenates two or more strings into a single string. Particularly useful in contexts where composite expressions cannot be used, such as where the result of concatenation needs to feed into another function or operator. org.eclipse.sapphire.modeling.el.ConcatFunction
FirstSegment Breaks a string into segments using the provided separators and returns the first segment. If no separators are found in the string, the entire string is returned. This function takes two string operands. The first is the string to tokenize. The second is a sequence of characters that individually should be treated as valid separators. org.eclipse.sapphire.modeling.el.FirstSegmentFunction
InstanceOf Determines if an object is of specified type. The object to be checked is the first operand and the type is the second operand. The type must be a fully-qualified Java class name. org.eclipse.sapphire.modeling.el.InstanceOfFunction
LastSegment Breaks a string into segments using the provided separators and returns the last segment. If no separators are found in the string, the entire string is returned. This function takes two string operands. The first is the string to tokenize. The second is a sequence of characters that individually should be treated as valid separators. org.eclipse.sapphire.modeling.el.LastSegmentFunction
List Constructs a list from arbitrary number of operands. org.eclipse.sapphire.modeling.el.ListFunction
Parent Returns the parent of the current model element. org.eclipse.sapphire.modeling.el.ParentElementFunction
Root Returns the root of the model. org.eclipse.sapphire.modeling.el.RootElementFunction

Type Casts

Source Type Target Type Description Implementation
java.lang.String org.eclipse.sapphire.modeling.ImageData Able to convert a string to an image if the requesting function origin is a model element and if that element is contained in ISapphireUiDef or if the element is adaptable to ResourceLocator. org.eclipse.sapphire.ui.def.internal.StringToImageDataCast

Action

Action ID Description Key Binding Contexts
Sapphire.Add Adds an entity. A common use is to add a new element to the model. SHIFT+CONTROL+ALT+n Sapphire.ListPropertyEditor
Sapphire.EditorPage.Outline.Node
Sapphire.Diagram.Editor
Sapphire.Assist Shows property editor assistance popup. The popup can also be accessed by clicking on the small decorator image (either a light builb, an error marker or a warning marker) that appears next to the property editor. SHIFT+CONTROL+ALT+i Sapphire.ValuePropertyEditor
Sapphire.ElementPropertyEditor
Sapphire.ListPropertyEditor
Sapphire.WithDirective
Sapphire.Browse Browses among possible values for a property. SHIFT+CONTROL+ALT+l Sapphire.ValuePropertyEditor
Sapphire.Create Creates the entity referenced by the property value. SHIFT+CONTROL+ALT+c Sapphire.ValuePropertyEditor
Sapphire.Delete Deletes an entity. A common use is to delete an element from the model. DEL Sapphire.ListPropertyEditor
Sapphire.EditorPage.Outline
Sapphire.EditorPage.Outline.Node
Sapphire.Diagram.Node
Sapphire.Diagram.Connection
Sapphire.Diagram.Grid.Toggle Show or hide the grid   Sapphire.Diagram.Editor
Sapphire.Diagram.Guides.Toggle Show or hide the guides   Sapphire.Diagram.Editor
Sapphire.Diagram.Layout Apply auto layout to diagram   Sapphire.Diagram.Editor
Sapphire.Diagram.Node.Default     Sapphire.Diagram.Node
Sapphire.Drop     Sapphire.Diagram
Sapphire.Help Shows help content for the entity.   Sapphire.EditorPage
Sapphire.Section
Sapphire.Jump Shows the entity referenced by the property value. A common use is to open a file or another resource type referenced by a path held by the property. SHIFT+CONTROL+ALT+j Sapphire.ValuePropertyEditor
Sapphire.ListPropertyEditor
Sapphire.Move.Down Moves an entity down, from the perspective of how the entity appears on the screen. A common use is to move a model element one position towards the end of the list, swapping places with the following element. SHIFT+CONTROL+ALT+ARROW_DOWN Sapphire.ListPropertyEditor
Sapphire.EditorPage.Outline.Node
Sapphire.Move.Left Moves an entity to the left, from the perspective of how the entity appears on the screen.   Sapphire.ListPropertyEditor
Sapphire.Move.Right Moves an entity to the right, from the perspective of how the entity appears on the screen.   Sapphire.ListPropertyEditor
Sapphire.Move.Up Moves an entity up, from the perspective of how the entity appears on the screen. A common use is to move a model element one position towards the beginning of the list, swapping places with the preceding element. SHIFT+CONTROL+ALT+ARROW_UP Sapphire.ListPropertyEditor
Sapphire.EditorPage.Outline.Node
Sapphire.Outline.CollapseAll Collapses all nodes in the content outline.   Sapphire.EditorPage.Outline.Header
Sapphire.Outline.ExpandAll Expands all nodes in the content outline.   Sapphire.EditorPage.Outline.Header
Sapphire.Outline.Hide Hides the content outline that is embedded in an editor page. This is a toggle action. It can be used to show the embedded outline after it has been hidden.   Sapphire.EditorPage
Sapphire.Restore.Defaults Restores properties in a section to their default values. For value properties, it means setting the property to null. For list properties, it means clearing the list.   Sapphire.Section
Sapphire.ShowInSource Shows the model element associated with a given part in the corresponding source editor.   Sapphire.EditorPage.Outline.Node
Sapphire.Diagram.Node
Sapphire.Diagram.Connection

Action Handlers

Action Action Handler ID Description
Sapphire.Browse Sapphire.Browse.File.Absolute Opens the native file browse dialog. Activates if the property is a value property, has @AbsolutePath annotation and has @ValidFileSystemResourceType annotation that specifies file type.
Sapphire.Browse Sapphire.Browse.Folder.Absolute Opens the native folder browse dialog. Activates if the property is a value property, has @AbsolutePath annotation and has @ValidFileSystemResourceType annotation that specifies folder type.
Sapphire.Browse Sapphire.Browse.Java.Type Opens a browse dialog listing applicable Java types. Activates if the property is a reference value property from JavaTypeName to JavaType.
Sapphire.Browse Sapphire.Browse.Path.Relative Opens a browse dialog for a relative path to a file or a folder. Activates if the property is a value property and has a RelativePathService.
Sapphire.Browse Sapphire.Browse.Possible Opens a browse dialog listing possible values for the property. Activates if the property is a value property and has either @PossibleValuesProvider, @PossibleValues or @PossibleValuesFromModel annotation.
Sapphire.Create Sapphire.Create.Java.Annotation Creates the specified Java type and opens the created type using Eclipse Java Editor. Activates if the property is a reference value property from JavaTypeName to JavaType, has a @JavaTypeConstraint and specifies ANNOTATION among type kinds.
Sapphire.Create Sapphire.Create.Java.Class Creates the specified Java type and opens the created type using Eclipse Java Editor. Activates if the property is a reference value property from JavaTypeName to JavaType, has a @JavaTypeConstraint and specifies CLASS or ABSTRACT_CLASS among type kinds.
Sapphire.Create Sapphire.Create.Java.Enum Creates the specified Java type and opens the created type using Eclipse Java Editor. Activates if the property is a reference value property from JavaTypeName to JavaType, has a @JavaTypeConstraint and specifies ENUM among type kinds.
Sapphire.Create Sapphire.Create.Java.Interface Creates the specified Java type and opens the created type using Eclipse Java Editor. Activates if the property is a reference value property from JavaTypeName to JavaType, has a @JavaTypeConstraint and specifies INTERFACE among type kinds.
Sapphire.Delete Sapphire.Diagram.Delete Deletes the model element associated with a given diagram node or connection.
Sapphire.Delete Sapphire.Outline.Delete Deletes the model element associated with a given content outline node. Activates if the UI part is a content outline or a content outline node. All affected nodes must have the same parent and that parent must be a list property.
Sapphire.Diagram.Grid.Toggle   Show/Hide diagram grid
Sapphire.Diagram.Guides.Toggle   Show/Hide guides
Sapphire.Diagram.Layout    
Sapphire.Diagram.Layout    
Sapphire.Help Sapphire.Help Shows the documentation associated with a given UI part using Eclipse context help view.
Sapphire.Jump Sapphire.Jump.Java.Type Opens the specified Java type using Eclipse Java Editor. Activates if the property is a reference value property from JavaTypeName to JavaType.
Sapphire.Jump Sapphire.Jump.Path.Relative Opens the file specified by a relative path using the associated Eclipse editor. Activates if the property is a value property and has a RelativePathService.
Sapphire.Jump Sapphire.Jump.URL Opens the specified URL using an external web browser. Activates if the property is of type URL.
Sapphire.Move.Down Sapphire.Outline.Move.Down Moves the model element one position towards the end of the containing list, swapping places with the following element. Activates if the UI part is a content outline node. The affected node must have a list property parent.
Sapphire.Move.Up Sapphire.Outline.Move.Up Moves the model element one position towards the beginning of the containing list, swapping places with the preceding element. Activates if the UI part is a content outline node. The affected node must have a list property parent.
Sapphire.Outline.CollapseAll Sapphire.Outline.CollapseAll Collapses all nodes in the content outline.
Sapphire.Outline.ExpandAll Sapphire.Outline.ExpandAll Expands all nodes in the content outline.
Sapphire.Restore.Defaults Sapphire.Restore.Defaults Opens a dialog showing all properties in the section with non-default values. The user can select which of those properties to restore to their default state.
Sapphire.ShowInSource Sapphire.Diagram.ShowInSource Shows the model element associated with a given diagram node in the corresponding source editor.
Sapphire.ShowInSource Sapphire.Outline.ShowInSource Shows the model element associated with a given content outline node in the corresponding source editor.

Action Handler Factories

Action Description
Sapphire.Add Creates an add action handler for every possible member element type for all lists whose members are shown as child nodes beneath the content outline node in question.
Sapphire.Add Creates an add action handler for every node type.