OSDN Git Service

ADT/GLE: Cleaned up the open/replace file process in the GLE and the config composite
authorXavier Ducrohet <xav@android.com>
Fri, 8 Jan 2010 01:49:37 +0000 (17:49 -0800)
committerXavier Ducrohet <xav@android.com>
Fri, 8 Jan 2010 04:25:44 +0000 (20:25 -0800)
commitaa58f6c0cc7e6442bc2980e379fbf4595a011d7d
tree52747fa4b14d9747eb7161942b85aa055df1ac50
parent5a5e30a49ae8ac966650d013359f8b7c13b63d0b
ADT/GLE: Cleaned up the open/replace file process in the GLE and the config composite

The GLE and the config composite must handle 3 cases:
- new file opened following the creation of the editor
- replacement file when the user opens a different version of a layout
  that's already opened. The editor stays and switch to the new file.
- replacement file whne the user change the configuration and a new
  file that better matches the config is automicatlly opened.

Additionally, the editor/config composite must handle files being
opened while the SDK or the file's project's target are not yet
loaded.

File change or change in the SDK/Target must attempts to keep the
config/theme selection as close as possible as the previous state
while still remaining compatible with the new file/sdk/target.

Also removed the duplicate ITargetChangeListener, by making the
one in AndroidEditor optional (constructor flag), so that the
one in GraphicalLayoutEditor/Part is the only one used in the GLE
(it gives us more control on the order in which the code previously
executed by both listeners is now executed).

Also split the themes and locales updates as they happen on
different triggers.

Change-Id: If6d73bbe8af11cd221fb7830a37ffcc163135fc4
eclipse/changes.txt
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/AndroidEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/IGraphicalLayoutEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/configuration/ConfigurationComposite.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle1/GraphicalLayoutEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java