org.eclipse.ui.navigator.ICommonViewerWorkbenchSite Java Examples

The following examples show how to use org.eclipse.ui.navigator.ICommonViewerWorkbenchSite. 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: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init ( final ICommonActionExtensionSite aSite )
{
    super.init ( aSite );
    final ICommonViewerSite viewSite = aSite.getViewSite ();
    if ( viewSite instanceof ICommonViewerWorkbenchSite )
    {
        final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite)viewSite;
        this.openAction = new Action ( "Open", IAction.AS_PUSH_BUTTON ) {
            @Override
            public void run ()
            {
                handleOpen ( workbenchSite );
            }
        };
    }
}
 
Example #2
Source File: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init ( final ICommonActionExtensionSite aSite )
{
    super.init ( aSite );
    final ICommonViewerSite viewSite = aSite.getViewSite ();
    if ( viewSite instanceof ICommonViewerWorkbenchSite )
    {
        final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite)viewSite;
        this.openAction = new Action ( "Open", IAction.AS_PUSH_BUTTON ) {
            @Override
            public void run ()
            {
                EditorHelper.handleOpen ( workbenchSite.getPage (), workbenchSite.getSelectionProvider () );
            }
        };
    }
}
 
Example #3
Source File: PortingActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
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;
		}
	}
 
Example #4
Source File: PortingActionProvider.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
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;
		}
	}
 
Example #5
Source File: CustomOpenActionProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aConfig) {
    if (aConfig.getViewSite() instanceof ICommonViewerWorkbenchSite) {
        viewSite = (ICommonViewerWorkbenchSite) aConfig.getViewSite();
        openFileAction = new OpenEditorActionGroup((IViewPart) viewSite.getPart());
        contribute = true;
    }
    repositoryAccessor = new RepositoryAccessor();
    repositoryAccessor.init();
    fileStoreFinder = new FileStoreFinder();
}
 
Example #6
Source File: ProcessNavigatorActionProvider.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
* @generated
*/
public void init(ICommonActionExtensionSite aSite) {
	super.init(aSite);
	if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		myContribute = true;
		makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
	} else {
		myContribute = false;
	}
}
 
Example #7
Source File: GoNavigatorActionProvider.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aSite) {
	super.init(aSite);
	
	ICommonViewerSite viewSite = aSite.getViewSite();
	if(viewSite instanceof ICommonViewerWorkbenchSite) {
		ICommonViewerWorkbenchSite cvws = (ICommonViewerWorkbenchSite) viewSite;
		navigatorOpenAction = new NavigatorOpenAction(cvws.getPage(), cvws.getSelectionProvider());
	}
}
 
Example #8
Source File: LangNavigatorActionProvider.java    From goclipse with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite site) {
	if (site.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite) site.getViewSite();
		if (workbenchSite.getPart() instanceof IViewPart) {
			IViewPart viewPart= (IViewPart) workbenchSite.getPart();
			
			initActionGroups(viewPart);
		}
	}
}
 
Example #9
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());
    }
}
 
Example #10
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 #11
Source File: OpenActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(ICommonActionExtensionSite aConfig) {
	if (aConfig.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		viewSite = (ICommonViewerWorkbenchSite) aConfig.getViewSite();
		openFileAction = new OpenFileWithValidAction(viewSite.getPage());
		openFileAction.setText(WorkbenchNavigatorMessages.actions_OpenActionProvider_openFileAction);
		contribute = true;
	}
}
 
Example #12
Source File: NewActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
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;
		}
	}
 
Example #13
Source File: OpenActionProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
public void init(ICommonActionExtensionSite aConfig) {
	if (aConfig.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		viewSite = (ICommonViewerWorkbenchSite) aConfig.getViewSite();
		openFileAction = new OpenFileWithValidAction(viewSite.getPage());
		openFileAction.setText(WorkbenchNavigatorMessages.actions_OpenActionProvider_openFileAction);
		contribute = true;
	}
}
 
Example #14
Source File: NewActionProvider.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
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;
		}
	}
 
