aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse/plugins/com.android.ide.eclipse.adt
Commit message (Collapse)AuthorAgeFilesLines
* Layoutlib API: updated API for insert/move/remove child.Xavier Ducrohet2010-12-011-3/+2
| | | | | | Also added some new SceneStatus enums. Change-Id: I225c58201d81cb1109d1d533fea48b6eacb2e286
* Merge "ADT: The image given to layoutlib now shares data with ImageData"Xavier Ducrohet2010-12-013-79/+81
|\
| * ADT: The image given to layoutlib now shares data with ImageDataXavier Ducrohet2010-11-303-79/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We now create a custom BufferedImage that also includes a reusable ImageData to generate SWT images. While there is still the AWT to SWT conversion, at least most buffers aren't re-allocated every time during animation. The only new allocation is the one done in the Image constructor to pass the ImageData content to the native image object. This also fixes the tearing issue introduced in the previous commit by calling ImageOverlay.setImage from the animation listener callback. This should not be done in the UI thread runnable as each rendering reuse the same bitmap. When the animation listener callback returns, the image will be reused for a new rendering so it's content will change. Also fixes the windows rendering by computing the proper band offset based on the SWT palette Data. Change-Id: Id57a3696bd92441271f6bee9681edefd12140b02
* | Merge "ADT: fix java/class name mismatch."Raphael Moll2010-11-301-0/+0
|\ \
| * | ADT: fix java/class name mismatch.Raphael Moll2010-11-301-0/+0
| | | | | | | | | | | | Change-Id: Id0e539be1873904245f50b3bcd861f171360a990
* | | Merge "ADT: cleanup RenamePackage action."Raphael Moll2010-11-304-226/+291
|\ \ \ | |_|/ |/| |
| * | ADT: cleanup RenamePackage action.Raphael Moll2010-11-264-226/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | Move it to the refactoring package. Split action code from refactoring code. No change in functionality nor invocation (via context menu project > Android Tools.) Change-Id: Ieec945b37fdd33d497bf745d207eb5d6b5445d9f
* | | ADT/Layoutlib: New API to let the caller instantiate the bitmap.Xavier Ducrohet2010-11-304-10/+106
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | This allows us to use a bitmap more compatible with SWT. In ADT's case, because the bitmap needs to be converted to SWT before being displayed, we create a BufferedImage using a byte[] instead of a int[] so that we can simply do an array copy. Also, we reuse the generated BufferedImage unless the size changed, which lets us see less GC during animation playback. Change-Id: I0062a4f4442ff6469cf0ad4f501c1fbe8c719400
* | Move WST doc to sdk/docs.Raphael Moll2010-11-301-181/+0
| | | | | | | | Change-Id: I53d7838b557da43a9194ddb13ec1bcd0f1119a36
* | ADT string refactoring: replace in all files.Raphael Moll2010-11-305-101/+452
| | | | | | | | | | | | | | | | | | | | When doing an extract string either from Java or XML: - can scan/replace in all other Java files. - can scan/replace in all other XML files. - in Java, also replace in assignements. - in XML, also replace existing string name if already defined. Change-Id: Ifeef5fd444c2c18b9c071955b8e8567d6515ea95
* | Replace reflection with Sdk.makeRelativeToTor Norbye2010-11-301-27/+2
| | | | | | | | | | | | | | | | Replace reflection-based invocation of IPath.makeRelativeTo (which is not available in Eclipse 3.4) with usage of Sdk.makeRelativeTo, our own copy of the equivalent code. Change-Id: If67d985b96b845d85cf7fc13d47e9adeee49e8a8
* | Merge "The rendering target mode should be preserved across IDE sessions"Tor Norbye2010-11-301-3/+59
|\ \
| * | The rendering target mode should be preserved across IDE sessionsTor Norbye2010-11-301-3/+59
| | | | | | | | | | | | | | | | | | | | | | | | This changeset fixes the bug where the rendering target is not preserved across IDE sessions the way the other configuration settings seem to be. Change-Id: I56fc82b1de18c162f62e80d1ba96b54d697b2607
* | | ADT: more animation stuff.Xavier Ducrohet2010-11-292-9/+47
| | | | | | | | | | | | Change-Id: I020342a4fe205161328f22e9dabb0b03343677b5
* | | Rename some layout editor classesTor Norbye2010-11-2935-135/+140
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset contains only renaming of some classes (and a couple of >100 column adjustments), no semantic changes. The name changes are: BaseView => BaseViewRule BaseLayout => BaseLayoutRule ScaleInfo => CanvasTransform CanvasSelection => SelectionItem PropertySheetPage2 => PropertySheetPage OutlinePage2 => OutlinePage Change-Id: I14d8c711b12154f4fcb2169129fd553e31fdab84
* | Merge "ADT: rework extract string refactoring."Raphael Moll2010-11-293-200/+494
|\ \
| * | ADT: rework extract string refactoring.Raphael Moll2010-11-293-200/+494
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This updates the code that inserts new <string> elements in a <resources> XML, replacing my micro-XML stream-oriented parser by one based on the WST SSE region model. Also added a mini doc to explain the WST region model, since there's no doc anywhere as far as I can see. I choose to place this ad-hoc doc where I need it rather than in a generic place -- it's not a generic doc, more a reminder of the API. Change-Id: Icd39390c4124ce0ec21322ff223390ac4a06f431
* | | ADT: Animation preparation.Xavier Ducrohet2010-11-294-4/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update layoutlib API to work better with the new scene locking mechanism (for concurrent renderings), new error types in SceneResult, and updated Animation listener. ADT changes to record the view object in CanvasViewInfo, and the current LayoutScene in ViewHierarchy. Added a test menu item to start an animation. This is temporary and will be fixed later. Change-Id: I67df2d116afdfd23c093e4645d4a0f99695c5d95
* | | Merge "Extract layout constants into a separate constants class"Tor Norbye2010-11-2918-81/+150
|\ \ \
| * | | Extract layout constants into a separate constants classTor Norbye2010-11-2818-81/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine the constants in BaseView and a LayoutConstants class over in the internal packages into a new LayoutConstants class, and reference these constants elsewhere (statically imported). This was suggested by in the feedback to review #18971. Change-Id: I40b76f8f6045c34a98f7a2363f96d2942360d1f3
* | | | Merge "Add unit test configuration for moreUnit"Tor Norbye2010-11-291-0/+4
|\ \ \ \ | |/ / / |/| | |
| * | | Add unit test configuration for moreUnitTor Norbye2010-11-241-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Eclipse doesn't have a builtin mechanism to jump between a class and its test, as well as a way to run tests associated with a given class. There is however a plugin for this, "moreUnit". Our projects have split off our unit tests in a separate project, which requires some per-project configuration to tell moreUnit where to look for tests. This information has to live with the project rather than in my workspace, so I'm checking in the configuration file - it is harmless if you don't have moreUnit but useful if you do. Change-Id: Id29c46e2eaa89f2ad530c2b24700db28cc823b3b
* | | Fix build. Wrong import package!Tor Norbye2010-11-281-1/+1
| | | | | | | | | | | | | | | | | | Fix build. Wrong import package! Change-Id: Id96450a7f5553c88d0d5c0996ff5c378ea03bbc3
* | | Show images during canvas dragsTor Norbye2010-11-2810-43/+279
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you drag in the canvas, show a drag image for the view being dragged. The drag image is using 30% translucency such that it does not obscure the drag feedback below it. We're grabbing the image data right out of the rendered scene and just copying out the rectangles for the bounds of each selected item. This has to take the canvas zoom into effect too. While in the zoom code I modified the Zoom In and Zoom Out buttons to only zoom by a factor of 20% rather than 100%. I cleaned up the Pair class slightly; in an earlier version of this fix I was using it to pass back two results from the rectangle painting function; I don't do that anymore but the Pair might as well be cleaned up. (By the way, as suggested in review #19035 I rewrote the FIXME comment related to resource lookup and put it in this CL rather than revising the other one.) Change-Id: Iabe6e29c4073252f5046e3c26b56f4e7674a3f3a
* | Replace IPath.makeRelativeTo call with reflectionTor Norbye2010-11-231-1/+27
| | | | | | | | | | | | | | | | I broke the build because on Eclipse 3.4 there is no makeRelativeTo method on IPath. This replaces that call with reflection. This won't work on 3.4, but it's a quick fix for the broken build. Change-Id: Ia917cf5a745f76bbb96f59fae93e2a4fc4f5f900
* | Open included layout on double clickTor Norbye2010-11-237-11/+224
|/ | | | | | | | | On double click, if the clicked area originates from an <include>'ed XML file, open the included layout in the editor. Also opens files in the @android: namespace if available, for example if you inculde @android:layout/select_dialog_multichoice. Change-Id: I215c411257717f7b97e7b0ee1d5498c318cdb04d
* ADT: ensure <application> is last in manifest.Raphael Moll2010-11-2311-130/+231
| | | | | | | | | | | | | | | | | | | | | | ADT descriptors have no notion of XML ordering. We modify the concept of "mandatory" descriptor to have normal mandatory descriptors versus "mandatory last" ones. ("mandatory" elements are virtual reserved slots that are always present in the UiModel even if they have no real counterpart in the XML model. These elements ensure they can be manipulated in the UI even before their XML is created.) Then we try our best to ensure the "last" ones remain at the end of the UiNode model. There are 2 cases: - in UiElementNode, when constructing the UINode model when parsing an existing XML model, we try to reorder the nodes at the end if possible. - in UiActions, when adding a new element to the UiModel, we try to place it before the first "mandatory last" element. SDK Bug 3197310 Change-Id: I6a7d9502a95ebe92ff82e07f3f3249a0d25c2154
* Merge "Refactor selection painting to fix highlighting of included views"Tor Norbye2010-11-237-196/+94
|\
| * Refactor selection painting to fix highlighting of included viewsTor Norbye2010-11-227-196/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset moves the painting of selection bounds and selection hints out of the view rules and into the core IDE. The reason for this is that the visual appearance of the selection shouldn't be up to each rule; for one thing the selection highlight should be consistent and not vary from view to view (and in fact there was only a single implementation of the paint selection method among the view rules), and for another the view rules are in theory sharable among IDEs whereas the selection appearance is going to be IDE specific. There was also painting of "hints" in the RelativeLayout; rather than having the visual appearance of this dictated by the rule, this is also moved into the IDE such that the rules only provide the hint text and the hints are displayed by the IDE itself. The above refactoring also fixes selection feedback for <include>'ed views, which were not visually selectable because there was no corresponding ViewRule, so nobody to paint selection. With these changes selection painting is now independent of the rules. Change-Id: I22dd926102128634a443b8bafb54d4764f1eda41
* | Merge "Fix live manipulation of <include> elements"Tor Norbye2010-11-232-5/+23
|\ \
| * | Fix live manipulation of <include> elementsTor Norbye2010-11-222-5/+23
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset fixes bugs related to dragging included views around in the canvas: First, the <include> tag would get rewritten to <null>. This happened because the layout editor treats the FQCN and the XML node name as equivalent, but in the case of the include tag the FQCN was set to null instead of "include". Second, the "layout" attribute would not get copied because it is NOT in the Android namespace, and the code to copy attributes ended up with an empty-string namespace which was not handled correctly. Third, when copied the "layout" attribute would end up with the namespace "ns:" because the code to create attribute nodes always created namespaced attribute nodes rather than a plain attribute node when the namespace is null. Change-Id: Ibd34212517615aa8ec79abe14bca765cdca525f6
* | Fix potential NPE when closing Eclipse/ADTRaphael Moll2010-11-221-1/+6
|/ | | | | | | | | | | Seems like it was trying to finish a build and closing the plugin ADT at the same time. How's that even possible? In any case I've never seen that before and I was in debug mode, so I bet it's a rare race condition. SDK Bug 3222178 Change-Id: I28a9bdfcbe56e2a6b73eafb5cadea611c5177f7f
* Merge "Fix SwtUtils conversion for no-alpha case."Raphael Moll2010-11-191-12/+66
|\
| * Fix SwtUtils conversion for no-alpha case.Raphael Moll2010-11-191-12/+66
| | | | | | | | Change-Id: I275b526670ca6e60cfc4f8749631dff2ef240b96
* | GLE: Remove obsolete IGraphicalLayoutEditor interface.Raphael Moll2010-11-196-218/+121
| | | | | | | | Change-Id: I96f929ce9386e88f80d15195b2ff6a498e374554
* | ADT: support for editing embedded layouts.Xavier Ducrohet2010-11-193-4/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a very first rough changeset. The context in which the layout is edited is hardcoded until we have the UI for it. The basics are the following: - if there's a context, don't pass the parser on top of the model to the layout lib. - instead create a KXml based parser that will return the model-based parser when queried for a custom parser (if the layout name matches the file being edited). Change-Id: I2d106def9c64e82ab50c8fae96cb050338422a85
* | ADT/Layoutlib: update API to control how layout expands.Xavier Ducrohet2010-11-191-1/+15
|/ | | | | | | | | | | | | | Previous API was a single on/off to let the layouts expand at render time depending on how much space they needed. The new API can now control expansion is horizontal and/or vertical (or not at all) Basic implementation in the editor, with a manual detect of "ScrollView" as top element. We should make the ViewRule handle this somehow. Change-Id: Idc503bc0d1d3df98fbf01cc84625952ca55a8afb
* Add per-view custom initialization logicTor Norbye2010-11-1934-180/+1347
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset adds support for adding custom-logic to initialize views, both to add children and default attributes and to customize layout attributes when added to a new parent. First, there is a new "onCreate" hook which is called to notify a view rule that an instance of its corresponding view has been created. This lets the ViewRule perform custom initialization of the object. The ViewRule is told what type of insertion occurred, such that it can distinguish between a newly created view, a view that is the result of a copy/paste, and a view that is part of a move operation. The changeset adds a number of new ViewRules which take advantage of this: - A TabHost rule creates the various skeleton children that are required, such as a TabWidget child with id @android:id/tabs and a FrameLayout child with id @android:id/tabcontent - A DialerFilter rule creates the mandatory EditText children ("hint" and "primary") - The HorizontalScrollView rule creates a horizontal LinearLayout child - The ImageButton and ImageViewButtons initialize the "src" attribute to a sample image - The MapViewRule initializes the apiKey attribute In addition, views are also notified when a new view is added as a child, such that they can perform additional customizations, in the form of an "onInsert" event. The most important application of this is LinearLayoutRule, which uses this to set reasonable defaults for the layout_width and layout_height parameters. It uses metadata (which is currently built into ADT but would ideally migrate into our XML config files) to determine whether a given child prefers to grow horizontally, grow vertically, both, or neither, depending on the surrounding parent context. For example, an EditText will default to filling the parent width if it is in a vertical LinearLayout, but it will not grow vertically in a horizontal linear layout. And so on. Various other rules also use the onInsert event to tweak children attributes. A ScrollView will for example always initialize its single child to match parent. Views can now also add plain menu items into the context menu, and the TableViewRule adds one such action: "Add Row", which appends a new row into the table. The Palette Preview code also invokes these creation hooks, such that if you for example drag a DialerFilter it can properly render since the mandatory children are created up front. This required various changes to the preview code to be able to handle XML edits by the rules. Finally, this changeset includes various other misc changes that I performed at the same time: - Removed SWT dependency from the ViewRule classes (SWT Rectangle use in Rect) - Fixed AbsoluteLayout unit test (issue 3203560) - Fixed positioning of the preview outline in LinearLayout when only one of the dimensions are clipped due to a smaller target layout Change-Id: I5956fe4e7a31a20b8dd2f9d9b0c1f90e2f75d68a
* Merge "Cleanup and comment the refresh code in GLE2."Raphael Moll2010-11-181-30/+16
|\
| * Cleanup and comment the refresh code in GLE2.Raphael Moll2010-11-181-30/+16
| | | | | | | | Change-Id: I95a922c463992600edfc8c25edfc688dc38f79bd
* | Merge "Cleanup GRE preload."Raphael Moll2010-11-182-14/+0
|\ \ | |/
| * Cleanup GRE preload.Raphael Moll2010-11-182-14/+0
| | | | | | | | | | | | | | | | GRE used to preload the groovy BaseView rule to improve the first selection speed. We don't need that now that we switched to a non-groovy engine. Change-Id: Ib29272f28df6285137d62c45441cd9ac72efd10f
* | Remove non-api references from AttrsXmlParser.Raphael Moll2010-11-182-8/+8
|/ | | | Change-Id: Ic139e6f942e835dda4b7ef0303556aef014a60d3
* Merge "ADT/GLE: call LayoutScene.dispose() when needed."Xavier Ducrohet2010-11-182-47/+54
|\
| * ADT/GLE: call LayoutScene.dispose() when needed.Xavier Ducrohet2010-11-182-47/+54
| | | | | | | | Change-Id: I95819d95827164d3e57dc179d3f321d26a649599
* | Remove AdtPlugin dependency from AttrsXmlParser.Raphael Moll2010-11-174-29/+54
|/ | | | | | | | | | | | The AdtPluin was used just for logging. Instead the AttrsXmlParser takes an ILogger (AdtPlug implements ILogger and can be used directly in unit tests too). For unit tests there is a new StdSdkLog convenience class that prints to stdout/stderr (formerly MockStdLogger from the Sdk Manager was doing that.) Change-Id: I658af61d04efb19ad6e3bf9c0bf471452372885a
* ADT/GLE2: Add callback before the rendering target changes.Xavier Ducrohet2010-11-173-67/+137
| | | | Change-Id: If02fd18c39b06042615735b55190e9f03fef5b19
* Merge "ADT/GLE: Platform selection when rendering layouts."Xavier Ducrohet2010-11-173-339/+513
|\
| * ADT/GLE: Platform selection when rendering layouts.Xavier Ducrohet2010-11-163-339/+513
| | | | | | | | Change-Id: Iabbd49cdd52419b947b83fb84f9fb3a5d4576471
* | ADT: Extract AttrsXmlParser in com.android.ide.commonRaphael Moll2010-11-1616-27/+30
|/ | | | | | | | | | | | | | | This is a pure-refactoring CL that moves AttrsXmlParser into an ide.common.resources.platform package. In a next CL, the parser should be cleanup to remove some references to external classes (e.g. adtplugin is only used for logging so it will become an ILog reference.) The goal of the resources.platform package is to allow other IDEs to parse the manifest schema. An utility class would be provided here that would then be used by AndroidTargetParser. The rest of the data parsing (widgets, resources, etc.) is a non-goal. Maybe later. Change-Id: I4fb8eb5d168b75ef8bfab57d0b2883aea85b6167