|
Lines 13-21
Link Here
|
| 13 |
package org.eclipse.ui.internal.ide.dialogs; |
13 |
package org.eclipse.ui.internal.ide.dialogs; |
| 14 |
|
14 |
|
| 15 |
import java.net.URL; |
15 |
import java.net.URL; |
| 16 |
import java.util.ArrayList; |
16 |
import java.util.HashMap; |
|
|
17 |
import java.util.LinkedList; |
| 18 |
import java.util.Map; |
| 17 |
|
19 |
|
| 18 |
import org.eclipse.core.runtime.IPluginDescriptor; |
20 |
import org.eclipse.core.runtime.IBundleGroup; |
|
|
21 |
import org.eclipse.core.runtime.IBundleGroupProvider; |
| 19 |
import org.eclipse.core.runtime.Platform; |
22 |
import org.eclipse.core.runtime.Platform; |
| 20 |
import org.eclipse.jface.dialogs.IDialogConstants; |
23 |
import org.eclipse.jface.dialogs.IDialogConstants; |
| 21 |
import org.eclipse.jface.dialogs.MessageDialog; |
24 |
import org.eclipse.jface.dialogs.MessageDialog; |
|
Lines 106-130
Link Here
|
| 106 |
this.helpContextId = helpContextId; |
109 |
this.helpContextId = helpContextId; |
| 107 |
this.productName = productName; |
110 |
this.productName = productName; |
| 108 |
|
111 |
|
| 109 |
ArrayList list = new ArrayList(bundles.length); |
112 |
// create a data object for each bundle, remove duplicates |
| 110 |
for(int i = 0; i < bundles.length; ++i ) |
113 |
Map map = new HashMap(); |
| 111 |
list.add(new AboutBundleData(bundles[i])); |
114 |
for (int i = 0; i < bundles.length; ++i) { |
| 112 |
bundleInfos = (AboutBundleData[])list.toArray(new AboutBundleData[0]); |
115 |
AboutBundleData data = new AboutBundleData(bundles[i]); |
|
|
116 |
if (!map.containsKey(data.getVersionedId())) |
| 117 |
map.put(data.getVersionedId(), data); |
| 118 |
} |
| 119 |
bundleInfos = (AboutBundleData[]) map.values().toArray( |
| 120 |
new AboutBundleData[0]); |
| 113 |
|
121 |
|
| 114 |
AboutData.sortByProvider(reverseSort, bundleInfos); |
122 |
AboutData.sortByProvider(reverseSort, bundleInfos); |
| 115 |
} |
123 |
} |
| 116 |
|
124 |
|
| 117 |
// TODO when bug 54574 is fixed, this should be changed to use bundle |
|
|
| 118 |
// providers -> bundle groups -> bundles |
| 119 |
private static Bundle[] getAllBundles() { |
125 |
private static Bundle[] getAllBundles() { |
| 120 |
IPluginDescriptor[] descs = Platform.getPluginRegistry().getPluginDescriptors(); |
126 |
LinkedList result = new LinkedList(); |
| 121 |
Bundle[] bundles = new Bundle[descs.length]; |
|
|
| 122 |
for(int i = 0; i < descs.length; ++i) |
| 123 |
bundles[i] = Platform.getBundle(descs[i].getUniqueIdentifier()); |
| 124 |
|
127 |
|
| 125 |
return bundles; |
128 |
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders(); |
| 126 |
} |
129 |
if (providers != null) |
|
|
130 |
for (int i = 0; i < providers.length; ++i) { |
| 131 |
IBundleGroup[] bundleGroups = providers[i].getBundleGroups(); |
| 132 |
for (int j = 0; j < bundleGroups.length; ++j) { |
| 133 |
Bundle[] bundles = bundleGroups[i].getBundles(); |
| 134 |
for (int k = 0; k < bundles.length; ++k) { |
| 135 |
result.add(bundles[k]); |
| 136 |
} |
| 137 |
} |
| 138 |
} |
| 127 |
|
139 |
|
|
|
140 |
return (Bundle[]) result.toArray(new Bundle[result.size()]); |
| 141 |
} |
| 142 |
|
| 128 |
/* |
143 |
/* |
| 129 |
* (non-Javadoc) Method declared on Dialog. |
144 |
* (non-Javadoc) Method declared on Dialog. |
| 130 |
*/ |
145 |
*/ |
|
Lines 251-258
Link Here
|
| 251 |
item.setData(bundleInfos[i]); |
266 |
item.setData(bundleInfos[i]); |
| 252 |
} |
267 |
} |
| 253 |
|
268 |
|
| 254 |
GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL, |
269 |
GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true); |
| 255 |
GridData.VERTICAL_ALIGN_FILL, true, true); |
|
|
| 256 |
gridData.heightHint = convertVerticalDLUsToPixels(TABLE_HEIGHT); |
270 |
gridData.heightHint = convertVerticalDLUsToPixels(TABLE_HEIGHT); |
| 257 |
vendorInfo.setLayoutData(gridData); |
271 |
vendorInfo.setLayoutData(gridData); |
| 258 |
} |
272 |
} |