author | dadubrow |
Fri, 05 Feb 2010 10:29:19 -0600 | |
changeset 899 | b5675f3e69ad |
parent 876 | bb5d67b9dbe6 |
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> |
|
876 | 27 |
* This variant allows selecting a "current connection" which will map to the currently selected connection at runtime. |
728 | 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 |
|
899 | 34 |
* @since 2.5 |
728 | 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. |
|
876 | 63 |
* @return the connection id, which may represent a "current" connection. |
728 | 64 |
*/ |
65 |
String getSelectedConnection(); |
|
66 |
||
67 |
/** |
|
68 |
* Adds a listener to the client site UI |
|
69 |
* @param listener IListener |
|
70 |
*/ |
|
71 |
void addListener(IListener listener); |
|
72 |
||
73 |
/** |
|
74 |
* Removes a listener from the client site UI |
|
75 |
* @param listener IListener |
|
76 |
*/ |
|
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 | 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 | 89 |
* compatible ones, but the current may be anything.) This is only a warning |
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 | 95 |
} |