Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Schwarz2013-12-13 04:22:07 -0500
committerTobias Schwarz2014-01-09 00:51:33 -0500
commit5271285e0ab605e589963b553785fd102d3f70d7 (patch)
tree0f60c5ca03e79c87b46334be251f56df5b4045ab /target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src
parent90c9d157577333df9b9fdff9b1ff52ff63d2e813 (diff)
downloadorg.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.ui.views/src')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java18
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java22
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java10
4 files changed, 34 insertions, 34 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java
index b0f3fee33..adcf443f2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/ScriptPad.java
@@ -58,7 +58,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
import org.eclipse.tcf.te.runtime.utils.StatusHelper;
-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.ui.views.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.views.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.views.scriptpad.actions.CopyAction;
@@ -91,7 +91,7 @@ public class ScriptPad extends ViewPart implements ISelectionProvider, Selection
private final List<ISelectionChangedListener> listeners = new ArrayList<ISelectionChangedListener>();
// Reference to the selected peer model
- /* default */ IPeerModel peerModel;
+ /* default */ IPeerNode peerNode;
// References to the global action handlers
private CutAction cutHandler;
@@ -392,10 +392,10 @@ public class ScriptPad extends ViewPart implements ISelectionProvider, Selection
label.append(" - "); //$NON-NLS-1$
- if (peerModel == null) {
+ if (peerNode == null) {
label.append("<no peer>"); //$NON-NLS-1$
} else {
- PeerAction action = new PeerAction(this, peerModel);
+ PeerAction action = new PeerAction(this, peerNode);
label.append(action.getText());
}
@@ -421,10 +421,10 @@ public class ScriptPad extends ViewPart implements ISelectionProvider, Selection
/**
* Sets the peer model.
*
- * @param peerModel The peer model or <code>null</code>.
+ * @param peerNode The peer model or <code>null</code>.
*/
- public void setPeerModel(IPeerModel peerModel) {
- this.peerModel = peerModel;
+ public void setPeerModel(IPeerNode peerNode) {
+ this.peerNode = peerNode;
// Update the head label
updateHeadLabel();
// Update the action bars
@@ -444,8 +444,8 @@ public class ScriptPad extends ViewPart implements ISelectionProvider, Selection
*
* @return The associated peer model.
*/
- public IPeerModel getPeerModel() {
- return peerModel;
+ public IPeerNode getPeerModel() {
+ return peerNode;
}
/**
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java
index 7882de782..5f87474a2 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeerAction.java
@@ -11,7 +11,7 @@ package org.eclipse.tcf.te.tcf.ui.views.scriptpad.actions;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.action.Action;
-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.ui.views.scriptpad.ScriptPad;
import org.eclipse.tcf.te.ui.views.navigator.DelegatingLabelProvider;
import org.eclipse.ui.IViewPart;
@@ -24,7 +24,7 @@ public class PeerAction extends Action {
private final static DelegatingLabelProvider delegate = new DelegatingLabelProvider();
// Reference to the peer model
- private IPeerModel peerModel;
+ private IPeerNode peerNode;
// Reference to the parent view part
private IViewPart view;
@@ -32,17 +32,17 @@ public class PeerAction extends Action {
* Constructor.
*
* @param view The parent view part. Must not be <code>null</code>.
- * @param peerModel The peer model. Must not be <code>null</code>.
+ * @param peerNode The peer model. Must not be <code>null</code>.
*/
- public PeerAction(IViewPart view, IPeerModel peerModel) {
+ public PeerAction(IViewPart view, IPeerNode peerNode) {
super("", AS_CHECK_BOX); //$NON-NLS-1$
- Assert.isNotNull(peerModel);
- this.peerModel = peerModel;
+ Assert.isNotNull(peerNode);
+ this.peerNode = peerNode;
- String label = delegate.getText(peerModel);
+ String label = delegate.getText(peerNode);
if (label != null) {
- setText(delegate.decorateText(label, peerModel));
+ setText(delegate.decorateText(label, peerNode));
}
Assert.isNotNull(view);
@@ -58,7 +58,7 @@ public class PeerAction extends Action {
// Pass on the selected peer model to the parent view
if (view instanceof ScriptPad) {
- ((ScriptPad)view).setPeerModel(peerModel);
+ ((ScriptPad)view).setPeerModel(peerNode);
}
}
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
index 1075fb32b..436c22425 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PeersSubMenuAction.java
@@ -26,8 +26,8 @@ import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.tcf.locator.interfaces.IModelListener;
-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.nodes.IPeerNode;
import org.eclipse.tcf.te.tcf.locator.listener.ModelAdapter;
import org.eclipse.tcf.te.tcf.locator.model.Model;
import org.eclipse.tcf.te.tcf.ui.views.scriptpad.ScriptPad;
@@ -60,10 +60,10 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
// Create and register the locator model listener
listener = new ModelAdapter() {
@Override
- public void locatorModelChanged(ILocatorModel model, IPeerModel peer, boolean added) {
+ public void locatorModelChanged(IPeerModel model, IPeerNode peer, boolean added) {
// Re-evaluate the enablement
if (actionProxy != null) {
- final IPeerModel[] peers = Model.getModel().getPeers();
+ final IPeerNode[] peers = Model.getModel().getPeers();
actionProxy.setEnabled(peers != null && peers.length > 0);
// If the peer is not set to the view yet, but the action get's
@@ -119,7 +119,7 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
// Determine the enablement. The action is disabled
// if no peers are available.
- IPeerModel[] peers = Model.getModel().getPeers();
+ IPeerNode[] peers = Model.getModel().getPeers();
if (peers != null && peers.length > 0) {
action.setEnabled(true);
if (view instanceof ScriptPad) ((ScriptPad)view).setPeerModel(peers[0]);
@@ -204,14 +204,14 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
}
// Get the selected peer model
- IPeerModel selected = null;
+ IPeerNode selected = null;
if (view instanceof ScriptPad) selected = ((ScriptPad)view).getPeerModel();
boolean selectFirst = selected == null;
- IPeerModel[] peers = Model.getModel().getPeers();
+ IPeerNode[] peers = Model.getModel().getPeers();
if (peers != null && peers.length > 0) {
- for (IPeerModel peer : peers) {
+ for (IPeerNode peer : peers) {
if (isValueAdd(peer)) continue;
Action action = new PeerAction(view, peer);
if (selectFirst) {
@@ -235,17 +235,17 @@ public class PeersSubMenuAction extends Action implements IMenuCreator, IViewAct
/**
* Determines if the given peer model node is a value-add.
*
- * @param peerModel The peer model node. Must not be <code>null</code>.
+ * @param peerNode The peer model node. Must not be <code>null</code>.
* @return <code>True</code> if the peer model node is value-add, <code>false</code> otherwise.
*/
- /* default */ final boolean isValueAdd(final IPeerModel peerModel) {
- Assert.isNotNull(peerModel);
+ /* default */ final boolean isValueAdd(final IPeerNode peerNode) {
+ Assert.isNotNull(peerNode);
final AtomicBoolean isValueAdd = new AtomicBoolean();
Runnable runnable = new Runnable() {
@Override
public void run() {
- String value = peerModel.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
+ String value = peerNode.getPeer().getAttributes().get("ValueAdd"); //$NON-NLS-1$
boolean isValueAddValue = value != null && ("1".equals(value.trim()) || Boolean.parseBoolean(value.trim())); //$NON-NLS-1$
isValueAdd.set(isValueAddValue);
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java
index a4c4eabda..692e5637f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui.views/src/org/eclipse/tcf/te/tcf/ui/views/scriptpad/actions/PlayAction.java
@@ -24,7 +24,7 @@ import org.eclipse.tcf.te.runtime.properties.PropertiesContainer;
import org.eclipse.tcf.te.runtime.statushandler.StatusHandlerUtil;
import org.eclipse.tcf.te.tcf.core.scripting.interfaces.IScriptLauncherProperties;
import org.eclipse.tcf.te.tcf.core.scripting.launcher.ScriptLauncher;
-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.ui.views.help.IContextHelpIds;
import org.eclipse.tcf.te.tcf.ui.views.nls.Messages;
import org.eclipse.tcf.te.tcf.ui.views.scriptpad.ScriptPad;
@@ -98,21 +98,21 @@ public class PlayAction extends Action implements IViewActionDelegate, IActionDe
@Override
public void run() {
String script = null;
- IPeerModel peerModel = null;
+ IPeerNode peerNode = null;
if (view instanceof ScriptPad && ((ScriptPad)view).getStyledText() != null) {
script = ((ScriptPad)view).getStyledText().getText();
- peerModel = ((ScriptPad)view).getPeerModel();
+ peerNode = ((ScriptPad)view).getPeerModel();
}
- if (script != null && !"".equals(script) && peerModel != null) { //$NON-NLS-1$
+ if (script != null && !"".equals(script) && peerNode != null) { //$NON-NLS-1$
final ScriptLauncher launcher = new ScriptLauncher();
IPropertiesContainer properties = new PropertiesContainer();
properties.setProperty(IScriptLauncherProperties.PROP_SCRIPT, script);
final AtomicReference<IPeer> peer = new AtomicReference<IPeer>();
- final IPeerModel finPeerModel = peerModel;
+ final IPeerNode finPeerModel = peerNode;
Runnable runnable = new Runnable() {
@Override
public void run() {

Back to the top