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.

Bug 144139 - Extending the selection using the shift key does not work
Summary: Extending the selection using the shift key does not work
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Graph (show other bugs)
Version: 6.x
Hardware: All Windows XP
: P2 blocker (vote)
Assignee: t_h
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks:
 
Reported: 2008-08-16 00:29 UTC by giorgio42
Modified: 2008-09-16 17:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Main repository patch (15.62 KB, patch)
2008-08-27 13:20 UTC, David Kaspar
Details | Diff
Contrib repository patch (usage example) (4.25 KB, patch)
2008-08-27 13:22 UTC, David Kaspar
Details | Diff
patch with updated information (18.99 KB, text/plain)
2008-09-07 10:14 UTC, t_h
Details

Note You need to log in before you can comment on or make changes to this bug.
Description giorgio42 2008-08-16 00:29:01 UTC
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.
Comment 1 Trey Spiva 2008-08-19 21:40:46 UTC
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.
Comment 2 David Kaspar 2008-08-26 12:42:29 UTC
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...
Comment 3 David Kaspar 2008-08-27 13:15:36 UTC
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.
Comment 4 David Kaspar 2008-08-27 13:20:26 UTC
Created attachment 68439 [details]
Main repository patch
Comment 5 David Kaspar 2008-08-27 13:22:10 UTC
Created attachment 68440 [details]
Contrib repository patch (usage example)
Comment 6 t_h 2008-09-07 10:14:04 UTC
Created attachment 69245 [details]
patch with updated information
Comment 7 t_h 2008-09-16 10:07:07 UTC
ef6e0e5b81dc
Comment 8 Quality Engineering 2008-09-16 17:30:26 UTC
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