diff options
author | Tobias Schwarz | 2013-12-20 08:07:37 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-01-09 05:51:45 +0000 |
commit | d13562ef48a56a83862aa7307dce52713e1b3da9 (patch) | |
tree | f622ce024315727ea002cd82d1666cd4986996f6 | |
parent | 5f262f29d855de9b0dafef8cdd7fd2b3ab98ff45 (diff) | |
download | org.eclipse.tcf-d13562ef48a56a83862aa7307dce52713e1b3da9.tar.gz org.eclipse.tcf-d13562ef48a56a83862aa7307dce52713e1b3da9.tar.xz org.eclipse.tcf-d13562ef48a56a83862aa7307dce52713e1b3da9.zip |
Target Explorer: remember last selected peerId
-rw-r--r-- | target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/sections/SimulatorTypeSelectionSection.java | 7 |
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 { |