Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #22 from KlasJoenssson/Bug3272
Bug3272
  • Loading branch information
jonalv committed Aug 22, 2012
2 parents 87cb543 + 3db7d6a commit 9a4d6aa
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 30 deletions.
Expand Up @@ -16,7 +16,6 @@
import java.util.Iterator;
import net.bioclipse.usermanager.AccountType.Property;
import net.bioclipse.usermanager.business.IUserManager;
import net.bioclipse.usermanager.business.UserManager;

import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.fieldassist.ControlDecoration;
Expand All @@ -25,19 +24,14 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;

import sun.security.krb5.Asn1Exception;

/**
*
* @author Klas Jšnsson (aka "konditorn")
Expand All @@ -52,7 +46,7 @@ public class AccountPropertiesPage {
private Text[] accountTxt;
private Label accountNameLabel;
private Text accountNameTxt;
private Button testLoginButton;
// private Button testLoginButton;
private ArrayList<Text> requiredFields = new ArrayList<Text>();
private Image reqImage = FieldDecorationRegistry.getDefault()
.getFieldDecoration(FieldDecorationRegistry.DEC_REQUIRED)
Expand Down Expand Up @@ -169,25 +163,26 @@ public void modifyText( ModifyEvent e ) {
i++;
}

new Label(accountComposite, SWT.NONE);
if (accountType.hasLogo()) {
new Label(accountComposite, SWT.NONE);
}
testLoginButton = new Button(accountComposite, SWT.PUSH);
testLoginButton.setText( "Test log-in" );
testLoginButton.addSelectionListener( new SelectionListener() {

@Override
public void widgetSelected( SelectionEvent e ) {
accountLoggIn();
}

@Override
public void widgetDefaultSelected( SelectionEvent e ) {

}

} );
// TODO Make the logic behind this button work properly
// new Label(accountComposite, SWT.NONE);
// if (accountType.hasLogo()) {
// new Label(accountComposite, SWT.NONE);
// }
// testLoginButton = new Button(accountComposite, SWT.PUSH);
// testLoginButton.setText( "Test log-in" );
// testLoginButton.addSelectionListener( new SelectionListener() {
//
// @Override
// public void widgetSelected( SelectionEvent e ) {
// accountLoggIn();
// }
//
// @Override
// public void widgetDefaultSelected( SelectionEvent e ) {
//
// }
//
// } );
}

/**
Expand Down
Expand Up @@ -393,8 +393,8 @@ public void widgetSelected(SelectionEvent e) {
accountsListViewer.getList().select(0);
}
refreshOnSelectionChanged();
return container;

return container;
}

/**
Expand Down Expand Up @@ -434,8 +434,12 @@ private void refreshTable() {
}

private void refreshOnSelectionChanged() {
if ( accountsListViewer.getList().getSelection().length == 0 )
return;
/* If there's no item selected (e.g. if the user clicked below the last
* item in the list) we'll select the last item in the list. */
if ( accountsListViewer.getList().getSelectionCount() == 0 )
accountsListViewer.getList().select(accountsListViewer
.getList().getItemCount() - 1 );

String selectedAccountId =
extractAccountId( accountsListViewer.getList()
.getSelection()[0] );
Expand Down

0 comments on commit 9a4d6aa

Please sign in to comment.