From cf42cc1545c7f105e7a91c64531962646d4ae00b Mon Sep 17 00:00:00 2001 From: Tor Norbye Date: Tue, 8 Feb 2011 19:13:12 -0800 Subject: [PATCH] Fix Extract as Include Two fixes for Extract as Include: (1) After extracting the view fragments from the source layout, save the layout file. This is necessary in order to make the "Show Included In" functionality work on the newly extracted fragment, since the include-finder which identifies candidates for inclusion is triggered by file saves, not buffer edits, and secondly even the Show Included In facility itself requires the outer buffer to be a saved file, not an edited buffer since the parser reads from disk. (2) Insert a space after the closing quote in the include string; this could lead to broken XML in some instances. Change-Id: I10ede72ef40dc0afaa93322637397245ac9a54ee --- .../adt/internal/editors/layout/gle2/ExtractIncludeAction.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExtractIncludeAction.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExtractIncludeAction.java index f4d31d754..d3ff090b5 100644 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExtractIncludeAction.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/ExtractIncludeAction.java @@ -57,6 +57,7 @@ import org.eclipse.jface.dialogs.InputDialog; import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.window.Window; import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.PartInitException; import org.eclipse.ui.ide.IDE; import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel; @@ -476,6 +477,7 @@ public class ExtractIncludeAction extends Action { sb.append("