Example #15
Source File: OpenActionProvider.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void init(final ICommonActionExtensionSite aConfig) {
	if (aConfig.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		viewSite = (ICommonViewerWorkbenchSite) aConfig.getViewSite();
		openFileAction = new OpenFileAction(viewSite.getPage());
		contribute = true;
	}
}
 
Example #16
Source File: NavigatorActionProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void init(ICommonActionExtensionSite aSite) {
	super.init(aSite);
	if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		myContribute = true;
		makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
	} else {
		myContribute = false;
	}
}
 
Example #17
Source File: TmfActionProvider.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aSite) {
    ICommonViewerSite viewSite = aSite.getViewSite();
    if (viewSite instanceof ICommonViewerWorkbenchSite) {
        ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite) viewSite;
        page = workbenchSite.getPage();
        openAction = new OpenAction(page, workbenchSite.getSelectionProvider());
    }
}
 
Example #18
Source File: CrossflowNavigatorActionProvider.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
/**
* @generated
*/
public void init(ICommonActionExtensionSite aSite) {
	super.init(aSite);
	if (aSite.getViewSite() instanceof ICommonViewerWorkbenchSite) {
		myContribute = true;
		makeActions((ICommonViewerWorkbenchSite) aSite.getViewSite());
	} else {
		myContribute = false;
	}
}
 
Example #19
Source File: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
protected void handleOpen ( final ICommonViewerWorkbenchSite workbenchSite )
{
    for ( final ConnectionHolder holder : SelectionHelper.iterable ( workbenchSite.getSelectionProvider ().getSelection (), ConnectionHolder.class ) )
    {
        if ( holder.getConnectionState () == ConnectionState.BOUND )
        {
            holder.disconnect ();
        }
        else if ( holder.getConnectionState () == ConnectionState.CLOSED )
        {
            holder.connect ( DisplayCallbackHandler.createDefault ( workbenchSite.getShell () ) );
        }
    }
}
 
Example #20
Source File: UndoRedoActionProvider.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
public void init(ICommonActionExtensionSite anActionSite) {
	IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin
			.getWorkspace().getAdapter(IUndoContext.class);
	undoRedoGroup = new UndoRedoActionGroup(((ICommonViewerWorkbenchSite) anActionSite.getViewSite()).getSite(),
			workspaceContext, true);
}
 
Example #21
Source File: DefaultNavigatorActionProvider.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void init(ICommonActionExtensionSite aSite)
{
	super.init(aSite);
	partSite = ((ICommonViewerWorkbenchSite) aSite.getViewSite()).getSite();
}
 
Example #22
Source File: UndoRedoActionProvider.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
public void init(ICommonActionExtensionSite anActionSite) {
	IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin
			.getWorkspace().getAdapter(IUndoContext.class);
	undoRedoGroup = new UndoRedoActionGroup(((ICommonViewerWorkbenchSite) anActionSite.getViewSite()).getSite(),
			workspaceContext, true);
}
 
Example #23
Source File: NavigatorActionProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
	super("Open Diagram");
	myViewerSite = viewerSite;
}
 
Example #24
Source File: NavigatorActionProvider.java    From statecharts with Eclipse Public License 1.0 4 votes vote down vote up
private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
	myOpenDiagramAction = new OpenDiagramAction(viewerSite);
}
 
Example #25
Source File: CrossflowNavigatorActionProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
	super(Messages.NavigatorActionProvider_OpenDiagramActionName);
	myViewerSite = viewerSite;
}
 
Example #26
Source File: CrossflowNavigatorActionProvider.java    From scava with Eclipse Public License 2.0 4 votes vote down vote up
/**
* @generated
*/
private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
	myOpenDiagramAction = new OpenDiagramAction(viewerSite);
}
 
Example #27
Source File: ProcessNavigatorActionProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
private void makeActions(ICommonViewerWorkbenchSite viewerSite) {
	myOpenDiagramAction = new OpenDiagramAction(viewerSite);
}
 
Example #28
Source File: ProcessNavigatorActionProvider.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
/**
* @generated
*/
public OpenDiagramAction(ICommonViewerWorkbenchSite viewerSite) {
	super(Messages.NavigatorActionProvider_OpenDiagramActionName);
	myViewerSite = viewerSite;
}