Search in sources :

Example 1 with RepositoryDropAssistant

use of org.talend.mdm.repository.core.dnd.RepositoryDropAssistant in project tmdm-studio-se by Talend.

the class PasteAction method getDropAssistant.

private RepositoryDropAssistant getDropAssistant() {
    INavigatorDnDService dndService = commonViewer.getNavigatorContentService().getDnDService();
    CommonDropAdapterAssistant[] dropAssistants = dndService.findCommonDropAdapterAssistants(getSelectedDropViewObj(), getStructuredSelection());
    for (CommonDropAdapterAssistant assistant : dropAssistants) {
        if (assistant instanceof RepositoryDropAssistant) {
            return (RepositoryDropAssistant) assistant;
        }
    }
    return null;
}
Also used : INavigatorDnDService(org.eclipse.ui.navigator.INavigatorDnDService) CommonDropAdapterAssistant(org.eclipse.ui.navigator.CommonDropAdapterAssistant) RepositoryDropAssistant(org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)

Example 2 with RepositoryDropAssistant

use of org.talend.mdm.repository.core.dnd.RepositoryDropAssistant in project tmdm-studio-se by Talend.

the class PasteAction method isVisible.

public boolean isVisible(IRepositoryViewObject viewObj) {
    RepositoryDropAssistant dropAssistant = getDropAssistant();
    if (dropAssistant != null) {
        IRepositoryViewObject dragViewObj = getSelectedDragViewObj();
        IRepositoryViewObject dropViewObj = (IRepositoryViewObject) getSelectedObject().get(0);
        return dropAssistant.validate(DND.DROP_COPY, dragViewObj, dropViewObj);
    }
    return super.isVisible(viewObj);
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) RepositoryDropAssistant(org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)

Example 3 with RepositoryDropAssistant

use of org.talend.mdm.repository.core.dnd.RepositoryDropAssistant in project tmdm-studio-se by Talend.

the class DuplicateAction method doRun.

protected void doRun() {
    RepositoryDropAssistant dropAssistant = getDropAssistant();
    if (dropAssistant != null) {
        IRepositoryViewObject viewObj = getSelectedViewObj();
        boolean result = dropAssistant.copyViewObj(viewObj, viewObj);
        if (result) {
            refreshContainer(dropAssistant, viewObj);
        }
    }
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) RepositoryDropAssistant(org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)

Example 4 with RepositoryDropAssistant

use of org.talend.mdm.repository.core.dnd.RepositoryDropAssistant in project tmdm-studio-se by Talend.

the class PasteAction method doRun.

protected void doRun() {
    RepositoryDropAssistant dropAssistant = getDropAssistant();
    if (dropAssistant != null) {
        IRepositoryViewObject dropViewObj = getSelectedDropViewObj();
        boolean result = dropAssistant.copyViewObj(getSelectedDragViewObj(), dropViewObj);
        if (result) {
            refreshContainer(dropAssistant, dropViewObj);
        }
    }
}
Also used : IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) RepositoryDropAssistant(org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)

Example 5 with RepositoryDropAssistant

use of org.talend.mdm.repository.core.dnd.RepositoryDropAssistant in project tmdm-studio-se by Talend.

the class DuplicateAction method getDropAssistant.

private RepositoryDropAssistant getDropAssistant() {
    INavigatorDnDService dndService = commonViewer.getNavigatorContentService().getDnDService();
    CommonDropAdapterAssistant[] dropAssistants = dndService.findCommonDropAdapterAssistants(getSelectedViewObj(), getStructuredSelection());
    for (CommonDropAdapterAssistant assistant : dropAssistants) {
        if (assistant instanceof RepositoryDropAssistant) {
            return (RepositoryDropAssistant) assistant;
        }
    }
    return null;
}
Also used : INavigatorDnDService(org.eclipse.ui.navigator.INavigatorDnDService) CommonDropAdapterAssistant(org.eclipse.ui.navigator.CommonDropAdapterAssistant) RepositoryDropAssistant(org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)

Aggregations

RepositoryDropAssistant (org.talend.mdm.repository.core.dnd.RepositoryDropAssistant)5 IRepositoryViewObject (org.talend.core.model.repository.IRepositoryViewObject)3 CommonDropAdapterAssistant (org.eclipse.ui.navigator.CommonDropAdapterAssistant)2 INavigatorDnDService (org.eclipse.ui.navigator.INavigatorDnDService)2