Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-12-20 03:07:37 -0500
committerTobias Schwarz2013-12-20 03:07:37 -0500
commit568fb6da9752d6a836da9b0d6d3ecf465062cab7 (patch)
tree0e040d02fd0712c5c89767d76289b792525267fa /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui
parentf703d6178c9ad5eca4a4f270725cd014d27c4b52 (diff)
downloadorg.eclipse.tcf-568fb6da9752d6a836da9b0d6d3ecf465062cab7.tar.gz
org.eclipse.tcf-568fb6da9752d6a836da9b0d6d3ecf465062cab7.tar.xz
org.eclipse.tcf-568fb6da9752d6a836da9b0d6d3ecf465062cab7.zip
Target Explorer: remember last selected peerId
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java
index f7e742d1b..e2b306b7a 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java
@@ -66,6 +66,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID
protected static final int SELECTION_REAL = 0;
protected static final int SELECTION_SIM = 1;
+ protected String selectedPeerId = null;
protected IPeer selectedPeer = null;
/**
@@ -166,6 +167,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID
if (selection instanceof IStructuredSelection && !selection.isEmpty() && ((IStructuredSelection)selection).getFirstElement() instanceof IPeer) {
IPeer oldPeer = selectedPeer;
selectedPeer = (IPeer)((IStructuredSelection)selection).getFirstElement();
+ selectedPeerId = selectedPeer != null ? selectedPeer.getID() : null;
dataChanged(null);
onPeerChanged(isLabelControlSelected(), isLabelControlSelected(), oldPeer, selectedPeer);
}
@@ -308,6 +310,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID
});
}
}
+ selectedPeerId = peerId;
selectedPeer = peer.get();
}
@@ -404,7 +407,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID
if (target != null) {
data.setProperty(IPeerNodeProperties.PROP_SIM_ENABLED, target.isLabelControlSelected());
}
- data.setProperty(IPeerNodeProperties.PROP_PEER_ID, selectedPeer != null ? selectedPeer.getID() : null);
+ data.setProperty(IPeerNodeProperties.PROP_PEER_ID, selectedPeer != null ? selectedPeer.getID() : selectedPeerId);
if (simulator != null) {
data.setProperty(IPeerNodeProperties.PROP_SIM_ENABLED, simulator.isLabelControlSelected());
@@ -543,7 +546,7 @@ public class SimulatorTypeSelectionSection extends AbstractSection implements ID
}
String oldPeerId = odc.getStringProperty(IPeerNodeProperties.PROP_PEER_ID);
- String newPeerId = selectedPeer != null ? selectedPeer.getID() : null;
+ String newPeerId = selectedPeer != null ? selectedPeer.getID() : selectedPeerId;
if (newPeerId == null || "".equals(newPeerId)) { //$NON-NLS-1$
isDirty |= oldPeerId != null && !"".equals(oldPeerId); //$NON-NLS-1$
} else {

Back to the top