Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 54548 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/ui/internal/ide/AboutData.java (+7 lines)
Lines 32-37 Link Here
32
    private String name;
32
    private String name;
33
    private String version;
33
    private String version;
34
    private String id;
34
    private String id;
35
    private String versionedId = null;
35
36
36
    protected AboutData(String providerName, String name, String version, String id) {
37
    protected AboutData(String providerName, String name, String version, String id) {
37
        this.providerName = providerName == null ? "" : providerName; //$NON-NLS-1$
38
        this.providerName = providerName == null ? "" : providerName; //$NON-NLS-1$
Lines 54-59 Link Here
54
55
55
    public String getVersion() {
56
    public String getVersion() {
56
        return version;
57
        return version;
58
    }
59
    
60
    public String getVersionedId() {
61
        if(versionedId == null)
62
            versionedId = getId() + "_" + getVersion(); //$NON-NLS-1$
63
        return versionedId;
57
    }
64
    }
58
65
59
    /**
66
    /**
(-)src/org/eclipse/ui/internal/ide/dialogs/AboutFeaturesDialog.java (-6 / +9 lines)
Lines 108-116 Link Here
108
        setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.APPLICATION_MODAL);
108
        setShellStyle(SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.APPLICATION_MODAL);
109
109
110
        this.productName = productName;
110
        this.productName = productName;
111
        this.bundleGroupInfos = bundleGroupInfos;
112
111
113
        AboutData.sortByProvider(reverseSort, bundleGroupInfos);
112
        // the order of the array may be changed due to sorting, so create a
113
        // copy
114
        this.bundleGroupInfos = new AboutBundleGroupData[bundleGroupInfos.length];
115
        System.arraycopy(bundleGroupInfos, 0, this.bundleGroupInfos, 0,
116
                bundleGroupInfos.length);
117
118
        AboutData.sortByProvider(reverseSort, this.bundleGroupInfos);
114
    }
119
    }
115
120
116
	/**
121
	/**
Lines 245-252 Link Here
245
        createTable(outer);
250
        createTable(outer);
246
        createInfoArea(outer);
251
        createInfoArea(outer);
247
252
248
        GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_FILL,
253
        GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
249
                GridData.VERTICAL_ALIGN_FILL, true, true);
250
        gridData.heightHint = convertVerticalDLUsToPixels(TABLE_HEIGHT);
254
        gridData.heightHint = convertVerticalDLUsToPixels(TABLE_HEIGHT);
251
        table.setLayoutData(gridData);
255
        table.setLayoutData(gridData);
252
256
Lines 431-438 Link Here
431
        if (map == null)
435
        if (map == null)
432
            return null;
436
            return null;
433
437
434
        String key = info.getId() + "_" + info.getVersion(); //$NON-NLS-1$
438
        return (IFeature) map.get(info.getVersionedId());
435
        return (IFeature) map.get(key);
436
    }
439
    }
437
440
438
	/**
441
	/**
(-)src/org/eclipse/ui/internal/ide/dialogs/AboutPluginsDialog.java (-16 / +30 lines)
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
    }

Return to bug 54548