Java Code Examples for org.eclipse.ui.navigator.ICommonViewerWorkbenchSite#getShell()

The following examples show how to use org.eclipse.ui.navigator.ICommonViewerWorkbenchSite#getShell() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PythonActionProvider.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aSite) {
    ICommonViewerSite viewSite = aSite.getViewSite();
    if (viewSite instanceof ICommonViewerWorkbenchSite) {
        ICommonViewerWorkbenchSite site = (ICommonViewerWorkbenchSite) viewSite;
        Shell shell = site.getShell();

        ISharedImages images = PlatformUI.getWorkbench().getSharedImages();
        clipboard = new Clipboard(shell.getDisplay());
        selectionProvider = site.getSelectionProvider();
        openPythonAction = new PyOpenPythonFileAction(site.getPage(), selectionProvider);
        openResourceAction = new PyOpenResourceAction(site.getPage(), selectionProvider);
        openExternalAction = new PyOpenExternalAction(site.getPage(), selectionProvider);

        deleteResourceAction = new PyDeleteResourceAction(shell, selectionProvider);
        copyResourceAction = new PyCopyResourceAction(shell, selectionProvider, clipboard);
        pasteAction = new PyPasteAction(shell, selectionProvider, clipboard);
        moveResourceAction = new PyMoveResourceAction(shell, selectionProvider);

        copyResourceAction.setDisabledImageDescriptor(images
                .getImageDescriptor(ISharedImages.IMG_TOOL_COPY_DISABLED));
        copyResourceAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_COPY));

        pasteAction.setDisabledImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE_DISABLED));
        pasteAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_PASTE));

        deleteResourceAction.setDisabledImageDescriptor(images
                .getImageDescriptor(ISharedImages.IMG_TOOL_DELETE_DISABLED));
        deleteResourceAction.setImageDescriptor(images.getImageDescriptor(ISharedImages.IMG_TOOL_DELETE));

    }
}
 
Example 2
Source File: PythonRefactorActionProvider.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aSite) {
    ICommonViewerSite viewSite = aSite.getViewSite();
    if (viewSite instanceof ICommonViewerWorkbenchSite) {
        ICommonViewerWorkbenchSite site = (ICommonViewerWorkbenchSite) viewSite;
        Shell shell = site.getShell();
        renameResourceAction = new PyRenameResourceAction(shell, site.getSelectionProvider());
    }
}