use of org.eclipse.ui.activities.IActivityManager in project dbeaver by dbeaver.
the class DataSourceProviderRegistry method getEnabledDataSourceProviders.
public List<DataSourceProviderDescriptor> getEnabledDataSourceProviders() {
IActivityManager activityManager = PlatformUI.getWorkbench().getActivitySupport().getActivityManager();
List<DataSourceProviderDescriptor> enabled = new ArrayList<>(dataSourceProviders);
enabled.removeIf(p -> !activityManager.getIdentifier(p.getFullIdentifier()).isEnabled());
return enabled;
}
use of org.eclipse.ui.activities.IActivityManager in project titan.EclipsePlug-ins by eclipse.
the class Activator method switchActivity.
/**
* Activates or deactivates the given activity
* @param activityId The activity
* @param enable <code>true</code> if the given activity should be enabled, <code>false</code> otherwise
* @return <code>true</code> if an activity change is performed, <code>false</code> otherwise
*/
@SuppressWarnings("unchecked")
public static final boolean switchActivity(final String activityId, final boolean enable) {
final IWorkbenchActivitySupport as = PlatformUI.getWorkbench().getActivitySupport();
final IActivityManager am = as.getActivityManager();
@SuppressWarnings({ "rawtypes" }) final Set enabledActivities = new HashSet(am.getEnabledActivityIds());
final boolean activityChange = enable ? enabledActivities.add(activityId) : enabledActivities.remove(activityId);
if (!activityChange) {
return false;
}
as.setEnabledActivityIds(enabledActivities);
return true;
}
Aggregations