use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class MultiPageSqlBuilderEditor method createPartControl2.
public final void createPartControl2(Composite parent) {
//super.createPartControl(parent);
Composite pageContainer = createPageContainer(parent);
this.container = createContainer(pageContainer);
createPages();
// done
if (getActivePage() == -1) {
setActivePage(0);
IEditorPart part = getEditor(0);
if (part != null) {
final IServiceLocator serviceLocator = part.getEditorSite();
if (serviceLocator instanceof INestable) {
activeServiceLocator = (INestable) serviceLocator;
activeServiceLocator.activate();
}
}
}
}
use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.
the class OpenCamelExistVersionProcessAction method doRun.
@Override
protected void doRun() {
ISelection selection = getSelection();
Object obj = ((IStructuredSelection) selection).getFirstElement();
IRepositoryNode node = (IRepositoryNode) obj;
IPath path = RepositoryNodeUtilities.getPath(node);
String originalName = node.getObject().getLabel();
RepositoryObject repositoryObj = new RepositoryObject(node.getObject().getProperty());
repositoryObj.setRepositoryNode(node.getObject().getRepositoryNode());
OpenCamelExistVersionProcessWizard wizard = new OpenCamelExistVersionProcessWizard(repositoryObj);
WizardDialog dialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
dialog.setHelpAvailable(false);
dialog.setPageSize(300, 250);
//$NON-NLS-1$
dialog.setTitle(Messages.getString("OpenExistVersionProcess.open.dialog"));
if (dialog.open() == Dialog.OK) {
refresh(node);
// refresh the corresponding editor's name
IEditorPart part = getCorrespondingEditor(node);
if (part != null && part instanceof IUIRefresher) {
((IUIRefresher) part).refreshName();
} else {
processRoutineRenameOperation(originalName, node, path);
}
}
}
use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.
the class RunContainerPreferencePage method performOk.
/*
* (non-Javadoc)
*
* @see org.talend.designer.esb.runcontainer.preferences.FieldLayoutPreferencePage#performOk()
*/
@Override
public boolean performOk() {
boolean performOk = super.performOk();
if (runtimeEnable != getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI)) {
IRunProcessService service = (IRunProcessService) GlobalServiceRegister.getDefault().getService(IRunProcessService.class);
if (service != null) {
service.refreshView();
}
List<IEditorReference> editorRefs = new ArrayList();
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorReference[] reference = page.getEditorReferences();
for (IEditorReference editorRef : reference) {
IEditorPart part = editorRef.getEditor(false);
if (part.getEditorInput() instanceof JobEditorInput) {
editorRefs.add(editorRef);
}
}
if (editorRefs.size() > 0 && MessageDialog.openConfirm(getShell(), "Running Container Changed", "All editors need to be closed to apply the changes, do you want to close all opening editors now?")) {
page.closeEditors(editorRefs.toArray(new IEditorReference[editorRefs.size()]), true);
}
}
return performOk;
}
use of org.eclipse.ui.IEditorPart in project tesb-studio-se by Talend.
the class ESBService method refreshComponentView.
/**
* When services connection is renamed, refresh the connection label in the component view of job.
*
* @param item
*/
@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);
}
}
use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class StatsAndLogsView method createStatsAndLogsView.
/**
* ftang Comment method "createStatsAndLogsView".
*
*/
public void createStatsAndLogsView() {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) activeEditor).getTalendEditor();
createFullPartControl(this.parent, (Process) talendEditor.getProcess());
}
Aggregations