Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/ProcessPropertyPage.java77
1 files changed, 76 insertions, 1 deletions
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 019ee9d3e..f0351d7b9 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
@@ -1 +1,76 @@
-package org.eclipse.debug.internal.ui.preferences; /********************************************************************** Copyright (c) 2000, 2002 IBM Corp. All rights reserved. This file is made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html **********************************************************************/ import org.eclipse.debug.core.model.IDebugTarget; import org.eclipse.debug.core.model.IProcess; import org.eclipse.swt.SWT; import org.eclipse.swt.graphics.Font; 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.ui.dialogs.PropertyPage; public class ProcessPropertyPage extends PropertyPage { /** * Constructor for ProcessPropertyPage */ public ProcessPropertyPage() { super(); } /** * @see PreferencePage#createContents(Composite) */ protected Control createContents(Composite ancestor) { Font font = ancestor.getFont(); noDefaultAndApplyButton(); Composite parent= new Composite(ancestor, SWT.NULL); GridLayout layout= new GridLayout(); layout.numColumns= 2; parent.setLayout(layout); Label l1= new Label(parent, SWT.NULL); l1.setText(DebugPreferencesMessages.getString("ProcessPropertyPage.Command_Line__1")); //$NON-NLS-1$ GridData gd= new GridData(); gd.verticalAlignment= GridData.BEGINNING; l1.setLayoutData(gd); l1.setFont(font); Text l2= new Text(parent, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY); gd= new GridData(GridData.FILL_HORIZONTAL); gd.widthHint= convertWidthInCharsToPixels(80); gd.heightHint= convertHeightInCharsToPixels(15); l2.setLayoutData(gd); l2.setFont(font); initCommandLineLabel(l2); return parent; } private void initCommandLineLabel(Text l) { Object o= getElement(); if (o instanceof IDebugTarget) o= ((IDebugTarget)o).getProcess(); if (o instanceof IProcess) { IProcess process= (IProcess)o; String cmdLine= process.getAttribute(IProcess.ATTR_CMDLINE); if (cmdLine != null) l.setText(cmdLine); } } } \ No newline at end of file
+/*******************************************************************************
+ * Copyright (c) 2000, 2003 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.preferences;
+
+
+import org.eclipse.debug.core.model.IDebugTarget;
+import org.eclipse.debug.core.model.IProcess;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+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.ui.dialogs.PropertyPage;
+
+public class ProcessPropertyPage extends PropertyPage {
+
+ /**
+ * Constructor for ProcessPropertyPage
+ */
+ public ProcessPropertyPage() {
+ super();
+ }
+
+ /**
+ * @see PreferencePage#createContents(Composite)
+ */
+ protected Control createContents(Composite ancestor) {
+ Font font = ancestor.getFont();
+ noDefaultAndApplyButton();
+
+ Composite parent= new Composite(ancestor, SWT.NULL);
+ GridLayout layout= new GridLayout();
+ layout.numColumns= 2;
+ parent.setLayout(layout);
+
+ Label l1= new Label(parent, SWT.NULL);
+ l1.setText(DebugPreferencesMessages.getString("ProcessPropertyPage.Command_Line__1")); //$NON-NLS-1$
+
+ GridData gd= new GridData();
+ gd.verticalAlignment= GridData.BEGINNING;
+ l1.setLayoutData(gd);
+ l1.setFont(font);
+ Text l2= new Text(parent, SWT.WRAP | SWT.BORDER | SWT.V_SCROLL | SWT.READ_ONLY);
+ gd= new GridData(GridData.FILL_HORIZONTAL);
+ gd.widthHint= convertWidthInCharsToPixels(80);
+ gd.heightHint= convertHeightInCharsToPixels(15);
+ l2.setLayoutData(gd);
+ l2.setFont(font);
+ initCommandLineLabel(l2);
+
+ return parent;
+ }
+
+ private void initCommandLineLabel(Text l) {
+ Object o= getElement();
+ if (o instanceof IDebugTarget)
+ o= ((IDebugTarget)o).getProcess();
+ if (o instanceof IProcess) {
+ IProcess process= (IProcess)o;
+ String cmdLine= process.getAttribute(IProcess.ATTR_CMDLINE);
+ if (cmdLine != null)
+ l.setText(cmdLine);
+ }
+ }
+}

Back to the top