use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class TutorialsService method openTutorialsDialog.
@Override
public void openTutorialsDialog() {
IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
if (activePage != null) {
TutorialsDialog dialog = new TutorialsDialog();
dialog.open();
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ExportJobScriptAction method checkDirtyPart.
/**
* DOC Administrator Comment method "checkDirtyPart".
*
* @param workbench
*/
@SuppressWarnings("restriction")
private boolean checkDirtyPart(IWorkbench workbench) {
ISaveablePart[] parts = null;
IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
for (IWorkbenchWindow window : windows) {
IWorkbenchPage[] pages = window.getPages();
for (IWorkbenchPage page : pages) {
parts = page.getDirtyEditors();
}
}
if (parts != null && parts.length > 0) {
return true;
}
return false;
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class ContextRepositoryCommand method refreshContextView.
/**
* qzhang Comment method "refreshContextView".
*/
private void refreshContextView() {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IViewPart view2 = page.findView(ContextsView.CTX_ID_DESIGNER);
if (view2 instanceof ContextsView) {
((ContextsView) view2).updateContextView(contextItem == null);
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class TalendLaunchToolbarAction method run.
/**
* Launch the last launch, or open the launch config dialog if none.
*
* @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
*/
@Override
public void run(IAction action) {
// launch the job that is selected in the repository.
if (selection instanceof IStructuredSelection) {
IStructuredSelection sel = (IStructuredSelection) selection;
Object o = sel.getFirstElement();
if ((o instanceof RepositoryNode)) {
RepositoryNode node = (RepositoryNode) o;
if (node.getObject() != null && node.getObject().getRepositoryObjectType().equals(ERepositoryObjectType.PROCESS)) {
JobLaunchShortcutManager.run(selection);
return;
}
}
}
// launch the job that is open in editor
if (window != null) {
IWorkbenchPage page = window.getActivePage();
if (page != null) {
if (page.getActivePart() == page.getActiveEditor()) {
IEditorPart editor = page.getActiveEditor();
IEditorInput input = editor.getEditorInput();
if (input instanceof RepositoryEditorInput) {
JobLaunchShortcutManager.run(editor);
return;
}
}
}
}
ILaunchConfiguration configuration = getLastLaunch();
if (configuration == null) {
// MessageDialog
// .openInformation(
// DebugUIPlugin.getShell(),
// Messages.getString("TalendLaunchToolbarAction.information"), Messages.getString("TalendLaunchToolbarAction.noAvailableItem")); //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openInformation(getShell(), Messages.getString("TalendLaunchToolbarAction.information"), //$NON-NLS-1$ //$NON-NLS-2$
Messages.getString("TalendLaunchToolbarAction.noAvailableItem"));
// DebugUITools.openLaunchConfigurationDialogOnGroup(DebugUIPlugin.getShell(), new StructuredSelection(),
// getLaunchGroupIdentifier());
} else {
DebugUITools.launch(configuration, getMode());
}
}
use of org.eclipse.ui.IWorkbenchPage in project tdi-studio-se by Talend.
the class DesignerCoreService method refreshComponentView.
@Override
public void refreshComponentView(Item item) {
try {
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
IEditorReference[] editors = activePage.getEditorReferences();
for (IEditorReference er : editors) {
IEditorPart part = er.getEditor(false);
if (part instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor editor = (AbstractMultiPageTalendEditor) part;
CommandStack stack = (CommandStack) editor.getTalendEditor().getAdapter(CommandStack.class);
if (stack != null) {
IProcess process = editor.getProcess();
for (final INode processNode : process.getGraphicalNodes()) {
if (processNode instanceof Node) {
checkRepository((Node) processNode, item, stack);
}
}
}
}
}
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
Aggregations