aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
Commit message (Collapse)AuthorAgeFilesLines
* Extract client rules engine into top level classTor Norbye2011-06-022-445/+491
| | | | | | | | | The IDE-side implementation of the IClientRulesEngine interface was nested within the RulesManager class, and has grown a lot over time. This changeset moves it out as its own top level class. There are no semantic changes, just a straightforward refactoring operation. Change-Id: Ica072e8f7a06b822c6bde28e37b10ec86e05a402
* Merge "Simple code cleanup"Tor Norbye2011-06-022-59/+26
|\
| * Simple code cleanupTor Norbye2011-06-022-59/+26
| | | | | | | | | | | | | | | | | | We had a number of constants for attribute values which had the prefix VALUE_ but which were really attributes and should have the prefix ATTR_. We already had the equivalent ATTR_ constants, so get rid of the VALUE_ constants and clean up the usage slightly. Change-Id: Icc0f0ad8910695b4ac4904c620f73d6cf4bcacba
* | Properly configure KXml parsers.Xavier Ducrohet2011-06-011-2/+2
|/ | | | Change-Id: If307659aabe37c5204f7e40c10fc93576de0e145
* Move rendering code into RenderService classTor Norbye2011-06-015-366/+579
| | | | | | | | | | | | | | | | | | This CL moves the various rendering-related code in GraphicalEditorPart into a separate RenderService class, which can be configured for different purposes: - Rendering a layout shown in the canvas - Rendering palette previews - Rendering a preview of a node during a drag from a palette - Rendering a theme drawable - Rendering layout-only to measure preferred sizes Once configured, the rendering service can be used repeatedly and off the UI thread to for example render all the palette previews without blocking editor startup. This will be addressed in a follow-up CL. Change-Id: I851148d80c3a4dc9e4b5b66c9838ae49809ea03c
* Resize & Guideline SupportTor Norbye2011-06-0163-847/+5024
| | | | | | | | | | | | | | | RelativeLayout now has both drop/move and resize guidelines, and existing constraints are visualized for the selection. LinearLayout resizing now uses weights to change the size of nodes rather than setting width/height. All resize operations offer guidelines to snap to their "wrap_content" size. Various bug fixes in related areas as well. Change-Id: I817e34c6e67ce61cfb137eb067076d91f69f99e9
* Add Resize Support to the Layout EditorTor Norbye2011-06-0122-79/+1209
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds "resizing" support to the layout editor. First, the normal selection overlay is replaced with a selection rectangle which also has "selection handles" in the corners and in the middle of each edge. Moving the cursor over one of the selection handle will show a directional resize cursor, and dragging the handle will initiate a new resizing gesture. (This also made it possible to remove the selection fill we've used until now, so the layout editor will "interfere" less with the visual look of the layout.) During the resizing operation, the current size is displayed in the Eclipse status bar. The resizability of widgets is determined by metadata, so for example a ZoomControls widget is not resizable, a rating bar is only horizontally resizable, a TableRow is only vertically resizable, and most widgets are resizable in any direction. The parent layout is involved in the resizing operation. Currently, the resizing gestures will only update the width and height properties (except for absolute layout, which will also set the x and y properties if you are dragging a left or top edge). In a follow up changeset this will be extended to for example make RelativeLayout allow resize dragging to snap to new edges and the resize will be applied as a set of new constraints on the "resized" widget. Thus, you'll be able to drag the right hand side of a widget and drag it over to attach to some other widget or edge, independent of what the left edge or vertical edges are bound to. This changeset also adds the ability for ViewRules to provide a message or error message back to the IDE during a drag or resize operation. For resizing this is used to display the new size. However, it is now also used to display more useful messages in a couple of older scenarios: * Attempting to drag anything into a ListView will display a message that AdapterViews much be configured via Java code * Attempting to drag anything into or within an AbsoluteLayout will warn that AbsoluteLayouts are deprecated. Note that resizing will currently set the size to specific pixel (dip) sizes. In the next changeset I will add guidelines which (in addition to those described for RelativeLayout above) will add guidelines for significant sizes such as the parent size, the preferred (wrap_content) size of the widget, and possibly other hardcoded sizes in the same layout. Change-Id: Ie4f3367e81b24259a106c649c944008f4a3d31ec
* SdkManager: Refactor name of UpdaterWindow.Raphael Moll2011-05-273-12/+12
| | | | | | | | | | | | | | Since the sdkmanager now contains separate windows for the "SDK Updater" versus the "AVD Manager", the various UpdaterWindow classes are renamed to SdkUpdateWindow. We already have now a standalone AvdManagerWindow that matches this pattern. This is a pure refactoring/renaming CL with no workflow change whatsoever. Change-Id: I18ecb6aa33b7e9bd2294a959b371b424d03b2060
* [EXTERNALIZATION] This commit externalizes the strings of the DDMS plugin.Pablo Leite2011-05-2715-262/+565
| | | | | | | | | | | | | | | | | | | | | | | | | | After applying it, please run the Eclipse's Externalize Wizard at “Source -> Externalize Strings…”. This ensure that hard-coded strings added between the time the patch was created and the time it was integrated will also be externalized. From the time this patch is integrated on, each new string created in the plugin should be added to the following files: eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/i18n/messages.properties Example: JavaClassName_MessageID=<string value> <string value> refers to the string itself. eclipse/plugins/com.android.ide.eclipse.ddms/src/com/android/ide/eclipse/ddms/i18n/Messages.java Example: public static String JavaClassName_MessageID; In the Java class, the new string should be referenced this way: Messages.JavaClassName_MessageID Related patches: All patches with the [EXTERNALIZATION] tag Changes after review: Code formatted according using android code formatter template Merged Strings DeviceView_Unable_Create_HPROF_For_Application and DeviceView_Unable_Create_HPROF_For_Application. Removed Motorola copyright notices. Change-Id: Id889db593ef313760515f28b5973d3a9a8ad80d0
* Default render target level should consider project targetTor Norbye2011-05-262-8/+46
| | | | | | | | | | | | | | | | | | When picking the default render target, we attempt to pick a render target that is at least version 5 of layoutlib (where rendering fidelity has improved significantly, where include support is improved, etc.) However, this sometimes picked a render target whose API level is lower than the project target. This CL fixes that problem, and also improves the detection of compatible layout libraries to not only consider API level 11 or higher, but also the new layoutlib API property which will identify qualified SDK versions when we release backported versions of layout lib. Change-Id: I4d4159389692d984a66856eeb80035a8e8b7d1cf
* Fix ADT-testXavier Ducrohet2011-05-251-0/+4
| | | | Change-Id: Iebc29d774747ba64f1f895cd36970330145fd6b4
* Add support for addon providing their own layoutlib and/or res.Xavier Ducrohet2011-05-254-6/+10
| | | | | | | | | | | | | | | | | | During addon parsing, the SDK Manager will detect whether the addon has: - data/layoutlib.jar - data/res/ - data/fonts/ if the first one is present, then it is used during rendering. if *both* the 2nd and 3rd ones are present, then addon resources are used during rendering. On the GLE side, all that's needed is adding addons to the list of rendering targets if they have either library or resources (or both). Change-Id: Id16925eea2c98b9fbaaa884ac6fd8c1c1c444db2
* Merge "Use sdklib.OsHelper in AddCompatibilityJarAction."Raphael Moll2011-05-241-106/+3
|\
| * Use sdklib.OsHelper in AddCompatibilityJarAction.Raphael Moll2011-05-241-106/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | ADT's AddCompatibilityJarAction defined 2 new generic useful methods, copyFile and isSameFile. SdkLib already had an OsHelper.copyFile, so I moved that class to a more generic sdklib.io package and added the new method isSameFile. Another suitable candidate would have been io.FileWrapper in the common project. Change-Id: If310e09af112c5f4d87a253b35e67e4f5adb34da
* | Merge "Don't apply default attributes in a move/copy"Tor Norbye2011-05-243-8/+23
|\ \
| * | Don't apply default attributes in a move/copyTor Norbye2011-05-243-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is a method in the layout editor which fills in required default attributes like id, width and height, as well as some optional attributes like a default text attribute. This code was called unconditionally whenever a new child is added to a layout. However, this should only be done when a new widget is created, not during moves or copies from existing elements. Change-Id: Ic04dec746c70359eca38454bacfdcdb87891719f
* | | Merge "Disable palette preview for some widgets on some platforms"Tor Norbye2011-05-242-1/+44
|\ \ \ | |_|/ |/| |
| * | Disable palette preview for some widgets on some platformsTor Norbye2011-05-242-1/+44
| |/ | | | | | | | | | | | | | | | | | | ListView palette preview requires adapterview support in layoutlib, and DatePicker and TimePicker require Holo themes on Honeycomb. This changeset adds some conditional logic to the palette preview code to drop rendering of these widgets based on the current render target, layout library and theme. Change-Id: Ic42a40faf817e60525485e0a46b7ad967ed1c363
* | Merge "List project themes, if any, before framework themes"Tor Norbye2011-05-231-39/+39
|\ \
| * | List project themes, if any, before framework themesTor Norbye2011-05-201-39/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset moves the project-themes in the combobox up above the framework themes, since (a) it's likely that the user wants to frequently choose these, and (b) the list of project themes is usually much smaller than the framework list, so it brings these items up to the visible part of the combo Change-Id: Idb989d388f5cb1f5cc6a302a6c5796db69e78c8e
* | | Detect and add special warning for wrong themesTor Norbye2011-05-232-4/+13
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you open a layout designed for a particular theme in another theme, you can get many confusing error messages. Instead of "attribute missing" it may tell you that it failed to convert a resource to a color or drawable, and so on. To help guide users to the root problem (wrong theme chosen) this changeset detects the scenario where theme attributes can't be resolved, and when these are found the top of the error log will start with a bold message stating that theme resources were not found and to check whether the correct theme is chosen. To do this, the resource resolver emits a new sub-type of the resource missing tag into the error log, which is used in the IDE to prefix the errors with the special error message. Change-Id: Ic29c9af37da4b5cc2c9fb1ca5670c8b8f79bf852
* | Merge "NPE safeguard"Tor Norbye2011-05-231-0/+4
|\ \
| * | NPE safeguardTor Norbye2011-05-201-0/+4
| |/ | | | | | | Change-Id: I3f55c21f79ad66bed1329a2f5882deb94e93be62
* | Merge "Mechanism to disable SwtMenuBar in SdkMan2"Raphael Moll2011-05-201-3/+4
|\ \
| * | Mechanism to disable SwtMenuBar in SdkMan2Raphael Moll2011-05-201-3/+4
| |/ | | | | | | | | | | | | | | | | | | | | | | | | The SDK Manager 2 should not try to change the menu bar when invoked from Eclipse. Actually it can't because the SwtMenuBar lib isn't even present to it crashes with a NoClassDef exception. This CL adds the notion of "invocation context" so that we know what is invoking the manager and we can change the UI accordingly. Change-Id: I606850a20fbc5f9d2d1d4fd0e16aa0bd71ef41c7
* | Offer to install fragment compatibility libraryTor Norbye2011-05-205-36/+156
|/ | | | | | | | | | | | | | | This changeset changes the popup displayed when you drop a fragment tag in a pre-API-11 project. Instead of just displaying an error message, you now get a dialog which asks if you want to install the project, and if you click the "Install" button it invokes the SDK manager to install the right package, and then copies it into the project. In addition, the fragment selector now has a "Create New" action which invokes the New Class wizard pre-configured with the right fragment class. Change-Id: I4ce1b51fbfe939a21e91379eb6b77ff722c13f0f
* Merge "SDK Manager dialog to perform specific updates from ADT."Raphael Moll2011-05-203-7/+354
|\
| * SDK Manager dialog to perform specific updates from ADT.Raphael Moll2011-05-203-7/+354
| | | | | | | | | | | | | | | | As a working case example, this adds an ADT project context menu to add the Android Compatibility JAR to an android project. Change-Id: Icd86930b72558240dc9f5a6f732478253b8cb0fb
* | Merge "Update changes.txt"Tor Norbye2011-05-191-0/+11
|\ \
| * | Update changes.txtTor Norbye2011-05-191-0/+11
| |/ | | | | | | Change-Id: Ic53c7174d4ed74b94cc24680e00737ddeaad024b
* | Fix potential stackoverflow in theme detection.Xavier Ducrohet2011-05-191-3/+6
|/ | | | Change-Id: I19d2a3c9c6802b3e1c065ca36828d2b672130630
* Add preview support for GridViewsTor Norbye2011-05-196-27/+101
| | | | | | | | GridViews are another AdapterView subclass. This changeset adds preview support for GridViews by modifying the ListView preview support to also accommodate GridViews. Change-Id: I5af0a4c7e270cfa23c609be316d01dfb188a051b
* Fix auto-mergeTor Norbye2011-05-191-27/+0
| | | | | | | | | A change that was cherrypicked from the external master into the tools-r11 branch was automerged back into the external master in such a way that a method and a field got duplicated. This CL fixes the merge. Change-Id: I5b05c8a9477b4afb669efd1904c1415925d25307
* merge from tools-adt_r11The Android Open Source Project2011-05-181-0/+27
|\ | | | | | | Change-Id: Ic374b2d4185f1c3c4dbad2ea81b901fe9b07666a
| * Add Request Focus to textfieldsTor Norbye2011-05-186-3/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds a couple of focus related changes: 1) When the first text field is added into a layout, it is automatically requesting focus 2) There is a new context menu item available on textfields to request focus. When invoked on a text field, it will both add <requestFocus> to itself and remove it from any other text fields that have set it in the layout. When invoked on a text field which already has focus, it will offer to clear the focus. 3) The Advanced section of the palette also contains the <requestFocus> tag. Change-Id: Ie9e1ab07c4f7ea701e9fac17f6c82e52656bc755
| * Merge "Binary XML editor" into tools-adt_r11Tor Norbye2011-05-181-3/+13
| |\
| | * Binary XML editorHaris Peco2011-05-171-3/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | This change contains the workaround for http://code.google.com/p/android/issues/detail?id=15003 For details, see http://code.google.com/p/android/issues/detail?id=15003#c50 Change-Id: I6485d32620a23c17879922155a8cfb6e4290f05e
| * | Merge "Fix bug in editor open utility" into tools-adt_r11Tor Norbye2011-05-182-47/+55
| |\ \
| | * | Fix bug in editor open utilityTor Norbye2011-05-172-47/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to open a file (called by Go To Declaration, Show Include etc) handles two scenarios: (1) The file is in the workspace - open using Eclipse IFile mechanism (2) The file is outside the workspace - open using the fallback external storage (which means you get a plain XML editor) There's a third scenario: the file is not in the workspace, but is part of a project in the workspace so it does have a valid IFile. (This can happen if you import a project but choose not to copy the contents into the workspace). This changeset adjusts the code to open up an editor such that it handles this third scenario and we get our own XML editors for these types of files. Change-Id: I040e1b899cd38bbda3fcf3475cc4dfb541d10016
| * | | Merge "Fragment Rendering Support" into tools-adt_r11Tor Norbye2011-05-188-27/+382
| |\ \ \ | | |/ /
| | * | Fragment Rendering SupportTor Norbye2011-05-178-27/+382
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds designtime-previewing of fragments, where a layout which contains fragments will show the contents of the fragments inline. Initially, the fragments are empty, but you can right click on them to bring up a context menu where you can choose which layout to show at designtime. This is persisted across IDE sessions, just like the ListView render preview. In addition to the generic layout chooser, all layout references found in the associated Fragment class (usually what you want) are listed directly in the menu. Change-Id: Iff3e6e5cbf87a19bdb61e677a63f663ca6e4848b
| * | | Merge "Basic fragment support" into tools-adt_r11Tor Norbye2011-05-1812-18/+325
| |\ \ \ | | |/ /
| | * | Basic fragment supportTor Norbye2011-05-1712-18/+325
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | Merge "Make Go To Declaration work for <fragment> names." into tools-adt_r11Tor Norbye2011-05-188-5/+102
| |\ \ \ | | |/ /
| | * | Make Go To Declaration work for <fragment> names.Tor Norbye2011-05-178-5/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/common/layout/LayoutConstants.java Change-Id: I5260aacb7d7a14141f43d9a65bb4bb87627d17c2
| * | | Merge "Custom View handling improvements" into tools-adt_r11Tor Norbye2011-05-189-9/+66
| |\ \ \ | | |/ /
| | * | Custom View handling improvementsTor Norbye2011-05-179-9/+66
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First and foremost, allow custom views to accept children such that you can drag & drop children into the custom view in the outline. Second, prevent an NPE which can occur if you drag into a layout where the root element is a custom view. Third, handle <view> (not <View>) better: provide a custom icon, and inline the view class name in the outline label. Fourth, allow double clicks (in addition to ctrl-click which is already supported) on the custom views in the palette to allow jumping to the custom view code. Change-Id: I13c2bf2f4169185c9fcc893ce487f2abdac46802 Conflicts: eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/descriptors/LayoutDescriptors.java
| * | Escape Strings extracted with the Extract String refactoringTor Norbye2011-05-171-0/+31
| |/ | | | | | | | | | | | | | | | | Escape any single or double quotes inside the string value definition in strings.xml: This'll work => "This'll work" Escape '" => Escape \'\" Change-Id: I21cb506e10e837feb0e435a21cb50aaa5342f0fa
| * Merge 580ecb7a from master. do not merge.Xavier Ducrohet2011-05-171-0/+1
| | | | | | | | | | | | | | | | | | Add baseline/margins to ViewInfo. Also make it so that older layoutlib that are using API5 return the value through reflection (done in LayoutLibrary.) Change-Id: Ied102625430b53f9b5e62aa738c8c598054cc266
| * Merge 'Remove "Android Tools > Convert to Android Project"' into tools-adt_r11Raphael Moll2011-05-162-189/+0
| | | | | | | | | | | | | | | | | | | | | | | | The feature to convert a Java Project into an Android Project is broken. It's also quite irrelevant now since project are better created using the NPW. SDK Bug: 3259855 (cherry picked from commit 7f8f80cfe2a29b7ebaf139fb4228ad31192fb8a9) Change-Id: Ifb5e93d2dcf6853136cd4add5e4af6b14fafec35