use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ConnectionPart method setSelected.
/*
* (non-Javadoc)
*
* @see org.eclipse.gef.editparts.AbstractEditPart#setSelected(int)
*/
@Override
public void setSelected(final int value) {
super.setSelected(value);
List cl = this.getChildren();
for (int i = 0; i < cl.size(); i++) {
if (((EditPart) cl.get(i)).getSelected() != value) {
((EditPart) cl.get(i)).setSelected(value);
}
}
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (value == SELECTED_PRIMARY) {
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view != null) {
ComponentSettingsView compSettings = (ComponentSettingsView) view;
compSettings.setElement((Connection) getModel());
CodeView.refreshCodeView((Connection) getModel());
}
} else if (value == SELECTED_NONE) {
IViewPart view = page.findView(ComponentSettingsView.ID);
if (view != null) {
ComponentSettingsView compSettings = (ComponentSettingsView) view;
compSettings.cleanDisplay();
}
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ComponentChooseDialog method getJobletPart.
public AbstractMultiPageTalendEditor getJobletPart(JobletContainerPart part) {
AbstractMultiPageTalendEditor openEditor = null;
Node jobletNode = ((JobletContainer) part.getModel()).getNode();
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (PluginChecker.isJobLetPluginLoaded()) {
IJobletProviderService service = (IJobletProviderService) GlobalServiceRegister.getDefault().getService(IJobletProviderService.class);
if (service != null) {
openEditor = (AbstractMultiPageTalendEditor) service.openJobletEditor(jobletNode, page);
}
}
return openEditor;
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class RefreshView method refreshAll.
public static void refreshAll() {
IWorkbenchWindow workBenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (workBenchWindow == null) {
return;
}
IWorkbenchPage workBenchPage = workBenchWindow.getActivePage();
if (workBenchPage == null) {
return;
}
for (IViewDescriptor desc : PlatformUI.getWorkbench().getViewRegistry().getViews()) {
IViewPart viewPart = workBenchPage.findView(desc.getId());
// show the view again in order to see the change
if (viewPart != null) {
workBenchPage.hideView(viewPart);
}
}
workBenchPage.resetPerspective();
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class RunProcessAction method run.
@Override
public void run() {
if ((ProcessComposite.getProcessContext() != null && !ProcessComposite.getProcessContext().isRunning())) {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
// TODO SML Use getInstance
ShowRunProcessViewAction action = new ShowRunProcessViewAction();
action.run();
// TODO SML Optimize
ProcessView view = (ProcessView) page.getActivePart();
view.runAction.run();
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class RunProcessShortcutAction method run.
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart activeEditor = page.getActiveEditor();
if (CorePlugin.getDefault().getDesignerCoreService().isTalendEditor(activeEditor)) {
JobLaunchShortcutManager.run(activeEditor);
} else {
new RunProcessAction().run();
}
}
Aggregations