|
Lines 10-89
Link Here
|
| 10 |
*******************************************************************************/ |
10 |
*******************************************************************************/ |
| 11 |
package org.eclipse.pde.internal.ui.wizards.imports; |
11 |
package org.eclipse.pde.internal.ui.wizards.imports; |
| 12 |
|
12 |
|
| 13 |
import org.eclipse.pde.internal.ui.provisional.IBundeImportWizardPage; |
|
|
| 14 |
|
| 15 |
import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; |
| 16 |
|
| 17 |
import org.eclipse.pde.internal.core.importing.IBundleImporter; |
| 18 |
|
| 19 |
import java.io.File; |
13 |
import java.io.File; |
| 20 |
import java.lang.reflect.InvocationTargetException; |
14 |
import java.lang.reflect.InvocationTargetException; |
| 21 |
import java.net.MalformedURLException; |
15 |
import java.net.MalformedURLException; |
| 22 |
import java.net.URL; |
16 |
import java.net.URL; |
| 23 |
import java.util.ArrayList; |
17 |
import java.util.*; |
| 24 |
import java.util.Collections; |
|
|
| 25 |
import java.util.Comparator; |
| 26 |
import java.util.HashMap; |
| 27 |
import java.util.HashSet; |
| 28 |
import java.util.Iterator; |
| 29 |
import java.util.List; |
| 30 |
import java.util.Map; |
| 31 |
import java.util.Map.Entry; |
18 |
import java.util.Map.Entry; |
| 32 |
import java.util.Set; |
19 |
import java.util.List; |
| 33 |
import org.eclipse.core.runtime.CoreException; |
20 |
import org.eclipse.core.runtime.*; |
| 34 |
import org.eclipse.core.runtime.IConfigurationElement; |
|
|
| 35 |
import org.eclipse.core.runtime.IExtensionPoint; |
| 36 |
import org.eclipse.core.runtime.IPath; |
| 37 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 38 |
import org.eclipse.core.runtime.Path; |
| 39 |
import org.eclipse.core.runtime.Platform; |
| 40 |
import org.eclipse.core.runtime.SubProgressMonitor; |
| 41 |
import org.eclipse.jface.dialogs.Dialog; |
21 |
import org.eclipse.jface.dialogs.Dialog; |
| 42 |
import org.eclipse.jface.dialogs.IDialogSettings; |
22 |
import org.eclipse.jface.dialogs.IDialogSettings; |
| 43 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
23 |
import org.eclipse.jface.operation.IRunnableWithProgress; |
| 44 |
import org.eclipse.jface.preference.IPreferenceNode; |
24 |
import org.eclipse.jface.preference.*; |
| 45 |
import org.eclipse.jface.preference.PreferenceDialog; |
|
|
| 46 |
import org.eclipse.jface.preference.PreferenceManager; |
| 47 |
import org.eclipse.jface.window.Window; |
25 |
import org.eclipse.jface.window.Window; |
| 48 |
import org.eclipse.jface.wizard.IWizardPage; |
26 |
import org.eclipse.jface.wizard.*; |
| 49 |
import org.eclipse.jface.wizard.Wizard; |
27 |
import org.eclipse.pde.core.plugin.*; |
| 50 |
import org.eclipse.jface.wizard.WizardPage; |
28 |
import org.eclipse.pde.internal.core.*; |
| 51 |
import org.eclipse.pde.core.plugin.IPluginBase; |
29 |
import org.eclipse.pde.internal.core.importing.IBundleImporter; |
| 52 |
import org.eclipse.pde.core.plugin.IPluginModelBase; |
30 |
import org.eclipse.pde.internal.core.importing.provisional.BundleImportDescription; |
| 53 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
|
|
| 54 |
import org.eclipse.pde.core.plugin.TargetPlatform; |
| 55 |
import org.eclipse.pde.internal.core.ICoreConstants; |
| 56 |
import org.eclipse.pde.internal.core.PDECore; |
| 57 |
import org.eclipse.pde.internal.core.PDEPreferencesManager; |
| 58 |
import org.eclipse.pde.internal.core.PDEState; |
| 59 |
import org.eclipse.pde.internal.core.SourceLocationKey; |
| 60 |
import org.eclipse.pde.internal.core.SourceLocationManager; |
| 61 |
import org.eclipse.pde.internal.core.project.BundleProjectService; |
31 |
import org.eclipse.pde.internal.core.project.BundleProjectService; |
| 62 |
import org.eclipse.pde.internal.core.target.provisional.IBundleContainer; |
32 |
import org.eclipse.pde.internal.core.target.provisional.*; |
| 63 |
import org.eclipse.pde.internal.core.target.provisional.IResolvedBundle; |
33 |
import org.eclipse.pde.internal.ui.*; |
| 64 |
import org.eclipse.pde.internal.core.target.provisional.ITargetDefinition; |
|
|
| 65 |
import org.eclipse.pde.internal.core.target.provisional.ITargetHandle; |
| 66 |
import org.eclipse.pde.internal.core.target.provisional.ITargetPlatformService; |
| 67 |
import org.eclipse.pde.internal.ui.IHelpContextIds; |
| 68 |
import org.eclipse.pde.internal.ui.IPDEUIConstants; |
| 69 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
| 70 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
| 71 |
import org.eclipse.pde.internal.ui.SWTFactory; |
| 72 |
import org.eclipse.pde.internal.ui.preferences.TargetPlatformPreferenceNode; |
34 |
import org.eclipse.pde.internal.ui.preferences.TargetPlatformPreferenceNode; |
|
|
35 |
import org.eclipse.pde.internal.ui.provisional.IBundeImportWizardPage; |
| 73 |
import org.eclipse.swt.SWT; |
36 |
import org.eclipse.swt.SWT; |
| 74 |
import org.eclipse.swt.custom.BusyIndicator; |
37 |
import org.eclipse.swt.custom.BusyIndicator; |
| 75 |
import org.eclipse.swt.events.ModifyEvent; |
38 |
import org.eclipse.swt.events.*; |
| 76 |
import org.eclipse.swt.events.ModifyListener; |
|
|
| 77 |
import org.eclipse.swt.events.SelectionAdapter; |
| 78 |
import org.eclipse.swt.events.SelectionEvent; |
| 79 |
import org.eclipse.swt.layout.GridData; |
39 |
import org.eclipse.swt.layout.GridData; |
| 80 |
import org.eclipse.swt.layout.GridLayout; |
40 |
import org.eclipse.swt.layout.GridLayout; |
| 81 |
import org.eclipse.swt.widgets.Button; |
41 |
import org.eclipse.swt.widgets.*; |
| 82 |
import org.eclipse.swt.widgets.Combo; |
|
|
| 83 |
import org.eclipse.swt.widgets.Composite; |
| 84 |
import org.eclipse.swt.widgets.DirectoryDialog; |
| 85 |
import org.eclipse.swt.widgets.Group; |
| 86 |
import org.eclipse.swt.widgets.Shell; |
| 87 |
import org.eclipse.ui.PlatformUI; |
42 |
import org.eclipse.ui.PlatformUI; |
| 88 |
import org.osgi.framework.Version; |
43 |
import org.osgi.framework.Version; |
| 89 |
|
44 |
|
|
Lines 728-734
Link Here
|
| 728 |
} |
683 |
} |
| 729 |
if (page != null) { |
684 |
if (page != null) { |
| 730 |
nextPages.add(page); |
685 |
nextPages.add(page); |
| 731 |
page.setSelection((BundleImportDescription[]) entry.getValue()); |
686 |
// page.setSelection((BundleImportDescription[]) entry.getValue()); |
| 732 |
} |
687 |
} |
| 733 |
} |
688 |
} |
| 734 |
} |
689 |
} |
|
Lines 931-934
Link Here
|
| 931 |
return getDropLocation(); |
886 |
return getDropLocation(); |
| 932 |
} |
887 |
} |
| 933 |
} |
888 |
} |
|
|
889 |
|
| 890 |
/** |
| 891 |
* Notifies the contributed bundle import pages of the bundles to import. |
| 892 |
* |
| 893 |
* @param models the models selected for import |
| 894 |
*/ |
| 895 |
public void configureBundleImportPages(IPluginModelBase[] models) { |
| 896 |
// make a set of the models to import for quick lookup |
| 897 |
Set modelsSet = new HashSet(); |
| 898 |
for (int i = 0; i < models.length; i++) { |
| 899 |
modelsSet.add(models[i]); |
| 900 |
} |
| 901 |
Map importerToImportees = new HashMap(); |
| 902 |
Iterator iterator = importerToInstructions.entrySet().iterator(); |
| 903 |
while (iterator.hasNext()) { |
| 904 |
Entry entry = (Entry) iterator.next(); |
| 905 |
IBundleImporter importer = (IBundleImporter) entry.getKey(); |
| 906 |
BundleImportDescription[] descriptions = (BundleImportDescription[]) entry.getValue(); |
| 907 |
for (int i = 0; i < descriptions.length; i++) { |
| 908 |
IPluginModelBase model = (IPluginModelBase) descriptions[i].getProperty(BundleProjectService.PLUGIN); |
| 909 |
if (modelsSet.contains(model)) { |
| 910 |
List importees = (List) importerToImportees.get(importer); |
| 911 |
if (importees == null) { |
| 912 |
importees = new ArrayList(); |
| 913 |
importerToImportees.put(importer, importees); |
| 914 |
} |
| 915 |
importees.add(descriptions[i]); |
| 916 |
} |
| 917 |
} |
| 918 |
} |
| 919 |
iterator = importerToImportees.entrySet().iterator(); |
| 920 |
while (iterator.hasNext()) { |
| 921 |
Entry entry = (Entry) iterator.next(); |
| 922 |
IBundleImporter importer = (IBundleImporter) entry.getKey(); |
| 923 |
List list = (List) entry.getValue(); |
| 924 |
BundleImportDescription[] descriptions = (BundleImportDescription[]) list.toArray(new BundleImportDescription[list.size()]); |
| 925 |
IBundeImportWizardPage page = (IBundeImportWizardPage) importIdToWizardPage.get(importer.getId()); |
| 926 |
if (page != null) { |
| 927 |
page.setSelection(descriptions); |
| 928 |
} |
| 929 |
} |
| 930 |
} |
| 934 |
} |
931 |
} |