use of org.eclipse.ui.IEditorReference 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.IEditorReference 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.IEditorReference in project tdi-studio-se by Talend.
the class AbstractJobSettingsPage method getEditors.
protected IEditorReference[] getEditors() {
final List<IEditorReference> list = new ArrayList<IEditorReference>();
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
IEditorReference[] reference = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getEditorReferences();
list.addAll(Arrays.asList(reference));
}
});
return list.toArray(new IEditorReference[0]);
}
use of org.eclipse.ui.IEditorReference in project tdi-studio-se by Talend.
the class DesignerColorsPreferencePage method switchToCurrentColor.
/**
* zli Comment method "switchToCurrentColor".
*/
private void switchToCurrentColor() {
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (activeWorkbenchWindow != null) {
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if (activePage != null) {
for (IEditorReference ref : activePage.getEditorReferences()) {
IEditorPart editor = ref.getEditor(true);
if (editor instanceof AbstractMultiPageTalendEditor) {
AbstractMultiPageTalendEditor pageEditor = (AbstractMultiPageTalendEditor) editor;
AbstractTalendEditor talendEditor = pageEditor.getTalendEditor();
ProcessPart processPart = talendEditor.getProcessPart();
processPart.ajustReadOnly();
changeMRGroupColor(processPart);
}
}
}
}
}
use of org.eclipse.ui.IEditorReference in project tdi-studio-se by Talend.
the class DeleteAssignmentAction method doRun.
@Override
protected void doRun() {
IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (activeEditor instanceof BusinessDiagramEditor) {
BusinessDiagramEditor editor = (BusinessDiagramEditor) activeEditor;
ISelection selection2 = editor.getSelection();
EObject element = null;
Object firstElement = ((IStructuredSelection) selection2).getFirstElement();
if (firstElement instanceof BusinessItemShapeEditPart) {
BusinessItemShapeEditPart editpart = (BusinessItemShapeEditPart) firstElement;
element = ((Node) editpart.getModel()).getElement();
} else if (firstElement instanceof BaseBusinessItemRelationShipEditPart) {
BaseBusinessItemRelationShipEditPart editpart = (BaseBusinessItemRelationShipEditPart) firstElement;
element = ((EdgeImpl) editpart.getModel()).getElement();
}
if (element instanceof BusinessItem) {
BusinessItem businessItem = (BusinessItem) element;
DeleteAssignmentCommand command = new DeleteAssignmentCommand(businessItem, selection);
try {
command.execute(null, null);
} catch (ExecutionException e) {
ExceptionHandler.process(e);
}
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
for (IEditorReference editors : page.getEditorReferences()) {
CorePlugin.getDefault().getDiagramModelService().refreshBusinessModel(editors);
}
}
}
}
Aggregations