Prev Next

Drop Elements from Project Browser

As well as creating new elements in the current diagram, you can drag existing elements (individually or as a group) from the Project Browser into the diagram. To select multiple elements, click on the element names in the Project Browser while pressing and holding:

  • Ctrl to add single items to the selection of multiple elements, or
  • Shift to select all the elements between the first and last selected items

When you drag an element onto a diagram from the Project Browser, the system response depends on whether you are dragging a Package element or any other type of element. For information on dragging a Package element onto a diagram, see the Drop Packages topic.

Access

Other

Drag existing element(s) from the Project Browser onto the diagram

(If the 'Drop <element> from Project Browser' dialog does not display, press Ctrl while dragging the elements)

Select Paste options

Option

Action

See also

Drop as

Click on the drop-down arrow and select one of the drop types:

  • Link - Drop the element as a simple link: in this case the one element is represented in the Project Browser and in any diagram to which it has been added; changes to the element are reflected in all diagrams in which it is shown
  • Lifeline - (On Sequence diagrams) Drop a copy of the element as a separate Lifeline element, classified by the original element
  • Instance - (On diagrams other than Sequence) Drop a copy of the element as a separate instance of the original element, classified by the original element
  • Invocation - Drop a copy of a StateMachine or Activity element as an invocation of the source element; the resulting element is a State object or Action - respectively - with the source element as its classifier
  • Property - Drop a copy of the element as a separate Object instance
  • Attribute - (Available when dragging a classifier onto an element that supports attributes) Create a new attribute classified by the dragged classifier; the attribute is automatically selected in in-place editing so that you can add the attribute name
  • Child - Drop the element as a child of the copied element - that is, as a new  element with a Generalization connector back to the copied element; this is very useful when you have a Class library or framework from which you inherit new forms - for example, you can drop a Hashtable as 'MyHashtable', which automatically becomes a child of the original Hashtable

    Used with the 'Override Parent Operations' feature, this is a quick way to create new structures based on frameworks such as the Java SDK and the .NET SDK
Classifiers and Instances Edit Element Item Name Override Parent Operations

Name

If the dropped element is a new element (that is, a Lifeline, Instance, Child, or Property), this field is active; type a name for the new element.

Structural Elements

If the original element has any structural elements (for example, Ports and Parts) this field contains the value 'Select'. Either:

  • Leave this value as is, so that when you click on the OK button the Features window displays, from which you can select the child elements to reproduce with the pasted element (on the 'Parts / Properties' tab, 'Interaction Points' tab or 'Connection Points' tab, depending on the element type)
  • Click on the drop-down arrow and select:
         -  'None' to not reproduce any child elements
         -  'All' to reproduce all child elements on the original element, or
         -  'Based on Instance <diagram names>' to reproduce the
            configuration of child elements on an instance of the original
            element on another diagram, if there are any other instances

The resulting Object element is created large enough to display the selected child elements laid out neatly within the Object border.

(If the element has no structural elements, the field contains the text 'No Embedded Elements'.)

Manage Structural Elements

Copy Connectors

This checkbox is enabled when you select to drop the copied element as an Instance, Property or Invocation.

Select the checkbox to reproduce on the diagram any connectors between the original element and any other elements that have also been dropped into this diagram, as connectors between the instances.

Select for all

(If dragging multiple elements onto the diagram at once.)

Select the checkbox to apply the dialog settings to all multiple-selected elements being dragged onto the diagram, and to add the elements together.

Leave the checkbox unselected to add the elements to the diagram one at a time, with the opportunity to change the dialog settings for each element.

Save selection as default

Select this checkbox to make the current settings on this dialog the default for all drag and drop operations from the Project Browser.

This option also deselects the 'Auto Instance' checkbox on the 'Diagram > Behavior' page of the 'Preferences' dialog. The automatic drop operation becomes whatever you have set on the 'Drop ... from Project Browser' dialog, and is not overridden by the drop-as-Instance imposed by the 'Auto Instance' checkbox.

The default setting you apply on Sequence diagrams is separate from the default for other types of diagram. Therefore, you can set the default to 'Lifeline' (if you prefer) and this does not affect or  get changed by the default you might set for other types of diagram.

Diagram Behavior

Hold Ctrl to Show this dialog

Select this checkbox to display this dialog for drag and drop operations only if you press and hold Ctrl as you drag the element onto the diagram.

If you select this option, you can drag elements from the Project Browser without displaying the dialog; the paste operation complies with whatever settings you used the last time you opened the dialog. To change these settings, hold Ctrl as you drag an element, and edit the field values on the dialog.

OK

Click on this button to complete the drop operation and close the dialog.

Cancel

Click on this button to cancel the drop operation and close the dialog.

If you have selected multiple elements, the first-selected element is not dropped, but the remainder are.

Cancel All

(If dragging multiple elements onto the diagram at once.)

Click on this button to cancel the insertion of all the multiple-selected elements being dragged onto the diagram.

Notes

  • Not all drop options apply to all element types; for many types, the only option available is 'Link'
  • When an element dragged from the Project Browser is dropped into the diagram, its default style and size is applied rather than any alternative styles and sizes used for instances of the element in other diagrams
  • When using the 'Drop as - Instance' option, if the Instance is the same element type as the Classifier, then any stereotype that has been applied to the Classifier will be propagated to the Instance also

Learn more