Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2014-08-14 20:45:18 -0400
committerSam Davis2014-08-18 20:09:31 -0400
commitdb2da8bfed93a729949b060617d40db1e4be2eed (patch)
tree4626d0a47b95e4cb07efaa6187cba9273ef460e6 /org.eclipse.mylyn.reviews.ui/src
parente3bf535045b57df0d669deeb30bb62807ad0f0cc (diff)
downloadorg.eclipse.mylyn.reviews-db2da8bfed93a729949b060617d40db1e4be2eed.tar.gz
org.eclipse.mylyn.reviews-db2da8bfed93a729949b060617d40db1e4be2eed.tar.xz
org.eclipse.mylyn.reviews-db2da8bfed93a729949b060617d40db1e4be2eed.zip
440821: make dialog modeless on all platforms
Change-Id: I289dd43bf88164f50be9cf39bdc826976a083325 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440821
Diffstat (limited to 'org.eclipse.mylyn.reviews.ui/src')
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java4
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/messages.properties2
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/CommentInputDialog.java30
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/Messages.java4
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/messages.properties2
5 files changed, 5 insertions, 37 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
index ab27ca9e..2302b279 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialog.java
@@ -15,6 +15,7 @@ package org.eclipse.mylyn.internal.reviews.ui.annotations;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.PopupDialog;
import org.eclipse.jface.layout.GridDataFactory;
@@ -257,7 +258,8 @@ public class CommentPopupDialog extends PopupDialog implements IReviewActionList
currentCommentInputDialog.setComments(commentList);
currentCommentInputDialog.create();
currentCommentInputDialog.getShell().setText(
- NLS.bind(Messages.CommentInputDialog_LineNumber, getLineNumber()));
+ NLS.bind(Messages.CommentInputDialog_LineNumber, getLineNumber(),
+ new Path(reviewitem.getName()).lastSegment()));
// adjust size to display maximum of 15 lines, which means 5 comments
if (annotationInput.getAnnotations().size() < 5) {
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/messages.properties b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/messages.properties
index f7eb4899..9e49b73a 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/messages.properties
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/messages.properties
@@ -10,5 +10,5 @@
###############################################################################
CommentAnnotation_X_dash_Y={0} - {1}
CommentAnnotationHover_Multiple_comments=There are multiple comments on this line
-CommentInputDialog_LineNumber=Comments for line {0}
+CommentInputDialog_LineNumber=Comments for line {0} of {1}
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/CommentInputDialog.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/CommentInputDialog.java
index 3109ad1f..19cd07f4 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/CommentInputDialog.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/CommentInputDialog.java
@@ -21,7 +21,6 @@ import java.util.concurrent.atomic.AtomicReference;
import org.apache.commons.lang.StringUtils;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -54,8 +53,6 @@ import org.eclipse.swt.events.ControlAdapter;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellAdapter;
-import org.eclipse.swt.events.ShellEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -111,15 +108,11 @@ public class CommentInputDialog extends FormDialog {
private Composite buttonparent;
- private Composite buttonBarParent;
-
private final Shell parent;
public CommentInputDialog(Shell aParentShell, ReviewBehavior reviewBehavior, IReviewItem reviewitm, LineRange range) {
super(aParentShell);
- if (!isWindowPlatform()) {
- setShellStyle(SWT.MODELESS | SWT.SHELL_TRIM | SWT.BORDER);
- }
+ setShellStyle(SWT.CLOSE | SWT.TITLE | SWT.RESIZE | SWT.MODELESS);
this.reviewBehavior = reviewBehavior;
this.reviewitem = reviewitm;
this.range = range;
@@ -127,10 +120,6 @@ public class CommentInputDialog extends FormDialog {
}
- private boolean isWindowPlatform() {
- return Platform.getOS().equals(Platform.WS_WIN32);
- }
-
@Override
protected IDialogSettings getDialogBoundsSettings() {
IDialogSettings settings = ReviewsUiPlugin.getDefault().getDialogSettings();
@@ -387,21 +376,6 @@ public class CommentInputDialog extends FormDialog {
//Set default focus
fCommentInputTextField.setFocus();
- if (!isWindowPlatform()) {
- getShell().addShellListener(new ShellAdapter() {
- @Override
- public void shellDeactivated(ShellEvent e) {
- boolean isExit = MessageDialog.openQuestion(getShell(),
- Messages.CommentInputDialog_ConfirmExitCaption, Messages.CommentInputDialog_ConfirmExit);
- if (isExit) {
- buttonPressed(IDialogConstants.CANCEL_ID);
- } else {
- getShell().setFocus();
- }
- }
- });
- }
-
this.setHelpAvailable(false);
}
@@ -409,8 +383,6 @@ public class CommentInputDialog extends FormDialog {
@Override
protected Control createButtonBar(final Composite parent) {
final Composite composite = new Composite(parent, SWT.NONE);
- buttonBarParent = parent;
-
GridLayoutFactory.fillDefaults().spacing(0, 0).applyTo(composite);
composite.setLayoutData(new GridData(SWT.LEFT, SWT.BOTTOM, true, false));
composite.setFont(parent.getFont());
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/Messages.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/Messages.java
index 93a68212..e8d10691 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/Messages.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/Messages.java
@@ -41,10 +41,6 @@ public class Messages extends NLS {
public static String CommentInputDialog_No_author;
- public static String CommentInputDialog_ConfirmExit;
-
- public static String CommentInputDialog_ConfirmExitCaption;
-
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/messages.properties b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/messages.properties
index 548bdfb8..4d9af145 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/messages.properties
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/dialogs/messages.properties
@@ -19,5 +19,3 @@ ReviewsCommentToolTip=The Comment Description
CommandServerOperation=Performing server operation...
CommentInputDialog_ServerError=Server Connection Error
CommentInputDialog_No_author=(no author)
-CommentInputDialog_ConfirmExit=Do you want to exit the dialog ?
-CommentInputDialog_ConfirmExitCaption=Confirm exit

Back to the top