Difference between revisions of "Selection View"

From Developer Documents
Jump to navigation Jump to search
m
Line 27: Line 27:
 
* StandardProperties is an Explorer view which expects a single Variable as an input.
 
* StandardProperties is an Explorer view which expects a single Variable as an input.
 
* The view has the columns 'Property', 'Value' and 'Unit'
 
* The view has the columns 'Property', 'Value' and 'Unit'
* Children are obtained using variable.browseProperties such that the property contains a property named 'HasStandardPropertyInfo'
+
* Tree children for variable v are all properties of v which have a property called HasStandardPropertyInfo
* Labels are obtained by selecting all properties that have a property called DISPLAY_COLUMN (for obtaining column identifiers)
+
* Column labels for child c are obtained by collecting all properties of c that have a property called DISPLAY_COLUMN
 +
** The (String) value of DISPLAY_COLUMN property if the column identifier
 
* Modifier uses 'HasInputValidator' for getting a validator
 
* Modifier uses 'HasInputValidator' for getting a validator
 
* Modifier writes with Bindings.STRING into the property.
 
* Modifier writes with Bindings.STRING into the property.
* Categories?
+
* The HasStandardPropertyInfo property defines the following attributes of the displayed property
 +
** Category
 
* Required, Default?
 
* Required, Default?

Revision as of 07:15, 27 February 2012

The Selection View is a standard Simantics view, which shows tabbed configuration views about the current workbench selection.

Basic implementation

Selection view displays content for the workbench selection, which is produced by the active workbench part. The main implementation of the Selection View is also contributed by the active workbench part.

The implementation class is org.simantics.ui.workbench.IPropertyPage.

The standard implementation is org.simantics.selectionview.StandardPropertyPage (needs refactoring).

Selection processing

StandardPropertyPage uses org.simantics.selectionview.SelectionProcessor for computing a list of tabs from the given workbench selection. The tabs are implementations of org.simantics.selectionview.ComparableTabContributor.

A modelled implementation of the SelectionProcessor interface is org.simantics.selectionview.StandardSelectionProcessor.

StandardSelectionProcessor seeks all instances of http://www.simantics.org/SelectionView-0.0/TabContribution and adapts them to org.simantics.selectionview.TabContribution.

StandardSelectionProcessor seeks all instances of http://www.simantics.org/SelectionView-0.0/SelectionTransformation (which are also L0.Function) and applies them to obtain a set of inputs, which is then fed to all TabContributions.

Tab implementation

The standard way of implementing a tab is a Simantics Modelled View. Generic modelled selection view tabs include

StandardProperties (http://www.simantics.org/SelectionView-0.0/StandardProperties)

  • StandardProperties is an Explorer view which expects a single Variable as an input.
  • The view has the columns 'Property', 'Value' and 'Unit'
  • Tree children for variable v are all properties of v which have a property called HasStandardPropertyInfo
  • Column labels for child c are obtained by collecting all properties of c that have a property called DISPLAY_COLUMN
    • The (String) value of DISPLAY_COLUMN property if the column identifier
  • Modifier uses 'HasInputValidator' for getting a validator
  • Modifier writes with Bindings.STRING into the property.
  • The HasStandardPropertyInfo property defines the following attributes of the displayed property
    • Category
  • Required, Default?