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);
|
||||
|
|
|
@ -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) {
|
||||
|
@ -362,6 +362,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
try {
|
||||
Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
|
||||
if (env != null) {
|
||||
fElements.clear();
|
||||
fElements.putAll(env);
|
||||
fVariableList.refresh();
|
||||
updateButtons();
|
||||
|
@ -372,7 +373,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
|||
}
|
||||
|
||||
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