Search in sources :

Example 1 with IEditPartOperation

use of org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation in project tdi-studio-se by Talend.

the class BusinessEditPartProvider method provides.

/**
     * @generated
     */
public synchronized boolean provides(IOperation operation) {
    if (operation instanceof CreateGraphicEditPartOperation) {
        View view = ((IEditPartOperation) operation).getView();
        if (!BusinessProcessEditPart.MODEL_ID.equals(BusinessVisualIDRegistry.getModelID(view))) {
            return false;
        }
        if (isAllowCaching() && getCachedPart(view) != null) {
            return true;
        }
        IGraphicalEditPart part = createEditPart(view);
        if (part != null) {
            if (isAllowCaching()) {
                cachedPart = new WeakReference(part);
                cachedView = new WeakReference(view);
            }
            return true;
        }
    }
    return false;
}
Also used : IGraphicalEditPart(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart) WeakReference(java.lang.ref.WeakReference) IEditPartOperation(org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation) CreateGraphicEditPartOperation(org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation) View(org.eclipse.gmf.runtime.notation.View)

Aggregations

WeakReference (java.lang.ref.WeakReference)1 IGraphicalEditPart (org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart)1 CreateGraphicEditPartOperation (org.eclipse.gmf.runtime.diagram.ui.services.editpart.CreateGraphicEditPartOperation)1 IEditPartOperation (org.eclipse.gmf.runtime.diagram.ui.services.editpart.IEditPartOperation)1 View (org.eclipse.gmf.runtime.notation.View)1