Difference between revisions of "InstanceGridWidget"

From Protege Wiki
Jump to: navigation, search
(Updated info about the fied_value_type parameter)
(The field_type parameter: Changed instance_property to instance_property_value)
 
(7 intermediate revisions by the same user not shown)
Line 41: Line 41:
 
This is the default <code>field_type</code> for "Instance" the <code>field_value_type</code>.  
 
This is the default <code>field_type</code> for "Instance" the <code>field_value_type</code>.  
 
|-  
 
|-  
|<code>instance_property</code>
+
|<code>instance_property_value</code>
 
|shows the a given property value of the instance that is set to be as the value of the property.
 
|shows the a given property value of the instance that is set to be as the value of the property.
 +
|-
 +
|<code>instance_property_icon</code>
 +
|shows a "text" icon to represent the presence or absence of an instance as the value of the property. <BR>
 +
Clicking on this icon we can generate and add such an instance, and we can view and edit a specific property of that instance.
 
|}
 
|}
 
  
 
== The <code>field_value_type</code> parameter ==
 
== The <code>field_value_type</code> parameter ==
Line 55: Line 58:
 
!meaning
 
!meaning
 
|-
 
|-
|String
+
|<code>String</code>
 
|
 
|
 
|-
 
|-
|Symbol
+
|<code>Symbol</code>
 
|
 
|
 
|-
 
|-
|Literal
+
|<code>Literal</code>
 
|
 
|
 
|-
 
|-
|Integer
+
|<code>Integer</code>
 
|
 
|
 
|-
 
|-
|Float
+
|<code>Float</code>
 
|
 
|
 
|-
 
|-
|Date
+
|<code>Date</code>
 
|
 
|
 
|-
 
|-
|Boolean
+
|<code>Boolean</code>
 
|
 
|
 
|-
 
|-
|Instance
+
|<code>Instance</code>
 
|
 
|
 
|-
 
|-
|Cls
+
|<code>Cls</code>
 
|
 
|
 
|-
 
|-
|Class
+
|<code>Class</code>
 
|
 
|
 
|-
 
|-
|Property
+
|<code>Property</code>
 
|
 
|
 
|-
 
|-
|Any
+
|<code>Any</code>
 
|
 
|
 
|}
 
|}
Line 94: Line 97:
 
