use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class TalendEditorComponentCreationUtil method removeAssistListenerOnOpenedEditors.
public static void removeAssistListenerOnOpenedEditors() {
IEditorReference[] editorReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
for (IEditorReference er : editorReferences) {
if (er == null) {
continue;
}
IEditorPart editor = er.getEditor(true);
if (editor == null || !(editor instanceof AbstractMultiPageTalendEditor)) {
continue;
}
AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) editor).getTalendEditor();
removeComponentCreationAssist(talendEditor);
}
}
use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class TalendEditorComponentCreationUtil method registerAssistListenerFromOpenedEditors.
public static void registerAssistListenerFromOpenedEditors() {
IEditorReference[] editorReferences = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
for (IEditorReference er : editorReferences) {
if (er == null) {
continue;
}
IEditorPart editor = er.getEditor(true);
if (editor == null || !(editor instanceof AbstractMultiPageTalendEditor)) {
continue;
}
AbstractTalendEditor talendEditor = ((AbstractMultiPageTalendEditor) editor).getTalendEditor();
addComponentCreationAssist(talendEditor);
}
}
use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class ShowDesignerPageAction method run.
@Override
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
if (editorPart instanceof MultiPageTalendEditor) {
((MultiPageTalendEditor) editorPart).showDesignerPage();
}
}
use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class ShowEditorPageAction method run.
@Override
public void run() {
IWorkbench workbench = PlatformUI.getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
IEditorPart editorPart = page.getActiveEditor();
if (editorPart instanceof MultiPageTalendEditor) {
((MultiPageTalendEditor) editorPart).showCodePage();
}
}
use of org.eclipse.ui.IEditorPart in project tdi-studio-se by Talend.
the class JobletUtil method needReadOnlyJoblet.
public boolean needReadOnlyJoblet(JobletProcessItem jobletItem) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart[] editors = page.getEditors();
for (IEditorPart editor : editors) {
if (editor instanceof AbstractMultiPageTalendEditor) {
List<? extends INode> nodeList = ((AbstractMultiPageTalendEditor) editor).getProcess().getGraphicalNodes();
for (INode node : nodeList) {
if (((Node) node).isJoblet() && jobletItem.getProperty() != null) {
if (jobletItem.getProperty().getId().equals(node.getComponent().getProcess().getId())) {
boolean haveLock = jobletItem.getState().isLocked();
boolean isSvn = false;
ISVNProviderService service = null;
if (PluginChecker.isSVNProviderPluginLoaded()) {
service = (ISVNProviderService) GlobalServiceRegister.getDefault().getService(ISVNProviderService.class);
}
if (service != null && service.isProjectInSvnMode()) {
isSvn = service.isProjectInSvnMode();
}
if (isSvn) {
IProxyRepositoryService proxyService = (IProxyRepositoryService) GlobalServiceRegister.getDefault().getService(IProxyRepositoryService.class);
IProxyRepositoryFactory factory = proxyService.getProxyRepositoryFactory();
ERepositoryStatus repositoryStatus = factory.getStatus(jobletItem);
if (repositoryStatus == ERepositoryStatus.LOCK_BY_USER) {
haveLock = true;
}
}
if (haveLock) {
return true;
}
}
}
}
}
}
return false;
}
Aggregations