Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPawel Piech2012-10-08 18:39:59 +0000
committerPawel Piech2012-10-08 18:39:59 +0000
commit8a127c21baa725d357936a29c926bba2e0fb418d (patch)
treeeeb12f3cfccb93d81271a3ae69718ac1efc548c6
parentd6a02af9bf146e8096b0ba5fea9b022946f12e69 (diff)
downloadeclipse.platform.debug-8a127c21baa725d357936a29c926bba2e0fb418d.tar.gz
eclipse.platform.debug-8a127c21baa725d357936a29c926bba2e0fb418d.tar.xz
eclipse.platform.debug-8a127c21baa725d357936a29c926bba2e0fb418d.zip
Bug 386097 - [debug view] Cannot copy stack trace with "Show Qualified Names" option enabledv20121008-183959I20121009-0800
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java47
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java55
2 files changed, 48 insertions, 54 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
index bc8dd76ad..956cb4f0d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java
@@ -34,7 +34,8 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem.Index;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
-import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
+import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugView;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -150,33 +151,19 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
private IPresentationContext makeVirtualPresentationContext(final IPresentationContext clientViewerContext) {
- return new PresentationContext(clientViewerContext.getId()) {
- {
- String[] clientProperties = clientViewerContext.getProperties();
- for (int i = 0; i < clientProperties.length; i++) {
- setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
- }
-
- }
-
- public String[] getColumns() {
- String[] clientColumns = super.getColumns();
-
- if (clientColumns == null || clientColumns.length == 0) {
- // No columns are used.
- return null;
- }
-
- // Try to find the name column.
- for (int i = 0; i < clientColumns.length; i++) {
- if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
- return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
- }
- }
-
- return new String[] { clientColumns[0] };
- }
- };
+ PresentationContext context = null;
+ if (clientViewerContext instanceof DebugModelPresentationContext) {
+ IDebugModelPresentation presentation =
+ ((DebugModelPresentationContext)clientViewerContext).getModelPresentation();
+ context = new DebugModelPresentationContext(clientViewerContext.getId(), null, presentation);
+ } else {
+ context = new PresentationContext(clientViewerContext.getId());
+ }
+ String[] clientProperties = clientViewerContext.getProperties();
+ for (int i = 0; i < clientProperties.length; i++) {
+ context.setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
+ }
+ return context;
}
private class ItemsToCopyVirtualItemValidator implements IVirtualItemValidator {
@@ -217,6 +204,10 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
virtualViewer.addLabelUpdateListener(listener);
virtualViewer.getTree().addItemListener(listener);
virtualViewer.setInput(input);
+ if (virtualViewer.canToggleColumns()) {
+ virtualViewer.setShowColumns(clientViewer.isShowColumns());
+ virtualViewer.setVisibleColumns(clientViewer.getPresentationContext().getColumns());
+ }
virtualViewer.updateViewer(stateDelta);
// Parse selected items from client viewer and add them to the virtual viewer selection.
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
index a7f0007bf..3fee8e5c6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualFindAction.java
@@ -37,6 +37,8 @@ import org.eclipse.debug.internal.ui.viewers.model.provisional.PresentationConte
import org.eclipse.debug.internal.ui.viewers.model.provisional.TreeModelViewer;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualItem;
import org.eclipse.debug.internal.ui.viewers.model.provisional.VirtualTreeModelViewer;
+import org.eclipse.debug.internal.ui.views.DebugModelPresentationContext;
+import org.eclipse.debug.ui.IDebugModelPresentation;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
@@ -165,40 +167,41 @@ public class VirtualFindAction extends Action implements IUpdate {
fVirtualViewer.setInput(input);
if (fVirtualViewer.canToggleColumns()) {
fVirtualViewer.setShowColumns(clientViewer.isShowColumns());
+ fVirtualViewer.setVisibleColumns(getColumnIds(clientViewer.getPresentationContext()));
}
fVirtualViewer.updateViewer(stateDelta);
return fVirtualViewer;
}
- private IPresentationContext makeVirtualPresentationContext(final IPresentationContext clientViewerContext) {
- return new PresentationContext(clientViewerContext.getId()) {
-
- {
- String[] clientProperties = clientViewerContext.getProperties();
- for (int i = 0; i < clientProperties.length; i++) {
- setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
- }
-
- }
+ private IPresentationContext makeVirtualPresentationContext(IPresentationContext clientViewerContext) {
+ PresentationContext context = null;
+ if (clientViewerContext instanceof DebugModelPresentationContext) {
+ IDebugModelPresentation presentation =
+ ((DebugModelPresentationContext)clientViewerContext).getModelPresentation();
+ context = new DebugModelPresentationContext(clientViewerContext.getId(), null, presentation);
+ } else {
+ context = new PresentationContext(clientViewerContext.getId());
+ }
+ String[] clientProperties = clientViewerContext.getProperties();
+ for (int i = 0; i < clientProperties.length; i++) {
+ context.setProperty(clientProperties[i], clientViewerContext.getProperty(clientProperties[i]));
+ }
+ return context;
+ }
+
+ private String[] getColumnIds(IPresentationContext clientViewerContext) {
+ String[] clientColumns = clientViewerContext.getColumns();
+ if (clientColumns != null && clientColumns.length != 0) {
- public String[] getColumns() {
- String[] clientColumns = super.getColumns();
-
- if (clientColumns == null || clientColumns.length == 0) {
- // No columns are used.
- return null;
+ // Try to find the name column.
+ for (int i = 0; i < clientColumns.length; i++) {
+ if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
+ return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
}
-
- // Try to find the name column.
- for (int i = 0; i < clientColumns.length; i++) {
- if (IDebugUIConstants.COLUMN_ID_VARIABLE_NAME.equals(clientColumns[i])) {
- return new String[] { IDebugUIConstants.COLUMN_ID_VARIABLE_NAME };
- }
- }
-
- return new String[] { clientColumns[0] };
}
- };
+ return new String[] { clientColumns[0] };
+ }
+ return null;
}
public void run() {

Back to the top