For the more up-to-date list of possible values please see: [http://smi-protege.stanford.edu/svn/icat/trunk/src/edu/stanford/bmir/protege/web/client/rpc/data/ValueType.java?view=markup]<BR>
 
For the more up-to-date list of possible values please see: [http://smi-protege.stanford.edu/svn/icat/trunk/src/edu/stanford/bmir/protege/web/client/rpc/data/ValueType.java?view=markup]<BR>
 
<BR>
 
<BR>
Specifying this parameter is optional, as this information can be deduced from the ontology. However the type information sometimes is not calculated (and is not sent back and forth btw. the server and the client) in the code. In those cases the default value is assumed, namely <code>String</code>.<BR>
+
Specifying this parameter is optional, as this information can be deduced from the ontology. However, the type information is not always calculated in the code (and is not sent back and forth between the server and the client). In those cases the default value is assumed, namely <code>String</code>.<BR>
The most interesting interesting use case for specifying this parameter is to override the default value, and specifying it would help choose the right defaults for the <code>field_type</code> and <code>field_editor</code> parameters.
+
The most interesting use case for specifying this parameter is to override the default value, and specifying an explicit value for it would help WebProtege to choose the right defaults for the <code>field_type</code> and <code>field_editor</code> parameters.
 +
 
  
  
 +
== The <code>field_editor</code> parameter ==
 +
The <code>field_editor</code> parameter specifies the editor that is used to edit the field value in the grid.<BR>
 
{| class="wikitable"
 
{| class="wikitable"
 
|+ <code>field_editor</code>
 
|+ <code>field_editor</code>
Line 104: Line 110:
 
!meaning
 
!meaning
 
|-
 
|-
|ligh_green
+
|<code>inline</code>
|light green
+
|editing happens right within the grid cell, as the label used to display the value of the field turns into an editable textfield.
 +
|-
 +
|<code>flexible</code>
 +
|editing happens right in the grid cell, as the label used to display the value in the cell turns either into an editable textarea (if there is enough vertical space for it) or into a textfield.<BR>
 +
This is the default for all <code>String</code> valued <code>field_value_type</code>s.
 +
|-
 +
|<code>multiline</code>
 +
|the cell value will be edited in a separate pop-up window, presenting a multi-line text area editor.
 +
|-
 +
|<code>html</code>
 +
|the cell value will be edited in a separate pop-up window, presenting a multi-line HTML editor.
 +
|-
 +
|<code>class_selector</code>
 +
|the cell value will be edited in a separate pop-up window, where the user is presented with the class hierarchy of (a branch from) the ontology, from which he or she can choose one class.<BR>
 +
This is the default for all <code>Class</code> valued <code>field_value_type</code>s.
 +
|-
 +
|<code>instance_selector</code>
 +
|the cell value will be edited in a separate pop-up window, where the user is presented with an instance list (which may be filtered by navigating a class hierarchy), from which he or she can choose on instance.<BR>
 +
This is the default for all <code>Instance</code> valued <code>field_value_type</code>s.
 
|}
 
|}
  
 
+
== The <code>field_align</code> parameter ==
 +
The <code>field_editor</code> parameter specifies the editor that is used to edit the field value in the grid.<BR>
 
{| class="wikitable"
 
{| class="wikitable"
 
|+ <code>field_align</code>
 
|+ <code>field_align</code>
Line 115: Line 140:
 
!meaning
 
!meaning
 
|-
 
|-
|ligh_green
+
|<code>left</code>
|light green
+
|field content is left aligned. Default, if no value is specified.
 +
|-
 +
|<code>center</code>
 +
|field content is center aligned
 +
|-
 +
|<code>right</code>
 +
|field content is right aligned
 
|}
 
|}
  
  
 +
 +
== The <code>field_bg_color</code> parameter ==
 +
The <code>field_bg_color</code> parameter specifies the background color of a certain field in the grid.<BR>
 +
It can take any valid CSS color code or constant [http://www.w3schools.com/colors/colors_hex.asp]
 
{| class="wikitable"
 
{| class="wikitable"
|+ <code>field_bg_color</code>
+
|+ Example <code>field_bg_color</code> values
 
|-
 
|-
 
!value
 
!value
 
!meaning
 
!meaning
 
|-
 
|-
|ligh_green
+
|<code>yellow</code>
|light green
+
|yellow (#FFFF00) &nbsp;<span style="background-color:#FFFF00; border:1px solid;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
 +
|-
 +
|<code>beige</code>
 +
|beige (#F5F5DC) &nbsp;<span style="background-color:beige; border:1px solid;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
 +
|-
 +
|<code>lightgreen</code>
 +
|light green (#90EE90) &nbsp;<span style="background-color:lightgreen; border:1px solid;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
 +
|-
 +
|<code>#4CAF50</code>
 +
|#4CAF50 &nbsp;<span style="background-color:#4CAF50; border:1px solid;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
 
|}
 
|}
  
  
  
 
+
== More information ==
  
 
To get a more up-to-date list of all the supported parameters and values you may want to check out the latest version of the [http://smi-protege.stanford.edu/svn/icat/trunk/src/edu/stanford/bmir/protege/web/client/ui/portlet/propertyForm/FormConstants.java?view=markup edu.stanford.bmir.protege.web.client.ui.portlet.propertyForm.FormConstants] class.
 
To get a more up-to-date list of all the supported parameters and values you may want to check out the latest version of the [http://smi-protege.stanford.edu/svn/icat/trunk/src/edu/stanford/bmir/protege/web/client/ui/portlet/propertyForm/FormConstants.java?view=markup edu.stanford.bmir.protege.web.client.ui.portlet.propertyForm.FormConstants] class.

Latest revision as of 15:41, March 1, 2017

InstanceGridWidget Layout Configuration

This page provides a basic overview of the different configuration options that can be set in form of parameter-value pairs for the InstanceGridWidget (edu.stanford.bmir.protege.web.client.ui.portlet.propertyForm.InstanceGridWidget) in WebProtege.

The field_type parameter

The field_type parameter sets the "type" of a field (i.e. data cell) in the grid.
To clearly separate the content of the field from its presentation, and the way these values are edited, we have created separate parameters (field_value_type and field_editor) to control those other aspects of the field.

field_type
value meaning
linkicon shows a link icon, which provides a hyperlink to the URL represented by this property value
nolink displays a URL without creating a hyperlink to it (which would be the default behavior in the absence of this parameter specification)
checkbox shows a standard checkbox, where the checked checkbox represents the value "true" and the unchcheck checkbox represents the value false (or in case of non-boolean fields, any other value than "true").

Unknown values are represented with a checkbox containing a red question mark.

checkbox_important uses a three-way checkbox to represent "Not allowed"-"Allowed"-"Required" states, as 0-1-2 values.

This field type was introduced to support use cases provided by WHO, and is used in the ICD-11 editor, iCAT.

radio a radio button can represent "true" and "false" states for a number of items, with the restriction that at any given time when an item is selected as "true" the other items will be set to "false".
combobox a dropdown list of elements that can be selected as the value of the property
class_browsertext shows the "browser text" of the class that is set to be as the value of the property

This is the default field_type for "Class" and "Cls" field_value_types.

instance_browsertext shows the "browser text" of the instance that is set to be as the value of the property

This is the default field_type for "Instance" the field_value_type.

instance_property_value shows the a given property value of the instance that is set to be as the value of the property.
instance_property_icon shows a "text" icon to represent the presence or absence of an instance as the value of the property.

Clicking on this icon we can generate and add such an instance, and we can view and edit a specific property of that instance.

The field_value_type parameter

The field_value_type parameter specifies the type of a field value in the grid.

field_value_type
value meaning
String
Symbol
Literal
Integer
Float
Date
Boolean
Instance
Cls
Class
Property
Any

For the more up-to-date list of possible values please see: [1]

Specifying this parameter is optional, as this information can be deduced from the ontology. However, the type information is not always calculated in the code (and is not sent back and forth between the server and the client). In those cases the default value is assumed, namely String.
The most interesting use case for specifying this parameter is to override the default value, and specifying an explicit value for it would help WebProtege to choose the right defaults for the field_type and field_editor parameters.


The field_editor parameter

The field_editor parameter specifies the editor that is used to edit the field value in the grid.

field_editor
value meaning
inline editing happens right within the grid cell, as the label used to display the value of the field turns into an editable textfield.
flexible editing happens right in the grid cell, as the label used to display the value in the cell turns either into an editable textarea (if there is enough vertical space for it) or into a textfield.

This is the default for all String valued field_value_types.

multiline the cell value will be edited in a separate pop-up window, presenting a multi-line text area editor.
html the cell value will be edited in a separate pop-up window, presenting a multi-line HTML editor.
class_selector the cell value will be edited in a separate pop-up window, where the user is presented with the class hierarchy of (a branch from) the ontology, from which he or she can choose one class.

This is the default for all Class valued field_value_types.

instance_selector the cell value will be edited in a separate pop-up window, where the user is presented with an instance list (which may be filtered by navigating a class hierarchy), from which he or she can choose on instance.

This is the default for all Instance valued field_value_types.

The field_align parameter

The field_editor parameter specifies the editor that is used to edit the field value in the grid.

field_align
value meaning
left field content is left aligned. Default, if no value is specified.
center field content is center aligned
right field content is right aligned


The field_bg_color parameter

The field_bg_color parameter specifies the background color of a certain field in the grid.
It can take any valid CSS color code or constant [2]

Example field_bg_color values
value meaning
yellow yellow (#FFFF00)      
beige beige (#F5F5DC)      
lightgreen light green (#90EE90)      
#4CAF50 #4CAF50      


More information

To get a more up-to-date list of all the supported parameters and values you may want to check out the latest version of the edu.stanford.bmir.protege.web.client.ui.portlet.propertyForm.FormConstants class.