Index: /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/EnterRoomDialog.java =================================================================== --- /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/EnterRoomDialog.java (revision 43) +++ /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/EnterRoomDialog.java (working copy) @@ -16,10 +16,14 @@ private Text roomNameText; private Label errorLabel; private Text nickNameText; + private Text emailText; + private Text passwordText; private String roomName; private String nickName; - + private String email; + private String password; + protected EnterRoomDialog(Shell parentShell) { super(parentShell); } @@ -28,7 +32,7 @@ protected Control createDialogArea(Composite parent) { Composite composite = (Composite)super.createDialogArea(parent); GridLayout layout = new GridLayout(); - layout.numColumns = 2; + layout.numColumns = 4; composite.setLayout(layout); // Label roomNameLabel = new Label(composite, SWT.NONE); @@ -52,6 +56,26 @@ String systemUserName = System.getProperty("user.name"); nickNameText.setText(systemUserName); // + Label emailLabel = new Label(composite, SWT.NONE); + emailLabel.setText("email:"); + // + emailText = new Text(composite, SWT.SINGLE | SWT.BORDER); + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + emailText.setLayoutData(layoutData); + emailText.setText(""); + // + Label passwordLabel = new Label(composite, SWT.NONE); + passwordLabel.setText("password:"); + // + passwordText = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD); + layoutData = new GridData(); + layoutData.grabExcessHorizontalSpace = true; + layoutData.horizontalAlignment = GridData.FILL; + passwordText.setLayoutData(layoutData); + passwordText.setText(""); + // errorLabel = new Label(composite, SWT.NONE); errorLabel.setForeground(Activator.getDefault().getColorProvider().getColor(ColorProvider.RED)); layoutData = new GridData(); @@ -71,7 +95,7 @@ errorLabel.setText("Room name is empty."); roomNameText.setText(roomName); } else if (StringUtils.isEmpty(nickName)) { - errorLabel.setText("Room name is empty."); + errorLabel.setText("Nick name is empty."); nickNameText.setText(nickName); } else { this.roomName = roomName; @@ -76,6 +100,8 @@ } else { this.roomName = roomName; this.nickName = nickName; + this.email = emailText.getText().trim(); + this.password = passwordText.getText().trim(); setReturnCode(OK); close(); } @@ -95,4 +121,18 @@ newShell.setText("Enter room"); } + /** + * @return the email + */ + public String getEmail() { + return email; + } + + /** + * @return the password + */ + public String getPassword() { + return password; + } + } Index: /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/SampleView.java =================================================================== --- /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/SampleView.java (revision 43) +++ /Users/yoshiori/Documents/workspace/Test/lingrclipse-view/src/jp/eisbahn/eclipse/plugins/lingrclipse/view/SampleView.java (working copy) @@ -24,6 +24,7 @@ import jp.eisbahn.eclipse.plugins.lingrclipse.StatusFailException; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; @@ -649,6 +650,11 @@ try { showBusy(true); LingrclipseCore.init(); + String email = dialog.getEmail(); + String password = dialog.getPassword(); + if(StringUtils.isNotEmpty(email) && StringUtils.isNotEmpty(password)){ + LingrclipseCore.login(email, password); + } LingrclipseCore.enterRoom(dialog.getRoomName(), dialog.getNickName(), new EnterRoomListener() { public void entered(final LingrEnteredRoom enteredRoom) { getSite().getShell().getDisplay().syncExec(new Runnable() {