Search in sources :

Example 1 with IIdentifier

use of org.eclipse.ui.activities.IIdentifier in project dbeaver by dbeaver.

the class DatabaseLaunchContributionFactory method createContributionItems.

@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
    IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
    String identifierId = createContributionIdentifier();
    IIdentifier identifier = activitySupport.getActivityManager().getIdentifier(identifierId);
    if (!identifier.isEnabled()) {
        return;
    }
    MenuManager menuManager = new MenuManager(text, imageDescriptor, id);
    DatabaseLaunchContributionItem item = createContributionItem();
    item.setVisible(true);
    menuManager.add(item);
    additions.addContributionItem(menuManager, null);
}
Also used : IIdentifier(org.eclipse.ui.activities.IIdentifier) MenuManager(org.eclipse.jface.action.MenuManager) IWorkbenchActivitySupport(org.eclipse.ui.activities.IWorkbenchActivitySupport)

Example 2 with IIdentifier

use of org.eclipse.ui.activities.IIdentifier in project dbeaver by serge-rider.

the class DatabaseLaunchContributionFactory method createContributionItems.

@Override
public void createContributionItems(IServiceLocator serviceLocator, IContributionRoot additions) {
    IWorkbenchActivitySupport activitySupport = PlatformUI.getWorkbench().getActivitySupport();
    String identifierId = createContributionIdentifier();
    IIdentifier identifier = activitySupport.getActivityManager().getIdentifier(identifierId);
    if (!identifier.isEnabled()) {
        return;
    }
    MenuManager menuManager = new MenuManager(text, imageDescriptor, id);
    DatabaseLaunchContributionItem item = createContributionItem();
    item.setVisible(true);
    menuManager.add(item);
    additions.addContributionItem(menuManager, null);
}
Also used : IIdentifier(org.eclipse.ui.activities.IIdentifier) MenuManager(org.eclipse.jface.action.MenuManager) IWorkbenchActivitySupport(org.eclipse.ui.activities.IWorkbenchActivitySupport)

Aggregations

MenuManager (org.eclipse.jface.action.MenuManager)2 IIdentifier (org.eclipse.ui.activities.IIdentifier)2 IWorkbenchActivitySupport (org.eclipse.ui.activities.IWorkbenchActivitySupport)2