Difference between revisions of "PrF UG forms custom instancerow"

From Protege Wiki
Jump to: navigation, search
(Warnings and Suggestions)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
== Customizing an InstanceRowWidget or InstanceTableWidget ==
 
== Customizing an InstanceRowWidget or InstanceTableWidget ==
  
{{PrF_UG_TOC_forms}}<div id='prf_ug'>
+
<noinclude>{{PrF_UG_TOC_forms}}<div id='prf_ug'></noinclude>
  
 
InstanceRowWidget (Single Cardinality)
 
InstanceRowWidget (Single Cardinality)
Line 17: Line 17:
 
     [[PrF_UG_forms_select_widget_type|Change the widget type]] of an Instance field
 
     [[PrF_UG_forms_select_widget_type|Change the widget type]] of an Instance field
 
     to an InstanceRowWidget or InstanceTableWidget
 
     to an InstanceRowWidget or InstanceTableWidget
     using the [[PrF_UG_forms_widget_type_menu|Widget Type Menu]].
+
     using the [[PrF_UG_forms_widget_type_menu|Widget Type menu]].
 
     </p>
 
     </p>
  
Line 43: Line 43:
  
 
You can choose which slots to show in the widget
 
You can choose which slots to show in the widget
and/or change the order in which they appear using the <b>Define columns of instance table</b> tab.
+
and/or change the order in which they appear
Although the current implementation does not allow you to change the order directly by dragging,
+
using the <b>Define columns of instance table</b> tab.
 +
Although the current implementation does not allow you
 +
to change the order directly by dragging,
 
you can reorder the slots by first removing them from the widget,
 
you can reorder the slots by first removing them from the widget,
 
and then adding them back in the order in which you wish them to appear.
 
and then adding them back in the order in which you wish them to appear.
Line 276: Line 278:
  
 
<div>[[Image:PrF_UG_forms_instancetable_warnings.png|frame|none|
 
<div>[[Image:PrF_UG_forms_instancetable_warnings.png|frame|none|
          Configure Widget dialog, Warnings and Suggestions tab]]</div>
+
      Configure Widget dialog, Warnings and Suggestions tab]]</div>
  
  
</div>
+
<noinclude></div></noinclude>

Latest revision as of 16:53, November 13, 2008

Customizing an InstanceRowWidget or InstanceTableWidget


Protege-Frames User's Guide
Forms
Understanding Forms
Forms Tab
Form Browser
Form Buttons
Form Editor
Display Slot Menu
Selected Widget Type Menu
Widget Configuration Dialog
Form Configuration Dialog Box
Default Widget Types
Additional String Widgets
Instance Row and Table Widgets
Contains Widget
Direct Instances Widget
Global Characteristics
Moving or Resizing a Widget
Widget Configuration Properties
Selecting a Widget Display
Hiding a Widget
Customizing a Row or Table Widget
Customizing a Contains Widget
Using a Resource List Widget
Additional Widget Types
Glossary, Editing Help

InstanceRowWidget (Single Cardinality) and InstanceTableWidget (Multiple Cardinality) show all the slot values for any instance that is a value of the slot.

InstanceRowWidget

You can perform the standard customizations:

The Configure Widget dialog box for an InstanceRowWidget or InstanceTableWidget has the following additional customizations: Defining Columns, New Instances, In-place editing characteristics, Warnings and Suggestions.

Defining Columns

You can choose which slots to show in the widget and/or change the order in which they appear using the Define columns of instance table tab. Although the current implementation does not allow you to change the order directly by dragging, you can reorder the slots by first removing them from the widget, and then adding them back in the order in which you wish them to appear.

To add or remove slots, change their order, or change the name under which they are displayed:

  1. Double-click on the widget to open the Configure Widget dialog box.

  2. Click the Define columns of instance table tab.

    Configure Widget dialog, Define columns of instance table tab
  3. To make any modifications, you must click in the Column Name of the slot you wish to modify. (The top row, Slot Name, is a property of the slot and cannot be modified.)

  4. To remove a column, click in its Column Name and click the Remove the currently selected column (all_object.remove) button.

  5. To rename a column, edit the text in Column Name.

  6. To add a column, click the Add one or more slots to the list of columns (all_object.add) button. The column will be added after all the existing columns.

  7. To reorder columns, remove all the columns except the one you want to appear first, then add the other columns. For instance, to make date appear first in the example, you would delete the prototype, contents, and number_of_pages columns, then add any columns you wanted back in.

New Instances

If you are allowing end-users to create new instances from this field, you can control various aspects of new instance creation. If you do not want users to be able to create instances, disable the Create Instance (instances_instance.create) button using the Buttons tab.

  1. Double-click on the widget to open the Configure Widget dialog box.

  2. Click the New instances tab.

    Configure Widget dialog, New instances tab
  3. Select the basic options you want:

    • Display forms for newly-created instances: When enabled, the Instance Editor is automatically displayed whenever the end-user creates a new instance. This allows the user to define the properties of the instance immediately. If this option is disabled, you may want to enable Use in place editing at the In-place Editing Characteristics tab.

      Note: Users can still edit the instance by clicking the View Instance (instances_instance.view) button.

    • Automatically select newly created or added rows: When this option is enabled, the row corresponding to the new instance is automatically selected; again, this is useful if you allow in-place editing.

    • Always highlight selected row: This option is self-explanatory.

  4. Select the Prototype Depth to control how the values in this field are copied if the instance that contains this field is copied:

    • Shallow Copy: If the containing instance is copied, the copy has the same instance(s) as values for this field that the original does.

    • Depth 1 Copy: If the containing instance is copied, the value(s) of this field will be shallow copies of the original instances in this field. For example, if this field contains three instances and the containing instance is copied, the new instance will have three new instances at this field; they will be identical to the previous instances except for the name.

    • Deep Copy: New instances are created for each instance in the field and for any additional referenced instances. See What is a Deep Copy? for more information.

In-Place Editing Characteristics

  1. Double-click on the widget to open the Configure Widget dialog box.

  2. Click the In-place Editing Characteristics tab.

    Configure Widget dialog, In-place Editing Characteristics tab
  3. Select the options you want:

    • Use in place editing: This allows the user to edit a value directly in the instance table.

    • Use a dialog panel to select classes: If the instance values of the field have fields of type Class, enabling this means that double-clicking in the field displays a menu which allows the user to select a class.

    • Use a dialog panel to select instances: If the instance values of the field have fields of type Instance, enabling this means that double-clicking in the field displays a menu which allows the user to select a class. You may want to enable this if Display forms for newly-created instances is disabled at the New Instances tab.

Example: using the dialog panel to select instances

If Use a dialog panel to select instances is enabled, then the user can select an instance as follows:

  1. Double-click in the instance field. A menu is displayed:

    instance selection menu
  2. Select Choose... to open the Select Instance dialog box.

    Select Instance dialog
  3. Select the class and instance you want and click OK.

If the field already contains a value, the user can change it in the same manner:

  1. Double-click in the instance field. A menu is displayed:

    field selection menu
  2. Select Choose... to open the Select Instance dialog box. You can also choose View... to display the Instance Editor for this instance, or Remove to clear the field.

  3. Select the class and instance you want and click OK.

Warnings and Suggestions

You can check the configuration of the widget at the Warnings and Suggestions tab.

Configure Widget dialog, Warnings and Suggestions tab