author | dadubrow |
Mon, 01 Mar 2010 07:58:33 -0600 | |
changeset 1037 | 7261015324d2 |
parent 886 | 8747d97a4fec |
child 1081 | eb755d0b6c12 |
permissions | -rw-r--r-- |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
1 |
/* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
8 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
11 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
13 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
15 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
16 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
17 |
package com.nokia.carbide.remoteconnections; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
18 |
|
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
19 |
import java.util.ArrayList; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
20 |
import java.util.Collection; |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
21 |
import java.util.HashMap; |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
22 |
import java.util.Map; |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
23 |
import java.util.Map.Entry; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
24 |
|
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
25 |
import org.eclipse.core.runtime.CoreException; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
26 |
import org.eclipse.core.runtime.IConfigurationElement; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
27 |
import org.eclipse.core.runtime.IStatus; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
28 |
import org.eclipse.core.runtime.Platform; |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
29 |
import org.eclipse.core.runtime.preferences.InstanceScope; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
30 |
import org.eclipse.jface.resource.ImageDescriptor; |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
31 |
import org.eclipse.jface.viewers.IFilter; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
32 |
import org.eclipse.swt.widgets.Control; |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
33 |
import org.eclipse.swt.widgets.Display; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
34 |
import org.eclipse.swt.widgets.Shell; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
35 |
import org.eclipse.ui.PlatformUI; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
36 |
import org.eclipse.ui.plugin.AbstractUIPlugin; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
37 |
import org.osgi.framework.BundleContext; |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
38 |
import org.osgi.service.prefs.BackingStoreException; |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
39 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
40 |
import com.nokia.carbide.remoteconnections.interfaces.IConnectionTypeProvider; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
41 |
import com.nokia.carbide.remoteconnections.interfaces.IConnectionsManager; |
700 | 42 |
import com.nokia.carbide.remoteconnections.internal.api.IDeviceDiscoveryAgent; |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
43 |
import com.nokia.carbide.remoteconnections.internal.api.IStatusDisplay; |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
44 |
import com.nokia.carbide.remoteconnections.internal.api.IDeviceDiscoveryAgent.IPrerequisiteStatus; |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
45 |
import com.nokia.carbide.remoteconnections.internal.registry.Registry; |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
46 |
import com.nokia.carbide.remoteconnections.internal.ui.DeviceDiscoveryPrequisiteErrorDialog; |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
47 |
import com.nokia.carbide.remoteconnections.internal.ui.StatusDisplay; |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
48 |
import com.nokia.cpp.internal.api.utils.core.Logging; |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
49 |
import com.nokia.cpp.internal.api.utils.ui.WorkbenchUtils; |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
50 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
51 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
52 |
* The activator class controls the plug-in life cycle |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
53 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
54 |
public class RemoteConnectionsActivator extends AbstractUIPlugin { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
55 |
|
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
56 |
private final class WhenWorkbenchIsVisibleThread extends Thread { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
57 |
private Shell shell; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
58 |
private boolean visible; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
59 |
private final Runnable runnable; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
60 |
|
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
61 |
public WhenWorkbenchIsVisibleThread(Runnable runnable) { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
62 |
this.runnable = runnable; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
63 |
shell = WorkbenchUtils.getActiveShell(); |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
64 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
65 |
|
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
66 |
public void run() { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
67 |
while (true) { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
68 |
Display.getDefault().syncExec(new Runnable() { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
69 |
public void run() { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
70 |
if (shell != null && shell.isVisible()) { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
71 |
visible = true; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
72 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
73 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
74 |
}); |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
75 |
if (visible) |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
76 |
break; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
77 |
|
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
78 |
try { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
79 |
Thread.sleep(500); |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
80 |
} catch (InterruptedException e) { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
81 |
break; |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
82 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
83 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
84 |
if (visible) |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
85 |
runnable.run(); |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
86 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
87 |
} |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
88 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
89 |
// The plug-in ID |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
90 |
public static final String PLUGIN_ID = "com.nokia.carbide.remoteConnections"; //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
91 |
|
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
92 |
private static final String DISCOVERY_AGENT_EXTENSION = PLUGIN_ID + ".deviceDiscoveryAgent"; //$NON-NLS-1$ |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
93 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
94 |
// The shared instance |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
95 |
private static RemoteConnectionsActivator plugin; |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
96 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
97 |
private Collection<IDeviceDiscoveryAgent> discoveryAgents; |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
98 |
|
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
99 |
private static final String IGNORE_AGENT_LOAD_ERRORS_KEY = "ignoreAgentLoadErrors"; //$NON-NLS-1$ |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
100 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
101 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
102 |
* The constructor |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
103 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
104 |
public RemoteConnectionsActivator() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
105 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
106 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
107 |
public void start(BundleContext context) throws Exception { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
108 |
super.start(context); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
109 |
plugin = this; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
110 |
Registry instance = Registry.instance(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
111 |
instance.loadExtensions(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
112 |
instance.loadConnections(); |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
113 |
|
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
114 |
new WhenWorkbenchIsVisibleThread(new Runnable() { |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
115 |
public void run() { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
116 |
if (!ignoreAgentLoadErrors()) |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
117 |
checkPrerequisites(); |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
118 |
|
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
119 |
loadAndStartDeviceDiscoveryAgents(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
120 |
} |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
121 |
}).start(); |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
122 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
123 |
|
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
124 |
private boolean ignoreAgentLoadErrors() { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
125 |
return getPreferenceStore().getBoolean(IGNORE_AGENT_LOAD_ERRORS_KEY); |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
126 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
127 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
128 |
private void checkPrerequisites() { |
886 | 129 |
if (WorkbenchUtils.isJUnitRunning()) |
130 |
return; |
|
131 |
||
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
132 |
final Map<IDeviceDiscoveryAgent, IPrerequisiteStatus> agentToStatusMap = |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
133 |
new HashMap<IDeviceDiscoveryAgent, IPrerequisiteStatus>(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
134 |
|
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
135 |
// load the extensions just to check statuses |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
136 |
Collection<IDeviceDiscoveryAgent> agents = new ArrayList<IDeviceDiscoveryAgent>(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
137 |
loadExtensions(DISCOVERY_AGENT_EXTENSION, null, agents, null); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
138 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
139 |
for (IDeviceDiscoveryAgent agent : agents) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
140 |
IPrerequisiteStatus status = agent.getPrerequisiteStatus(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
141 |
if (!status.isOK()) { |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
142 |
agentToStatusMap.put(agent, status); |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
143 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
144 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
145 |
|
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
146 |
if (!agentToStatusMap.isEmpty()) { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
147 |
DeviceDiscoveryPrequisiteErrorDialog dlg = new DeviceDiscoveryPrequisiteErrorDialog(WorkbenchUtils.getSafeShell()); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
148 |
for (Entry<IDeviceDiscoveryAgent, IPrerequisiteStatus> entry : agentToStatusMap.entrySet()) { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
149 |
IDeviceDiscoveryAgent agent = entry.getKey(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
150 |
IPrerequisiteStatus status = entry.getValue(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
151 |
dlg.addAgentData(agent.getDisplayName(), status.getErrorText(), status.getURL()); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
152 |
} |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
153 |
dlg.open(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
154 |
if (dlg.isDontAskAgainChecked()) |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
155 |
storeIgnoreAgentLoadErrorsFlag(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
156 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
157 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
158 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
159 |
public void stop(BundleContext context) throws Exception { |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
160 |
stopDeviceDiscoveryAgents(); |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
161 |
Registry.instance().storeConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
162 |
Registry.instance().disposeConnections(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
163 |
plugin = null; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
164 |
super.stop(context); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
165 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
166 |
|
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
167 |
private void storeIgnoreAgentLoadErrorsFlag() { |
856
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
168 |
getPreferenceStore().setValue(IGNORE_AGENT_LOAD_ERRORS_KEY, true); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
169 |
try { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
170 |
new InstanceScope().getNode(PLUGIN_ID).flush(); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
171 |
} catch (BackingStoreException e) { |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
172 |
logError(e); |
74d8d653d11a
tweaks to new discovery error dialog and calling code
dadubrow
parents:
852
diff
changeset
|
173 |
} |
849
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
174 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
756
diff
changeset
|
175 |
|
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
176 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
177 |
* Returns the shared instance |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
178 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
179 |
* @return the shared instance |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
180 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
181 |
public static RemoteConnectionsActivator getDefault() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
182 |
return plugin; |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
183 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
184 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
185 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
186 |
* Returns an image descriptor for the image file at the given |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
187 |
* plug-in relative path |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
188 |
* |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
189 |
* @param path the path |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
190 |
* @return the image descriptor |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
191 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
192 |
public static ImageDescriptor getImageDescriptor(String path) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
193 |
return imageDescriptorFromPlugin(PLUGIN_ID, path); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
194 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
195 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
196 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
197 |
* Return the implementation of IConnectionsManager |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
198 |
* @return IConnectionsManager |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
199 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
200 |
public static IConnectionsManager getConnectionsManager() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
201 |
return Registry.instance(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
202 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
203 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
204 |
/** |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
205 |
* Return the implementation of IConnectionTypeProvider |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
206 |
* @return IConnectionTypeProvider |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
207 |
*/ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
208 |
public static IConnectionTypeProvider getConnectionTypeProvider() { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
209 |
return Registry.instance(); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
210 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
211 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
212 |
public static void logError(Throwable t) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
213 |
Logging.log(plugin, Logging.newSimpleStatus(0, t)); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
214 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
215 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
216 |
public static void logMessage(String message, int type) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
217 |
Logging.log(plugin, Logging.newStatus(plugin, type, message)); |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
218 |
} |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
219 |
|
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
220 |
public static void setHelp(Control control, String id) { |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
221 |
PlatformUI.getWorkbench().getHelpSystem().setHelp(control, PLUGIN_ID + id); //$NON-NLS-1$ |
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
222 |
} |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
223 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
224 |
private void loadAndStartDeviceDiscoveryAgents() { |
749 | 225 |
String loadError = Messages.getString("RemoteConnectionsActivator.DiscoveryAgentLoadError"); //$NON-NLS-1$ |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
226 |
discoveryAgents = new ArrayList<IDeviceDiscoveryAgent>(); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
227 |
loadExtensions(DISCOVERY_AGENT_EXTENSION, loadError, discoveryAgents, new IFilter() { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
228 |
public boolean select(Object toTest) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
229 |
if (toTest instanceof IDeviceDiscoveryAgent) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
230 |
try { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
231 |
((IDeviceDiscoveryAgent) toTest).start(); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
232 |
return true; |
756
218edd9d77f1
Catch any exception from a discovery agent so it doesn't kill the Remote Connections view
Ed Swartz <ed.swartz@nokia.com>
parents:
749
diff
changeset
|
233 |
} catch (Throwable e) { |
218edd9d77f1
Catch any exception from a discovery agent so it doesn't kill the Remote Connections view
Ed Swartz <ed.swartz@nokia.com>
parents:
749
diff
changeset
|
234 |
// since we launch arbitrary code, catch any exception to prevent killing the view |
698
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
235 |
logError(e); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
236 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
237 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
238 |
return false; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
239 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
240 |
}); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
241 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
242 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
243 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
244 |
private void stopDeviceDiscoveryAgents() { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
245 |
for (IDeviceDiscoveryAgent agent : discoveryAgents) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
246 |
try { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
247 |
agent.stop(); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
248 |
} catch (CoreException e) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
249 |
logError(e); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
250 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
251 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
252 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
253 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
254 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
255 |
public static void log(String errorStr, Throwable t) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
256 |
RemoteConnectionsActivator p = RemoteConnectionsActivator.getDefault(); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
257 |
String error = errorStr; |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
258 |
if (t != null) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
259 |
error += " : " + t.getLocalizedMessage(); //$NON-NLS-1$ |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
260 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
261 |
Logging.log(p, Logging.newStatus(p, IStatus.ERROR, error)); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
262 |
if (t instanceof CoreException) |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
263 |
Logging.log(p, ((CoreException) t).getStatus()); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
264 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
265 |
|
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
266 |
@SuppressWarnings("unchecked") |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
267 |
public static <T> void loadExtensions(String extensionId, String loadError, Collection<T> extensionObjects, IFilter filter) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
268 |
IConfigurationElement[] elements = |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
269 |
Platform.getExtensionRegistry().getConfigurationElementsFor(extensionId); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
270 |
for (IConfigurationElement element : elements) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
271 |
try { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
272 |
T extObject = (T) element.createExecutableExtension("class"); //$NON-NLS-1$ |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
273 |
if (filter == null || filter.select(extObject)) |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
274 |
extensionObjects.add(extObject); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
275 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
276 |
catch (CoreException e) { |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
277 |
if (loadError != null) |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
278 |
RemoteConnectionsActivator.log(loadError, e); |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
279 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
280 |
} |
9162f4cfad65
more changes to remote connections for discovery + load extensions
dadubrow
parents:
421
diff
changeset
|
281 |
} |
1037
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
282 |
|
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
283 |
public static IStatusDisplay getStatusDisplay() { |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
284 |
return new StatusDisplay(); |
7261015324d2
Add support for status notification popups and remove ui dependency + use new notification to switch mode
dadubrow
parents:
886
diff
changeset
|
285 |
} |
0
fb279309251b
DP tools release version Revision: 200912
Deepak Modgil <Deepak.Modgil@Nokia.com>
parents:
diff
changeset
|
286 |
} |