Lines 27-32
Link Here
|
27 |
import org.eclipse.datatools.connectivity.internal.ui.wizards.WizardCategoryProvider; |
27 |
import org.eclipse.datatools.connectivity.internal.ui.wizards.WizardCategoryProvider; |
28 |
import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider; |
28 |
import org.eclipse.datatools.connectivity.ui.wizards.IWizardCategoryProvider; |
29 |
import org.eclipse.jface.wizard.IWizard; |
29 |
import org.eclipse.jface.wizard.IWizard; |
|
|
30 |
import org.eclipse.ui.IPluginContribution; |
31 |
import org.eclipse.ui.PlatformUI; |
32 |
import org.eclipse.ui.activities.ActivityManagerEvent; |
33 |
import org.eclipse.ui.activities.IActivityManagerListener; |
34 |
import org.eclipse.ui.activities.WorkbenchActivityHelper; |
30 |
|
35 |
|
31 |
public class ConnectionProfileManagerUI { |
36 |
public class ConnectionProfileManagerUI { |
32 |
|
37 |
|
Lines 34-39
Link Here
|
34 |
|
39 |
|
35 |
private Map mNewWizards = null; |
40 |
private Map mNewWizards = null; |
36 |
private Map mWizardCategories = null; |
41 |
private Map mWizardCategories = null; |
|
|
42 |
|
43 |
private IActivityManagerListener activityListener = null; |
37 |
|
44 |
|
38 |
public static ConnectionProfileManagerUI getInstance() { |
45 |
public static ConnectionProfileManagerUI getInstance() { |
39 |
return sInstance; |
46 |
return sInstance; |
Lines 53-60
Link Here
|
53 |
} |
60 |
} |
54 |
|
61 |
|
55 |
public Map getNewWizards() { |
62 |
public Map getNewWizards() { |
56 |
if (mNewWizards == null) |
63 |
if (mNewWizards == null) { |
57 |
processExtensions(); |
64 |
processExtensions(); |
|
|
65 |
activityListener = new IActivityManagerListener () { |
66 |
public void activityManagerChanged( |
67 |
ActivityManagerEvent activityManagerEvent) { |
68 |
processExtensions(); |
69 |
} |
70 |
}; |
71 |
PlatformUI.getWorkbench().getActivitySupport().getActivityManager().addActivityManagerListener(activityListener); |
72 |
} |
58 |
return mNewWizards; |
73 |
return mNewWizards; |
59 |
} |
74 |
} |
60 |
|
75 |
|
Lines 69-80
Link Here
|
69 |
return ((ProfileWizardProvider) getNewWizards().get(id)).getWizard(); |
84 |
return ((ProfileWizardProvider) getNewWizards().get(id)).getWizard(); |
70 |
} |
85 |
} |
71 |
|
86 |
|
72 |
private void processNewWizard(IConfigurationElement element) { |
87 |
private void processNewWizard(final IConfigurationElement element) { |
73 |
ProfileWizardProvider c = new ProfileWizardProvider(element); |
88 |
ProfileWizardProvider c = new ProfileWizardProvider(element); |
74 |
Assert.isTrue(!mNewWizards.containsKey(c.getId()), ConnectivityPlugin |
89 |
Assert.isTrue(!mNewWizards.containsKey(c.getId()), ConnectivityPlugin |
75 |
.getDefault().getResourceString( |
90 |
.getDefault().getResourceString( |
76 |
"assert.invalid.profile", new Object[] { element //$NON-NLS-1$ |
91 |
"assert.invalid.profile", new Object[] { element //$NON-NLS-1$ |
77 |
.toString()})); |
92 |
.toString()})); |
|
|
93 |
IPluginContribution pc = new IPluginContribution() { |
94 |
|
95 |
public String getLocalId() { |
96 |
return ""; |
97 |
} |
98 |
|
99 |
public String getPluginId() { |
100 |
// TODO Auto-generated method stub |
101 |
return element.getContributor().getName(); |
102 |
} |
103 |
|
104 |
}; |
105 |
if (WorkbenchActivityHelper.filterItem(pc)) |
106 |
return; |
78 |
mNewWizards.put(c.getId(), c); |
107 |
mNewWizards.put(c.getId(), c); |
79 |
} |
108 |
} |
80 |
|
109 |
|