Search in sources :

Example 6 with BusinessDiagramEditor

use of org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor in project tdi-studio-se by Talend.

the class DiagramModelService method refreshBusinessModel.

public void refreshBusinessModel(IEditorReference editors) {
    IEditorPart editor = editors.getEditor(true);
    if (editor instanceof BusinessDiagramEditor) {
        BusinessDiagramEditor businessDiagramEditor = (BusinessDiagramEditor) editor;
        businessDiagramEditor.refresh();
    }
}
Also used : BusinessDiagramEditor(org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor) IEditorPart(org.eclipse.ui.IEditorPart)

Example 7 with BusinessDiagramEditor

use of org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor in project tdi-studio-se by Talend.

the class DiagramModelService method handleNewEditorAction.

public void handleNewEditorAction(IWorkbenchPart editor) {
    if (editor instanceof BusinessDiagramEditor) {
        BusinessDiagramEditor diagrmEditor = (BusinessDiagramEditor) editor;
        if (diagrmEditor.isAlreadyOpened()) {
            IEditorReference[] ref = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findEditors(diagrmEditor.getEditorInput(), diagrmEditor.getEditorID(), IWorkbenchPage.MATCH_INPUT);
            IEditorPart editorPart = ref[0].getEditor(false);
            editorPart.doSave(new NullProgressMonitor());
            ((BusinessDiagramEditor) editorPart).setKeepPropertyLocked(true);
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeEditor(editorPart, false);
        }
    }
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IEditorReference(org.eclipse.ui.IEditorReference) BusinessDiagramEditor(org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor) IEditorPart(org.eclipse.ui.IEditorPart)

Aggregations

IEditorPart (org.eclipse.ui.IEditorPart)7 BusinessDiagramEditor (org.talend.designer.business.model.business.diagram.part.BusinessDiagramEditor)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)4 IFile (org.eclipse.core.resources.IFile)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 BusinessProcessItem (org.talend.core.model.properties.BusinessProcessItem)3 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)3 RepositoryNode (org.talend.repository.model.RepositoryNode)3 ISelection (org.eclipse.jface.viewers.ISelection)2 IEditorReference (org.eclipse.ui.IEditorReference)2 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)2 Property (org.talend.core.model.properties.Property)2 BaseBusinessItemRelationShipEditPart (org.talend.designer.business.diagram.custom.edit.parts.BaseBusinessItemRelationShipEditPart)2 BusinessItemShapeEditPart (org.talend.designer.business.diagram.custom.edit.parts.BusinessItemShapeEditPart)2 BusinessItem (org.talend.designer.business.model.business.BusinessItem)2 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 List (java.util.List)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 IFigure (org.eclipse.draw2d.IFigure)1