summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Zarna2013-05-27 16:28:54 (EDT)
committerGerrit Code Review @ Eclipse.org2013-10-03 09:47:33 (EDT)
commit0c7cf9aa265b2b67aacaac0e262f5f0fdf7509ef (patch)
tree17b421eab95b6a0969ae2519954287aed572a741
parentbbed1fa2ac96a0add04439fcacbc5eed153553d7 (diff)
downloadorg.eclipse.mylyn.reviews-0c7cf9aa265b2b67aacaac0e262f5f0fdf7509ef.zip
org.eclipse.mylyn.reviews-0c7cf9aa265b2b67aacaac0e262f5f0fdf7509ef.tar.gz
org.eclipse.mylyn.reviews-0c7cf9aa265b2b67aacaac0e262f5f0fdf7509ef.tar.bz2
408767: add inline comment dialog should be non-modal and resizablerefs/changes/47/13247/9
Bug: 408767 Change-Id: Ic07b9dfd3c1cc621832be59cf6d1b0d199ccf75f Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=408767 Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/Messages.java4
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/actions/AddLineCommentToFileAction.java2
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java22
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/messages.properties2
4 files changed, 23 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/Messages.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/Messages.java
index 44fece8..b31a781 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/Messages.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/Messages.java
@@ -16,6 +16,10 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.internal.reviews.ui.messages"; //$NON-NLS-1$
+ public static String Reviews_AddCommentDialog_Title;
+
+ public static String Reviews_AddCommentDialog_Message;
+
public static String Reviews_GeneralCommentsText;
public static String Reviews_RetrievingContents;
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/actions/AddLineCommentToFileAction.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/actions/AddLineCommentToFileAction.java
index 339860a..0faaf5e 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/actions/AddLineCommentToFileAction.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/actions/AddLineCommentToFileAction.java
@@ -90,7 +90,7 @@ public class AddLineCommentToFileAction extends AbstractReviewAction {
}
protected LineRange getSelectedRange() {
- //if its the action from the compareeditor, get currently selected lines
+ //if its the action from the compare editor, get currently selected lines
if (compareSourceViewer != null) {
return compareSourceViewer.getSelection();
} else {
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
index 58c1505..75d94ee 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/AddCommentDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011 Tasktop Technologies and others.
+ * Copyright (c) 2011, 2013 Tasktop Technologies and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,10 +17,12 @@ import java.util.concurrent.atomic.AtomicReference;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.mylyn.commons.workbench.editors.CommonTextSupport;
+import org.eclipse.mylyn.internal.reviews.ui.Messages;
import org.eclipse.mylyn.internal.reviews.ui.ReviewsUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.internal.tasks.ui.editors.RichTextEditor;
@@ -40,6 +42,7 @@ import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.TasksUi;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorExtension;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.FocusEvent;
import org.eclipse.swt.events.FocusListener;
@@ -118,7 +121,7 @@ public class AddCommentDialog extends ProgressDialog {
} catch (InvocationTargetException e) {
StatusManager.getManager().handle(
new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID,
- "Unexpected error during execution of operation", e),
+ "Unexpected error during execution of operation", e), //$NON-NLS-1$
StatusManager.SHOW | StatusManager.LOG);
} catch (InterruptedException e) {
// cancelled
@@ -162,14 +165,15 @@ public class AddCommentDialog extends ProgressDialog {
@Override
protected Control createDialogArea(Composite parent) {
toolkit = new FormToolkit(TasksUiPlugin.getDefault().getFormColors(parent.getDisplay()));
- Control control = super.createDialogArea(parent);
- return control;
+ return super.createDialogArea(parent);
}
@Override
protected Control createPageControls(Composite parent) {
- setTitle("Add Comment");
- setMessage("");
+ getShell().setText(Messages.Reviews_AddCommentDialog_Title);
+ setTitle(Messages.Reviews_AddCommentDialog_Title);
+ setMessage(NLS.bind(Messages.Reviews_AddCommentDialog_Message, new Path(item.getName()).lastSegment(),
+ location.getIndex()));
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(1, false));
@@ -210,4 +214,10 @@ public class AddCommentDialog extends ProgressDialog {
return editor;
}
+
+ @Override
+ protected void setShellStyle(int newShellStyle) {
+ super.setShellStyle(SWT.CLOSE | SWT.MODELESS | SWT.BORDER | SWT.TITLE | SWT.RESIZE);
+ setBlockOnOpen(false);
+ }
}
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/messages.properties b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/messages.properties
index 185df35..f747276 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/messages.properties
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/messages.properties
@@ -1,3 +1,5 @@
+Reviews_AddCommentDialog_Title=Add Comment
+Reviews_AddCommentDialog_Message={0} line {1}
Reviews_GeneralCommentsText=Global
Reviews_RetrievingContents=[Retrieving contents...]
Reviews_RetrievingDetails=[Retrieving details...]