connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java
author Ed Swartz <ed.swartz@nokia.com>
Wed, 30 Dec 2009 11:43:43 -0600
changeset 730 8ecd45ef360e
parent 728 a39d0ba41f81
child 759 d4aeef4e0f16
permissions -rw-r--r--
Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
728
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     1
/*
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     8
*
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    11
*
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    12
* Contributors:
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    13
*
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    14
* Description: 
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    15
*
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    16
*/
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    17
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    18
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    19
package com.nokia.carbide.remoteconnections.interfaces;
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    20
730
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    21
import org.eclipse.core.runtime.IStatus;
728
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    22
import org.eclipse.swt.widgets.Composite;
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    23
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    24
/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    25
 * The user interface for picking or defining a connection to use that can be added to client service user interfaces.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    26
 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    27
 * This variant allows selecting a "default connection" which will map to the currently selected default at runtime.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    28
 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    29
 * This requires that you use {@link IConnectionsManager#ensureConnection(String, IService)}
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    30
 * to map from a persisted connection identifier to an IConnection.  Do not rely on "validating"
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    31
 * the identifier manually by iterating the {@link IConnectionsManager#getConnections()}!
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    32
 * @noimplement
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    33
 * @noextend
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    34
 * @since 3.0
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    35
 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    36
public interface IClientServiceSiteUI2 {
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    37
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    38
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    39
	 * A listener interface to allow client sites to be notified when a new connection is selected
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    40
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    41
	public interface IListener {
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    42
		void connectionSelected();
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    43
	}
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    44
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    45
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    46
	 * Create the composite with the client site UI for IService
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    47
	 * @param parent Composite
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    48
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    49
	void createComposite(Composite parent);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    50
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    51
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    52
	 * Select a specific connection object - must be called after create composite
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    53
	 * @param connection the connection id or <code>null</code>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    54
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    55
	void selectConnection(String connection);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    56
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    57
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    58
	 * Return the selected connection object - may be called after UI is disposed.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    59
	 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    60
	 * Do not expect to find this identifier in the {@link IConnectionsManager#getConnections()} list.  
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    61
	 * Instead, use {@link IConnectionsManager#ensureConnection(String, IService)} to find
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    62
	 * the actual IConnection at runtime.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    63
	 * @return the connection id, which may represent a "default".  
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    64
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    65
	String getSelectedConnection();
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    66
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    67
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    68
	 * Get the display name of the selected connection id
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    69
	 * @param connection the connection id
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    70
	 * @return String, never <code>null</code>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    71
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    72
	String getConnectionDisplayName(String connection);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    73
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    74
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    75
	 * Adds a listener to the client site UI
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    76
	 * @param listener IListener
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    77
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    78
	void addListener(IListener listener);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    79
	
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    80
	/**
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    81
	 * Removes a listener from the client site UI
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    82
	 * @param listener IListener
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    83
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    84
	void removeListener(IListener listener);
730
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    85
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    86
	/**
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    87
	 * Validate the selected connection and return a status.
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    88
	 * <p>
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    89
	 * @return IStatus for the state of the selection:
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    90
	 * <ol>
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    91
	 * <li>If a connection is selected and it's compatible, return OK.
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    92
	 * <li>If no connection is selected, return ERROR.
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    93
	 * <li>If selected connection is a default, but the current default is incompatible,
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    94
	 * return WARNING.
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    95
	 * (Normally, the concrete connections are already filtered to show only
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    96
	 * compatible ones, but the default may be anything.)  This is only a warning
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    97
	 * because the default connection can be changed externally to this UI, thus
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    98
	 * isn't a fatal error.
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
    99
	 * </ol>
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
   100
	 */
8ecd45ef360e Fix up some issues found when using the random connected service provider. Also, move validation checks of IClientServiceSiteUI2 into a method of that interface, since we need to handle the case where the default connection is currently incompatible.
Ed Swartz <ed.swartz@nokia.com>
parents: 728
diff changeset
   101
	IStatus getSelectionStatus();
728
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
   102
}