OSDN Git Service

Add custom views and third party views to the palette
authorTor Norbye <tnorbye@google.com>
Thu, 17 Mar 2011 16:00:14 +0000 (09:00 -0700)
committerTor Norbye <tnorbye@google.com>
Mon, 21 Mar 2011 16:59:32 +0000 (09:59 -0700)
commit4563c4e2f168df1d6c97206a4ac6444dfa2264ba
treee04b1fcc3888a0935dd8b9158f8907c2ec11fe5b
parent7016ca24cca083efa9570fcc4b53fe696eaad937
Add custom views and third party views to the palette

This changeset adds a new category to the palette, "Custom & Third
Party Views", which is populated with android.view.View subclasses
found in the current project (or any of its libraries), and in any
jars included by the project. They can be dragged directly to the
canvas, and control clicking on the palette entries will jump to the
source.

There are a bunch of adjustments in various places to make working
with custom views better - from ensuring that we don't use fully
qualified class names in default ids, to showing the Java class icon
for custom views in outline and elsewhere, to making zero-sized view
highlight and expand when selected like we do for laoyuts - since with
custom views it's quite easy to end up with an "invisible" view that
you can't see after dropping it.

There are also some fixes to the code which looks up third party and
custom views (which was already used by the Wrap In refactoring) - to
handle inner classes, to filter out non public or abstract classes,
and most importantly to only include views reachable from the current
project (since the view search necessarily is workspace wide.)

Change-Id: If1d8c7e5c7dd907a68d8d0962e85c5144e911503
18 files changed:
eclipse/plugins/com.android.ide.eclipse.adt/icons/refresh.png [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtils.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/ProjectCallback.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/CustomViewDescriptorService.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/AccordionControl.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CanvasViewInfo.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/CustomViewFinder.java [new file with mode: 0644]
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/DomUtilities.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/IncludeFinder.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/PaletteControl.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/SelectionItem.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.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ViewHierarchy.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/ChangeViewWizard.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/refactoring/WrapInWizard.java
eclipse/plugins/com.android.ide.eclipse.tests/unittests/com/android/ide/eclipse/adt/internal/editors/descriptors/DescriptorsUtilsTest.java