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));
}
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);
}
}
Aggregations