aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Fix issue 12251: double click handling"Tor Norbye2010-11-111-1/+6
|\
| * Fix issue 12251: double click handlingTor Norbye2010-11-111-1/+6
| | | | | | | | | | | | | | | | Surprisingly, SWT will deliver a double click event even if you click button 1 then 3 in rapid succession. This changeset ensures that only a double click on button 1 warps to XML. Change-Id: I2b470e2dea5bdb4c9240c9304650ca1c7403db84
* | Merge "Rename layoutlib_utils into ide_common."Xavier Ducrohet2010-11-1120-10/+9
|\ \ | |/ |/|
| * Rename layoutlib_utils into ide_common.Xavier Ducrohet2010-11-1120-10/+9
|/ | | | Change-Id: Id243fe66e2ce577bc821ca454bca18444ebb5e7d
* Merge "Make ADT use the new layoutlib API."Xavier Ducrohet2010-11-1134-378/+646
|\
| * Make ADT use the new layoutlib API.Xavier Ducrohet2010-11-1134-378/+646
|/ | | | | | | | | | | | | | | | | | | | | | ADT now exclusively use the new API. The older platforms that still use the old API are accessed through a compatibility layer provided by the class LayoutBridgeWrapper that converts the old to the new API (both input and output). The wrapper and the loading code for the bridge have moved to layoutlib_utils, but into the ide.common package. Layoutlib_utils is to be renamed ide-common later. .sdk.LoadStatus has moved into .ide.common too since it's used by the bridge loading code. As we'll move more code into ide-common it's ok to have it there anyway. Also did some minor fix to the API: - missing implementation of ViewInfo - Made a singleton for SUCCESS state of SceneResult. Change-Id: I5e7130ca03b92ad71dc9c293b2ffc40566df645c
* Merge "Improvements to the new Layoutlib API."Xavier Ducrohet2010-11-108-157/+566
|\
| * Improvements to the new Layoutlib API.Xavier Ducrohet2010-11-108-157/+566
| | | | | | | | | | | | | | | | | | | | | | | | | | Move to classes instead of interfaces so that the layoutlib API code can provide default implementation. This will reduce the testing on the ADT side about whether a method is present for the current API level or not. Also moved all the parameters of startLayout (actually renamed createScene) into a SceneParams class. Change-Id: I58389cd1bed9e79f6825b7c4e5a79206496ca439
* | Merge "Refactor to make model rendering reusable"Tor Norbye2010-11-103-126/+209
|\ \ | |/ |/|
| * Refactor to make model rendering reusableTor Norbye2010-11-103-126/+209
|/ | | | | | | | | | | | | | | | This changeset refactors the code in GraphicalEditorPart a bit to make the part which renders a model into an image reusable. This will be used by an upcoming changeset to provide previews of palette items as you drag them. The refactoring is straightforward, even though the diffs unfortunately don't show it. I basically split up the large recomputeLayout() method into smaller separate chunks (validating the current file, validating the model and validating the sdk and looking up the bridge) and added a new render method which can take just a model (separate from the editor's own model) and render it. Change-Id: I96603c4beb2d56d36416cd2b6448c87dd306217c
* Merge "Minor update to the layoutlib API."Xavier Ducrohet2010-11-102-2/+4
|\
| * Minor update to the layoutlib API.Xavier Ducrohet2010-11-092-2/+4
|/
* Merge "Add transient visibility mode for empty containers"Tor Norbye2010-11-0913-26/+513
|\
| * Add transient visibility mode for empty containersTor Norbye2010-11-0913-26/+513
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you add a new container, such as a LinearLayout, it is usually invisible. The reason for this is that an empty layout has 0 width and 0 height. There are two existing features in the layout editor to deal with this: (1) Outline mode, which renders rectangles around all views, and (2) Padding mode, which adds 10 pixels of padding to all views. In combination, these two modes will create a rectangle for empty layouts making them visible and user-manipulatable -- you can for example select or drop into them. This changeset attempts to make dealing with these types of containers easier and more discoverable. It adds a new temporary mode where empty containers (and only empty containers) are automatically padded and have their outlines painted. And more importantly, this is only done in some limited scenarios: When you drag into, or drag within, the layout canvas. As soon as you finish the drag, empty containers disappear again. Unlike padding mode, we don't enlarge the design surface itself, since this mode comes and goes easily and frequently. In addition to this, there is special handling for selection. If you select a zero-sized element (which for example is automatically done when you drop a new layout, and which can also be done by clicking in the outline), then the element is also revealed similar to the show-empty mode, but in this case only the selected item and not any other invisible containers are shown. Change-Id: Ibf3ec6a080a50a8f0f55919c3d3e6c4d2890468d
* Merge "Fix ADT to build with the new layoutlib API."Xavier Ducrohet2010-11-093-11/+26
|\
| * Fix ADT to build with the new layoutlib API.Xavier Ducrohet2010-11-093-11/+26
| | | | | | | | | | | | | | Also make the custom cleaning of the layoutlib looper only done through API 4. Newer bridge can do their own clean up. Change-Id: I1ee128e09912df53e110094d8909f81bc6a788e3
* | Merge "New layoutlib API."Xavier Ducrohet2010-11-096-8/+253
|\ \ | |/
| * New layoutlib API.Xavier Ducrohet2010-11-096-8/+253
| | | | | | | | | | | | | | This is the new API to move to a stateful layoutlib, allowing for faster actions on an inflated layout. Change-Id: Ice6324c056efc6e82d5760b5f4e3d40b58938368
* | Merge "Don't unregister listeners from disposed widget"Tor Norbye2010-11-092-3/+11
|\ \
| * | Don't unregister listeners from disposed widgetTor Norbye2010-11-082-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | This changeset fixes a couple of exceptions on shutdown which stem from the fact that once a widget is disposed it's an error to attempt to remove listeners from it. Change-Id: Ie4b1049668805c6e9bbedd1f7f0cf480e2d68c9d
* | | Merge "Fix icon painting transparency for the palette"Tor Norbye2010-11-093-24/+60
|\ \ \ | |_|/ |/| |
| * | Fix icon painting transparency for the paletteTor Norbye2010-11-093-24/+60
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The icons shown in the palette do not have transparency applied to them, which means that you end up with white squares on a white background. This looks okay in the outline view where the icons are shown on a white background, but it does not look good in the palette where they are on a gray background. This changeset fixes the icon generation a bit such that it records a transparent pixel for these icons. It's not an ideal solution since we only have on/off transparency, not an alpha channel, which means that we can't have a smoothly anti-aliased edge of the circles regardless of the background. Luckily, a light color seems to work fine for both cases. While I was at it I also adjusted the font positioning slightly on the Mac platform for some letters that needed it. Change-Id: Idf5a4f6709096935122bfe05cfecffc63e74a863
* | Merge "Add autoformatting of XML, and improved manual formatting"Tor Norbye2010-11-087-28/+341
|\ \ | |/ |/|
| * Add autoformatting of XML, and improved manual formattingTor Norbye2010-11-087-28/+341
|/ | | | | | | | | | | | | | | | | | | This changeset improves the formatting of XML edited by the layout editor in two ways: (1) It improves the way the layout editor handles insertion and deletion into the XML document; it looks up the indentation of the sibling and parent elements and attempts to correctly indent new elements based on the existing surrounding formatting, and it also attempts to clean things up correctly on element deletion. (2) It adds a new user option for turning on automatic XML formatting. When this is on, it will invoke the Eclipse XML formatter on portions of the XML after each edit. This will ensure that the document adheres to the user's preferred formatting settings (maximum line width, tabs versus spaces, line breaks before attributes, etc. Change-Id: I74f9a4240a8c5ca4295c01f3b55751ef10b1c1b0
* Merge "Sort palette contents"Tor Norbye2010-11-052-1/+9
|\
| * Sort palette contentsTor Norbye2010-11-052-1/+9
|/ | | | | | | The palette has many of the Android views in a seemingly random order. This changeset ensures that they are ordered alphabetically. Change-Id: I675265747e7835c933fe8e2c7f99dc3c64e6bfaf
* Merge "Mark internal strings as NON-NLS in rule classes"Tor Norbye2010-11-056-142/+157
|\
| * Mark internal strings as NON-NLS in rule classesTor Norbye2010-11-056-142/+157
|/ | | | | | | | Mark internal strings as NON-NLS in rule classes. This code was initially written in Groovy which is why it didn't have NON-NLS markers. Change-Id: I74517771271e54f165332543092a9d29fc2bc52a
* Merge "Remove deprecated UiElementNode "editData" property"Tor Norbye2010-11-051-172/+152
|\
| * Remove deprecated UiElementNode "editData" propertyTor Norbye2010-11-041-172/+152
| | | | | | | | | | | | | | | | | | As requested in another review (#18753) the editData property on UiElementNodes is obsolete (it was used by GLE1) and should be removed. While there I also updated the naming style of local vars in that class from underline to camelcase. Change-Id: Ic5c50d07abedb1177cd018c866901f1e54cd0ec5
* | Merge "Add gesture support, marquee selection, and refactoring"Tor Norbye2010-11-0538-1822/+4147
|\ \ | |/ |/|
| * Add gesture support, marquee selection, and refactoringTor Norbye2010-11-0438-1822/+4147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This checkin adds support for gestures and overlays. Gestures are sessions of mouse/keyboard activity, and this is documented in the javadoc for the new Gesture class. Overlays are units of graphics, and these are documented in the Overlay javadoc. The gesture architecture lets us isolate the logic for each different type of operation (marquee, resize, move, etC), and with associated overlays we don't attempt to for example paint drag feedback during a resize operation, etc. The checkin also adds marquee selection (as a second gesture, in addition to the existing drag & drop based move gesture), along with some associated changes in how the root view is treated. As part of isolating the mouse handling and painting related to gestures, painting etc., I also refactored the code quite a bit. LayoutCanvas which used to be a large class has been split into a number of new classes, one for each area of responsibility: - The mouse listener and drag & drop code has been moved into a GestureManager. (A lot of the drop handling code also came from the CanvasDropListener class.) - Code related to maintaining the set of rendered views, and performing searches in the views, has been moved into a ViewHierarchy class. - Code related to selection has been moved into a SelectionManager. - Various individual painting pieces (outline, hover, etc) have been moved into individual Overlay classes such as OutlineOverlay, HoverOverlay, SelectionOverlay, etc. This also moved associated resource allocation and cleanup into the overlays. - New coordinate classes, ControlPoint and LayoutPoint, are used instead of ints and plain Points to make it really clear which methods require coordinates in the layout (such as the ViewHieararchy search methods) and which ones require coordinates in the canvas control (such as paint methods). There are factory methods to automatically construct the right kind of coordinate from different types of mouse events, as well as methods to convert between the two. I also tweaked the visual appearance of selection a bit more, and some other misc cleanup. Change-Id: I666aabdcd36720bebe406b68237e8966d985fb8f
* | Merge "Fix XML editing whitespace handling"Tor Norbye2010-11-041-2/+20
|\ \
| * | Fix XML editing whitespace handlingTor Norbye2010-11-031-2/+20
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset fixes three problems related to the way whitespace is handled by the visual editor. (1) The editor would insert a newline text node after a newly inserted element, but this element was appended rather than inserted immediately after the element, which meant that if you inserted your element anywhere in the *middle* of the child list, you would accumulate blank lines at the end of the parent's element and have no separator before the current element. The fix is simple - use insertBefore() rather than appendChild() when inserting the new node. (2) On deletion, no XML text nodes were deleted. This means that if you inserted 4 elements, then deleted them, you would end up with 4 blank text nodes. The fix here is to look at the sibling when we are about to delete, and if it looks like a pure whitespace node, remove it as well. (3) When nested content (like a LinearLayout) was inserted, there would be no newline inserted before the child, so that first element would end up on the same line as the parent. The fix here is to detect this scenario (when we are inserting an element into an element that has no children) and insert a newline *before* the element (as well as after, as is the case for all newly inserted elements). Longer term we should do more advanced things with formatting, such as indenting nested content, and making sure that when we insert and remove whitespace nodes we always adjust the indentation correctly. But for now, this changeset makes the XML generated by the editor much more readable and consistent. Change-Id: I2e65152568092a775074a606e3f5e54c680611c6
* | merge from tools_r8The Android Open Source Project2010-11-0411-81/+249
|\ \ | |/ |/| | | Change-Id: I7bc7385266c44927db9dc66eed3b06e92eaf99e1
| * Merge "SDK Repo Schema: <vendor> for <extra> elements." into tools_r8Raphael Moll2010-11-0411-81/+249
| |\
| | * SDK Repo Schema: <vendor> for <extra> elements.Raphael Moll2010-11-0311-81/+249
| |/ | | | | | | Change-Id: I8fa13d28b787e3ecb8bd96896e6410313e2a66a9
* | merge from tools_r8The Android Open Source Project2010-10-295-22/+89
|\ \ | |/ | | | | Change-Id: If932f5db0eb1d3b8caf49a2f18bc94b84eab9e3f
| * Merge "SDK Manager: fix suggestions of new platforms." into tools_r8Raphael Moll2010-10-295-22/+89
| |\
| | * SDK Manager: fix suggestions of new platforms.Raphael Moll2010-10-285-22/+89
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | I accidentally broke the way the SDK Manager was suggesting new platforms when I "optimized" the way it was fetching new sources when resolving dependencies. The fix is that even if we don't need to refresh or fetch a source, we still need to report the packages we know it contains. Also made the Archive and ArchiveInfo implement Comparable and defer their comparison to the one of Package. This way we can sort the archives in the install window. Change-Id: Ic3b39e49e8143541b19b00de09468c1b3f01b0d7
* | merge from tools_r8The Android Open Source Project2010-10-276-21/+163
|\ \ | |/ | | | | Change-Id: I90eeb2def2e3d3f0ee6f34b0a3f710f966808a7a
| * Merge "ADT: support synthetic parent chains in attrs_manifest.xml" into tools_r8Raphael Moll2010-10-276-21/+163
| |\
| | * ADT: support synthetic parent chains in attrs_manifest.xmlRaphael Moll2010-10-276-21/+163
| | | | | | | | | | | | | | | | | | SDK Bug: 3125910 Change-Id: I00450b13d10cbe4f32cbfbd6e1945985b599920f
* | | Merge "Select element surrounding caret when switching from editor"Tor Norbye2010-10-275-21/+122
|\ \ \
| * | | Select element surrounding caret when switching from editorTor Norbye2010-10-275-21/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you edit the XML, and then switch back to the visual editor, this changeset will cause the element surrounding the caret (if any) to be selected in the visual editor. Change-Id: I1f03856b3b3946fe23d6e654773ee4318d0d56ed
* | | | merge from tools_r8The Android Open Source Project2010-10-272-6/+2
|\ \ \ \ | |/ / / |/| / / | |/ / Change-Id: I8792be345899be48cbe7c22f386f09fd4aa13691
| * | Merge "Fix adb location in ant rules." into tools_r8Xavier Ducrohet2010-10-272-6/+2
| |\ \ | | |/ | |/|
| | * Fix adb location in ant rules.Xavier Ducrohet2010-10-272-6/+2
| |/ | | | | | | Change-Id: Ia8188de0b8af0ec4474f5c4ca2cec294c077e03f
* | Merge "Warp to source editor on widget double click"Tor Norbye2010-10-273-1/+66
|\ \
| * | Warp to source editor on widget double clickTor Norbye2010-10-273-1/+66
| | | | | | | | | | | | | | | | | | | | | | | | Update mouse handler such that a double click will look up the corresponding XML element, front the XML source editor and select the text range (scrolling if necessary) to reveal the corresponding tag. Change-Id: Iaa3d6f845c3fea190c304a07fab07314baa3f638