mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 06:32:10 +02:00
fixed 'revert' behavior
This commit is contained in:
parent
ec5c2fbaa9
commit
a25c4af562
2 changed files with 29 additions and 20 deletions
|
@ -12,6 +12,8 @@ import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
|
|||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.events.ModifyEvent;
|
||||
import org.eclipse.swt.events.ModifyListener;
|
||||
import org.eclipse.swt.events.SelectionAdapter;
|
||||
import org.eclipse.swt.events.SelectionEvent;
|
||||
import org.eclipse.swt.layout.GridData;
|
||||
import org.eclipse.swt.layout.GridLayout;
|
||||
import org.eclipse.swt.widgets.Button;
|
||||
|
@ -51,6 +53,12 @@ public class CDebuggerPage extends AbstractLaunchConfigurationTab {
|
|||
|
||||
fAutoSoLibButton = new Button(comp, SWT.CHECK ) ;
|
||||
fAutoSoLibButton.setText("Load shared library symbols automatically");
|
||||
fAutoSoLibButton.addSelectionListener(new SelectionAdapter() {
|
||||
public void widgetSelected(SelectionEvent e) {
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
});
|
||||
|
||||
gd = new GridData();
|
||||
gd.horizontalSpan = 2;
|
||||
fAutoSoLibButton.setLayoutData(gd);
|
||||
|
|
|
@ -125,15 +125,15 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
protected Control createDialogArea(Composite parent) {
|
||||
Composite composite = new Composite(parent, SWT.NONE);
|
||||
GridLayout layout = new GridLayout(2, false);
|
||||
layout.marginWidth= 5;
|
||||
layout.numColumns= 2;
|
||||
layout.marginWidth = 5;
|
||||
layout.numColumns = 2;
|
||||
composite.setLayout(layout);
|
||||
|
||||
|
||||
GC gc = new GC(composite);
|
||||
gc.setFont(composite.getFont());
|
||||
FontMetrics metrics= gc.getFontMetrics();
|
||||
FontMetrics metrics = gc.getFontMetrics();
|
||||
gc.dispose();
|
||||
int fieldWidthHint= convertWidthInCharsToPixels(metrics, 50);
|
||||
int fieldWidthHint = convertWidthInCharsToPixels(metrics, 50);
|
||||
|
||||
Label label = new Label(composite, SWT.NONE);
|
||||
label.setText("Name:");
|
||||
|
@ -195,7 +195,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
fElements = new Properties();
|
||||
Composite control = new Composite(parent, SWT.NONE);
|
||||
GridLayout gl = new GridLayout(2, false);
|
||||
|
||||
|
||||
createVerticalSpacer(control, 2);
|
||||
|
||||
control.setLayout(gl);
|
||||
|
@ -204,7 +204,6 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
setControl(control);
|
||||
fVariableList.setInput(fElements);
|
||||
fVariableList.getTable().setFocus();
|
||||
updateButtons();
|
||||
}
|
||||
|
||||
public void set(String env) {
|
||||
|
@ -212,8 +211,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
ByteArrayInputStream input = new ByteArrayInputStream(env.getBytes());
|
||||
try {
|
||||
fElements.load(input);
|
||||
}
|
||||
catch (IOException e) {
|
||||
} catch (IOException e) {
|
||||
}
|
||||
|
||||
fVariableList.refresh();
|
||||
|
@ -265,17 +263,16 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
column2.setText("Value");
|
||||
tableLayout.addColumnData(new ColumnWeightData(30));
|
||||
|
||||
fVariableList.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
public void selectionChanged(SelectionChangedEvent e) {
|
||||
updateButtons();
|
||||
}
|
||||
});
|
||||
|
||||
fVariableList.addDoubleClickListener(new IDoubleClickListener() {
|
||||
public void doubleClick(DoubleClickEvent e) {
|
||||
elementDoubleClicked((IStructuredSelection) e.getSelection());
|
||||
}
|
||||
});
|
||||
fVariableList.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||
public void selectionChanged(SelectionChangedEvent e) {
|
||||
updateButtons();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void createButtons(Composite parent) {
|
||||
|
@ -327,6 +324,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
fVariableList.refresh();
|
||||
}
|
||||
updateButtons();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
protected void edit() {
|
||||
|
@ -342,6 +340,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
fVariableList.refresh();
|
||||
}
|
||||
updateButtons();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
protected void remove() {
|
||||
|
@ -351,6 +350,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
fElements.remove(((Map.Entry) elements[i]).getKey());
|
||||
fVariableList.refresh();
|
||||
updateButtons();
|
||||
updateLaunchConfigurationDialog();
|
||||
}
|
||||
|
||||
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
|
||||
|
@ -360,19 +360,20 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
|
||||
public void initializeFrom(ILaunchConfiguration config) {
|
||||
try {
|
||||
Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map)null);
|
||||
if ( env != null ) {
|
||||
Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
|
||||
if (env != null) {
|
||||
fElements.clear();
|
||||
fElements.putAll(env);
|
||||
fVariableList.refresh();
|
||||
updateButtons();
|
||||
}
|
||||
// config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
|
||||
} catch ( CoreException e ) {
|
||||
// config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
|
||||
} catch (CoreException e) {
|
||||
}
|
||||
}
|
||||
|
||||
public void performApply(ILaunchConfigurationWorkingCopy config) {
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, fElements);
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) fElements.clone());
|
||||
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue