connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java
author dadubrow
Fri, 05 Feb 2010 10:29:19 -0600
changeset 899 b5675f3e69ad
parent 876 bb5d67b9dbe6
permissions -rw-r--r--
update since tags to 2.5
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>
876
bb5d67b9dbe6 update javadoc
dadubrow
parents: 759
diff changeset
    27
 * This variant allows selecting a "current connection" which will map to the currently selected connection at runtime.
728
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
899
b5675f3e69ad update since tags to 2.5
dadubrow
parents: 876
diff changeset
    34
 * @since 2.5
728
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.
876
bb5d67b9dbe6 update javadoc
dadubrow
parents: 759
diff changeset
    63
	 * @return the connection id, which may represent a "current" connection.  
728
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
	 * Adds a listener to the client site UI
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    69
	 * @param listener IListener
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    70
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    71
	void addListener(IListener listener);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    72
	
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
	 * Removes a listener from the client site UI
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    75
	 * @param listener IListener
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    76
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    77
	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
    78
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
    79
	/**
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
    80
	 * 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
    81
	 * <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
    82
	 * @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
    83
	 * <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
    84
	 * <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
    85
	 * <li>If no connection is selected, return ERROR.
876
bb5d67b9dbe6 update javadoc
dadubrow
parents: 759
diff changeset
    86
	 * <li>If selected connection is current, but the current connection is incompatible,
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
    87
	 * 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
    88
	 * (Normally, the concrete connections are already filtered to show only
876
bb5d67b9dbe6 update javadoc
dadubrow
parents: 759
diff changeset
    89
	 * compatible ones, but the current may be anything.)  This is only a warning
bb5d67b9dbe6 update javadoc
dadubrow
parents: 759
diff changeset
    90
	 * because the current connection can be changed externally to this UI, thus
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
    91
	 * 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
    92
	 * </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
    93
	 */
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
	IStatus getSelectionStatus();
728
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    95
}