Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Keller2012-10-10 13:14:53 +0000
committerMarkus Keller2012-10-10 13:14:53 +0000
commita68f972007c011994af90bf8a7a9f1b81616f306 (patch)
treef90e7daa1dddfc190c94a695662ff93f0b86d263
parent93b068c839132926a06535deffa61e49f1756b50 (diff)
downloadeclipse.platform.debug-a68f972007c011994af90bf8a7a9f1b81616f306.tar.gz
eclipse.platform.debug-a68f972007c011994af90bf8a7a9f1b81616f306.tar.xz
eclipse.platform.debug-a68f972007c011994af90bf8a7a9f1b81616f306.zip
Bug 387504 - Bugs in program argument parsing (compared to command line)
-rwxr-xr-xorg.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java23
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java17
2 files changed, 32 insertions, 8 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java
index 89ce8e033..618c247d3 100755
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/SWTFactory.java
@@ -17,6 +17,7 @@ import org.eclipse.jface.layout.PixelConverter;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.custom.ViewForm;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
@@ -383,6 +384,28 @@ public class SWTFactory {
}
/**
+ * Creates a new styled text widget
+ * @param parent the parent composite to add this styled text widget to
+ * @param style the style bits for the styled text widget
+ * @param hspan the horizontal span to take up on the parent composite
+ * @param width the desired width of the styled text widget
+ * @param height the desired height of the styled text widget
+ * @param fill the fill style for the widget
+ * @return the new styled text widget
+ * @since 3.9
+ */
+ public static StyledText createStyledText(Composite parent, int style, int hspan, int width, int height, int fill) {
+ StyledText t = new StyledText(parent, style);
+ t.setFont(parent.getFont());
+ GridData gd = new GridData(fill);
+ gd.horizontalSpan = hspan;
+ gd.widthHint = width;
+ gd.heightHint = height;
+ t.setLayoutData(gd);
+ return t;
+ }
+
+ /**
* Creates a new text widget
* @param parent the parent composite to add this text widget to
* @param style the style bits for the text widget
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
index 4e42fc0b6..6dfe43554 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java
@@ -24,8 +24,9 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SegmentEvent;
-import org.eclipse.swt.events.SegmentListener;
+import org.eclipse.swt.custom.BidiSegmentEvent;
+import org.eclipse.swt.custom.BidiSegmentListener;
+import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
@@ -83,14 +84,14 @@ public class ProcessPropertyPage extends PropertyPage {
//create command line section
SWTFactory.createLabel(parent, DebugPreferencesMessages.ProcessPropertyPage_Command_Line__1, fHeadingFont, 1);
- text = SWTFactory.createText(parent,
+ StyledText styledText = SWTFactory.createStyledText(parent,
SWT.WRAP | SWT.READ_ONLY | SWT.BORDER | SWT.V_SCROLL,
1,
convertWidthInCharsToPixels(13),
convertHeightInCharsToPixels(10),
GridData.FILL_BOTH);
- text.setBackground(parent.getBackground());
- ((GridData)text.getLayoutData()).horizontalIndent = 10;
+ styledText.setBackground(parent.getBackground());
+ ((GridData)styledText.getLayoutData()).horizontalIndent = 10;
String commandLineText = getCommandLineText(proc);
if (commandLineText != null) {
String[] arguments = DebugPlugin.parseArguments(commandLineText);
@@ -103,14 +104,14 @@ public class ProcessPropertyPage extends PropertyPage {
commandLineText = DebugPlugin.renderArguments(arguments, segments);
- text.addSegmentListener(new SegmentListener() {
- public void getSegments(SegmentEvent event) {
+ styledText.addBidiSegmentListener(new BidiSegmentListener() {
+ public void lineGetSegments(BidiSegmentEvent event) {
event.segments = segments;
event.segmentsChars = chars;
}
});
}
- text.setText(commandLineText);
+ styledText.setText(commandLineText);
}
//create environment section

Back to the top