Issue #1298 Changes for non-blocking WrapLengthDialog.

Changes from reviewer's comments.
Fix merge conflict.

Change-Id: If31259188ff9fc1c84a02ca11399dd328dd669d4

Former-commit-id: 5f0a583d86 [formerly ab77dfa758] [formerly 66606f88de] [formerly 5f0a583d86 [formerly ab77dfa758] [formerly 66606f88de] [formerly e982c0f43a [formerly 66606f88de [formerly 50327729d4b0b135cf959a9093dc90a32cf091e6]]]]
Former-commit-id: e982c0f43a
Former-commit-id: 4f08c126b6 [formerly 3b07bb1ae6] [formerly bad97768d4ebf7b70752c8307f99e51df3dd9fe0 [formerly de21a3f2ef]]
Former-commit-id: 2f7bf56cdf35e135b2334c51978e89aa272307ed [formerly d9c7c4ae56]
Former-commit-id: 3bc3bf17fd
This commit is contained in:
Roger Ferrel 2012-11-09 16:02:11 -06:00
parent 9fe8203d77
commit 25370d4e80
2 changed files with 24 additions and 13 deletions

View file

@ -142,6 +142,7 @@ import com.raytheon.viz.ui.dialogs.ICloseCallback;
* 07 Nov 2012 1298 rferrel Changes for non-blocking CallToActionsDlg.
* Changes for non-blocking FindReplaceDlg.
* Changes for non-blocking StoreTransmitDlg.
* Changes for non-blocking WrapLengthDialog.
*
* </pre>
*
@ -866,14 +867,27 @@ public class ProductEditorComp extends Composite implements
wrapLengthMI.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
WrapLengthDialog wrapLengthDialog = new WrapLengthDialog(
// The dialog being opened is modal to the parent dialog. This
// will prevent the launching of another dialog until the modal
// dialog is closed.
final WrapLengthDialog wrapLengthDialog = new WrapLengthDialog(
getShell());
wrapLengthDialog.setWrapLength(wrapColumn);
int result = wrapLengthDialog.open();
if (result == Window.OK) {
wrapColumn = wrapLengthDialog.getWrapLength();
textComp.setWrapColumn(wrapColumn);
}
wrapLengthDialog.setBlockOnOpen(false);
wrapLengthDialog.setCloseCallback(new ICloseCallback() {
@Override
public void dialogClosed(Object returnValue) {
if (returnValue instanceof Integer) {
int result = (Integer) returnValue;
if (result == Window.OK) {
wrapColumn = wrapLengthDialog.getWrapLength();
textComp.setWrapColumn(wrapColumn);
}
}
}
});
wrapLengthDialog.open();
}
});
}

View file

@ -41,6 +41,7 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 27, 2010 wldougher Initial creation
* Nov 09, 2012 1298 rferrel Code clean up for non-blocking dialog.
*
* </pre>
*
@ -49,11 +50,11 @@ import com.raytheon.viz.ui.dialogs.CaveJFACEDialog;
*/
public class WrapLengthDialog extends CaveJFACEDialog {
private static final int MAX_COLUMNS = 255;
private final int MAX_COLUMNS = 255;
private static final int MIN_COLUMNS = 15;
private final int MIN_COLUMNS = 15;
private static final String MESSAGE = "Current Wrap Length: %d\n"
private final String MESSAGE = "Current Wrap Length: %d\n"
+ "Enter new Wrap Length";
protected Label notice;
@ -66,10 +67,6 @@ public class WrapLengthDialog extends CaveJFACEDialog {
super(parentShell);
}
protected WrapLengthDialog(Shell parentShell, boolean perspectiveSpecific) {
super(parentShell, perspectiveSpecific);
}
/**
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets
* .Composite)