author | Ed Swartz <ed.swartz@nokia.com> |
Fri, 23 Apr 2010 14:15:21 -0500 | |
changeset 1275 | 9e9250d7a09b |
parent 1274 | d2ec5b43969e |
child 1557 | c431b953b863 |
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.internal.ui; |
|
20 |
||
21 |
import com.nokia.carbide.remoteconnections.Messages; |
|
22 |
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; |
|
23 |
import com.nokia.carbide.remoteconnections.interfaces.*; |
|
24 |
import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionListener; |
|
25 |
import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionsManagerListener; |
|
26 |
import com.nokia.carbide.remoteconnections.internal.registry.Registry; |
|
27 |
import com.nokia.carbide.remoteconnections.settings.ui.SettingsWizard; |
|
28 |
import com.nokia.cpp.internal.api.utils.core.Check; |
|
29 |
import com.nokia.cpp.internal.api.utils.core.ListenerList; |
|
30 |
||
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
|
31 |
import org.eclipse.core.runtime.IStatus; |
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
|
32 |
import org.eclipse.core.runtime.Status; |
728 | 33 |
import org.eclipse.jface.dialogs.Dialog; |
34 |
import org.eclipse.jface.dialogs.IDialogConstants; |
|
35 |
import org.eclipse.jface.resource.JFaceResources; |
|
36 |
import org.eclipse.jface.viewers.*; |
|
37 |
import org.eclipse.swt.SWT; |
|
38 |
import org.eclipse.swt.events.DisposeEvent; |
|
39 |
import org.eclipse.swt.events.DisposeListener; |
|
40 |
import org.eclipse.swt.events.SelectionAdapter; |
|
41 |
import org.eclipse.swt.events.SelectionEvent; |
|
42 |
import org.eclipse.swt.graphics.*; |
|
43 |
import org.eclipse.swt.layout.GridData; |
|
44 |
import org.eclipse.swt.layout.GridLayout; |
|
45 |
import org.eclipse.swt.widgets.*; |
|
46 |
||
47 |
import java.text.MessageFormat; |
|
48 |
import java.util.*; |
|
49 |
import java.util.List; |
|
50 |
||
51 |
/** |
|
52 |
* Implementation of IClientServiceSiteUI2 |
|
53 |
*/ |
|
54 |
@SuppressWarnings("deprecation") |
|
55 |
public class ClientServiceSiteUI2 implements IClientServiceSiteUI2, IConnectionListener, IConnectionsManagerListener { |
|
56 |
||
57 |
private IService service; |
|
58 |
private ComboViewer viewer; |
|
59 |
private FontMetrics fm; |
|
60 |
private Set<IConnectionType> compatibleConnectionTypes; |
|
61 |
private Button editButton; |
|
62 |
private Button newButton; |
|
63 |
private String connection; |
|
64 |
private ListenerList<IListener> listenerList; |
|
65 |
private static final String UID = ".uid"; //$NON-NLS-1$ |
|
66 |
private Map<String, String> connectionNames; |
|
67 |
||
68 |
public ClientServiceSiteUI2(IService service) { |
|
69 |
Check.checkArg(service); |
|
70 |
this.service = service; |
|
71 |
} |
|
72 |
||
73 |
public void createComposite(Composite parent) { |
|
74 |
initializeDialogUnits(parent); |
|
75 |
Group group = new Group(parent, SWT.NONE); |
|
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
|
76 |
group.setText(Messages.getString("ClientServiceSiteUI2.UseConnectionGroupLabel")); //$NON-NLS-1$ |
728 | 77 |
group.setLayout(new GridLayout()); |
78 |
group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); |
|
79 |
group.setData(UID, "useConnectionGroup"); //$NON-NLS-1$ |
|
80 |
||
81 |
viewer = new ComboViewer(group, SWT.READ_ONLY); |
|
82 |
viewer.setLabelProvider(new LabelProvider() { |
|
83 |
@Override |
|
84 |
public String getText(Object element) { |
|
85 |
Check.checkContract(element instanceof String); |
|
86 |
String id = (String) element; |
|
87 |
return connectionNames.get(id); |
|
88 |
} |
|
89 |
}); |
|
90 |
viewer.setContentProvider(new ArrayContentProvider()); |
|
91 |
GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false); |
|
92 |
viewer.getCombo().setLayoutData(gd); |
|
93 |
viewer.getControl().setData(UID, "viewer"); //$NON-NLS-1$ |
|
94 |
viewer.addSelectionChangedListener(new ISelectionChangedListener() { |
|
95 |
public void selectionChanged(SelectionChangedEvent event) { |
|
96 |
IStructuredSelection selection = (IStructuredSelection) event.getSelection(); |
|
97 |
String connection = (String) selection.getFirstElement(); |
|
1274 | 98 |
if (connection != null && !connection.equals(ClientServiceSiteUI2.this.connection)) { |
728 | 99 |
ClientServiceSiteUI2.this.connection = connection; |
100 |
fireConnectionSelected(); |
|
101 |
} |
|
102 |
} |
|
103 |
}); |
|
104 |
||
105 |
final Composite composite = new Composite(group, SWT.NONE); |
|
106 |
GridLayout layout = new GridLayout(); |
|
107 |
layout.numColumns = 2; |
|
108 |
layout.makeColumnsEqualWidth = true; |
|
109 |
layout.marginWidth = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_MARGIN); |
|
110 |
layout.marginHeight = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_MARGIN); |
|
111 |
layout.horizontalSpacing = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.HORIZONTAL_SPACING); |
|
112 |
layout.verticalSpacing = Dialog.convertVerticalDLUsToPixels(fm, IDialogConstants.VERTICAL_SPACING); |
|
113 |
composite.setLayout(layout); |
|
114 |
gd = new GridData(GridData.HORIZONTAL_ALIGN_END | GridData.VERTICAL_ALIGN_CENTER); |
|
115 |
composite.setLayoutData(gd); |
|
116 |
composite.setFont(parent.getFont()); |
|
117 |
||
118 |
newButton = new Button(composite, SWT.PUSH); |
|
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
|
119 |
newButton.setText(Messages.getString("ClientServiceSiteUI2.NewButtonLabel")); //$NON-NLS-1$ |
728 | 120 |
newButton.setFont(JFaceResources.getDialogFont()); |
121 |
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
|
122 |
int widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); |
|
123 |
Point minSize = newButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); |
|
124 |
gd.widthHint = Math.max(widthHint, minSize.x); |
|
125 |
newButton.setLayoutData(gd); |
|
126 |
newButton.setData(UID, "newButton"); //$NON-NLS-1$ |
|
127 |
newButton.addSelectionListener(new SelectionAdapter() { |
|
128 |
@Override |
|
129 |
public void widgetSelected(SelectionEvent e) { |
|
130 |
SettingsWizard wizard = new SettingsWizard(null, service); |
|
131 |
wizard.open(composite.getShell()); |
|
132 |
IConnection connection = wizard.getConnectionToEdit(); |
|
133 |
// note: refresh ASAP so the selection will be valid; but endure a listener event |
|
134 |
// which will redo this |
|
135 |
refreshUI(); |
|
136 |
setViewerInput(connection); |
|
137 |
} |
|
138 |
}); |
|
139 |
||
140 |
editButton = new Button(composite, SWT.PUSH); |
|
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
|
141 |
editButton.setText(Messages.getString("ClientServiceSiteUI2.EditButtonLabel")); //$NON-NLS-1$ |
728 | 142 |
editButton.setFont(JFaceResources.getDialogFont()); |
143 |
gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL); |
|
144 |
widthHint = Dialog.convertHorizontalDLUsToPixels(fm, IDialogConstants.BUTTON_WIDTH); |
|
145 |
minSize = editButton.computeSize(SWT.DEFAULT, SWT.DEFAULT, true); |
|
146 |
gd.widthHint = Math.max(widthHint, minSize.x); |
|
147 |
editButton.setLayoutData(gd); |
|
148 |
editButton.setData(UID, "editButton"); //$NON-NLS-1$ |
|
149 |
editButton.addSelectionListener(new SelectionAdapter() { |
|
150 |
@Override |
|
151 |
public void widgetSelected(SelectionEvent e) { |
|
152 |
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); |
|
153 |
Object value = selection.getFirstElement(); |
|
154 |
if (value instanceof String) { |
|
155 |
IConnection editConnection = getActualConnection((String) value); |
|
156 |
SettingsWizard wizard = new SettingsWizard(editConnection, service); |
|
157 |
wizard.open(composite.getShell()); |
|
158 |
||
159 |
// leave the viewer the same, callback will refresh anything needed |
|
160 |
} |
|
161 |
} |
|
162 |
}); |
|
163 |
||
164 |
// attach listeners |
|
165 |
RemoteConnectionsActivator.getConnectionsManager().addConnectionListener(this); |
|
166 |
RemoteConnectionsActivator.getConnectionsManager().addConnectionStoreChangedListener(this); |
|
167 |
||
168 |
// remove listeners on dispose |
|
169 |
group.addDisposeListener(new DisposeListener() { |
|
170 |
||
171 |
public void widgetDisposed(DisposeEvent e) { |
|
910 | 172 |
RemoteConnectionsActivator.getConnectionsManager().removeConnectionListener(ClientServiceSiteUI2.this); |
173 |
RemoteConnectionsActivator.getConnectionsManager().removeConnectionStoreChangedListener(ClientServiceSiteUI2.this); |
|
728 | 174 |
} |
175 |
}); |
|
176 |
||
177 |
setViewerInput(null); |
|
178 |
} |
|
179 |
||
180 |
/** |
|
181 |
* Get the actual connection for an identifier. |
|
182 |
* This is not {@link IConnectionsManager#ensureConnection(String, IService)} because we don't |
|
183 |
* want to actually validate the connection now. |
|
184 |
* @param id |
|
185 |
* @return {@link IConnection} or <code>null</code> |
|
186 |
*/ |
|
187 |
protected IConnection getActualConnection(String id) { |
|
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
|
188 |
if (id == null) { |
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
|
189 |
return null; |
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
|
190 |
} |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
191 |
if (id.equals(Registry.CURRENT_CONNECTION_ID)) { |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
192 |
return RemoteConnectionsActivator.getConnectionsManager().getCurrentConnection(); |
728 | 193 |
} |
194 |
for (IConnection connection : RemoteConnectionsActivator.getConnectionsManager().getConnections()) { |
|
195 |
if (connection.getIdentifier().equals(id)) { |
|
196 |
return connection; |
|
197 |
} |
|
198 |
} |
|
199 |
return null; |
|
200 |
} |
|
201 |
||
202 |
/** |
|
203 |
* Set the selected input. |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
204 |
* @param connection existing connection or <code>null</code> for the current |
728 | 205 |
*/ |
206 |
private void setViewerInput(IConnection connection) { |
|
207 |
List<IConnection> compatible = getCompatibleConnections(); |
|
208 |
connectionNames = new LinkedHashMap<String, String>(); |
|
209 |
||
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
210 |
// update the current |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
211 |
IConnection currentConnection = RemoteConnectionsActivator.getConnectionsManager().getCurrentConnection(); |
728 | 212 |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
213 |
connectionNames.put(Registry.CURRENT_CONNECTION_ID, createCurrentConnectionName(currentConnection)); |
728 | 214 |
|
215 |
for (IConnection conn : compatible) { |
|
216 |
connectionNames.put(conn.getIdentifier(), conn.getDisplayName()); |
|
217 |
} |
|
218 |
||
219 |
viewer.setInput(connectionNames.keySet()); |
|
220 |
||
221 |
if (connectionNames.isEmpty()) |
|
222 |
viewer.getCombo().setEnabled(false); |
|
223 |
else { |
|
224 |
viewer.getCombo().setEnabled(true); |
|
225 |
if (connection == null) { |
|
1265
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
226 |
String lastConnectionId = Registry.instance().getLastConnectionId(); |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
227 |
if (lastConnectionId != null) { |
1275
9e9250d7a09b
Fix connection selector defaults
Ed Swartz <ed.swartz@nokia.com>
parents:
1274
diff
changeset
|
228 |
viewer.getCombo().select(0); // the default setting |
9e9250d7a09b
Fix connection selector defaults
Ed Swartz <ed.swartz@nokia.com>
parents:
1274
diff
changeset
|
229 |
selectConnection(lastConnectionId); // should override if connection still exists |
1265
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
230 |
} else { |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
231 |
viewer.getCombo().select(0); |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
232 |
viewer.setSelection(viewer.getSelection()); |
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
233 |
} |
728 | 234 |
} |
235 |
else |
|
236 |
selectConnection(connection.getIdentifier()); |
|
237 |
} |
|
238 |
editButton.setEnabled(!viewer.getSelection().isEmpty()); |
|
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
|
239 |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
240 |
// fire listener in case we selected anew or the current connection changed |
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
|
241 |
fireConnectionSelected(); |
728 | 242 |
} |
243 |
||
244 |
private void refreshUI() { |
|
245 |
Display.getDefault().syncExec(new Runnable() { |
|
246 |
public void run() { |
|
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
|
247 |
if (viewer != null && viewer.getContentProvider() != null) { |
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
|
248 |
|
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
|
249 |
// try to preserve the currently selected item, if it's a concrete |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
250 |
// connection; if it's current, allow for the new current to be chosen. |
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
|
251 |
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection(); |
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
|
252 |
Object value = selection.getFirstElement(); |
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
|
253 |
String current = null; |
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
|
254 |
if (value instanceof String) { |
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
|
255 |
current = (String) value; |
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
|
256 |
} |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
257 |
if (Registry.CURRENT_CONNECTION_ID.equals(current)) { |
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
|
258 |
current = null; |
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
|
259 |
} |
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
|
260 |
setViewerInput(getActualConnection(current)); |
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
|
261 |
} |
728 | 262 |
} |
263 |
}); |
|
264 |
} |
|
265 |
||
266 |
/** |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
267 |
* @param currentConnection |
728 | 268 |
* @return |
269 |
*/ |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
270 |
private String createCurrentConnectionName(IConnection currentConnection) { |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
271 |
return MessageFormat.format(Messages.getString("ClientServiceSiteUI2.CurrentConnectionFormat"), //$NON-NLS-1$ |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
272 |
currentConnection != null ? currentConnection.getDisplayName() : |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
273 |
Messages.getString("ClientServiceSiteUI2.CurrentConnection_NoneDetected")); //$NON-NLS-1$ |
728 | 274 |
} |
275 |
||
276 |
private void initializeDialogUnits(Composite parent) { |
|
277 |
GC gc = new GC(parent); |
|
278 |
gc.setFont(JFaceResources.getDialogFont()); |
|
279 |
fm = gc.getFontMetrics(); |
|
280 |
gc.dispose(); |
|
281 |
} |
|
282 |
||
283 |
private List<IConnection> getCompatibleConnections() { |
|
284 |
getCompatibleConnectionTypes(); |
|
285 |
||
286 |
List<IConnection> compatibleConnections = new ArrayList<IConnection>(); |
|
287 |
for (IConnection connection : Registry.instance().getConnections()) { |
|
288 |
if (isCompatibleConnection(connection)) |
|
289 |
compatibleConnections.add(connection); |
|
290 |
} |
|
291 |
return compatibleConnections; |
|
292 |
} |
|
293 |
||
294 |
private boolean isCompatibleConnection(IConnection connection) { |
|
295 |
return compatibleConnectionTypes.contains(connection.getConnectionType()); |
|
296 |
} |
|
297 |
||
298 |
private void getCompatibleConnectionTypes() { |
|
299 |
compatibleConnectionTypes = new HashSet<IConnectionType>(); |
|
300 |
Collection<String> compatibleTypeIds = |
|
301 |
Registry.instance().getCompatibleConnectionTypeIds(service); |
|
302 |
for (String typeId : compatibleTypeIds) { |
|
303 |
compatibleConnectionTypes.add( |
|
304 |
Registry.instance().getConnectionType(typeId)); |
|
305 |
} |
|
306 |
} |
|
307 |
||
308 |
public void selectConnection(String connection) { |
|
309 |
viewer.setSelection(new StructuredSelection(connection)); |
|
310 |
} |
|
311 |
||
312 |
public String getSelectedConnection() { |
|
1265
f90f47d3882f
PlatSim-related launch wizard changes: (1) Remember last connection created and offer this by default in the Select Connection dialog; (2) Immediately open New Connection dialog if debugging and no connections exist; (3) Split out SelectConnectionDialog; (4) Fix some wording in Select Connection dialog since this is not always an error situation.
Ed Swartz <ed.swartz@nokia.com>
parents:
910
diff
changeset
|
313 |
Registry.instance().setLastConnectionId(connection); |
728 | 314 |
return connection; |
315 |
} |
|
316 |
||
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
|
317 |
public IStatus getSelectionStatus() { |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
318 |
String requiredConnectionTypes = getAllowedConnectionTypesString(); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
319 |
|
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
|
320 |
// no selection yet...? |
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
|
321 |
if (connection == null) { |
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
|
322 |
return new Status(IStatus.ERROR, RemoteConnectionsActivator.PLUGIN_ID, |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
323 |
MessageFormat.format( |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
324 |
Messages.getString("ClientServiceSiteUI2.NoConnectionError"), //$NON-NLS-1$ |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
325 |
service.getDisplayName(), |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
326 |
requiredConnectionTypes)); |
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
|
327 |
} |
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
|
328 |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
329 |
// check whether the current is compatible with the service and connection type |
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
330 |
if (Registry.CURRENT_CONNECTION_ID.equals(connection)) { |
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
|
331 |
IConnection actual = getActualConnection(connection); |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
332 |
if (actual == null) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
333 |
return new Status(IStatus.ERROR, RemoteConnectionsActivator.PLUGIN_ID, |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
334 |
MessageFormat.format( |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
335 |
Messages.getString("ClientServiceSiteUI2.NoCurrentConnection"), //$NON-NLS-1$ |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
336 |
service.getDisplayName(), |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
337 |
requiredConnectionTypes)); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
338 |
} |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
339 |
|
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
340 |
// is the service supported? |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
341 |
boolean found = false; |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
342 |
for (IConnectedService aService : Registry.instance().getConnectedServices(actual)) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
343 |
if (service.getIdentifier().equals(aService.getService().getIdentifier())) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
344 |
found = true; |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
345 |
break; |
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
|
346 |
} |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
347 |
} |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
348 |
if (!found) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
349 |
return new Status(IStatus.WARNING, RemoteConnectionsActivator.PLUGIN_ID, |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
350 |
MessageFormat.format( |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
351 |
Messages.getString("ClientServiceSiteUI2.IncompatibleCurrentConnectionService") //$NON-NLS-1$ |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
352 |
+ "\n" //$NON-NLS-1$ |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
353 |
+ Messages.getString("ClientServiceSiteUI2.IncompatibleCurrentConnectionFixupAdvice"), //$NON-NLS-1$ |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
354 |
actual.getDisplayName(), |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
355 |
service.getDisplayName())); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
356 |
} |
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
|
357 |
|
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
358 |
// is the hardware type supported by the service? |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
359 |
if (!isCompatibleConnection(actual)) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
360 |
return new Status(IStatus.WARNING, RemoteConnectionsActivator.PLUGIN_ID, |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
361 |
MessageFormat.format( |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
362 |
Messages.getString("ClientServiceSiteUI2.IncompatibleCurrentConnectionType") //$NON-NLS-1$ |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
363 |
+ "\n" //$NON-NLS-1$ |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
364 |
+ Messages.getString("ClientServiceSiteUI2.IncompatibleCurrentConnectionFixupAdvice"), //$NON-NLS-1$ |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
365 |
actual.getDisplayName(), |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
366 |
requiredConnectionTypes)); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
367 |
|
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
|
368 |
} |
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
|
369 |
} |
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
|
370 |
|
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
|
371 |
// otherwise, it's okay! |
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
|
372 |
return Status.OK_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
|
373 |
} |
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
374 |
|
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
375 |
private String getAllowedConnectionTypesString() { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
376 |
StringBuilder requiredConnectionTypes = new StringBuilder(); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
377 |
IConnectionType[] connectionTypes = |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
378 |
(IConnectionType[]) compatibleConnectionTypes.toArray(new IConnectionType[compatibleConnectionTypes.size()]); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
379 |
for (int i = 0; i < connectionTypes.length; i++) { |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
380 |
IConnectionType type = connectionTypes[i]; |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
381 |
if (requiredConnectionTypes.length() > 0) |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
382 |
requiredConnectionTypes.append(", "); //$NON-NLS-1$ |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
383 |
if (i == connectionTypes.length - 1) |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
384 |
requiredConnectionTypes.append(Messages.getString("ClientServiceSiteUI2.Or")); //$NON-NLS-1$ |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
385 |
requiredConnectionTypes.append(type.getDisplayName()); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
386 |
} |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
387 |
return requiredConnectionTypes.toString(); |
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
388 |
} |
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
|
389 |
|
728 | 390 |
/* (non-Javadoc) |
391 |
* @see com.nokia.carbide.remoteconnections.interfaces.IClientServiceSiteUI2#getConnectionDisplayName(java.lang.String) |
|
392 |
*/ |
|
393 |
public String getConnectionDisplayName(String connection) { |
|
394 |
String display = connectionNames.get(connection); |
|
395 |
if (display == null) |
|
731
68bc07acac96
Improve error checking and messages when default connection is inappropriate or no connections exist.
Ed Swartz <ed.swartz@nokia.com>
parents:
730
diff
changeset
|
396 |
display = MessageFormat.format(Messages.getString("ClientServiceSiteUI2.DeletedConnectionDisplayName"), connection); //$NON-NLS-1$ |
728 | 397 |
return display; |
398 |
} |
|
399 |
||
400 |
public void addListener(IListener listener) { |
|
401 |
if (listenerList == null) |
|
402 |
listenerList = new ListenerList<IListener>(); |
|
403 |
listenerList.add(listener); |
|
404 |
} |
|
405 |
||
406 |
public void removeListener(IListener listener) { |
|
407 |
if (listenerList != null) |
|
408 |
listenerList.remove(listener); |
|
409 |
} |
|
410 |
||
411 |
private void fireConnectionSelected() { |
|
412 |
if (listenerList != null) { |
|
413 |
for (IListener listener : listenerList) { |
|
414 |
listener.connectionSelected(); |
|
415 |
} |
|
416 |
} |
|
417 |
} |
|
418 |
||
419 |
/* (non-Javadoc) |
|
420 |
* @see com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionListener#connectionAdded(com.nokia.carbide.remoteconnections.interfaces.IConnection) |
|
421 |
*/ |
|
422 |
public void connectionAdded(IConnection connection) { |
|
423 |
refreshUI(); |
|
424 |
} |
|
425 |
||
426 |
/* (non-Javadoc) |
|
427 |
* @see com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionListener#connectionRemoved(com.nokia.carbide.remoteconnections.interfaces.IConnection) |
|
428 |
*/ |
|
429 |
public void connectionRemoved(IConnection connection) { |
|
430 |
refreshUI(); |
|
431 |
} |
|
432 |
||
433 |
/* (non-Javadoc) |
|
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
434 |
* @see com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionListener#currentConnectionSet(com.nokia.carbide.remoteconnections.interfaces.IConnection) |
728 | 435 |
*/ |
761
19123c07e2ab
Refactor API and related from default connection to current + update heuristics
dadubrow
parents:
731
diff
changeset
|
436 |
public void currentConnectionSet(IConnection connection) { |
728 | 437 |
refreshUI(); |
438 |
} |
|
439 |
||
440 |
/* (non-Javadoc) |
|
441 |
* @see com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionsManagerListener#connectionStoreChanged() |
|
442 |
*/ |
|
443 |
public void connectionStoreChanged() { |
|
444 |
refreshUI(); |
|
445 |
} |
|
446 |
||
447 |
/* (non-Javadoc) |
|
448 |
* @see com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager.IConnectionsManagerListener#displayChanged() |
|
449 |
*/ |
|
450 |
public void displayChanged() { |
|
451 |
refreshUI(); |
|
452 |
} |
|
453 |
} |