aboutsummaryrefslogtreecommitdiffstats
path: root/eclipse
diff options
context:
space:
mode:
authorRaphael <raphael@google.com>2012-02-21 13:01:03 -0800
committerRaphael <raphael@google.com>2012-02-21 13:32:25 -0800
commitecd69dd768fc25aeb12791a477c44e04f007d5f4 (patch)
tree934f0805d63b44acd7cc007c98f1f912c64801b0 /eclipse
parentc068e0e4646318364119eb17bff596866faa3a36 (diff)
downloadsdk-ecd69dd768fc25aeb12791a477c44e04f007d5f4.zip
sdk-ecd69dd768fc25aeb12791a477c44e04f007d5f4.tar.gz
sdk-ecd69dd768fc25aeb12791a477c44e04f007d5f4.tar.bz2
ADT fix save on layout configuration change.
When a layout is opened and its configuration is changed, the new delegate layout wasn't properly saving the layout before changing files. This is due to another instance of the delegate code calling a method on the delegate whereas it should have called a method with the same exact name on the editor. To reduce this confusion, this CL adds a 'delegate' prefix to methods which are common in the CommonXmlEditor and the delegates. At the expense of being a bit more verbose it makes it clearer which method is being invoked. Change-Id: I34e620a9d25272fe75dab54279161b04a961a598
Diffstat (limited to 'eclipse')
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationEditorDelegate.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorEditorDelegate.java8
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlDelegate.java22
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlEditor.java26
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableEditorDelegate.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java55
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java4
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java2
-rwxr-xr-xeclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java2
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuEditorDelegate.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/otherxml/OtherXmlEditorDelegate.java8
-rw-r--r--eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesEditorDelegate.java8
12 files changed, 80 insertions, 79 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationEditorDelegate.java
index a606e6c..bd1fa3d 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/animator/AnimationEditorDelegate.java
@@ -69,7 +69,7 @@ public class AnimationEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
/* Disabled for now; doesn't work quite right
try {
addPage(new AnimatorTreePage(this));
@@ -86,14 +86,14 @@ public class AnimationEditorDelegate extends CommonXmlDelegate {
* @param xmlDoc The XML document, if available, or null if none exists.
*/
@Override
- public void xmlModelChanged(Document xmlDoc) {
+ public void delegateXmlModelChanged(Document xmlDoc) {
Element rootElement = xmlDoc.getDocumentElement();
if (rootElement != null) {
mRootTag = rootElement.getTagName();
}
// create the ui root node on demand.
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
if (mRootTag != null
&& !mRootTag.equals(getUiRootNode().getDescriptor().getXmlLocalName())) {
@@ -126,7 +126,7 @@ public class AnimationEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The manifest UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
ElementDescriptor descriptor;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorEditorDelegate.java
index 3fc1552..2398486 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/color/ColorEditorDelegate.java
@@ -65,7 +65,7 @@ public class ColorEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
/* Disabled for now; doesn't work quite right
try {
addPage(new ColorTreePage(this));
@@ -77,16 +77,16 @@ public class ColorEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void xmlModelChanged(Document xmlDoc) {
+ public void delegateXmlModelChanged(Document xmlDoc) {
// create the ui root node on demand.
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
Element rootElement = xmlDoc.getDocumentElement();
getUiRootNode().loadFromXmlNode(rootElement);
}
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The manifest UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
ElementDescriptor descriptor;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlDelegate.java
index 36e51e7..7c454fb 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlDelegate.java
@@ -107,7 +107,7 @@ public abstract class CommonXmlDelegate {
}
/** Called to compute the initial {@code UiRootNode}. */
- public abstract void initUiRootNode(boolean force);
+ public abstract void delegateInitUiRootNode(boolean force);
/**
* Returns true, indicating the "save as" operation is supported by this editor.
@@ -119,16 +119,16 @@ public abstract class CommonXmlDelegate {
/**
* Create the various form pages.
*/
- public abstract void createFormPages();
+ public abstract void delegateCreateFormPages();
- public void postCreatePages() {
+ public void delegatePostCreatePages() {
// pass
}
/**
* Changes the tab/title name to include the project name.
*/
- public void setInput(IEditorInput input) {
+ public void delegateSetInput(IEditorInput input) {
if (input instanceof FileEditorInput) {
FileEditorInput fileInput = (FileEditorInput) input;
IFile file = fileInput.getFile();
@@ -141,13 +141,13 @@ public abstract class CommonXmlDelegate {
*
* @param xml_doc The XML document, if available, or null if none exists.
*/
- public abstract void xmlModelChanged(Document xml_doc);
+ public abstract void delegateXmlModelChanged(Document xml_doc);
- public void pageChange(int newPageIndex) {
+ public void delegatePageChange(int newPageIndex) {
// pass
}
- public void postPageChange(int newPageIndex) {
+ public void delegatePostPageChange(int newPageIndex) {
// pass
}
/**
@@ -160,7 +160,7 @@ public abstract class CommonXmlDelegate {
* Here we just need to tell the graphical editor that the model has
* been saved.
*/
- public void doSave(IProgressMonitor monitor) {
+ public void delegateDoSave(IProgressMonitor monitor) {
// pass
}
@@ -168,7 +168,7 @@ public abstract class CommonXmlDelegate {
* Tells the editor to start a Lint check.
* It's up to the caller to check whether this should be done depending on preferences.
*/
- public Job runLint() {
+ public Job delegateRunLint() {
return getEditor().startLintJob();
}
@@ -176,7 +176,7 @@ public abstract class CommonXmlDelegate {
/**
* Returns the custom IContentOutlinePage or IPropertySheetPage when asked for it.
*/
- public Object getAdapter(Class<?> adapter) {
+ public Object delegateGetAdapter(Class<?> adapter) {
return null;
}
@@ -196,7 +196,7 @@ public abstract class CommonXmlDelegate {
* @return false since editors do not support automatically formatting XML
* affected by GUI changes unless they explicitly opt in to it.
*/
- public boolean supportsFormatOnGuiEdit() {
+ public boolean delegateSupportsFormatOnGuiEdit() {
return false;
}
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlEditor.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlEditor.java
index 0790d6e..3ddc115 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlEditor.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/common/CommonXmlEditor.java
@@ -195,14 +195,14 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
* all data to the XML model and then having the Structured XML Editor
* save the XML.
* <p/>
- * Here we just need to tell the graphical editor that the model has
+ * Here we just need to tell the delegate that the model has
* been saved.
*/
@Override
public void doSave(IProgressMonitor monitor) {
super.doSave(monitor);
if (mDelegate != null) {
- mDelegate.doSave(monitor);
+ mDelegate.delegateDoSave(monitor);
}
}
@@ -225,7 +225,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
@Override
protected void createFormPages() {
if (mDelegate != null) {
- mDelegate.createFormPages();
+ mDelegate.delegateCreateFormPages();
}
}
@@ -234,7 +234,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
super.postCreatePages();
if (mDelegate != null) {
- mDelegate.postCreatePages();
+ mDelegate.delegatePostCreatePages();
}
}
@@ -266,7 +266,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
super.setInput(input);
assert mDelegate != null;
if (mDelegate != null) {
- mDelegate.setInput(input);
+ mDelegate.delegateSetInput(input);
}
}
@@ -274,7 +274,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
public void setInputWithNotify(IEditorInput input) {
super.setInputWithNotify(input);
if (mDelegate instanceof LayoutEditorDelegate) {
- ((LayoutEditorDelegate) mDelegate).setInputWithNotify(input);
+ ((LayoutEditorDelegate) mDelegate).delegateSetInputWithNotify(input);
}
}
@@ -286,14 +286,14 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
@Override
protected void xmlModelChanged(Document xml_doc) {
if (mDelegate != null) {
- mDelegate.xmlModelChanged(xml_doc);
+ mDelegate.delegateXmlModelChanged(xml_doc);
}
}
@Override
protected Job runLint() {
if (mDelegate != null) {
- return mDelegate.runLint();
+ return mDelegate.delegateRunLint();
}
return null;
}
@@ -304,7 +304,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
@Override
public Object getAdapter(@SuppressWarnings("rawtypes") Class adapter) {
if (mDelegate != null) {
- Object value = mDelegate.getAdapter(adapter);
+ Object value = mDelegate.delegateGetAdapter(adapter);
if (value != null) {
return value;
}
@@ -317,20 +317,20 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
@Override
protected void pageChange(int newPageIndex) {
if (mDelegate != null) {
- mDelegate.pageChange(newPageIndex);
+ mDelegate.delegatePageChange(newPageIndex);
}
super.pageChange(newPageIndex);
if (mDelegate != null) {
- mDelegate.postPageChange(newPageIndex);
+ mDelegate.delegatePostPageChange(newPageIndex);
}
}
@Override
public void initUiRootNode(boolean force) {
if (mDelegate != null) {
- mDelegate.initUiRootNode(force);
+ mDelegate.delegateInitUiRootNode(force);
}
}
@@ -345,7 +345,7 @@ public class CommonXmlEditor extends AndroidXmlEditor implements IShowEditorInpu
@Override
public boolean supportsFormatOnGuiEdit() {
if (mDelegate != null) {
- return mDelegate.supportsFormatOnGuiEdit();
+ return mDelegate.delegateSupportsFormatOnGuiEdit();
}
return super.supportsFormatOnGuiEdit();
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableEditorDelegate.java
index e9e0674..d5234bd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/drawable/DrawableEditorDelegate.java
@@ -71,7 +71,7 @@ public class DrawableEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
/* Disabled for now; doesn't work quite right
try {
addPage(new DrawableTreePage(this));
@@ -83,13 +83,13 @@ public class DrawableEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void xmlModelChanged(Document xmlDoc) {
+ public void delegateXmlModelChanged(Document xmlDoc) {
Element rootElement = xmlDoc.getDocumentElement();
if (rootElement != null) {
mRootTag = rootElement.getTagName();
}
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
if (mRootTag != null
&& !mRootTag.equals(getUiRootNode().getDescriptor().getXmlLocalName())) {
@@ -118,7 +118,7 @@ public class DrawableEditorDelegate extends CommonXmlDelegate {
}
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The manifest UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
ElementDescriptor descriptor;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
index 1c9ec1e..8d02bda 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/LayoutEditorDelegate.java
@@ -191,16 +191,16 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
/**
* Save the XML.
* <p/>
- * The actual save operation is done in the super class by committing
- * all data to the XML model and then having the Structured XML Editor
- * save the XML.
+ * Clients must NOT call this directly. Instead they should always
+ * call {@link CommonXmlEditor#doSave(IProgressMonitor)} so that th
+ * editor super class can commit the data properly.
* <p/>
* Here we just need to tell the graphical editor that the model has
* been saved.
*/
@Override
- public void doSave(IProgressMonitor monitor) {
- super.doSave(monitor);
+ public void delegateDoSave(IProgressMonitor monitor) {
+ super.delegateDoSave(monitor);
if (mGraphicalEditor != null) {
mGraphicalEditor.doSave(monitor);
}
@@ -210,7 +210,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* Create the various form pages.
*/
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
try {
// get the file being edited so that it can be passed to the layout editor.
IFile editedFile = null;
@@ -254,7 +254,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
}
@Override
- public void postCreatePages() {
+ public void delegatePostCreatePages() {
// Optional: set the default page. Eventually a default page might be
// restored by selectDefaultPage() later based on the last page used by the user.
// For example, to make the last page the default one (rather than the first page),
@@ -266,7 +266,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* Change the tab/title name to include the name of the layout.
*/
@Override
- public void setInput(IEditorInput input) {
+ public void delegateSetInput(IEditorInput input) {
handleNewInput(input);
}
@@ -274,7 +274,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* (non-Javadoc)
* @see org.eclipse.ui.part.EditorPart#setInputWithNotify(org.eclipse.ui.IEditorInput)
*/
- public void setInputWithNotify(IEditorInput input) {
+ public void delegateSetInputWithNotify(IEditorInput input) {
handleNewInput(input);
}
@@ -289,29 +289,30 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
return;
}
- // save the current editor input.
- doSave(new NullProgressMonitor());
+ // Save the current editor input. This must be called on the editor itself
+ // since it's the base editor that commits pending changes.
+ getEditor().doSave(new NullProgressMonitor());
- // get the current page
+ // Get the current page
int currentPage = getEditor().getActivePage();
- // remove the pages, except for the graphical editor, which will be dynamically adapted
+ // Remove the pages, except for the graphical editor, which will be dynamically adapted
// to the new model.
// page after the graphical editor:
int count = getEditor().getPageCount();
for (int i = count - 1 ; i > mGraphicalEditorIndex ; i--) {
getEditor().removePage(i);
}
- // pages before the graphical editor
+ // Pages before the graphical editor
for (int i = mGraphicalEditorIndex - 1 ; i >= 0 ; i--) {
getEditor().removePage(i);
}
- // set the current input. We're in the delegate, the input must
+ // Set the current input. We're in the delegate, the input must
// be set into the actual editor instance.
getEditor().setInputWithNotify(editorInput);
- // re-create or reload the pages with the default page shown as the previous active page.
+ // Re-create or reload the pages with the default page shown as the previous active page.
getEditor().createAndroidPages();
getEditor().selectDefaultPage(Integer.toString(currentPage));
@@ -324,7 +325,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
public void refreshXmlModel() {
Document xmlDoc = mUiDocRootNode.getXmlDocument();
- initUiRootNode(true /*force*/);
+ delegateInitUiRootNode(true /*force*/);
mUiDocRootNode.loadFromXmlNode(xmlDoc);
// Update the model first, since it is used by the viewers.
@@ -342,9 +343,9 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* @param xml_doc The XML document, if available, or null if none exists.
*/
@Override
- public void xmlModelChanged(Document xml_doc) {
+ public void delegateXmlModelChanged(Document xml_doc) {
// init the ui root on demand
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
mUiDocRootNode.loadFromXmlNode(xml_doc);
@@ -371,13 +372,13 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* affected by GUI changes
*/
@Override
- public boolean supportsFormatOnGuiEdit() {
+ public boolean delegateSupportsFormatOnGuiEdit() {
return true;
}
@Override
- public Job runLint() {
- Job job = super.runLint();
+ public Job delegateRunLint() {
+ Job job = super.delegateRunLint();
if (job != null) {
job.addJobChangeListener(new JobChangeAdapter() {
@@ -401,7 +402,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
* Returns the custom IContentOutlinePage or IPropertySheetPage when asked for it.
*/
@Override
- public Object getAdapter(Class<?> adapter) {
+ public Object delegateGetAdapter(Class<?> adapter) {
// For the outline, force it to come from the Graphical Editor.
// This fixes the case where a layout file is opened in XML view first and the outline
// gets stuck in the XML outline.
@@ -423,11 +424,11 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
}
// return default
- return super.getAdapter(adapter);
+ return super.delegateGetAdapter(adapter);
}
@Override
- public void pageChange(int newPageIndex) {
+ public void delegatePageChange(int newPageIndex) {
if (getEditor().getCurrentPage() == getEditor().getTextPageIndex() &&
newPageIndex == mGraphicalEditorIndex) {
// You're switching from the XML editor to the WYSIWYG editor;
@@ -443,7 +444,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
}
}
- super.pageChange(newPageIndex);
+ super.delegatePageChange(newPageIndex);
if (mGraphicalEditor != null) {
if (newPageIndex == mGraphicalEditorIndex) {
@@ -535,7 +536,7 @@ public class LayoutEditorDelegate extends CommonXmlDelegate
}
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The root UI node is always created, even if there's no corresponding XML node.
if (mUiDocRootNode == null || force) {
// get the target data from the opened file (and its project)
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
index 236d5fd..7c8cc81 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
@@ -168,7 +168,7 @@ import java.util.Set;
* <p/>
* This part is also an {@link ISelectionListener}. It listens to the site's selection
* service and thus receives selection changes from itself as well as the associated
- * outline and property sheet (these are registered by {@link LayoutEditorDelegate#getAdapter(Class)}).
+ * outline and property sheet (these are registered by {@link LayoutEditorDelegate#delegateGetAdapter(Class)}).
*
* @since GLE2
*/
@@ -826,7 +826,7 @@ public class GraphicalEditorPart extends EditorPart
// recreate the ui root node always, this will also call onTargetChange
// on the config composite
- mEditorDelegate.initUiRootNode(true /*force*/);
+ mEditorDelegate.delegateInitUiRootNode(true /*force*/);
}
private IProject getProject() {
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
index 211296f..b097743 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/LayoutCanvas.java
@@ -306,7 +306,7 @@ public class LayoutCanvas extends Canvas {
// --- setup outline ---
// Get the outline associated with this editor, if any and of the right type.
Object outline = editorDelegate == null ? null :
- editorDelegate.getAdapter(IContentOutlinePage.class);
+ editorDelegate.delegateGetAdapter(IContentOutlinePage.class);
if (outline instanceof OutlinePage) {
mOutlinePage = (OutlinePage) outline;
}
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java
index 3939a60..ef1a17c 100755
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/OutlinePage.java
@@ -102,7 +102,7 @@ import java.util.Set;
/**
* An outline page for the layout canvas view.
* <p/>
- * The page is created by {@link LayoutEditorDelegate#getAdapter(Class)}. This means
+ * The page is created by {@link LayoutEditorDelegate#delegateGetAdapter(Class)}. This means
* we have *one* instance of the outline page per open canvas editor.
* <p/>
* It sets itself as a listener on the site's selection service in order to be
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuEditorDelegate.java
index 275d3a0..a55d6e4 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/menu/MenuEditorDelegate.java
@@ -74,7 +74,7 @@ public class MenuEditorDelegate extends CommonXmlDelegate {
* Create the various form pages.
*/
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
try {
getEditor().addPage(new MenuTreePage(getEditor()));
} catch (PartInitException e) {
@@ -91,7 +91,7 @@ public class MenuEditorDelegate extends CommonXmlDelegate {
* @param xml_doc The XML document, if available, or null if none exists.
*/
@Override
- public void xmlModelChanged(Document xml_doc) {
+ public void delegateXmlModelChanged(Document xml_doc) {
if (mUpdatingModel) {
return;
}
@@ -100,7 +100,7 @@ public class MenuEditorDelegate extends CommonXmlDelegate {
mUpdatingModel = true;
// init the ui root on demand
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
getUiRootNode().setXmlDocument(xml_doc);
if (xml_doc != null) {
@@ -135,7 +135,7 @@ public class MenuEditorDelegate extends CommonXmlDelegate {
* @param force if true, a new UiRootNode is recreated even if it already exists.
*/
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The root UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
Document doc = null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/otherxml/OtherXmlEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/otherxml/OtherXmlEditorDelegate.java
index e1e13b2..f6e23de 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/otherxml/OtherXmlEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/otherxml/OtherXmlEditorDelegate.java
@@ -69,7 +69,7 @@ public class OtherXmlEditorDelegate extends CommonXmlDelegate {
* Create the various form pages.
*/
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
try {
getEditor().addPage(new OtherXmlTreePage(getEditor()));
} catch (PartInitException e) {
@@ -83,9 +83,9 @@ public class OtherXmlEditorDelegate extends CommonXmlDelegate {
* @param xml_doc The XML document, if available, or null if none exists.
*/
@Override
- public void xmlModelChanged(Document xml_doc) {
+ public void delegateXmlModelChanged(Document xml_doc) {
// init the ui root on demand
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
getUiRootNode().loadFromXmlNode(xml_doc);
}
@@ -95,7 +95,7 @@ public class OtherXmlEditorDelegate extends CommonXmlDelegate {
* @param force if true, a new UiRootNode is recreated even if it already exists.
*/
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The root UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
Document doc = null;
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesEditorDelegate.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesEditorDelegate.java
index fa2b52d..6198fcd 100644
--- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesEditorDelegate.java
+++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/values/ValuesEditorDelegate.java
@@ -77,7 +77,7 @@ public class ValuesEditorDelegate extends CommonXmlDelegate {
* Create the various form pages.
*/
@Override
- public void createFormPages() {
+ public void delegateCreateFormPages() {
try {
getEditor().addPage(new ValuesTreePage(getEditor()));
} catch (PartInitException e) {
@@ -92,9 +92,9 @@ public class ValuesEditorDelegate extends CommonXmlDelegate {
* @param xml_doc The XML document, if available, or null if none exists.
*/
@Override
- public void xmlModelChanged(Document xml_doc) {
+ public void delegateXmlModelChanged(Document xml_doc) {
// init the ui root on demand
- initUiRootNode(false /*force*/);
+ delegateInitUiRootNode(false /*force*/);
getUiRootNode().setXmlDocument(xml_doc);
if (xml_doc != null) {
@@ -122,7 +122,7 @@ public class ValuesEditorDelegate extends CommonXmlDelegate {
* @param force if true, a new UiRootNode is recreated even if it already exists.
*/
@Override
- public void initUiRootNode(boolean force) {
+ public void delegateInitUiRootNode(boolean force) {
// The manifest UI node is always created, even if there's no corresponding XML node.
if (getUiRootNode() == null || force) {
ElementDescriptor resources_desc =