use of org.talend.designer.core.ui.AbstractMultiPageTalendEditor 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.talend.designer.core.ui.AbstractMultiPageTalendEditor 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.talend.designer.core.ui.AbstractMultiPageTalendEditor 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;
}
use of org.talend.designer.core.ui.AbstractMultiPageTalendEditor in project tdi-studio-se by Talend.
the class JobletUtil method openedInJob.
public boolean openedInJob(JobletProcessItem jobletItem, Node currNode) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
IEditorPart[] editors = page.getEditors();
for (IEditorPart editor : editors) {
if (editor instanceof AbstractMultiPageTalendEditor) {
IProcess2 pro = ((AbstractMultiPageTalendEditor) editor).getProcess();
if (currNode != null) {
IProcess2 currPro = (IProcess2) currNode.getProcess();
if (currPro.getId().equals(pro.getId())) {
List<? extends INode> currNodeList = currPro.getGraphicalNodes();
for (INode node : currNodeList) {
if (node == currNode) {
continue;
} else {
if (((Node) node).isJoblet() && jobletItem.getProperty() != null) {
if (jobletItem.getProperty().getId().equals(node.getComponent().getProcess().getId()) && jobletItem.getProperty().getVersion().equals(node.getComponent().getVersion())) {
boolean haveOpened = !((Node) node).getNodeContainer().isCollapsed();
if (haveOpened) {
return true;
}
}
}
}
}
continue;
}
}
List<? extends INode> nodeList = pro.getGraphicalNodes();
for (INode node : nodeList) {
if (((Node) node).isJoblet() && jobletItem.getProperty() != null) {
if (jobletItem.getProperty().getId().equals(node.getComponent().getProcess().getId()) && jobletItem.getProperty().getVersion().equals(node.getComponent().getVersion())) {
boolean haveOpened = !((Node) node).getNodeContainer().isCollapsed();
if (haveOpened) {
return true;
}
}
}
}
}
}
return false;
}
use of org.talend.designer.core.ui.AbstractMultiPageTalendEditor in project tdi-studio-se by Talend.
the class TalendTabbedPropertySheetPage method selectionChanged.
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
ISelection newSelection;
if (part instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor mpte = (AbstractMultiPageTalendEditor) part;
newSelection = mpte.getTalendEditor().getViewer().getSelection();
if (selection instanceof StructuredSelection) {
StructuredSelection structSel = (StructuredSelection) newSelection;
if (structSel.size() != 1) {
return;
}
if (structSel.getFirstElement() instanceof EditPart) {
if (structSel.equals(oldSelection)) {
// if (getCurrentTab() != null) {
// getCurrentTab().setInput(part, selection);
// }
} else {
super.selectionChanged(part, selection);
}
oldSelection = structSel;
}
}
} else if (part instanceof ContentOutline) {
ContentOutline outline = (ContentOutline) part;
newSelection = outline.getSelection();
if (selection instanceof StructuredSelection) {
StructuredSelection structSel = (StructuredSelection) newSelection;
if (structSel.size() != 1) {
return;
}
if (structSel.getFirstElement() instanceof NodeTreeEditPart) {
if (structSel.equals(oldSelection)) {
// this.getCurrentTab().setInput(part, selection);
} else {
super.selectionChanged(part, selection);
}
oldSelection = structSel;
}
}
}
}
Aggregations