Issue #2955 - Made chat invitation dialogs non-modal

Change-Id: Ib7294e8149996715b6a247a1e04335dc1a0c7023

Former-commit-id: b507739637 [formerly 71cf0d04e7 [formerly ead90bc794] [formerly b507739637 [formerly bb61e3c39d5dabf7e698726f0a093d8cf4f7088a]]]
Former-commit-id: 71cf0d04e7 [formerly ead90bc794]
Former-commit-id: 71cf0d04e7
Former-commit-id: 6da65fe71a
This commit is contained in:
Mike Duff 2014-04-18 15:29:21 -05:00
parent 8f8a1407fd
commit f4f6283d2d

View file

@ -67,6 +67,7 @@ import com.raytheon.viz.ui.dialogs.CaveSWTDialogBase;
* Feb 13, 2014 2751 bclement better types for roomid and inviter
* Mar 06, 2014 2848 bclement moved join logic to separate method
* Mar 27, 2014 2632 mpduff Set the OK button as the default button.
* Apr 18, 2014 2955 mpduff Make dialog non-modal.
*
* </pre>
*
@ -105,18 +106,11 @@ public class InviteDialog extends CaveSWTDialogBase {
*
* @param parentShell
* Parent shell.
* @param title
* Title for the dialog.
* @param labelStr
* Test to put in the label for the message text control.
* @param messageStr
* Message to be displayed.
* @param iconStyle
* Icon style to be displayed.
* @param event
* The invitation event
*/
public InviteDialog(Shell parentShell, IVenueInvitationEvent event) {
super(parentShell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL
| SWT.PRIMARY_MODAL | SWT.SYSTEM_MODAL, CAVE.NONE);
super(parentShell, SWT.DIALOG_TRIM, CAVE.NONE);
setText("Session Invitation");
IUser inviter = event.getInviter();
VenueId room = event.getRoomId();
@ -151,7 +145,7 @@ public class InviteDialog extends CaveSWTDialogBase {
@Override
protected void initializeComponents(Shell shell) {
mainComp = new Composite(shell, SWT.NONE);
GridLayout gl = new GridLayout(2, false);
GridLayout gl = new GridLayout(1, false);
gl.marginHeight = 0;
gl.marginWidth = 0;
gl.horizontalSpacing = 0;
@ -233,10 +227,10 @@ public class InviteDialog extends CaveSWTDialogBase {
font = new Font(Display.getCurrent(), fontData[0]);
}
if (heading) {
gd = new GridData(SWT.LEFT, SWT.NONE, false, false);
gd = new GridData(SWT.LEFT, SWT.CENTER, false, false);
label.setFont(font);
} else {
gd = new GridData(SWT.LEFT, SWT.NONE, true, true);
gd = new GridData(SWT.LEFT, SWT.CENTER, true, true);
gd.widthHint = 300;
}
label.setLayoutData(gd);
@ -250,16 +244,15 @@ public class InviteDialog extends CaveSWTDialogBase {
Composite actionButtonComp = new Composite(mainComp, SWT.NONE);
actionButtonComp.setLayout(new GridLayout(2, false));
GridData gd = new GridData(SWT.FILL, SWT.DEFAULT, true, false);
gd.horizontalSpan = 2;
actionButtonComp.setLayoutData(gd);
int btnWidth = 80;
gd = new GridData(SWT.RIGHT, SWT.DEFAULT, true, false);
gd.widthHint = btnWidth;
Button okBtn = new Button(actionButtonComp, SWT.PUSH);
okBtn.setText("Join");
okBtn.setLayoutData(gd);
okBtn.addSelectionListener(new SelectionAdapter() {
Button joinBtn = new Button(actionButtonComp, SWT.PUSH);
joinBtn.setText("Join");
joinBtn.setLayoutData(gd);
joinBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent se) {
String handle = handleText.getText().trim();
@ -294,7 +287,7 @@ public class InviteDialog extends CaveSWTDialogBase {
}
});
this.getShell().setDefaultButton(okBtn);
this.getShell().setDefaultButton(joinBtn);
}
/**
@ -340,6 +333,11 @@ public class InviteDialog extends CaveSWTDialogBase {
}
}
/**
* Get the IVenueSession being used.
*
* @return the IVenueSession
*/
public IVenueSession getSession() {
return session;
}