mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-17 22:15:23 +02:00
Bug 418817 - Control dependency is not observed after clicking "Restore
Defaults" button Change-Id: I7f0aaac8f227c7f2ca0e05e144a7f1862d7bea95 Signed-off-by: Serge Beauchamp <sergebeauchamp@mac.com> Reviewed-on: https://git.eclipse.org/r/17110 Reviewed-by: Sergey Prigogin <eclipse.sprigogin@gmail.com> IP-Clean: Sergey Prigogin <eclipse.sprigogin@gmail.com> Tested-by: Sergey Prigogin <eclipse.sprigogin@gmail.com>
This commit is contained in:
parent
15fb26ea6a
commit
493f6ad273
1 changed files with 15 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2010 QNX Software Systems and others.
|
* Copyright (c) 2002, 2013 QNX Software Systems 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
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* IBM Corporation
|
* IBM Corporation
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
|
* Serge Beauchamp (Freescale Semiconductor) - Bug 418817
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.ui.preferences;
|
package org.eclipse.cdt.internal.ui.preferences;
|
||||||
|
@ -16,7 +17,9 @@ package org.eclipse.cdt.internal.ui.preferences;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
import java.util.LinkedHashSet;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.jface.layout.PixelConverter;
|
import org.eclipse.jface.layout.PixelConverter;
|
||||||
|
@ -36,6 +39,7 @@ import org.eclipse.swt.widgets.Button;
|
||||||
import org.eclipse.swt.widgets.Combo;
|
import org.eclipse.swt.widgets.Combo;
|
||||||
import org.eclipse.swt.widgets.Composite;
|
import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
import org.eclipse.swt.widgets.Event;
|
||||||
import org.eclipse.swt.widgets.Group;
|
import org.eclipse.swt.widgets.Group;
|
||||||
import org.eclipse.swt.widgets.Label;
|
import org.eclipse.swt.widgets.Label;
|
||||||
import org.eclipse.swt.widgets.Text;
|
import org.eclipse.swt.widgets.Text;
|
||||||
|
@ -55,12 +59,10 @@ public abstract class AbstractPreferencePage extends PreferencePage implements I
|
||||||
protected OverlayPreferenceStore fOverlayStore;
|
protected OverlayPreferenceStore fOverlayStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List of master/slave listeners when there's a dependency.
|
* Unique list of masters for control dependencies.
|
||||||
*
|
|
||||||
* @see #createDependency(Button, String, Control)
|
* @see #createDependency(Button, String, Control)
|
||||||
* @since 3.0
|
|
||||||
*/
|
*/
|
||||||
private ArrayList<SelectionListener> fMasterSlaveListeners= new ArrayList<SelectionListener>();
|
private Set<Button> fMasters = new LinkedHashSet<Button>();
|
||||||
|
|
||||||
protected Map<Object, String> fTextFields = new HashMap<Object, String>();
|
protected Map<Object, String> fTextFields = new HashMap<Object, String>();
|
||||||
private ModifyListener fTextFieldListener = new ModifyListener() {
|
private ModifyListener fTextFieldListener = new ModifyListener() {
|
||||||
|
@ -225,7 +227,7 @@ public abstract class AbstractPreferencePage extends PreferencePage implements I
|
||||||
public void widgetDefaultSelected(SelectionEvent e) {}
|
public void widgetDefaultSelected(SelectionEvent e) {}
|
||||||
};
|
};
|
||||||
master.addSelectionListener(listener);
|
master.addSelectionListener(listener);
|
||||||
fMasterSlaveListeners.add(listener);
|
fMasters.add(master);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void numberFieldChanged(Text textControl) {
|
protected void numberFieldChanged(Text textControl) {
|
||||||
|
@ -344,6 +346,13 @@ public abstract class AbstractPreferencePage extends PreferencePage implements I
|
||||||
// Interpret the state string as a Combo state description
|
// Interpret the state string as a Combo state description
|
||||||
ProposalFilterPreferencesUtil.restoreComboFromString(c, state);
|
ProposalFilterPreferencesUtil.restoreComboFromString(c, state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Notify listeners for control dependencies.
|
||||||
|
Iterator<Button> buttonIter = fMasters.iterator();
|
||||||
|
while (buttonIter.hasNext()) {
|
||||||
|
Button b = buttonIter.next();
|
||||||
|
b.notifyListeners(SWT.Selection, new Event());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue