Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2001-11-22 21:41:31 +0000
committerjames2001-11-22 21:41:31 +0000
commit79487a49b38b74f17f8ca3f11f4d1ee42676fc3a (patch)
treef9c15b06ef3e8309ea931b5a5e164a335a557f5c /bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
parent44bef0be945bba181d0dc3fd9577971f1e21e489 (diff)
downloadeclipse.platform.team-79487a49b38b74f17f8ca3f11f4d1ee42676fc3a.tar.gz
eclipse.platform.team-79487a49b38b74f17f8ca3f11f4d1ee42676fc3a.tar.xz
eclipse.platform.team-79487a49b38b74f17f8ca3f11f4d1ee42676fc3a.zip
InitialV2_0_0
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java')
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java91
1 files changed, 91 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
new file mode 100644
index 000000000..fc2f700c0
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ReleaseCommentDialog.java
@@ -0,0 +1,91 @@
+package org.eclipse.team.internal.ccvs.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2001.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.swt.SWT;
+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.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Prompts the user for a multi-line comment for releasing to CVS.
+ */
+public class ReleaseCommentDialog extends Dialog {
+ private static final int WIDTH_HINT = 350;
+ private static final int HEIGHT_HINT = 50;
+
+ private String comment = "";
+
+ private Text text;
+
+ /**
+ * ReleaseCommentDialog constructor.
+ *
+ * @param parentShell the parent of this dialog
+ */
+ public ReleaseCommentDialog(Shell parentShell) {
+ super(parentShell);
+ }
+ /*
+ * @see Dialog#createDialogArea(Composite)
+ */
+ protected Control createDialogArea(Composite parent) {
+ getShell().setText(Policy.bind("ReleaseCommentDialog.title"));
+ Composite composite = new Composite(parent, SWT.NULL);
+ composite.setLayout(new GridLayout());
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ Label label = new Label(composite, SWT.NULL);
+ label.setLayoutData(new GridData());
+ label.setText(Policy.bind("ReleaseCommentDialog.enterComment"));
+
+ text = new Text(composite, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.widthHint = WIDTH_HINT;
+ data.heightHint = HEIGHT_HINT;
+ text.setLayoutData(data);
+ text.setText(comment);
+ text.selectAll();
+/* text.addListener(SWT.KeyDown, new Listener() {
+ public void handleEvent(Event e) {
+ if (((e.stateMask & SWT.CTRL) != 0) && (e.character == '\n')) {
+ okPressed();
+ }
+ }
+ });*/
+ return composite;
+ }
+ /**
+ * Return the entered comment
+ *
+ * @return the comment
+ */
+ public String getComment() {
+ return comment;
+ }
+ /**
+ * Set the initial comment
+ *
+ * @param comment the initial comment
+ */
+ public void setComment(String comment) {
+ this.comment = comment;
+ }
+ /*
+ * @see Dialog#okPressed
+ */
+ protected void okPressed() {
+ comment = text.getText();
+ super.okPressed();
+ }
+}

Back to the top