Contextual Menu Actions in the Design Mode
The contextual menu of the Design mode offers the following edit
actions:
- Show
Definition (Ctrl Shift ENTER (Command Shift
ENTER on OS X))
- Shows the definition for the current selected component. For references, this action is
available by clicking the arrow displayed in its bottom right corner.
- Open
Schema (Ctrl Shift ENTER (Command Shift
ENTER on OS X))
- Opens the selected schema. This action is available for xsd:import,
xsd:include and xsd:redefine elements. If the file you
try to open does not exist, a warning message is displayed and you have the possibility to
create the file.
- Edit Attributes... ()
- Allows you to edit the attributes of the selected component in a dialog that presents
the same attributes as in the Attributes View and the Facets
View. The actions that can be performed on attributes in this dialog are the same
actions presented in the two views.
- Append child
- Offers a list of valid components to append depending on the context. For example to a
complex type you can append a compositor, a group, attributes or identity constraints
(unique, key, keyref). You can set a
name for a named component after it was added in the diagram.
- Insert before
- Inserts before the selected component in the schema. The list of components that can be
inserted depends on the context. For example, before an xsd:import you
can insert an xsd:import, xsd:include or
xsd:redefine. You can set a name for a named component after it was
added in the diagram.
- Insert after
- Inserts a component after the selected component on the schema. The list of components
that can be inserted depends on the context. You can set a name for a named component
after it was added in the diagram.
- New global
- Inserts a global component in the schema diagram. This action does not depend on the
current context. If you choose to insert an import you have to specify the URL of the
imported file, the target namespace and the import ID. The same information, excluding the
target namespace, is requested for an xsd:include or
xsd:redefine element. See the Edit Import dialog
for more details.
Note: If the imported file has declared a target namespace, the field
Namespace is completed automatically.
- Edit Schema Namespaces...
- When performed on the schema root, it allows you to edit the schema target namespace and
namespace mappings. You can also invoke the action by double-clicking the target namespace
property from Attributes view for the schema or by double-clicking
the schema component.
- Edit Annotations...
- Allows you to edit the annotation for the selected schema component in the
Edit Annotations dialog. You can perform the following operations
in the dialog:
- Edit all appinfo/documentation items for a specific
annotation - all appinfo/documentation items for a specific
annotation are presented in a table and can be easily edited. Information about an
annotation item includes: type (documentation/appinfo), content, source (optional,
specify the source of the documentation/appinfo element) and
xml:lang. The content of a documentation/appinfo
item can be edited in the Content area below the table.
-
Insert/Insert before/Remove documentation/appinfo. The Add button allows you
to insert a new annotation item (documentation/appinfo). You can add
a new item before the item selected in table by pressing the Insert
Before button. Also, you can delete the selected item using the
Remove button.
- Move items up/down - to do this use the Move up and
Move
down buttons.
- Insert/Insert before/Remove annotation - available for components that allow
multiple annotations like schemas or redefines.
- Specify an ID for the component annotation. the ID is optional.
Annotations are rendered by default under the graphical representation of the
component. When you have a reference to a component with annotations, these annotations
are presented in the diagram also below the reference component. The
Edit
Annotations action invoked from the contextual menu edit the annotations
for the reference. If the reference component does not have annotations, you can edit
the annotations of the referenced component by double-clicking the annotations area.
Otherwise you can edit the referenced component annotations only if you go to the
definition of the component.
Note: For imported/included components which do not belong
to the currently edited schema, the Edit Annotations dialog
presents the annotation as read-only. To edit its annotation, open the schema where
the component is defined.
- Extract Global Element
-
Action available for local elements. A local element is made global and is replaced
with a reference to the global element. The local element properties that are also valid
for the global element declaration are kept.
Figure: Extracting a Global Element
If you execute
Extract Global Element on element
name, the result is:
- Extract Global Attribute
- Action available for local attributes. A local attribute is made global and replaced
with a reference to the global attribute. The properties of local attribute that are also
valid in the global attribute declaration are kept.
Figure: Extracting a Global Attribute
If you execute
Extract Global Attribute on attribute
note the result is:
- Extract Global Group
- Action available for compositors (sequence, choice, all). This action extracts a global
group and makes a reference to it. The action is enabled only if the parent of the
compositor is not a group.
Figure: Extracting a Global Group
If you execute Extract Global Group on the sequence element,
the Extract Global Component dialog is shown and you can choose
a name for the group. If you type personGroup, the result is:
- Extract Global Type
- Action used to extract an anonymous simple type or an anonymous complex type as global.
For anonymous complex types, the action is available on the parent element.
Figure: Extracting a Global Simple Type
If you use the action on the
union component and choose
numericST for the new global simple type name, the result is:
Figure: Extracting a Global Complex Type
If you execute the action on element
person and choose
person_type for the new complex type name, the result is:
- Rename Component in...
- Rename the selected component.
- Cut
- Cut the selected component(s).
- Copy
- Copy the selected component(s).
- Copy
XPath
-
This action copies an XPath expression that identifies the selected element or
attribute in an instance XML document of the edited schema and places it in the
clipboard.
- Paste
- Paste the component(s) from the clipboard as children of the selected component.
- Paste as Reference
- Create references to the copied component(s). If not possible a warning message is
displayed.
- Remove (Delete)
- Remove the selected component(s).
- Override component
- Copies the overridden component in the current XML Schema. This option is available for
xs:override components.
- Redefine component
- The referenced component is added in the current XML Schema. This option is available
for xs:redefine components.
- Optional
- Can be performed on element/attribute/group references, local attributes, elements,
compositors, and element wildcards. The minOccurs property is set to 0
and the use property for attributes is set to
optional.
- Unbounded
- Can be performed on element/attribute/group references, local attributes, elements,
compositors, and element wildcards. The maxOccurs property is set to
unbounded and the use property for attributes is set
to required.
- Search
- Can be performed on local elements or attributes. This action makes a reference to a
global element or attribute.
-
Search
References
- Searches all references of the item found at current cursor position in the defined
scope if any.
- Search References in...
- Searches all references of the item found at current cursor position in the specified
scope.
- Search Occurrences in File
- Searches all occurrences of the item found at current cursor position in the current
file.
-
Component
Dependencies
- Allows you to see the dependencies for the current selected component.
- Resource Hierarchy
- Allows you to see the hierarchy for the current selected resource.
- Flatten Schema
- Recursively adds the components of included Schema files to the main one. It also
flattens every imported XML Schema from the hierarchy.
- Resource Dependencies
- Allows you to see the dependencies for the current selected resource.
Expand
all
- Expands recursively all sub-components of the selected component.
- Collapse
all
- Collapses recursively all sub-components of the selected component.
- Save as Image...
- Save the diagram as image, in JPEG, BMP, SVG or PNG format.
Generate Sample
XML Files
- Generate XML files using the current opened schema. The selected component is the XML
document root. See more in the Generate
Sample XML Files section.
- Options...
- Show the Schema preferences
panel.