Search in sources :

Example 1 with TalendEditorDropTargetListener

use of org.talend.designer.core.ui.editor.process.TalendEditorDropTargetListener in project tdi-studio-se by Talend.

the class AbstractTalendEditor method initializeGraphicalViewer.

// ------------------------------------------------------------------------
// Abstract methods from GraphicalEditor
@Override
protected void initializeGraphicalViewer() {
    super.initializeGraphicalViewer();
    // this uses the PartFactory set in configureGraphicalViewer
    // to create an EditPart for the diagram and sets it as the
    // content for the viewer
    IProcess2 process = getProcess();
    getGraphicalViewer().setContents(process);
    // containers are not correctly updated by default, so update them after all nodes have been added
    if (process != null) {
        for (ISubjobContainer subjobContainer : process.getSubjobContainers()) {
            subjobContainer.updateSubjobContainer();
        }
    }
    getGraphicalViewer().getControl().addMouseListener(new MouseAdapter() {

        /*
             * (non-Javadoc)
             * 
             * @see org.eclipse.swt.events.MouseAdapter#mouseUp(org.eclipse.swt.events.MouseEvent)
             */
        @Override
        public void mouseUp(MouseEvent e) {
            updateActions(getSelectionActions());
        }
    });
    talendEditorDropTargetListener = new TalendEditorDropTargetListener(this);
    getGraphicalViewer().addDropTargetListener(talendEditorDropTargetListener);
}
Also used : ISubjobContainer(org.talend.core.model.process.ISubjobContainer) MouseEvent(org.eclipse.swt.events.MouseEvent) TalendEditorDropTargetListener(org.talend.designer.core.ui.editor.process.TalendEditorDropTargetListener) IProcess2(org.talend.core.model.process.IProcess2) MouseAdapter(org.eclipse.swt.events.MouseAdapter)

Aggregations

MouseAdapter (org.eclipse.swt.events.MouseAdapter)1 MouseEvent (org.eclipse.swt.events.MouseEvent)1 IProcess2 (org.talend.core.model.process.IProcess2)1 ISubjobContainer (org.talend.core.model.process.ISubjobContainer)1 TalendEditorDropTargetListener (org.talend.designer.core.ui.editor.process.TalendEditorDropTargetListener)1