This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Element selection in the class diagram can only be extended by holding down the ctrl key and mouse clicks, but using the shift key has no effect. Instead ctrl key should activate non-contiguous selection and shift key contiguous selection.
The problem is that the SelectAction in the visual library does not support this feature. Since the SelectProvider does not get notified that about the modifier keys that are pressed we are not able to handle this in the UML code base. Another problem that is similar is the inverse selection modifier. In the select action the Control key is used to specify that inverse selection is being performed. I am not quite sure what "inverse selection" means (to me it would mean that all the selected elements become unselected and all of the unselected elements become selected), however the CTRL-Mouse Press is used on the mac to mean "show the context menu". Therefore the SelectAction is never receiving the CTRL + Mouse Pressed mouse event. So the invert select can not work on the mac. On the mac we should make the META key as the modifier for the invert selection.
As I understand it. This is a request for having following action: 1) Always remember the last selected object/widget 2a) If an object is clicked without any key-modifier, then the selection is replaced. 2b) If an object is clicked with CTRL key, then the clicked object is added to the selection. 2c) If an object is clicked with Shift key, then the SelectProvider (or any required interface) would perform the rectangular or any other form of contiguous selection of all objects between the last and the newly selected object. Logic on the side of the new SelectAction is very simple - remembering the last Widget+location and passing "Shift" key state to SelectProvider. The rest would have to be done on the SelectProvider implementation. Even more if ObjectScene.createSelectAction is used now, it would have to be changed as well since the logic for identifying the object within the range to last-newly selected object is not generic - it cannot be defined as "any object withing rectangular boundary from the last and new object...)... All this stuff would complicate the API. Instead it is easier to copy/paste the SelectAction and ObjectScene.ObjectSelectProvider and implement the requested in the client code. For the reasons above I would rather not implement it in the Visual Library directly...
Attaching a patch for main and contrib repositories. It contains a new ContiguousSelectAction (create using ActionFactory). It requires ContiguousSelectProvider to provide a selection logic. A test.action.ContiguousSelectActionTest example has been attached as well. The change is an backward-compatible API change. Please, update documentation, javadoc @since tag, manifest.mf and api-changes.xml files.
Created attachment 68439 [details] Main repository patch
Created attachment 68440 [details] Contrib repository patch (usage example)
Created attachment 69245 [details] patch with updated information
ef6e0e5b81dc
Integrated into 'main-golden', will be available in build *200809161401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/ef6e0e5b81dc User: Tomas Holy <t_h@netbeans.org> Log: #144139: Extending the selection using the shift key does not work