Adding a Member to a Container

From RAD Studio
Jump to: navigation, search

Go Up to Class Diagram Procedures

In the Diagram View or Model View, you can add members into containers on class diagrams.

To add a member into a container in the Model View

  1. Select View > Model View to open the Model View.
  2. Select some container (class, interface, and so on). To add a new member into the selected container you can use one of the following:
    • Right-click some container, and on the context menu open the Add submenu. It displays all types of members (attribute, operation, class, and so on), which can be added into the selected container. Select the desired member type and a new member of the selected type will be added.
    • If the container already has members in some compartment, right-click an existing member. The context menu shows the Add SelectedMemberType command to add a new member of the selected type. For example, if you right-click an operation, then the context menu shows the Add operation command.
    • Use one of the following shortcut keys: CTRL+W (for attributes), CTRL+M (for operations, methods), CTRL+L (for classes), CTRL+N (for enumerations), CTRL+SHIFT+L (for interfaces), CTRL+SHIFT+D (for Other diagrams), and CTRL+SHIFT+M (for shortcuts) to add a new member.
  3. You can edit the created member using the in-place editor, Object Inspector, or source code editor.
Result: The new member appears in the selected container node in the correct compartment.
You can set the sorting order by the Sorting type option in the Model View group in the Options dialog box.

To add a member into a container in the Diagram View

  1. In the Model View, right-click a diagram, namespace, or package and choose Open Diagram on the context menu to open the Diagram View.
  2. In the Diagram View, select some container (class, interface, and so on). To add a new member into the selected container you can use one of the following:
    • Right-click some container, and on the context menu click the Add submenu. It displays all types of members (attribute, operation, class, and so on), which can be added into the selected container. Select the desired member type and a new member of the selected type will be added.
    • Select some container and press INSERT; the Add context submenu opens. It displays all types of members (attribute, operation, class, and so on), which can be added into the selected container. Select the desired member type and a new member of the selected type will be added.
    • Click the + icon on the right of some compartment name. The appropriate type member will be created in the compartment.
    • Use one of the following shortcut keys: CTRL+W (for attributes), CTRL+M (for operations, methods), CTRL+L (for classes), CTRL+N (for enumerations), CTRL+SHIFT+L (for interfaces), CTRL+SHIFT+D (for Other diagrams), and CTRL+SHIFT+M (for shortcuts) to add a new member.
    • If the container already has members in some compartment, right-click an existing member. The context menu shows the Add SelectedMemberType command to add a new member of the selected type. For example, if you right-click an operation, then the context menu shows the Add operation command.
  3. You can edit the created member using the in-place editor, Object Inspector, or source code editor.
Result: The new member appears in the selected container in the correct compartment.
You can set the sorting order by the Sort members options in the Appearance group in the Options dialog box.

See Also