Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/model/VirtualCopyToClipboardActionDelegate.java19
1 files changed, 17 insertions, 2 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 be623e7d4..688ac3f63 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
@@ -144,8 +144,8 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
String[] labels = (String[]) item.getData(VirtualItem.LABEL_KEY);
if(labels != null && labels.length > 0) {
for (int i = 0; i < labels.length; i++) {
- String text = labels[i];
- if(text != null && !text.trim().equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
+ String text = trimLabel(labels[i]);
+ if (text != null && !text.equals(IInternalDebugCoreConstants.EMPTY_STRING)) {
buffer.append(text+TAB);
}
}
@@ -153,6 +153,21 @@ public class VirtualCopyToClipboardActionDelegate extends AbstractDebugActionDel
}
}
+ /**
+ * Trims the given String. Subclasses might want to cut off additional
+ * things from the given label retrieved by the label provider by overriding
+ * this method.
+ *
+ * @param label the label that should be trimmed (might be null)
+ * @return the trimmed label or null if label is null
+ */
+ protected String trimLabel(String label) {
+ if (label == null) {
+ return null;
+ }
+ return label.trim();
+ }
+
private class ItemsToCopyVirtualItemValidator implements IVirtualItemValidator {
Set<VirtualItem> fItemsToCopy = Collections.EMPTY_SET;

Back to the top