History log of /sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/manifest/descriptors/PackageAttributeDescriptor.java
Revision Date Author Comments
6b09013b6cb0fdcb48350a60bb3ed924ac9f562d 22-Mar-2012 Tor Norbye <tnorbye@google.com> Speed up Android Target Data loading

This changeset optimizes the handling of AttributeDescriptors during
the SDK target loading phase. From some simple benchmarks, this
speeds up target loading about 40%. (On an low-load machine, loading
two targets took on average 9.11s with standard deviation 1.86 for 13
runs; after the fix the same target loading took on average 6.359s
with standard deviation 0.944s for 17 runs -- so the speedup is 1.43).

The most important fix is to make the computation of the tooltip text
and the UI name (which performs various lowercase to uppercase
conversions, in some cases involving regular expressions, and many
string concatentations) be evaluated lazily. This is a big win since
most attributes never have their UI names or tooltips displayed, and
when they are, usually just a small number.

Since tooltips and UI names are now computed lazily from the
AttributeInfo, the constructor for the TextAttributeDescriptor and its
subclasses no longer take a UI name or tooltip; instead, there is an
explicit setter for the cases where you have a specific tooltip you
want to hardcode (as with the builtin descriptors such as the ones for
drawables).

The actual formatting method for UI names was also optimized a bit,
such as avoiding regexp replacements except for cases where they are
likely needed, preallocating a larger character buffer, etc.

Change-Id: I7004e403fcf696e18bd89a29c6cfd27b61c1e9f8
2be70bde5a6dcd6447c32ef55866020be372f96c 18-Oct-2010 Tor Norbye <tnorbye@google.com> Port layout rules to Java

We had a number of layout implementations in the tool written in
Groovy; these were hard to deal with because of lack of good tool
support (debugging didn't work, refactoring didn't work, code
completion didn't (always) work, go to declaration didn't work,
semantic checks like unused code didn't work, etc. etc.)

Since these layout helpers are only getting larger, replace them by
equivalent Java code to make development easier.

This checkin also moves the API classes formerly used by Groovy
scripts into a new package (next to the Java layout rules) under
com.android.ide.common (api and layout) since this code isn't Eclipse
specific and could be used by other IDE vendors.

These interfaces were left identical (only the package statements and
directory location changed), with two exceptions: I added a new method
called "in" to IAttributeInfo.java, and I added a parameter to
IViewRule's onInitialize method.

The Groovy code was kept as close to the original as possible; I
copied in the Groovy code, and then replaced the Groovy-specific
constructs (closure-iteration on collections, literal map syntax, etc)
with equivalent Java code. The only tricky part was ensuring that
Groovy's handling of the == and != operators were translated into
.equals calls.

Change-Id: Idf7660ddea3766eac0a4a65ce6524d3f5119f7b2
953aeea61efb31402198b969478d1bda5dcbe613 09-Jun-2010 Raphael Moll <ralf@android.com> ADT GLE2: Access AttributeInfo from groovy scripts.

This CL extracts IAttributeInfo from DeclareStyleable -- this used
to be the metadata extracted from an attribute declared in attrs.xml.

The interface that is now available to groovy scripts lets them
check whether an attribute is a reference, a string, etc. For an
enum or flag that means having access to the defined values too.

In the case of the AbsoluteLayout drop, we use this info to check if
an attribute is a reference. For example when duplicating a
RelativeLayout dropped in an AbsoluteLayout, we need to create new
ids and the RelativeLayout is prone to have inner self-references
that can be automatically adjusted that way.

A large part of the CL is about refactoring the various manually-created
attributes in the Descriptors for resources, XML, and such. In this
case the IAttributeInfo that is made available via the AttributeDescriptor
is not used, but it made sense to keep this consistent in case we want
to expose it later and to avoid having to care about special cases.

Change-Id: Ic02f69bc16f0e549fcac3956ae93b86651c5be3c
d4963dc4347c871be5faa76920709001490e1d2a 24-Feb-2010 The Android Open Source Project <initial-contribution@android.com> snapshot
e13151727c63786342cddc3ea355425582bd4e7a 13-Jan-2010 The Android Open Source Project <initial-contribution@android.com> android-2.1_r1 snapshot
69425d803b34589309a69eddc53a338e1409b30c 14-May-2009 Xavier Ducrohet <xav@android.com> ADT: Move more packages into internal:

editors -> adt.internal.editors.

This also marks the final refactoring of combining previous editors/common
plugin under the adt package.