Search in sources :

Example 1 with DefaultEditDomain

use of org.eclipse.gef.DefaultEditDomain in project tdi-studio-se by Talend.

the class TalendPaletteContextMenuProvider method isComponentsTypePalette.

// public TalendPaletteContextMenuProvider() {
//
// }
protected boolean isComponentsTypePalette(ComponentCategory componentCategory) {
    if (componentCategory == null) {
        return false;
    }
    EditDomain editDomain = getPaletteViewer().getEditDomain();
    if (editDomain == null || !(editDomain instanceof DefaultEditDomain)) {
        return false;
    }
    IEditorPart editorPart = ((DefaultEditDomain) editDomain).getEditorPart();
    if (editorPart == null || !(editorPart instanceof AbstractTalendEditor)) {
        return false;
    }
    IProcess2 process = ((AbstractTalendEditor) editorPart).getProcess();
    if (process == null) {
        return false;
    }
    return componentCategory.getName().equals(process.getComponentsType());
}
Also used : EditDomain(org.eclipse.gef.EditDomain) DefaultEditDomain(org.eclipse.gef.DefaultEditDomain) AbstractTalendEditor(org.talend.designer.core.ui.editor.AbstractTalendEditor) IProcess2(org.talend.core.model.process.IProcess2) IEditorPart(org.eclipse.ui.IEditorPart) DefaultEditDomain(org.eclipse.gef.DefaultEditDomain)

Aggregations

DefaultEditDomain (org.eclipse.gef.DefaultEditDomain)1 EditDomain (org.eclipse.gef.EditDomain)1 IEditorPart (org.eclipse.ui.IEditorPart)1 IProcess2 (org.talend.core.model.process.IProcess2)1 AbstractTalendEditor (org.talend.designer.core.ui.editor.AbstractTalendEditor)1