mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 309112 - "Open Declaration" window doesn't remember own size
Change-Id: I4fb1ed4ab0035c79a98bb5c8b7d33c6b2c22de92 Reviewed-on: https://git.eclipse.org/r/5682 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> Reviewed-by: Marc-Andre Laperle <malaperle@omnialabs.net> IP-Clean: Marc-Andre Laperle <malaperle@omnialabs.net> Tested-by: Marc-Andre Laperle <malaperle@omnialabs.net>
This commit is contained in:
parent
821918824e
commit
9ba6060632
1 changed files with 17 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2010 IBM Corporation and others.
|
* Copyright (c) 2000, 2012 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,12 +8,14 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM Corporation - initial API and implementation
|
* IBM Corporation - initial API and implementation
|
||||||
* Markus Schorn (Wind River Systems)
|
* Markus Schorn (Wind River Systems)
|
||||||
|
* Marc-Andre Laperle - Bug 309112 - Remember dialog bounds
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.actions;
|
package org.eclipse.cdt.internal.ui.actions;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.jface.dialogs.IDialogSettings;
|
||||||
import org.eclipse.jface.viewers.ILabelProvider;
|
import org.eclipse.jface.viewers.ILabelProvider;
|
||||||
import org.eclipse.jface.window.Window;
|
import org.eclipse.jface.window.Window;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
@ -25,6 +27,7 @@ import org.eclipse.cdt.core.model.CModelException;
|
||||||
import org.eclipse.cdt.core.model.ICElement;
|
import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ISourceReference;
|
import org.eclipse.cdt.core.model.ISourceReference;
|
||||||
import org.eclipse.cdt.ui.CElementLabelProvider;
|
import org.eclipse.cdt.ui.CElementLabelProvider;
|
||||||
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
import org.eclipse.cdt.internal.ui.util.EditorUtility;
|
||||||
import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
|
import org.eclipse.cdt.internal.ui.viewsupport.CElementLabels;
|
||||||
|
@ -32,6 +35,8 @@ import org.eclipse.cdt.internal.ui.viewsupport.CUILabelProvider;
|
||||||
|
|
||||||
public class OpenActionUtil {
|
public class OpenActionUtil {
|
||||||
|
|
||||||
|
private static final String DIALOG_SETTINGS_SECTION_NAME = CUIPlugin.PLUGIN_ID + ".OPEN_ACTION_SELECTION_DIALOG_SECTION"; //$NON-NLS-1$
|
||||||
|
|
||||||
private OpenActionUtil() {
|
private OpenActionUtil() {
|
||||||
// no instance.
|
// no instance.
|
||||||
}
|
}
|
||||||
|
@ -103,7 +108,17 @@ public class OpenActionUtil {
|
||||||
labelProvider= new CUILabelProvider(textFlags, imageFlags);
|
labelProvider= new CUILabelProvider(textFlags, imageFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, labelProvider);
|
ElementListSelectionDialog dialog= new ElementListSelectionDialog(shell, labelProvider) {
|
||||||
|
@Override
|
||||||
|
protected IDialogSettings getDialogBoundsSettings() {
|
||||||
|
IDialogSettings settings = CUIPlugin.getDefault().getDialogSettings();
|
||||||
|
IDialogSettings section = settings.getSection(DIALOG_SETTINGS_SECTION_NAME);
|
||||||
|
if (section == null) {
|
||||||
|
section = settings.addNewSection(DIALOG_SETTINGS_SECTION_NAME);
|
||||||
|
}
|
||||||
|
return section;
|
||||||
|
}
|
||||||
|
};
|
||||||
dialog.setTitle(title);
|
dialog.setTitle(title);
|
||||||
dialog.setMessage(message);
|
dialog.setMessage(message);
|
||||||
dialog.setElements(elements);
|
dialog.setElements(elements);
|
||||||
|
|
Loading…
Add table
Reference in a new issue