connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/internal/registry/Registry.java
changeset 791 43d328ced534
parent 790 6c8eba9e19ea
child 901 3a0c0b389d0d
equal deleted inserted replaced
790:6c8eba9e19ea 791:43d328ced534
    38 import java.util.regex.Pattern;
    38 import java.util.regex.Pattern;
    39 
    39 
    40 import org.eclipse.core.runtime.CoreException;
    40 import org.eclipse.core.runtime.CoreException;
    41 import org.eclipse.core.runtime.IPath;
    41 import org.eclipse.core.runtime.IPath;
    42 import org.eclipse.core.runtime.IStatus;
    42 import org.eclipse.core.runtime.IStatus;
    43 import org.eclipse.core.runtime.Status;
       
    44 import org.eclipse.jface.dialogs.Dialog;
    43 import org.eclipse.jface.dialogs.Dialog;
    45 import org.eclipse.jface.dialogs.IDialogConstants;
    44 import org.eclipse.jface.dialogs.IDialogConstants;
    46 import org.eclipse.jface.dialogs.IMessageProvider;
    45 import org.eclipse.jface.dialogs.IMessageProvider;
    47 import org.eclipse.jface.dialogs.TitleAreaDialog;
    46 import org.eclipse.jface.dialogs.TitleAreaDialog;
    48 import org.eclipse.jface.viewers.IFilter;
    47 import org.eclipse.jface.viewers.IFilter;
   541 						protected Control createDialogArea(Composite parent) {
   540 						protected Control createDialogArea(Composite parent) {
   542 							final Composite c = (Composite) super.createDialogArea(parent);
   541 							final Composite c = (Composite) super.createDialogArea(parent);
   543 							ui.createComposite(c);
   542 							ui.createComposite(c);
   544 							ui.addListener(new IListener() {
   543 							ui.addListener(new IListener() {
   545 								public void connectionSelected() {
   544 								public void connectionSelected() {
   546 									IStatus selectionStatus = ui.getSelectionStatus();
   545 									updateStatus(ui.getSelectionStatus());
   547 									updateStatus(selectionStatus);
       
   548 								}
   546 								}
   549 
   547 
   550 							});
   548 							});
   551 							
   549 							
   552 							return c;
   550 							return c;
   553 						}
   551 						}
   554 
   552 
   555 						private void updateStatus(IStatus selectionStatus) {
   553 						private void updateStatus(IStatus selectionStatus) {
   556 							setTitle(Messages.getString("Registry.EnsureConnection.TitleLabel")); //$NON-NLS-1$
   554 							setTitle(Messages.getString("Registry.EnsureConnection.TitleLabel")); //$NON-NLS-1$
       
   555 							setMessage(Messages.getString("Registry.EnsureConnection.Description")); //$NON-NLS-1$
   557 							switch (selectionStatus.getSeverity()) {
   556 							switch (selectionStatus.getSeverity()) {
   558 							case IStatus.ERROR:
   557 							case IStatus.ERROR:
   559 								setMessage(selectionStatus.getMessage(), IMessageProvider.ERROR);
   558 								setMessage(selectionStatus.getMessage(), IMessageProvider.ERROR);
   560 								getButton(IDialogConstants.OK_ID).setEnabled(false);
   559 								getButton(IDialogConstants.OK_ID).setEnabled(false);
   561 								break;
   560 								break;
   566 							case IStatus.INFO:
   565 							case IStatus.INFO:
   567 								setMessage(selectionStatus.getMessage(), IMessageProvider.INFORMATION);
   566 								setMessage(selectionStatus.getMessage(), IMessageProvider.INFORMATION);
   568 								getButton(IDialogConstants.OK_ID).setEnabled(true);
   567 								getButton(IDialogConstants.OK_ID).setEnabled(true);
   569 								break;
   568 								break;
   570 							default:
   569 							default:
   571 								setMessage(null, IMessageProvider.NONE);
       
   572 								getButton(IDialogConstants.OK_ID).setEnabled(true);
   570 								getButton(IDialogConstants.OK_ID).setEnabled(true);
   573 							}
   571 							}
   574 						}
   572 						}
   575 						
   573 						
   576 						@Override
   574 						@Override
   577 						public void create() {
   575 						public void create() {
   578 							super.create();
   576 							super.create();
   579 							updateStatus(new Status(IStatus.ERROR, RemoteConnectionsActivator.PLUGIN_ID, 
   577 							updateStatus(ui.getSelectionStatus());
   580 									Messages.getString("Registry.EnsureConnection.InitialStatusMessage"))); //$NON-NLS-1$
       
   581 						}
   578 						}
   582 						
   579 						
   583 						@Override
   580 						@Override
   584 						protected void configureShell(Shell newShell) {
   581 						protected void configureShell(Shell newShell) {
   585 							super.configureShell(newShell);
   582 							super.configureShell(newShell);