Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Stieber2014-01-09 13:30:49 +0000
committerUwe Stieber2014-01-10 08:25:14 +0000
commit563c3129dbe9697ba1ee4361f6bb19a1d2e2ea9b (patch)
treeecf64d33fd35ab1fde303996a6f6256ac0ba50a9 /target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui
parent4301ae02686e95d0ad03e3a211ae65ec975d5c94 (diff)
downloadorg.eclipse.tcf-563c3129dbe9697ba1ee4361f6bb19a1d2e2ea9b.tar.gz
org.eclipse.tcf-563c3129dbe9697ba1ee4361f6bb19a1d2e2ea9b.tar.xz
org.eclipse.tcf-563c3129dbe9697ba1ee4361f6bb19a1d2e2ea9b.zip
Target Explorer: Support filtering of auto generated path map rules from the path map table
Diffstat (limited to 'target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui')
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java54
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java1
-rw-r--r--target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties1
3 files changed, 56 insertions, 0 deletions
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
index d7f0bda3a..e3cef868d 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/editor/tabs/PathMapTab.java
@@ -11,7 +11,17 @@ package org.eclipse.tcf.te.tcf.launch.ui.editor.tabs;
import java.util.List;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab;
import org.eclipse.tcf.services.IPathMap;
import org.eclipse.tcf.te.launch.core.persistence.launchcontext.LaunchContextsPersistenceDelegate;
@@ -30,6 +40,8 @@ public class PathMapTab extends TCFPathMapTab {
// Reference to the parent editor page
private final AbstractTcfLaunchTabContainerEditorPage parentEditorPage;
+ /* default */ Button showAutoGeneratedRules;
+
/**
* Constructor
*
@@ -85,6 +97,48 @@ public class PathMapTab extends TCFPathMapTab {
}
/* (non-Javadoc)
+ * @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#createCustomControls(org.eclipse.swt.widgets.Composite)
+ */
+ @Override
+ protected void createCustomControls(Composite parent) {
+ Assert.isNotNull(parent);
+ super.createCustomControls(parent);
+
+ // Add a "[ ] Show all" to the bottom of the page
+ showAutoGeneratedRules = new Button(parent, SWT.CHECK);
+ showAutoGeneratedRules.setText(Messages.PathMapEditorPage_showAll_label);
+ showAutoGeneratedRules.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+ showAutoGeneratedRules.addSelectionListener(new SelectionAdapter() {
+ @SuppressWarnings("synthetic-access")
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ if (getViewer() != null) getViewer().refresh();
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#configureTableViewer(org.eclipse.jface.viewers.CheckboxTableViewer)
+ */
+ @Override
+ protected void configureTableViewer(CheckboxTableViewer viewer) {
+ Assert.isNotNull(viewer);
+ super.configureTableViewer(viewer);
+
+ // Add a filter filtering out the generated mappings if "Show all" is not checked
+ viewer.addFilter(new ViewerFilter() {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (showAutoGeneratedRules != null && !showAutoGeneratedRules.isDisposed() && !showAutoGeneratedRules.getSelection() && element instanceof IPathMap.PathMapRule) {
+ IPathMap.PathMapRule rule = (IPathMap.PathMapRule) element;
+ return rule.getProperties().get(PROP_GENERATED) == null || !((Boolean)rule.getProperties().get(PROP_GENERATED)).booleanValue();
+ }
+ return true;
+ }
+ });
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.tcf.internal.debug.ui.launch.TCFPathMapTab#initializePathMap(java.util.List, org.eclipse.debug.core.ILaunchConfiguration)
*/
@Override
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
index 45d214b9c..cd27bdf70 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.java
@@ -98,6 +98,7 @@ public class Messages extends NLS {
public static String PathMapEditorPage_name;
public static String PathMapEditorPage_error_apply;
public static String PathMapEditorPage_error_title;
+ public static String PathMapEditorPage_showAll_label;
public static String SourceLookupEditorPage_name;
diff --git a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
index 6d498ba1b..b44b8c341 100644
--- a/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
+++ b/target_explorer/plugins/org.eclipse.tcf.te.tcf.launch.ui/src/org/eclipse/tcf/te/tcf/launch/ui/nls/Messages.properties
@@ -39,6 +39,7 @@ LaunchConfigurationAdvancedTabSection_lineseparator_cr=CR
PathMapEditorPage_name=Object Paths
PathMapEditorPage_error_apply=Failed to update object paths for configuration ''{0}''.\n\nPossible cause:\n{1}
PathMapEditorPage_error_title=Error
+PathMapEditorPage_showAll_label=Show auto-generated path map rules
SourceLookupEditorPage_name=Source Paths

Back to the top