History log of /sdk/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/FragmentRule.java
Revision Date Author Comments
474bd94478a8ced503e292b17c7e5962de414d99 30-Nov-2012 Tor Norbye <tnorbye@google.com> Code completion improvements for custom views and themes

This changeset adds custom view completion to the content assist.
Code completion for elements (e.g. from text context or inside a <)
should now include custom views found in the project, and prefix
typing should work as well.

Similarly, code completing inside a <fragment> name attribute or a
<view> class attribute should complete fragment and view classes.
It will display javadocs for these classes, if available.

It also hooks up class completion in manifest files, so completing
<activity>, <application>, <receiver> etc android:name attributes
should show matching classes corresponding to the tag being edited.

The completion will also always complete theme references (?) even
when there is no known metadata for the tag, such as for an arbitrary
custom view.

Also fix descriptor metadata such that <view> and <requestFocus> show
up in code completion, works properly for layout editor palette drag
(with a class selection popup) and with a suitable outline icon.

Also tweak refactoring such that it handles both class= and
android:name usage for <fragment> elements.

Finally, for the LinearLayout automatically added inside new
ScrollViews, set the vertical attribute since that's usually what you
want.

Change-Id: Ifc98c19607ddc4e69d7645f2720120ce72d0cd95
12d4581faa6438941e65a9dc83213be34c6ca970 13-Sep-2012 Tor Norbye <tnorbye@google.com> Constants refactoring.

This changeset moves most constants into the SdkConstants
class, and gets rid of AndroidConstants and LintConstants.
It also migrates all non-ADT specific constants from
AdtConstants into SdkConstants. It furthermore moves various
other constants (such as those in XmlUtils and ValuesDescriptors)
into the constants class. It also fixes the modifier order
to be the canonical modifier order (JLS 8.x).

Finally, it removes redundancy and combines various constant
aliases such that we don't have both NAME_ATTR and ATTR_NAME
pointing to "name", etc.

Change-Id: Ifd1755016f62ce2dd80e5c76130d6de4b0e32161
85e4a1a9dd133abb879ec211ce8dd385004edf22 08-Aug-2012 Xavier Ducrohet <xav@android.com> Refactor common.jar

Move resources and com.android.util.Pair into layoutlib_api
where they belong since layoutlib depends on them and we need
to control the API.

Made a copy of Pair to stay in common.jar but moved it to
com.android.utils.Pair (the one in com.android.util.Pair is
marked as deprecated to prevent usage where applicable).

Also moved XmlUtil and PositionXmlParser to com.android.utils
to match Pair.

Change-Id: I21d7057d3f2ce604f86a3bb1fa3c130948c93b89
7e4b8e9d595e45baa9d87cdb8282f02759e73abc 30-May-2012 Tor Norbye <tnorbye@google.com> Fix nullness annotations

Eclipse 4.2 includes analysis support for @Nullable and @NonNull
annotations. However, it requires these annotations to be *repeated*
on every single method implementing or overriding a superclass or
interface method (!).

This changeset basically applies the quickfixes to inline these
annotations. It also changes the retention of our nullness
annotations from source to class, since without this Eclipse believes
that a @NonNull annotation downstream is a redefinition of a @Nullable
annotation.

Finally, the null analysis revealed a dozen or so places where the
nullness annotation was either wrong, or some null checking on
parameters or return values needed to be done.

Change-Id: I43b4e56e2d025a8a4c92a8873f55c13cdbc4c1cb
a881b0b34678ad76c9f5eba62fac7a00a22ac606 20-May-2012 Tor Norbye <tnorbye@google.com> Move XML code to the common library

The ManifestMerger library needs to look up the prefix to use for the
Android namespace, and the Document.lookupPrefix method is not
implemented by the Eclipse DOM implementation (which throws an
exception). However, we have an implementation of this in the ADT
plugin.

This changeset creates a new XmlUtils class in the common/ library
(which is accessible by both ADT and the manifest merger, and the
anttasks where the manifest merger is used), and moves the namespace
prefix lookup code in there. It also moves the XML escape methods
into that class. It also adds a new method to the ManifestMerger for
merging directly from documents (rather than files), and makes sure
that all the merging code goes via the prefix utility method rather
than calling the document.lookupPrefix method.

Finally, it moves the various string constants associated with XML
namespaces into the single XmlUtils class, since these were spread
across several different classes before (and many of them are needed
in the XmlUtils class).

The vast majority of the diffs in this changeset are related to simple
import statement changes to reflect the new locations of these
constants.

Change-Id: Ib8f3d0e5c89e47e61ea509a23925af7b6580abee
cd05e93b1194c89fe9eca1ee4b999d2991334f4b 15-May-2011 Tor Norbye <tnorbye@google.com> Basic fragment support

This changeset adds preliminary support for fragments:

* Add <fragment> to the palette, along with a drop handler which pops
up a class chooser to pick the Fragment class; all project
implementations of android.app.Fragment and
android.support.v4.app.Fragment are listed.

* Adds a fragment descriptor such that code completion works for
<fragment> elements

* Fix project callback such that it does not complain about a missing
class "fragment".

* Fix outline to display the name of the fragment rather than the
fragment tag name.

* This changeset also centers the label in MockViews since those are
still used to render fragments

Conflicts:

eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java

Change-Id: I6f39f0c29a0cf21799fa8a55406eeae1e3beb57f
46d0ebd2126fad6b1480fa5c8121e4638c463c73 15-May-2011 Tor Norbye <tnorbye@google.com> Basic fragment support

This changeset adds preliminary support for fragments:

* Add <fragment> to the palette, along with a drop handler which pops
up a class chooser to pick the Fragment class; all project
implementations of android.app.Fragment and
android.support.v4.app.Fragment are listed.

* Adds a fragment descriptor such that code completion works for
<fragment> elements

* Fix project callback such that it does not complain about a missing
class "fragment".

* Fix outline to display the name of the fragment rather than the
fragment tag name.

* This changeset also centers the label in MockViews since those are
still used to render fragments

Change-Id: I6e062970b335d9c95870f181ed408960978c423e