728
|
1 |
/*
|
|
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
package com.nokia.carbide.remoteconnections.interfaces;
|
|
20 |
|
|
21 |
import org.eclipse.swt.widgets.Composite;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* The user interface for picking or defining a connection to use that can be added to client service user interfaces.
|
|
25 |
* <p>
|
|
26 |
* This variant allows selecting a "default connection" which will map to the currently selected default at runtime.
|
|
27 |
* <p>
|
|
28 |
* This requires that you use {@link IConnectionsManager#ensureConnection(String, IService)}
|
|
29 |
* to map from a persisted connection identifier to an IConnection. Do not rely on "validating"
|
|
30 |
* the identifier manually by iterating the {@link IConnectionsManager#getConnections()}!
|
|
31 |
* @noimplement
|
|
32 |
* @noextend
|
|
33 |
* @since 3.0
|
|
34 |
*/
|
|
35 |
public interface IClientServiceSiteUI2 {
|
|
36 |
|
|
37 |
/**
|
|
38 |
* A listener interface to allow client sites to be notified when a new connection is selected
|
|
39 |
*/
|
|
40 |
public interface IListener {
|
|
41 |
void connectionSelected();
|
|
42 |
}
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Create the composite with the client site UI for IService
|
|
46 |
* @param parent Composite
|
|
47 |
*/
|
|
48 |
void createComposite(Composite parent);
|
|
49 |
|
|
50 |
/**
|
|
51 |
* Select a specific connection object - must be called after create composite
|
|
52 |
* @param connection the connection id or <code>null</code>
|
|
53 |
*/
|
|
54 |
void selectConnection(String connection);
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Return the selected connection object - may be called after UI is disposed.
|
|
58 |
* <p>
|
|
59 |
* Do not expect to find this identifier in the {@link IConnectionsManager#getConnections()} list.
|
|
60 |
* Instead, use {@link IConnectionsManager#ensureConnection(String, IService)} to find
|
|
61 |
* the actual IConnection at runtime.
|
|
62 |
* @return the connection id, which may represent a "default".
|
|
63 |
*/
|
|
64 |
String getSelectedConnection();
|
|
65 |
|
|
66 |
/**
|
|
67 |
* Get the display name of the selected connection id
|
|
68 |
* @param connection the connection id
|
|
69 |
* @return String, never <code>null</code>
|
|
70 |
*/
|
|
71 |
String getConnectionDisplayName(String connection);
|
|
72 |
|
|
73 |
/**
|
|
74 |
* Adds a listener to the client site UI
|
|
75 |
* @param listener IListener
|
|
76 |
*/
|
|
77 |
void addListener(IListener listener);
|
|
78 |
|
|
79 |
/**
|
|
80 |
* Removes a listener from the client site UI
|
|
81 |
* @param listener IListener
|
|
82 |
*/
|
|
83 |
void removeListener(IListener listener);
|
|
84 |
}
|