author | Chad Peckham <chad.peckham@nokia.com> |
Fri, 29 Jan 2010 15:42:36 -0600 | |
changeset 849 | d8886f16bea3 |
child 856 | 74d8d653d11a |
permissions | -rw-r--r-- |
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:
diff
changeset
|
1 |
/* |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
8 |
* |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
11 |
* |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
13 |
* |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
14 |
* Description: |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
15 |
* |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
16 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
17 |
package com.nokia.carbide.remoteconnections.internal.ui; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
18 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
19 |
import java.net.URL; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
20 |
import java.util.ArrayList; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
21 |
import java.util.Collection; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
22 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
23 |
import org.eclipse.jface.dialogs.Dialog; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
24 |
import org.eclipse.jface.dialogs.IDialogConstants; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
25 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
26 |
import org.eclipse.jface.viewers.ISelection; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
27 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
28 |
import org.eclipse.jface.viewers.IStructuredSelection; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
29 |
import org.eclipse.jface.viewers.LabelProvider; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
30 |
import org.eclipse.jface.viewers.ListViewer; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
31 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
32 |
import org.eclipse.jface.viewers.StructuredSelection; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
33 |
import org.eclipse.jface.window.IShellProvider; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
34 |
import org.eclipse.swt.SWT; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
35 |
import org.eclipse.swt.custom.SashForm; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
36 |
import org.eclipse.swt.events.SelectionAdapter; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
37 |
import org.eclipse.swt.events.SelectionEvent; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
38 |
import org.eclipse.swt.graphics.Point; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
39 |
import org.eclipse.swt.layout.GridData; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
40 |
import org.eclipse.swt.layout.GridLayout; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
41 |
import org.eclipse.swt.widgets.Button; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
42 |
import org.eclipse.swt.widgets.Composite; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
43 |
import org.eclipse.swt.widgets.Control; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
44 |
import org.eclipse.swt.widgets.Display; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
45 |
import org.eclipse.swt.widgets.Event; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
46 |
import org.eclipse.swt.widgets.Link; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
47 |
import org.eclipse.swt.widgets.Listener; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
48 |
import org.eclipse.swt.widgets.Shell; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
49 |
import org.eclipse.swt.widgets.Text; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
50 |
import org.eclipse.ui.IWorkbench; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
51 |
import org.eclipse.ui.PlatformUI; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
52 |
import org.eclipse.ui.browser.IWebBrowser; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
53 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
54 |
import com.nokia.carbide.remoteconnections.RemoteConnectionsActivator; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
55 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
56 |
public class DeviceDiscoveryPrequisiteErrorDialog extends Dialog { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
57 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
58 |
private class AgentItem { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
59 |
public String agentName; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
60 |
public String agentErrorText; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
61 |
public URL agentLocation; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
62 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
63 |
AgentItem(String name, String text, URL location) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
64 |
agentName = name; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
65 |
agentErrorText = text; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
66 |
agentLocation = location; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
67 |
// if location is not null and error text doesn't contain href |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
68 |
// then do it here |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
69 |
if (agentLocation != null && !agentErrorText.contains("href=")) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
70 |
String msg = String.format("%s - For more information go to: <a href=\"%s\">%s</a>", |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
71 |
agentErrorText, location.toString(), location.toString()); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
72 |
agentErrorText = msg; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
73 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
74 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
75 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
76 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
77 |
private Collection<AgentItem> agentList = new ArrayList<AgentItem>(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
78 |
private boolean isDontBotherMeOn = false; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
79 |
private ListViewer agentListViewer; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
80 |
private Link errorText; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
81 |
private Button dontBotherMeCheckBox; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
82 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
83 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
84 |
* @param parentShell |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
85 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
86 |
public DeviceDiscoveryPrequisiteErrorDialog(Shell parentShell) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
87 |
super(parentShell); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
88 |
agentList.clear(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
89 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
90 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
91 |
/** |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
92 |
* @param parentShell |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
93 |
*/ |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
94 |
public DeviceDiscoveryPrequisiteErrorDialog(IShellProvider parentShell) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
95 |
super(parentShell); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
96 |
agentList.clear(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
97 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
98 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
99 |
public void addAgentData(String name, String errorText, URL location) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
100 |
agentList.add(new AgentItem(name, errorText, location)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
101 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
102 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
103 |
public boolean isDontBotherMeOn() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
104 |
return isDontBotherMeOn; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
105 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
106 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
107 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
108 |
protected void createButtonsForButtonBar(Composite parent) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
109 |
// OK button == "Close" |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
110 |
// no Cancel button |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
111 |
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.CLOSE_LABEL, true); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
112 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
113 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
114 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
115 |
protected Control createDialogArea(Composite parent) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
116 |
initializeDialogUnits(parent); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
117 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
118 |
Composite container = new Composite(parent, SWT.NONE); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
119 |
GridLayout layout = new GridLayout(1, true); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
120 |
container.setLayout(layout); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
121 |
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
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:
diff
changeset
|
123 |
// Message at top |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
124 |
Text topMessage = new Text(container, SWT.MULTI | SWT.WRAP); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
125 |
topMessage.setText("At least one device discovery agent had load errors that prevent it from discovering connections to devices. Select one to get more information about its error."); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
126 |
topMessage.setEditable(false); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
127 |
topMessage.setDoubleClickEnabled(false); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
128 |
GridData topMsgData = new GridData(SWT.LEFT, SWT.CENTER, true, false); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
129 |
topMsgData.heightHint = 48; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
130 |
topMessage.setLayoutData(topMsgData); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
131 |
topMessage.setToolTipText("Select an agent for more information about load errors."); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
132 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
133 |
// next two panes can be resized with a sash form |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
134 |
SashForm sashForm = new SashForm(container, SWT.VERTICAL); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
135 |
GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
136 |
sashForm.setLayoutData(gridData); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
137 |
sashForm.setToolTipText("Slide to adjust pane size above and below to see more text."); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
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:
diff
changeset
|
139 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
140 |
// this pane lists all the agent display names |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
141 |
agentListViewer = new ListViewer(sashForm, SWT.V_SCROLL | SWT.BORDER); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
142 |
agentListViewer.setContentProvider(new ArrayContentProvider()); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
143 |
agentListViewer.setLabelProvider(new LabelProvider() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
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:
diff
changeset
|
145 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
146 |
public String getText(Object element) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
147 |
return ((AgentItem)element).agentName; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
148 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
149 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
150 |
}); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
151 |
agentListViewer.addSelectionChangedListener(new ISelectionChangedListener() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
152 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
153 |
public void selectionChanged(SelectionChangedEvent event) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
154 |
IStructuredSelection selection = (IStructuredSelection) event.getSelection(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
155 |
AgentItem item = (AgentItem) selection.getFirstElement(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
156 |
errorText.setText(item.agentErrorText); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
157 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
158 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
159 |
}); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
160 |
agentListViewer.setInput(agentList); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
161 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
162 |
// pane to view the information about the selected agent |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
163 |
errorText = new Link(sashForm, SWT.V_SCROLL | SWT.BORDER | SWT.WRAP); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
164 |
errorText.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_LIST_BACKGROUND)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
165 |
errorText.setToolTipText("Error message for the selected agent above"); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
166 |
errorText.addListener(SWT.Selection, new Listener() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
167 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
168 |
public void handleEvent(Event event) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
169 |
// Launch an external browser |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
170 |
String siteText = event.text; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
171 |
IWorkbench workbench = PlatformUI.getWorkbench(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
172 |
try { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
173 |
IWebBrowser browser = workbench.getBrowserSupport().getExternalBrowser(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
174 |
browser.openURL(new URL(siteText)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
175 |
} catch (Exception e) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
176 |
RemoteConnectionsActivator.logError(e); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
177 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
178 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
179 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
180 |
}); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
181 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
182 |
// add initial weights to the above two panes |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
183 |
sashForm.setWeights(new int[] {150,200}); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
184 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
185 |
// now the don't bother me check box |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
186 |
dontBotherMeCheckBox = new Button(container, SWT.CHECK); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
187 |
dontBotherMeCheckBox.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
188 |
dontBotherMeCheckBox.setText("Don't bother me again."); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
189 |
dontBotherMeCheckBox.setToolTipText("Check this to ignore further discovery agent load errors"); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
190 |
dontBotherMeCheckBox.setSelection(isDontBotherMeOn); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
191 |
dontBotherMeCheckBox.addSelectionListener(new SelectionAdapter() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
192 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
193 |
public void widgetSelected(SelectionEvent e) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
194 |
isDontBotherMeOn = dontBotherMeCheckBox.getSelection(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
195 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
196 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
197 |
}); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
198 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
199 |
// now finish by selecting the top most agent in the list |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
200 |
// and bringing it into view |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
201 |
Object o = agentListViewer.getElementAt(0); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
202 |
if (o != 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:
diff
changeset
|
203 |
agentListViewer.setSelection(new StructuredSelection(o)); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
204 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
205 |
ISelection selection = agentListViewer.getSelection(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
206 |
if (selection != null && !selection.isEmpty()) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
207 |
agentListViewer.reveal(selection); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
208 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
209 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
210 |
return container; |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
211 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
212 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
213 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
214 |
protected Point getInitialSize() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
215 |
return new Point(400,400); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
216 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
217 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
218 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
219 |
protected void okPressed() { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
220 |
// TODO Auto-generated method stub |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
221 |
super.okPressed(); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
222 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
223 |
|
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
224 |
@Override |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
225 |
protected void configureShell(Shell newShell) { |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
226 |
super.configureShell(newShell); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
227 |
// set our title to the dialog |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
228 |
newShell.setText("Device Discovery Load Errors"); |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
229 |
} |
d8886f16bea3
Add dialog to notify user of discovery agents not loaded because prerequisites not satisfied. Bug 10486
Chad Peckham <chad.peckham@nokia.com>
parents:
diff
changeset
|
230 |
} |