Search in sources :

Example 1 with ChangePerspectiveAction

use of org.talend.dataprofiler.core.ui.perspective.ChangePerspectiveAction in project tdq-studio-se by Talend.

the class ApplicationActionBarAdvisor method fillCoolBar.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.ui.application.ActionBarAdvisor#fillCoolBar(org.eclipse.jface.action.ICoolBarManager)
     */
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
    IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    // $NON-NLS-1$
    coolBar.add(new ToolBarContributionItem(toolbar, "switch_persp"));
    toolbar.add(new ChangePerspectiveAction(true));
    toolbar.add(ActionFactory.SAVE.create(window));
    // add feature:15174
    // Workbench3xImplementation4CoolBar.createLinksToolbarItem(coolBar);
    IToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
    toolBarManager.add(new LinksToolbarItem());
    coolBar.add(new ToolBarContributionItem(toolBarManager, LinksToolbarItem.COOLITEM_LINKS_ID));
}
Also used : ToolBarContributionItem(org.eclipse.jface.action.ToolBarContributionItem) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ChangePerspectiveAction(org.talend.dataprofiler.core.ui.perspective.ChangePerspectiveAction) IToolBarManager(org.eclipse.jface.action.IToolBarManager) ToolBarManager(org.eclipse.jface.action.ToolBarManager) LinksToolbarItem(org.talend.dataprofiler.rcp.intro.linksbar.LinksToolbarItem)

Example 2 with ChangePerspectiveAction

use of org.talend.dataprofiler.core.ui.perspective.ChangePerspectiveAction in project tdq-studio-se by Talend.

the class OpenSqlFileAction method run.

/*
     * (non-Javadoc)
     * 
     * @see org.eclipse.jface.action.Action#run()
     */
@Override
public void run() {
    try {
        for (IFile file : folder) {
            if (!file.exists()) {
                BusinessException createBusinessException = ExceptionFactory.getInstance().createBusinessException(file.getName());
                throw createBusinessException;
            }
        }
        // ADD xqliu 2010-08-20 bug 13729
        new ChangePerspectiveAction(PluginConstant.SE_ID).run();
        // ~ 13729
        IWorkbenchWindow aww = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        IWorkbenchPage ap = aww.getActivePage();
        for (IFile file : folder) {
            try {
                IDE.openEditor(ap, file, SqlExplorerUtils.SQLEDITOR_ID, true);
            } catch (PartInitException e) {
                log.error(e, e);
            }
        }
    } catch (BusinessException e) {
        ExceptionHandler.process(e, Level.FATAL);
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) BusinessException(org.talend.commons.exception.BusinessException) IFile(org.eclipse.core.resources.IFile) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) ChangePerspectiveAction(org.talend.dataprofiler.core.ui.perspective.ChangePerspectiveAction) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

ChangePerspectiveAction (org.talend.dataprofiler.core.ui.perspective.ChangePerspectiveAction)2 IFile (org.eclipse.core.resources.IFile)1 IToolBarManager (org.eclipse.jface.action.IToolBarManager)1 ToolBarContributionItem (org.eclipse.jface.action.ToolBarContributionItem)1 ToolBarManager (org.eclipse.jface.action.ToolBarManager)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 PartInitException (org.eclipse.ui.PartInitException)1 BusinessException (org.talend.commons.exception.BusinessException)1 LinksToolbarItem (org.talend.dataprofiler.rcp.intro.linksbar.LinksToolbarItem)1