Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Chen2012-01-18 03:50:52 +0000
committerWilliam Chen2012-01-18 03:50:52 +0000
commit2f62f47500af432035f03990a49036ef86fd6888 (patch)
tree76119b212c91348149aca00354f065c72dc05a04
parenta1802d0d8fadc7f8df505cd5e5275bbad17b9d42 (diff)
downloadorg.eclipse.tcf-2f62f47500af432035f03990a49036ef86fd6888.tar.gz
org.eclipse.tcf-2f62f47500af432035f03990a49036ef86fd6888.tar.xz
org.eclipse.tcf-2f62f47500af432035f03990a49036ef86fd6888.zip
Target Explorer: [368509] Add Properties dialog for the process list in
Target Explorer and Process Monitor.
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties13
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml129
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/AdvancedPropertiesPage.java72
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/ContextPage.java108
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/GeneralInformationPage.java96
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java36
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapContentProvider.java2
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapEntryLabelProvider.java49
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/testers/ProcessPropertyTester.java34
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.java50
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.properties25
11 files changed, 573 insertions, 41 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties
index a7ebd69ed..3994bea39 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.properties
@@ -56,9 +56,16 @@ singlethreadfilter.name = Single Thread Filter
commonFilter.singlethread.name = Single Thread Filter
-propertyTab.general.label = General
+propertyTab.general.label = Basic
propertyTab.context.label = Context
-propertyTab.advanced.label = Advanced
+propertyTab.advanced.label = Properties
command.refreshNode.label = Refresh
command.refreshNode.label.0 = Refresh
-command.refreshNode.name = Refresh Process Node \ No newline at end of file
+command.refreshNode.name = Refresh Process Node
+command.refresh.label.1 = Refresh
+command.refresh.tooltip.1 = Refresh the selected node
+command.properties.label.0 = Properties
+command.properties.label.1 = Properties
+page.properties.name = Properties
+page.context.name = Context
+page.basic.name = Basic \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
index 77d86341f..308f0745f 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/plugin.xml
@@ -129,10 +129,10 @@
<command
commandId="org.eclipse.tcf.te.ui.command.refresh"
id="org.eclipse.tcf.te.ui.commands.refresh"
- label="Refresh"
+ label="%command.refresh.label.1"
mnemonic="f"
style="push"
- tooltip="Refresh the selected node">
+ tooltip="%command.refresh.tooltip.1">
<visibleWhen
checkEnabled="false">
<with
@@ -185,6 +185,67 @@
</reference>
</visibleWhen>
</command>
+ <separator
+ name="group.properties"
+ visible="true">
+ </separator>
+ <command
+ commandId="org.eclipse.ui.file.properties"
+ id="properties"
+ label="%command.properties.label.0">
+ <visibleWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </instanceof>
+ <not>
+ <test
+ property="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process.isSystemRoot">
+ </test>
+ </not>
+ </and>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
+ </menuContribution>
+ <menuContribution
+ locationURI="popup:org.eclipse.tcf.te.ui.views.TargetExplorer#Popup?after=group.properties">
+ <command
+ commandId="org.eclipse.ui.file.properties"
+ id="properties"
+ label="%command.properties.label.1">
+ <visibleWhen>
+ <with
+ variable="selection">
+ <count
+ value="1">
+ </count>
+ <iterate
+ ifEmpty="false"
+ operator="and">
+ <and>
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </instanceof>
+ <not>
+ <test
+ property="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process.isSystemRoot">
+ </test>
+ </not>
+ </and>
+ </iterate>
+ </with>
+ </visibleWhen>
+ </command>
</menuContribution>
</extension>
@@ -555,5 +616,69 @@
</propertySection>
</propertySections>
</extension>
+ <extension
+ point="org.eclipse.ui.propertyPages">
+ <page
+ class="org.eclipse.tcf.te.tcf.processes.ui.internal.properties.AdvancedPropertiesPage"
+ id="org.eclipse.tcf.te.tcf.processes.ui.pages.advanced"
+ name="%page.properties.name">
+ <enabledWhen>
+ <and>
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </instanceof>
+ <not>
+ <test
+ property="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process.isSystemRoot">
+ </test>
+ </not>
+ </and>
+ </enabledWhen>
+ </page>
+ <page
+ class="org.eclipse.tcf.te.tcf.processes.ui.internal.properties.ContextPage"
+ id="org.eclipse.tcf.te.tcf.processes.ui.pages.context"
+ name="%page.context.name">
+ <enabledWhen>
+ <and>
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </instanceof>
+ <not>
+ <test
+ property="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process.isSystemRoot">
+ </test>
+ </not>
+ </and>
+ </enabledWhen>
+ </page>
+ <page
+ class="org.eclipse.tcf.te.tcf.processes.ui.internal.properties.GeneralInformationPage"
+ id="org.eclipse.tcf.te.tcf.processes.ui.pages.basic"
+ name="%page.basic.name">
+ <enabledWhen>
+ <and>
+ <instanceof
+ value="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </instanceof>
+ <not>
+ <test
+ property="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process.isSystemRoot">
+ </test>
+ </not>
+ </and>
+ </enabledWhen>
+ </page>
+ </extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.tcf.te.tcf.processes.ui.internal.testers.ProcessPropertyTester"
+ id="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process"
+ namespace="org.eclipse.tcf.te.tcf.processes.ui.propertytester.process"
+ properties="isSystemRoot"
+ type="org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode">
+ </propertyTester>
+ </extension>
</plugin>
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/AdvancedPropertiesPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/AdvancedPropertiesPage.java
new file mode 100644
index 000000000..34d81e39c
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/AdvancedPropertiesPage.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tcf.processes.ui.internal.properties;
+
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.tcf.te.tcf.processes.ui.internal.tabbed.MapContentProvider;
+import org.eclipse.tcf.te.tcf.processes.ui.internal.tabbed.MapEntryLabelProvider;
+import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
+import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * The property page to display the advanced properties of a process context.
+ */
+public class AdvancedPropertiesPage extends PropertyPage {
+ // The properties map.
+ private Map<String, Object> properties;
+
+ // The table control to display the properties.
+ private TableViewer viewer;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ IAdaptable element = getElement();
+ Assert.isTrue(element instanceof ProcessTreeNode);
+
+ ProcessTreeNode node = (ProcessTreeNode) element;
+ properties = node.context.getProperties();
+
+ Composite page = new Composite(parent, SWT.NONE);
+ FillLayout layout = new FillLayout();
+ layout.marginHeight = 10;
+ layout.marginWidth = 10;
+ page.setLayout(layout);
+
+ viewer = new TableViewer(page, SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
+ Table table = viewer.getTable();
+ TableColumn column = new TableColumn(table, SWT.LEFT);
+ column.setText(Messages.AdvancedPropertiesSection_Name);
+ column.setWidth(100);
+ column = new TableColumn(table, SWT.LEFT);
+ column.setText(Messages.AdvancedPropertiesSection_Value);
+ column.setWidth(150);
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ viewer.setContentProvider(new MapContentProvider());
+ viewer.setLabelProvider(new MapEntryLabelProvider());
+ viewer.setInput(properties);
+
+ return page;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/ContextPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/ContextPage.java
new file mode 100644
index 000000000..4b4a0b107
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/ContextPage.java
@@ -0,0 +1,108 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tcf.processes.ui.internal.properties;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.services.ISysMonitor.SysMonitorContext;
+import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
+import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * The property page to display the context IDs of a process.
+ */
+public class ContextPage extends PropertyPage {
+
+ private SysMonitorContext context;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ IAdaptable element = getElement();
+ Assert.isTrue(element instanceof ProcessTreeNode);
+
+ ProcessTreeNode node = (ProcessTreeNode) element;
+ Composite page = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ page.setLayout(gridLayout);
+
+ context = node.context;
+ createField(Messages.ContextPage_File, context.getFile(), page);
+ createField(Messages.ContextPage_WorkHome, context.getCurrentWorkingDirectory(), page);
+ createField(Messages.ContextPage_Root, context.getRoot(), page);
+ createField(Messages.ContextPage_State, context.getState(), page);
+ createField(Messages.ContextPage_Group, context.getGroupName(), page);
+ createSeparator(page);
+ createField(Messages.ContextPage_ID, context.getID(), page);
+ createField(Messages.ContextPage_ParentID, context.getParentID(), page);
+ createField(Messages.ContextPage_GroupID, Long.valueOf(context.getPGRP()), page);
+ createField(Messages.ContextPage_PID, Long.valueOf(context.getPID()), page);
+ createField(Messages.ContextPage_PPID, Long.valueOf(context.getPPID()), page);
+ createField(Messages.ContextPage_TTYGRPID, Long.valueOf(context.getTGID()), page);
+ createField(Messages.ContextPage_TracerPID, Long.valueOf(context.getTracerPID()), page);
+ createField(Messages.ContextPage_UserID, Long.valueOf(context.getUID()), page);
+ createField(Messages.ContextPage_UserGRPID, Long.valueOf(context.getUGID()), page);
+ createSeparator(page);
+ createField(Messages.ContextPage_Virtual, Long.valueOf(context.getVSize()), page);
+ createField(Messages.ContextPage_Pages, Long.valueOf(context.getPSize()), page);
+ createField(Messages.ContextPage_Resident, Long.valueOf(context.getRSS()), page);
+
+ return page;
+ }
+ /**
+ * Create a horizontal separator between field sections.
+ *
+ * @param parent
+ * The parent composite of the separator.
+ */
+ protected void createSeparator(Composite parent) {
+ Label label = new Label(parent, SWT.SEPARATOR | SWT.SHADOW_ETCHED_IN | SWT.HORIZONTAL);
+ GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+ }
+ /**
+ * Create a field displaying the a specific value with a specific label.
+ *
+ * @param text
+ * The label text for the field.
+ * @param value
+ * The value to be displayed.
+ * @param parent
+ * The parent composite of the field.
+ */
+ protected void createField(String text, Object value, Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText(text);
+ GridData data = new GridData();
+ data.horizontalAlignment = SWT.LEFT;
+ data.verticalAlignment = SWT.TOP;
+ label.setLayoutData(data);
+ Text txt = new Text(parent, SWT.WRAP | SWT.READ_ONLY);
+ data = new GridData();
+ data.verticalAlignment = SWT.TOP;
+ data.widthHint = 300;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ txt.setLayoutData(data);
+ txt.setBackground(txt.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ txt.setText(value == null ? "" : value.toString()); //$NON-NLS-1$
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/GeneralInformationPage.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/GeneralInformationPage.java
new file mode 100644
index 000000000..33266e402
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/properties/GeneralInformationPage.java
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tcf.processes.ui.internal.properties;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
+import org.eclipse.tcf.te.tcf.processes.ui.nls.Messages;
+import org.eclipse.ui.dialogs.PropertyPage;
+
+/**
+ * The general information page of a process' properties dialog.
+ */
+public class GeneralInformationPage extends PropertyPage {
+
+ private ProcessTreeNode node;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.preference.PreferencePage#createContents(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected Control createContents(Composite parent) {
+ IAdaptable element = getElement();
+ Assert.isTrue(element instanceof ProcessTreeNode);
+
+ node = (ProcessTreeNode) element;
+ Composite page = new Composite(parent, SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2, false);
+ page.setLayout(gridLayout);
+
+ createField(Messages.GeneralInformationPage_Name, node.name, page);
+ createField(Messages.GeneralInformationPage_Type, node.type, page);
+ createField(Messages.GeneralInformationPage_State, node.state, page);
+ createField(Messages.GeneralInformationPage_User, node.username, page);
+ createSeparator(page);
+ createField(Messages.GeneralInformationPage_ProcessID, Long.valueOf(node.pid), page);
+ createField(Messages.GeneralInformationPage_ParentPID, Long.valueOf(node.ppid), page);
+ createField(Messages.GeneralInformationPage_InternalPID, node.id, page);
+ createField(Messages.GeneralInformationPage_InternalPPID, node.parentId, page);
+
+ return page;
+ }
+ /**
+ * Create a horizontal separator between field sections.
+ *
+ * @param parent
+ * The parent composite of the separator.
+ */
+ protected void createSeparator(Composite parent) {
+ Label label = new Label(parent, SWT.SEPARATOR | SWT.SHADOW_ETCHED_IN | SWT.HORIZONTAL);
+ GridData data = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+ data.horizontalSpan = 2;
+ label.setLayoutData(data);
+ }
+ /**
+ * Create a field displaying the a specific value with a specific label.
+ *
+ * @param text
+ * The label text for the field.
+ * @param value
+ * The value to be displayed.
+ * @param parent
+ * The parent composite of the field.
+ */
+ protected void createField(String text, Object value, Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label.setText(text);
+ GridData data = new GridData();
+ data.horizontalAlignment = SWT.LEFT;
+ data.verticalAlignment = SWT.TOP;
+ label.setLayoutData(data);
+ Text txt = new Text(parent, SWT.WRAP | SWT.READ_ONLY);
+ data = new GridData();
+ data.verticalAlignment = SWT.TOP;
+ data.widthHint = 300;
+ data.grabExcessHorizontalSpace = true;
+ data.horizontalAlignment = GridData.FILL;
+ txt.setLayoutData(data);
+ txt.setBackground(txt.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
+ txt.setText(value == null ? "" : value.toString()); //$NON-NLS-1$
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
index f2306082f..014568ec6 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/AdvancedPropertiesSection.java
@@ -14,11 +14,8 @@ import java.util.Map;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
@@ -66,38 +63,7 @@ public class AdvancedPropertiesSection extends AbstractPropertySection {
table.setLinesVisible(true);
viewer = new TableViewer(table);
viewer.setContentProvider(new MapContentProvider());
- viewer.setLabelProvider(new PropertyLabelProvider());
- }
-
- /**
- * The label provider to display the property and its value in the table.
- */
- class PropertyLabelProvider extends LabelProvider implements ITableLabelProvider {
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
- */
- @Override
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
- */
- @Override
- public String getColumnText(Object element, int columnIndex) {
- if(element instanceof String) {
- if(columnIndex == 0)
- return (String) element;
- Object object = properties.get(element);
- if(object == null)
- return ""; //$NON-NLS-1$
- return object.toString();
- }
- return null;
- }
+ viewer.setLabelProvider(new MapEntryLabelProvider());
}
/*
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapContentProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapContentProvider.java
index f835cd72c..5e7226299 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapContentProvider.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapContentProvider.java
@@ -43,7 +43,7 @@ public class MapContentProvider implements IStructuredContentProvider {
public Object[] getElements(Object inputElement) {
if(inputElement instanceof Map) {
Map<?, ?> map = (Map<?, ?>) inputElement;
- return map.keySet().toArray();
+ return map.entrySet().toArray();
}
return null;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapEntryLabelProvider.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapEntryLabelProvider.java
new file mode 100644
index 000000000..a0feb9d3f
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/tabbed/MapEntryLabelProvider.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tcf.processes.ui.internal.tabbed;
+
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * The label provider to provide texts and images of map entries.
+ */
+public class MapEntryLabelProvider extends LabelProvider implements ITableLabelProvider {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnImage(java.lang.Object, int)
+ */
+ @Override
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.jface.viewers.ITableLabelProvider#getColumnText(java.lang.Object, int)
+ */
+ @Override
+ public String getColumnText(Object element, int columnIndex) {
+ if(element instanceof Entry) {
+ Entry<?, ?> entry = (Entry<?, ?>) element;
+ if(columnIndex == 0) {
+ Object key = entry.getKey();
+ return key == null ? "" : key.toString(); //$NON-NLS-1$
+ }
+ Object object = entry.getValue();
+ return object == null ? "" : object.toString(); //$NON-NLS-1$
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/testers/ProcessPropertyTester.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/testers/ProcessPropertyTester.java
new file mode 100644
index 000000000..8d954fccd
--- /dev/null
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/internal/testers/ProcessPropertyTester.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.tcf.processes.ui.internal.testers;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.tcf.te.tcf.processes.ui.model.ProcessTreeNode;
+
+/**
+ * The property tester for a process tree node.
+ */
+public class ProcessPropertyTester extends PropertyTester {
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.core.expressions.IPropertyTester#test(java.lang.Object, java.lang.String, java.lang.Object[], java.lang.Object)
+ */
+ @Override
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if(receiver instanceof ProcessTreeNode) {
+ ProcessTreeNode node = (ProcessTreeNode) receiver;
+ if(property.equals("isSystemRoot")) { //$NON-NLS-1$
+ return "ProcRootNode".equals(node.type); //$NON-NLS-1$
+ }
+ }
+ return false;
+ }
+}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.java
index 8d583fe05..379f3cf4e 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.java
@@ -97,6 +97,40 @@ public class Messages extends NLS {
public static String ContextIDSection_UserGRPID;
public static String ContextIDSection_UserID;
+ public static String ContextPage_File;
+
+ public static String ContextPage_Group;
+
+ public static String ContextPage_GroupID;
+
+ public static String ContextPage_ID;
+
+ public static String ContextPage_Pages;
+
+ public static String ContextPage_ParentID;
+
+ public static String ContextPage_PID;
+
+ public static String ContextPage_PPID;
+
+ public static String ContextPage_Resident;
+
+ public static String ContextPage_Root;
+
+ public static String ContextPage_State;
+
+ public static String ContextPage_TracerPID;
+
+ public static String ContextPage_TTYGRPID;
+
+ public static String ContextPage_UserGRPID;
+
+ public static String ContextPage_UserID;
+
+ public static String ContextPage_Virtual;
+
+ public static String ContextPage_WorkHome;
+
public static String EditSpeedGradeDialog_DialogMessage;
public static String EditSpeedGradeDialog_DialogTitle;
public static String EditSpeedGradeDialog_GradeSameValue;
@@ -145,4 +179,20 @@ public class Messages extends NLS {
public static String DetachStep_error_getContext;
public static String DetachStep_error_detach;
public static String DetachStep_error_openChannel;
+
+ public static String GeneralInformationPage_InternalPID;
+
+ public static String GeneralInformationPage_InternalPPID;
+
+ public static String GeneralInformationPage_Name;
+
+ public static String GeneralInformationPage_ParentPID;
+
+ public static String GeneralInformationPage_ProcessID;
+
+ public static String GeneralInformationPage_State;
+
+ public static String GeneralInformationPage_Type;
+
+ public static String GeneralInformationPage_User;
}
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.properties
index 99a979320..f75d72677 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.processes.ui/src/org/eclipse/tcf/te/tcf/processes/ui/nls/Messages.properties
@@ -65,6 +65,23 @@ ContextIDSection_TracerPID=Tracer PID:
ContextIDSection_TTY_GRPID=TTY GRPID:
ContextIDSection_UserGRPID=User GRPID:
ContextIDSection_UserID=User ID:
+ContextPage_File=File:
+ContextPage_Group=Group:
+ContextPage_GroupID=Group ID:
+ContextPage_ID=ID:
+ContextPage_Pages=Pages:
+ContextPage_ParentID=Parent ID:
+ContextPage_PID=PID:
+ContextPage_PPID=PPID:
+ContextPage_Resident=Resident:
+ContextPage_Root=Root:
+ContextPage_State=State:
+ContextPage_TracerPID=Tracer PID:
+ContextPage_TTYGRPID=TTY Group ID:
+ContextPage_UserGRPID=User Group ID:
+ContextPage_UserID=User ID:
+ContextPage_Virtual=Virtual:
+ContextPage_WorkHome=Work Home:
EditSpeedGradeDialog_DialogMessage=Edit the data of the selected grade below:
EditSpeedGradeDialog_DialogTitle=Edit Grade
@@ -116,3 +133,11 @@ DetachStep_error_disconnect=Failed to detach from context: {0}
DetachStep_error_getContext=Failed to get context: {0}
DetachStep_error_detach=Failed to detach context: {0}
DetachStep_error_openChannel=Failed to open channel: {0}
+GeneralInformationPage_InternalPID=Internal PID:
+GeneralInformationPage_InternalPPID=Internal PPID:
+GeneralInformationPage_Name=Name:
+GeneralInformationPage_ParentPID=Parent PID:
+GeneralInformationPage_ProcessID=Process ID:
+GeneralInformationPage_State=State:
+GeneralInformationPage_Type=Type:
+GeneralInformationPage_User=User:

Back to the top