[[Property:title|10 Retargeting Through Pick-and-Drop]] [[Property:link_title|Retargeting Through Pick-and-Drop]] [[Property:weight|-5]] [[Property:uuid|a3789781-153b-7f4d-bb94-4bdf8923fb56]] You now know quite a few ways of re-targeting a Development Window to a "development object" -- a class or a feature -- but haven't yet seen one of the most important: "Pick-and-Drop", which lets you pick a development object that you have spotted anywhere in the display, and retarget the current tool, or another, to it.
forth of class LIST . The next figure shows the whole window; it should be exactly what you see as a result of the last operations. We'll use the Ancestor versions view of the Feature Tab.
If for some reason the window doesn't look like the next figure, it's easy to reconstruct it: make sure both the Cluster tree and the Feature tree are visible (if not, click the corresponding buttons as detailed [[7 CLASS VIEWS|here]] ); target the tool to class LIST ; target further to its feature forth by clicking that feature name in the Feature tree; make sure both the top-right Editing Tool and the bottom-right Context Tool are visible; in the Context Tool, select the Feature Tab and its Descendant versions format.
[[Image:index-60]]
In the Context Tool near the bottom right, there is an entry that reads
ARRAYED_CIRCULAR forth
referring to the version of feature forth in class ARRAYED_CIRCULAR . Let's assume you want to see what that version actually is. It suffices to retarget the tool to it. Of course you could type or copy-paste the class name ARRAYED_CIRCULAR in the Class field at the top of the window, and the feature name forth in the adjacent Feature field. But this is too much work; after all, you have just seen a reference to the feature, through its name as it appears in the Descendant version format, so it's natural to use it directly from the graphical interface.
As we've seen before, you could control-right-click on the feature name at the place where it appears; this would create a new Development Window targeted to forth from ARRAYED_CIRCULAR . But you don't necessarily want a new window. Instead you can use Pick-and-Drop to retarget the current window.
Here is how it works. Position the cursor on the desired feature reference: the word forth in the line forth ARRAYED_CIRCULAR . Right-click, that is to say click the rightmost mouse button, and '''release the button immediately'''. That's right: you use a simple click, and do '''not''' maintain the button down.
Now move the mouse a trifle, without pressing any button :
forth . Now you can drop it at any appropriate place to retarget the corresponding tool. In fact you can drop it right where it is, in the Context Tool of the current Development tool. To drop, just '''right-click''' again. (That is to say, as before, press the rightmost mouse button and release it immediately.) This achieves a "drop", and retargets the Development Window to the chosen feature, forth from ARRAYED_CIRCULAR . The retargeting affects both the Editing Tool and the Context Tool (assuming the Link Content View option is selected on the toolbar, see below "Isolating the context" for more information), which keeps its current view ( Descendant versions in the Feature Tab). We'll see shortly how to give them separate targets if that's preferred.
[[Image:index-62]]
==How Pick-and-Drop works==
The Pick-and-Drop mechanism is very simple. It consists of three steps:
* '''Pick''' step: find the development object you want to pick, right-click it, release the mouse button.
* '''Move''' step: move the mouse to the desired drop point, without pressing any button.
* '''Drop''' step: right-click (again releasing the button immediately) at the drop position.
During the Move step, you can at any time '''cancel the whole operation''' simply through a '''left-click'''.
The Move step is actually optional: if the current position is a valid drop target, as explained next, you can drop immediately after the pick without moving the mouse.
POLYGON , you may assign not only an expression of that same type, but also one of type RECTANGLE , if class RECTANGLE inherits from -- conforms to -- class POLYGON . Similarly, EiffelStudio considers that the development type "feature" conforms to "class"; this means you may drop a feature into a Development Window targeted to a class; this will retarget the tool to the feature's class and the feature itself, with the text of the class scrolled to the position of the feature.
In the Pick-and-Drop example -- for forth of ARRAYED_CIRCULAR -- you did not have to go to a new target: the current window was a valid drop target, so you just dropped right away. In such a case you don't even have to move the mouse; Pick-and-Drop is just a matter of two right-clicks.
This is similar to a '''double-click''', a commonly used interaction technique, but without the stress of the usual double-click, which requires you to wait no more than a specified time -- typically half a second or so -- between the two clicks. With Pick-and-Drop the effect is the same whether the second click follows the first after one tenth of a second or two days.
File --> New window (unless you already have a second Development Window open, in which case you can simply reuse it). Make sure the two Development Window do not overlap too much, so that you can see enough of each. In the first Development Window, pick a class (right-click it). Move the mouse to the Editing Tool of the second Development Tool. Drop the class by right-clicking again. The tool retargets itself to the chosen class.
Many people like to take advantage of this possibility to keep two or more Development Windows open, and pick-and-drop frequently from one to the other when they see a development object of interest and want to know more about it, without losing its original context.
View --> Link context tool
After this, the entry will change to View --> Unlink context tool , so that you can later revert to isolated behavior. Under isolation behavior, try pick-and-dropping a class or feature into the top Editing Tool; then pick-and-drop a class or feature into the bottom Context Tool. You will notice that each of these operations retargets the affected tool, but not the other.
Link/Isolate button of the top toolbar. This button is not present by default on the toolbar, so this is a good opportunity to take a quick look at the user interface customization mechanism, which you can use later to tailor the interface to the exact form you need. Select
View --> Toolbars --> Customize standard toolbar
(The adjacent entry is toolbar project Customize which provides complementary capabilities under a similar form.) You see a list of available buttons:
[[Image:index-63]]
The icons in the list on the right are currently displayed in the toolbar, but not those on the left. Among the latter you see (fourth from the bottom on the left-side list) Link or not the context tool to other components . Select it by clicking; this makes the -> Add button active. Click this button to move the Link/Isolate icon to the list of displayed icons. It becomes the first item of the list, which is fine for the moment. (Later on you can change the order of buttons in the toolbar if you like, by using the Up and Down buttons.) Click OK . The toolbar of your development tool has a new button which you can now use to switch, for the enclosing Development Window, between the isolated and linked behaviors of the Context Tool.
Class Tab, and pick-and-dropping a feature switches to the Feature Tab.
* The view displayed in each case -- for example Ancestors for the Class Tab and Flat for the Feature Tab -- is default view for the corresponding Tab.
==The many paths to retargeting==
As a conclusion to this review of Pick-and-Drop let's recapitulate the various ways we've seen for retargeting a whole Development Window or a tool to a class:
{|
|-
| '''How to retarget'''
| '''Same window/tool, or new?'''
| '''Where described'''
|-
| Type class name, then Enter, in class field at top-left of tool
| Same
| [[6 STARTING TO BROWSE|"Retargeting by name" in Chapter 6, "Starting To Browse".]]
|-
| Choose class in Cluster tree
| Same
| [[6 STARTING TO BROWSE|"Retargeting from the Cluster Tree" in Chapter 6, "Starting To Browse". ]]
|-
| Choose class in Favorites
| Same
| [[6 STARTING TO BROWSE|"Adding to Favorites" in Chapter 6, "Starting To Browse".]]
|-
| "Back" button
| Same
| [[6 STARTING TO BROWSE|"Moving back and forth" in Chapter 6, "Starting To Browse".]]
|-
| "Forth" button
| Same
| [[6 STARTING TO BROWSE|"Moving back and forth" in Chapter 6, "Starting To Browse".]]
|-
| Pick class from history list
| Same
| [[6 STARTING TO BROWSE|"The Target History" in Chapter 6, "Starting To Browse".]]
|-
| Pick-and-drop: right-click on class name or graphical representation found in any tool, then move, then right-click
| Existing window/tool (of drop target)
| [[10 RETARGETING THROUGH PICK-AND-DROP|"How Pick-and-Drop works" In Chapter 10, "Retargeting Through Pick-and-Drop.]]
|-
| Control-right-click on class name or graphical representation found in any tool
| New
| [[6 STARTING TO BROWSE|"Starting a new tool" in Chapter 6, "Starting To Browse".]]
|}