Search in sources :

Example 1 with ICommonViewerWorkbenchSite

use of org.eclipse.ui.navigator.ICommonViewerWorkbenchSite in project translationstudio8 by heartsome.

the class NewActionProvider method init.

public void init(ICommonActionExtensionSite anExtensionSite) {
    if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
        IWorkbenchWindow window = ((ICommonViewerWorkbenchSite) anExtensionSite.getViewSite()).getWorkbenchWindow();
        showDlgAction = ActionFactory.NEW_WIZARD_DROP_DOWN.create(window);
        showDlgAction.setText(WorkbenchNavigatorMessages.actions_NewActionProvider_NewMenu_label);
        contribute = true;
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Example 2 with ICommonViewerWorkbenchSite

use of org.eclipse.ui.navigator.ICommonViewerWorkbenchSite in project sling by apache.

the class PackageExplorerOpenActionProvider method init.

@Override
public void init(ICommonActionExtensionSite site) {
    super.init(site);
    action = new OpenFileAction(getActivePage());
    ICommonViewerWorkbenchSite workbenchSite = null;
    if (site.getViewSite() instanceof ICommonViewerWorkbenchSite)
        workbenchSite = (ICommonViewerWorkbenchSite) site.getViewSite();
    if (workbenchSite != null) {
        if (workbenchSite.getPart() != null && workbenchSite.getPart() instanceof IViewPart) {
            IViewPart viewPart = (IViewPart) workbenchSite.getPart();
            if (site.getStructuredViewer() instanceof TreeViewer) {
                treeViewer = (TreeViewer) site.getStructuredViewer();
                treeViewer.addSelectionChangedListener(action);
            }
            fInViewPart = true;
        }
    }
}
Also used : OpenFileAction(org.eclipse.ui.actions.OpenFileAction) IViewPart(org.eclipse.ui.IViewPart) TreeViewer(org.eclipse.jface.viewers.TreeViewer) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Example 3 with ICommonViewerWorkbenchSite

use of org.eclipse.ui.navigator.ICommonViewerWorkbenchSite in project translationstudio8 by heartsome.

the class UndoRedoActionProvider method init.

/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
	 */
public void init(ICommonActionExtensionSite anActionSite) {
    IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
    undoRedoGroup = new UndoRedoActionGroup(((ICommonViewerWorkbenchSite) anActionSite.getViewSite()).getSite(), workspaceContext, true);
}
Also used : IUndoContext(org.eclipse.core.commands.operations.IUndoContext) UndoRedoActionGroup(org.eclipse.ui.operations.UndoRedoActionGroup) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Example 4 with ICommonViewerWorkbenchSite

use of org.eclipse.ui.navigator.ICommonViewerWorkbenchSite in project translationstudio8 by heartsome.

the class PortingActionProvider method init.

public void init(ICommonActionExtensionSite anExtensionSite) {
    Assert.isTrue(!disposed);
    if (anExtensionSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
        IWorkbenchWindow window = ((ICommonViewerWorkbenchSite) anExtensionSite.getViewSite()).getWorkbenchWindow();
        importAction = new ImportResourcesAction(window);
        importAction.setText(WorkbenchNavigatorMessages.PortingActionProvider_ImportResourcesMenu_label);
        exportAction = new ExportResourcesAction(window);
        exportAction.setText(WorkbenchNavigatorMessages.PortingActionProvider_ExportResourcesMenu_label);
        importWizardActionGroup = new WizardActionGroup(window, PlatformUI.getWorkbench().getImportWizardRegistry(), WizardActionGroup.TYPE_IMPORT, anExtensionSite.getContentService());
        exportWizardActionGroup = new WizardActionGroup(window, PlatformUI.getWorkbench().getExportWizardRegistry(), WizardActionGroup.TYPE_EXPORT, anExtensionSite.getContentService());
        contribute = true;
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ExportResourcesAction(org.eclipse.ui.actions.ExportResourcesAction) ImportResourcesAction(org.eclipse.ui.actions.ImportResourcesAction) WizardActionGroup(org.eclipse.ui.navigator.WizardActionGroup) ICommonViewerWorkbenchSite(org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)

Aggregations

ICommonViewerWorkbenchSite (org.eclipse.ui.navigator.ICommonViewerWorkbenchSite)4 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)2 IUndoContext (org.eclipse.core.commands.operations.IUndoContext)1 TreeViewer (org.eclipse.jface.viewers.TreeViewer)1 IViewPart (org.eclipse.ui.IViewPart)1 ExportResourcesAction (org.eclipse.ui.actions.ExportResourcesAction)1 ImportResourcesAction (org.eclipse.ui.actions.ImportResourcesAction)1 OpenFileAction (org.eclipse.ui.actions.OpenFileAction)1 WizardActionGroup (org.eclipse.ui.navigator.WizardActionGroup)1 UndoRedoActionGroup (org.eclipse.ui.operations.UndoRedoActionGroup)1