Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2013-10-22 06:55:54 +0000
committerUwe Stieber2013-10-22 06:55:54 +0000
commitc2aa8d46d5c8b3c001a26f27a23bf4c1b00b8b1c (patch)
tree8ad386b06d1584b7d588cba7ba55ee1222052011
parent3b3a0a0e7450b24c5827228c751f851d33ed024c (diff)
downloadorg.eclipse.tcf-c2aa8d46d5c8b3c001a26f27a23bf4c1b00b8b1c.tar.gz
org.eclipse.tcf-c2aa8d46d5c8b3c001a26f27a23bf4c1b00b8b1c.tar.xz
org.eclipse.tcf-c2aa8d46d5c8b3c001a26f27a23bf4c1b00b8b1c.zip
Target Explorer: Fix simulator actions and properties available for non-simulator connections
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java4
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java29
3 files changed, 35 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
index 0f9a4a653..3a8c24191 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.locator/plugin.xml
@@ -239,6 +239,8 @@
<adapt type="org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel">
<test property="org.eclipse.tcf.te.runtime.services.hasService"
value="org.eclipse.tcf.te.runtime.services.interfaces.ISimulatorService"/>
+ <test property="org.eclipse.tcf.te.tcf.locator.isAttribute"
+ args="SimulatorEnabled" value="true"/>
</adapt>
</definition>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
index ce24112e8..8d42bebd0 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.ui/src/org/eclipse/tcf/te/tcf/ui/internal/tabbed/PeerGeneralSectionContentProvider.java
@@ -27,6 +27,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.te.runtime.services.ServiceManager;
import org.eclipse.tcf.te.runtime.services.interfaces.IUIService;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerModel;
+import org.eclipse.tcf.te.ui.interfaces.services.INodePropertiesTableFilterUIDelegate;
import org.eclipse.tcf.te.ui.tables.properties.NodePropertiesTableTableNode;
import org.eclipse.tcf.te.ui.views.extensions.LabelProviderDelegateExtensionPointManager;
import org.eclipse.ui.forms.widgets.Section;
@@ -83,10 +84,13 @@ public class PeerGeneralSectionContentProvider implements IStructuredContentProv
});
}
+ INodePropertiesTableFilterUIDelegate filterDelegate = service != null ? service.getDelegate(inputElement, INodePropertiesTableFilterUIDelegate.class) : null;
+
for (Entry<String, Object> entry : properties.entrySet()) {
String name = entry.getKey();
// Check if the property is filtered
if (name.endsWith(".silent") || name.contains(".transient")) continue; //$NON-NLS-1$ //$NON-NLS-2$
+ if (filterDelegate != null && filterDelegate.isFiltered(inputElement, name, entry.getValue())) continue;
// Create the properties node
NodePropertiesTableTableNode propertiesNode = new NodePropertiesTableTableNode(name, entry.getValue() != null ? entry.getValue().toString() : ""); //$NON-NLS-1$
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java
new file mode 100644
index 000000000..36744088f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.ui/src/org/eclipse/tcf/te/ui/interfaces/services/INodePropertiesTableFilterUIDelegate.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Wind River Systems, Inc. and others. All rights reserved.
+ * This program and the accompanying materials are made available under the terms
+ * of the Eclipse Public License v1.0 which accompanies this distribution, and is
+ * available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Wind River Systems - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.tcf.te.ui.interfaces.services;
+
+/**
+ * Interface to be implemented by clients to filter the content of the
+ * node properties table control.
+ */
+public interface INodePropertiesTableFilterUIDelegate {
+
+ /**
+ * Returns if or if not the given property is filtered from the node
+ * properties table control.
+ *
+ * @param context The context. Must not be <code>null</code>.
+ * @param name The property name. Must not be <code>null</code>.
+ * @param value The property value or <code>null</code>.
+ *
+ * @return <code>True</code> if the property is filtered, <code>false</code> otherwise.
+ */
+ boolean isFiltered(Object context, String name, Object value);
+}

Back to the top