Merge "Issue #1298 Changes for non-blocking WrapLengthDialog. Changes from reviewer's comments. Fix merge conflict." into development
Former-commit-id: 46fbeba87efbee0b558fdd2c8f7e8c5abf004ac5
This commit is contained in:
commit
d4276e6474
2 changed files with 24 additions and 13 deletions
|
@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue