connectivity/com.nokia.carbide.remoteConnections/src/com/nokia/carbide/remoteconnections/interfaces/IClientServiceSiteUI2.java
author Ed Swartz <ed.swartz@nokia.com>
Tue, 29 Dec 2009 15:47:09 -0600
changeset 728 a39d0ba41f81
child 730 8ecd45ef360e
permissions -rw-r--r--
Initial work for bug #10418
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
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    21
import org.eclipse.swt.widgets.Composite;
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    22
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
 * 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
    25
 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    26
 * 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
    27
 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    28
 * 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
    29
 * 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
    30
 * the identifier manually by iterating the {@link IConnectionsManager#getConnections()}!
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    31
 * @noimplement
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    32
 * @noextend
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    33
 * @since 3.0
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    34
 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    35
public interface IClientServiceSiteUI2 {
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    36
	
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
	 * 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
    39
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    40
	public interface IListener {
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    41
		void connectionSelected();
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    42
	}
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
	 * 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
    46
	 * @param parent Composite
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    47
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    48
	void createComposite(Composite parent);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    49
	
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
	 * 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
    52
	 * @param connection the connection id or <code>null</code>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    53
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    54
	void selectConnection(String connection);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    55
	
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
	 * 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
    58
	 * <p>
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    59
	 * 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
    60
	 * Instead, use {@link IConnectionsManager#ensureConnection(String, IService)} to find
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    61
	 * the actual IConnection at runtime.
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    62
	 * @return the connection id, which may represent a "default".  
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    63
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    64
	String getSelectedConnection();
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    65
	
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
	 * Get the display name of the selected connection id
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    68
	 * @param connection the connection id
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    69
	 * @return String, never <code>null</code>
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
	String getConnectionDisplayName(String connection);
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
	 * Adds a listener to 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 addListener(IListener listener);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    78
	
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
	 * Removes a listener from the client site UI
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    81
	 * @param listener IListener
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    82
	 */
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    83
	void removeListener(IListener listener);
a39d0ba41f81 Initial work for bug #10418
Ed Swartz <ed.swartz@nokia.com>
parents:
diff changeset
    84
}