OSDN Git Service

Improvements to Selection - New Actions & Sync Fix
authorTor Norbye <tnorbye@google.com>
Thu, 10 Feb 2011 23:28:15 +0000 (15:28 -0800)
committerTor Norbye <tnorbye@google.com>
Thu, 10 Feb 2011 23:28:15 +0000 (15:28 -0800)
commit18e332d589e783bcbd8e73c7b39a745a7fef4040
treecc8c1960466d453993cfc648ee616ce69eb412c3
parent66271faf9d99562c7a44b4b5601fd762772648ee
Improvements to Selection - New Actions & Sync Fix

This changeset adds a new "Select" context menu. In addition to Select
All and Select None, there are new actions to select the parent of the
currently selected item, an action to select all its siblings, and an
action to select all widgets in the layout of the same type. For
example, invoking this on a button will select all buttons in the
layout. Select Parent is bound to Escape and is particularly useful
when you want to target a layout widget that has children and no free
space, since any mouse click will target one of its children. With
Select Parent you click on the child and hit Escape to reach the
container.

In addition, this changeset fixes selection synchronization for
context menus. Until now, you had to FIRST select an item, THEN right
click on it to see its context menu items. The root cause for this is
an SWT bug (eclipse issue 26605), but we can work around it with a
MenuDetectListener, which is run when the menu is posted and gives us
a chance to sync the selection.

Change-Id: If3e15c335c372a6ee8a3c8c357b48bb80fbbb40c
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ControlPoint.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManager.java
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfoTest.java
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionManagerTest.java [new file with mode: 0644]