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-- |
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 |
||
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 | 22 |
import org.eclipse.swt.widgets.Composite; |
23 |
||
24 |
/** |
|
25 |
* The user interface for picking or defining a connection to use that can be added to client service user interfaces. |
|
26 |
* <p> |
|
27 |
* This variant allows selecting a "default connection" which will map to the currently selected default at runtime. |
|
28 |
* <p> |
|
29 |
* This requires that you use {@link IConnectionsManager#ensureConnection(String, IService)} |
|
30 |
* to map from a persisted connection identifier to an IConnection. Do not rely on "validating" |
|
31 |
* the identifier manually by iterating the {@link IConnectionsManager#getConnections()}! |
|
32 |
* @noimplement |
|
33 |
* @noextend |
|
34 |
* @since 3.0 |
|
35 |
*/ |
|
36 |
public interface IClientServiceSiteUI2 { |
|
37 |
||
38 |
/** |
|
39 |
* A listener interface to allow client sites to be notified when a new connection is selected |
|
40 |
*/ |
|
41 |
public interface IListener { |
|
42 |
void connectionSelected(); |
|
43 |
} |
|
44 |
||
45 |
/** |
|
46 |
* Create the composite with the client site UI for IService |
|
47 |
* @param parent Composite |
|
48 |
*/ |
|
49 |
void createComposite(Composite parent); |
|
50 |
||
51 |
/** |
|
52 |
* Select a specific connection object - must be called after create composite |
|
53 |
* @param connection the connection id or <code>null</code> |
|
54 |
*/ |
|
55 |
void selectConnection(String connection); |
|
56 |
||
57 |
/** |
|
58 |
* Return the selected connection object - may be called after UI is disposed. |
|
59 |
* <p> |
|
60 |
* Do not expect to find this identifier in the {@link IConnectionsManager#getConnections()} list. |
|
61 |
* Instead, use {@link IConnectionsManager#ensureConnection(String, IService)} to find |
|
62 |
* the actual IConnection at runtime. |
|
63 |
* @return the connection id, which may represent a "default". |
|
64 |
*/ |
|
65 |
String getSelectedConnection(); |
|
66 |
||
67 |
/** |
|
68 |
* Get the display name of the selected connection id |
|
69 |
* @param connection the connection id |
|
70 |
* @return String, never <code>null</code> |
|
71 |
*/ |
|
72 |
String getConnectionDisplayName(String connection); |
|
73 |
||
74 |
/** |
|
75 |
* Adds a listener to the client site UI |
|
76 |
* @param listener IListener |
|
77 |
*/ |
|
78 |
void addListener(IListener listener); |
|
79 |
||
80 |
/** |
|
81 |
* Removes a listener from the client site UI |
|
82 |
* @param listener IListener |
|
83 |
*/ |
|
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 | 102 |
} |