Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to customize collapsing to definitions
xomega
#1 Posted : Tuesday, October 30, 2012 6:19:57 PM(UTC)
xomega



One of the challenges of working with medium and large XML model files is ability to quickly browse the structure of the model and then drill in to view and edit details of a specific model element. Xomega Editor extends the standard XML editor to support this through custom outlining and a standard Visual Studio feature of Collapsing to Definitions, which you can invoke by selecting the corresponding menu item (e.g. Edit > Outlining > Collapse to Definitions) or by using the associated shortcut (e.g. Ctrl+M,O).

When you collapse to definitions, the Xomega Editor collapses all the major entities, such as types, enumerations, object fields, operations, etc, which allows you to easily browse them and then expand only the ones that you're interested in. If the collapsed entity in turn contains other major entities, such as a subobject containing its own fields and operations, those will also be initially collapsed, so that you could browse them and expand as needed.

Xomega installation is already configured with which entities should be collapsed to definitions by default. However, you can easily change this behavior if you want a different set of entities to be collapsed, or if you have defined new entities that you want to be included as well. Below are the steps you need to take to achieve this.
  1. Go to the schema definition of the XML element in your model, for which you want to configure the behavior when collapsing to definitions. One of the easiest ways to do it is to set the cursor on the element in your model and select the Go To Definition context menu or press F12. This should take you to the definition of the element in the corresponding XSD file.
  2. Make sure that the element has an xs:annotation nested element, where the xs prefix is mapped to the "http://www.w3.org/2001/XMLSchema" namespace.
  3. Add an xs:appinfo element inside the xs:annotation element.
  4. Add an xom:outline-definition element inside the xs:appinfo element, where the xom prefix is mapped to the "urn:xomega-net:language" namespace.
  5. Set the collapse attribute to true to make the current element being collapsed when you collapse the definitions. If you don't want it to be collapsed, then you can set this attribute to false or remove these elements altogether.
  6. Save the schema file and go back to the model file. Collapse the model elements to definitions and make sure that it behaves as expected.

The following snippet demonstrates how a type element is configured in the schema to be collapsed when collapsing to definitions.
Code:
<xs:element name="type" type="tns:typeDefinition" maxOccurs="unbounded">
  <xs:annotation>
    <xs:documentation>A named simple type that can be used for fields and parameters.</xs:documentation>
    <xs:appinfo>
      <xom:outline-definition collapse="true"/>
    </xs:appinfo>
  </xs:annotation>
</xs:element>
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Copyright © 2009-2022 Xomega.Net. All rights reserved.