### Eclipse Workspace Patch 1.0
#P org.eclipse.jdt.ui
Index: ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java,v
retrieving revision 1.161
diff -u -r1.161 JavaSourceViewerConfiguration.java
--- ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java 14 Jan 2009 10:39:32 -0000 1.161
+++ ui/org/eclipse/jdt/ui/text/JavaSourceViewerConfiguration.java 9 Nov 2010 17:27:07 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2009 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -427,8 +427,11 @@
* @since 3.2
*/
public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) {
- if (getEditor() != null)
- return new JavaCorrectionAssistant(getEditor());
+ if (getEditor() != null) {
+ JavaCorrectionAssistant assistant= new JavaCorrectionAssistant(getEditor());
+ assistant.setRestoreCompletionProposalSize(getSettings("quick_assist_proposal_size")); //$NON-NLS-1$
+ return assistant;
+ }
return null;
}
#P org.eclipse.jface.text
Index: src/org/eclipse/jface/text/quickassist/QuickAssistAssistant.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.jface.text/src/org/eclipse/jface/text/quickassist/QuickAssistAssistant.java,v
retrieving revision 1.12
diff -u -r1.12 QuickAssistAssistant.java
--- src/org/eclipse/jface/text/quickassist/QuickAssistAssistant.java 11 Sep 2008 11:58:25 -0000 1.12
+++ src/org/eclipse/jface/text/quickassist/QuickAssistAssistant.java 9 Nov 2010 17:27:07 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006, 2008 IBM Corporation and others.
+ * Copyright (c) 2006, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,6 +14,8 @@
import org.eclipse.core.commands.IHandler;
+import org.eclipse.jface.dialogs.IDialogSettings;
+
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IInformationControlCreator;
import org.eclipse.jface.text.ITextViewer;
@@ -192,6 +194,30 @@
}
/**
+ * Tells this assistant to open the proposal popup with the size
+ * contained in the given dialog settings and to store the control's last valid size in the
+ * given dialog settings.
+ *
+ * Note: This API is only valid if the information control implements
+ * {@link org.eclipse.jface.text.IInformationControlExtension3}. Not following this restriction
+ * will later result in an {@link UnsupportedOperationException}.
+ *
+ *
+ * The constants used to store the values are:
+ *
+ * - {@link ContentAssistant#STORE_SIZE_X}
+ * - {@link ContentAssistant#STORE_SIZE_Y}
+ *
+ *
+ *
+ * @param dialogSettings the dialog settings
+ * @since 3.7
+ */
+ public void setRestoreCompletionProposalSize(IDialogSettings dialogSettings) {
+ fQuickAssistAssistantImpl.setRestoreCompletionProposalSize(dialogSettings);
+ }
+
+ /**
* Callback to signal this quick assist assistant that the presentation of the
* possible completions has been stopped.
*/
#P org.eclipse.ui.editors
Index: src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java,v
retrieving revision 1.48
diff -u -r1.48 TextSourceViewerConfiguration.java
--- src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java 14 Apr 2010 17:52:28 -0000 1.48
+++ src/org/eclipse/ui/editors/text/TextSourceViewerConfiguration.java 9 Nov 2010 17:27:08 -0000
@@ -400,8 +400,9 @@
if (fPreferenceStore == null || !fPreferenceStore.getBoolean(SpellingService.PREFERENCE_SPELLING_ENABLED))
return null;
- IQuickAssistAssistant assistant= new QuickAssistAssistant();
+ QuickAssistAssistant assistant= new QuickAssistAssistant();
assistant.setQuickAssistProcessor(new SpellingCorrectionProcessor());
+ assistant.setRestoreCompletionProposalSize(EditorsPlugin.getDefault().getDialogSettingsSection("quick_assist_proposal_size")); //$NON-NLS-1$
assistant.setInformationControlCreator(getQuickAssistAssistantInformationControlCreator());
return assistant;
Index: src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java
===================================================================
RCS file: /cvsroot/eclipse/org.eclipse.ui.editors/src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java,v
retrieving revision 1.40
diff -u -r1.40 EditorsPlugin.java
--- src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java 11 Sep 2008 12:00:14 -0000 1.40
+++ src/org/eclipse/ui/internal/editors/text/EditorsPlugin.java 9 Nov 2010 17:27:08 -0000
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2008 IBM Corporation and others.
+ * Copyright (c) 2000, 2010 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.MultiStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -281,4 +282,20 @@
return TextEditorMessages.EditorsPlugin_additionalInfo_affordance;
}
+ /**
+ * Returns a section in the ui.editors plugin's dialog settings. If the section doesn't exist yet, it is created.
+ *
+ * @param name the name of the section
+ * @return the section of the given name
+ * @since 3.7
+ */
+ public IDialogSettings getDialogSettingsSection(String name) {
+ IDialogSettings dialogSettings= getDialogSettings();
+ IDialogSettings section= dialogSettings.getSection(name);
+ if (section == null) {
+ section= dialogSettings.addNewSection(name);
+ }
+ return section;
+ }
+
}