mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +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.SWT;
|
||||||
import org.eclipse.swt.events.ModifyEvent;
|
import org.eclipse.swt.events.ModifyEvent;
|
||||||
import org.eclipse.swt.events.ModifyListener;
|
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.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
import org.eclipse.swt.widgets.Button;
|
import org.eclipse.swt.widgets.Button;
|
||||||
|
@ -51,6 +53,12 @@ public class CDebuggerPage extends AbstractLaunchConfigurationTab {
|
||||||
|
|
||||||
fAutoSoLibButton = new Button(comp, SWT.CHECK ) ;
|
fAutoSoLibButton = new Button(comp, SWT.CHECK ) ;
|
||||||
fAutoSoLibButton.setText("Load shared library symbols automatically");
|
fAutoSoLibButton.setText("Load shared library symbols automatically");
|
||||||
|
fAutoSoLibButton.addSelectionListener(new SelectionAdapter() {
|
||||||
|
public void widgetSelected(SelectionEvent e) {
|
||||||
|
updateLaunchConfigurationDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
gd = new GridData();
|
gd = new GridData();
|
||||||
gd.horizontalSpan = 2;
|
gd.horizontalSpan = 2;
|
||||||
fAutoSoLibButton.setLayoutData(gd);
|
fAutoSoLibButton.setLayoutData(gd);
|
||||||
|
|
|
@ -204,7 +204,6 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
setControl(control);
|
setControl(control);
|
||||||
fVariableList.setInput(fElements);
|
fVariableList.setInput(fElements);
|
||||||
fVariableList.getTable().setFocus();
|
fVariableList.getTable().setFocus();
|
||||||
updateButtons();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set(String env) {
|
public void set(String env) {
|
||||||
|
@ -212,8 +211,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
ByteArrayInputStream input = new ByteArrayInputStream(env.getBytes());
|
ByteArrayInputStream input = new ByteArrayInputStream(env.getBytes());
|
||||||
try {
|
try {
|
||||||
fElements.load(input);
|
fElements.load(input);
|
||||||
}
|
} catch (IOException e) {
|
||||||
catch (IOException e) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fVariableList.refresh();
|
fVariableList.refresh();
|
||||||
|
@ -265,17 +263,16 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
column2.setText("Value");
|
column2.setText("Value");
|
||||||
tableLayout.addColumnData(new ColumnWeightData(30));
|
tableLayout.addColumnData(new ColumnWeightData(30));
|
||||||
|
|
||||||
fVariableList.addSelectionChangedListener(new ISelectionChangedListener() {
|
|
||||||
public void selectionChanged(SelectionChangedEvent e) {
|
|
||||||
updateButtons();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
fVariableList.addDoubleClickListener(new IDoubleClickListener() {
|
fVariableList.addDoubleClickListener(new IDoubleClickListener() {
|
||||||
public void doubleClick(DoubleClickEvent e) {
|
public void doubleClick(DoubleClickEvent e) {
|
||||||
elementDoubleClicked((IStructuredSelection) e.getSelection());
|
elementDoubleClicked((IStructuredSelection) e.getSelection());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
fVariableList.addSelectionChangedListener(new ISelectionChangedListener() {
|
||||||
|
public void selectionChanged(SelectionChangedEvent e) {
|
||||||
|
updateButtons();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createButtons(Composite parent) {
|
private void createButtons(Composite parent) {
|
||||||
|
@ -327,6 +324,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
fVariableList.refresh();
|
fVariableList.refresh();
|
||||||
}
|
}
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void edit() {
|
protected void edit() {
|
||||||
|
@ -342,6 +340,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
fVariableList.refresh();
|
fVariableList.refresh();
|
||||||
}
|
}
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void remove() {
|
protected void remove() {
|
||||||
|
@ -351,6 +350,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
fElements.remove(((Map.Entry) elements[i]).getKey());
|
fElements.remove(((Map.Entry) elements[i]).getKey());
|
||||||
fVariableList.refresh();
|
fVariableList.refresh();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
updateLaunchConfigurationDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
|
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
|
||||||
|
@ -362,6 +362,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
try {
|
try {
|
||||||
Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
|
Map env = config.getAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_MAP, (Map) null);
|
||||||
if (env != null) {
|
if (env != null) {
|
||||||
|
fElements.clear();
|
||||||
fElements.putAll(env);
|
fElements.putAll(env);
|
||||||
fVariableList.refresh();
|
fVariableList.refresh();
|
||||||
updateButtons();
|
updateButtons();
|
||||||
|
@ -372,7 +373,7 @@ public class CEnvironmentTab extends CLaunchConfigurationTab {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void performApply(ILaunchConfigurationWorkingCopy config) {
|
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);
|
config.setAttribute(ICDTLaunchConfigurationConstants.ATTR_PROGRAM_ENVIROMENT_INHERIT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue