diff options
author | Tobias Schwarz | 2013-12-13 09:22:07 +0000 |
---|---|---|
committer | Tobias Schwarz | 2014-01-09 05:51:33 +0000 |
commit | 5271285e0ab605e589963b553785fd102d3f70d7 (patch) | |
tree | 0f60c5ca03e79c87b46334be251f56df5b4045ab /target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui | |
parent | 90c9d157577333df9b9fdff9b1ff52ff63d2e813 (diff) | |
download | org.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.tar.gz org.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.tar.xz org.eclipse.tcf-5271285e0ab605e589963b553785fd102d3f70d7.zip |
Target Explorer: rework peer model
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui')
3 files changed, 17 insertions, 17 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml index 03a38ec60..9316b0575 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/plugin.xml @@ -30,7 +30,7 @@ <with variable="selection"> <count value="1"/> <iterate operator="and" ifEmpty="false"> - <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel"/> + <instanceof value="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode"/> </iterate> </with> </enablement> diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java index 651cc2231..78575e471 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsLauncherDelegate.java @@ -19,7 +19,7 @@ import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.runtime.interfaces.callback.ICallback; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.services.interfaces.constants.ITerminalsConnectorConstants; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; +import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; import org.eclipse.tcf.te.tcf.terminals.core.interfaces.launcher.ITerminalsLauncher; import org.eclipse.tcf.te.tcf.terminals.core.launcher.TerminalsLauncher; import org.eclipse.tcf.te.tcf.terminals.ui.controls.TerminalsWizardConfigurationPanel; @@ -62,16 +62,16 @@ public class TerminalsLauncherDelegate extends AbstractLauncherDelegate { ISelection selection = (ISelection)properties.getProperty(ITerminalsConnectorConstants.PROP_SELECTION); if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object element = ((IStructuredSelection)selection).getFirstElement(); - if (element instanceof IPeerModel) { - final IPeerModel peerModel = (IPeerModel)element; + if (element instanceof IPeerNode) { + final IPeerNode peerNode = (IPeerNode)element; final AtomicReference<IPeer> peer = new AtomicReference<IPeer>(); if (Protocol.isDispatchThread()) { - peer.set(peerModel.getPeer()); + peer.set(peerNode.getPeer()); } else { Protocol.invokeAndWait(new Runnable() { @Override public void run() { - peer.set(peerModel.getPeer()); + peer.set(peerNode.getPeer()); } }); } diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java index 4ee81b551..cffd6ed86 100644 --- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java +++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.terminals.ui/src/org/eclipse/tcf/te/tcf/terminals/ui/launcher/TerminalsMementoHandler.java @@ -18,9 +18,9 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.tcf.protocol.Protocol; import org.eclipse.tcf.te.runtime.interfaces.properties.IPropertiesContainer; import org.eclipse.tcf.te.runtime.services.interfaces.constants.ITerminalsConnectorConstants; -import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.ILocatorModel; import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel; -import org.eclipse.tcf.te.tcf.locator.interfaces.services.ILocatorModelLookupService; +import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode; +import org.eclipse.tcf.te.tcf.locator.interfaces.services.IPeerModelLookupService; import org.eclipse.tcf.te.tcf.locator.model.Model; import org.eclipse.tcf.te.ui.terminals.interfaces.IMementoHandler; import org.eclipse.ui.IMemento; @@ -46,9 +46,9 @@ public class TerminalsMementoHandler implements IMementoHandler { ISelection selection = (ISelection)properties.getProperty(ITerminalsConnectorConstants.PROP_SELECTION); if (selection instanceof IStructuredSelection && !selection.isEmpty()) { Object element = ((IStructuredSelection)selection).getFirstElement(); - if (element instanceof IPeerModel) { - IPeerModel peerModel = (IPeerModel)element; - memento.putString("peerID", peerModel.getPeerId()); //$NON-NLS-1$ + if (element instanceof IPeerNode) { + IPeerNode peerNode = (IPeerNode)element; + memento.putString("peerID", peerNode.getPeerId()); //$NON-NLS-1$ } } } @@ -66,13 +66,13 @@ public class TerminalsMementoHandler implements IMementoHandler { final String peerID = memento.getString("peerID"); //$NON-NLS-1$ if (peerID != null) { - final ILocatorModel model = Model.getModel(); + final IPeerModel model = Model.getModel(); Assert.isNotNull(model); - final AtomicReference<IPeerModel> peerModel = new AtomicReference<IPeerModel>(); + final AtomicReference<IPeerNode> peerNode = new AtomicReference<IPeerNode>(); Runnable runnable = new Runnable() { @Override public void run() { - peerModel.set(model.getService(ILocatorModelLookupService.class).lkupPeerModelById(peerID)); + peerNode.set(model.getService(IPeerModelLookupService.class).lkupPeerModelById(peerID)); } }; Assert.isTrue(!Protocol.isDispatchThread()); @@ -80,14 +80,14 @@ public class TerminalsMementoHandler implements IMementoHandler { // If the node is null, this might mean that the peer to restore is a dynamically discovered peer. // In this case, we have to wait a little bit to give the locator service the chance to sync. - if (peerModel.get() == null) { + if (peerNode.get() == null) { // Sleep shortly try { Thread.sleep(300); } catch (InterruptedException e) {} Protocol.invokeAndWait(runnable); } - if (peerModel.get() != null) { - properties.setProperty(ITerminalsConnectorConstants.PROP_SELECTION, new StructuredSelection(peerModel.get())); + if (peerNode.get() != null) { + properties.setProperty(ITerminalsConnectorConstants.PROP_SELECTION, new StructuredSelection(peerNode.get())); } } } |