Java Code Examples for org.eclipse.gef.EditPart#getParent()

The following examples show how to use org.eclipse.gef.EditPart#getParent() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: IntermediateThrowMessageEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 2
Source File: ThrowLinkEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 3
Source File: StartMessageEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 4
Source File: StartSignalEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 5
Source File: InsertInLayoutUtil.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Validates container of drop target from scalar parameter in data view
 * 
 * @param dropPart
 * @return validate result
 */
protected static boolean handleValidateParameterDropContainer(
		EditPart dropPart )
{
	if ( dropPart.getParent( ) == null )
	{
		return false;
	}
	Object container = dropPart.getParent( ).getModel( );
	return ( container instanceof GridHandle
			|| container instanceof TableHandle
			|| container instanceof FreeFormHandle
			|| container instanceof ListHandle || dropPart.getModel( ) instanceof ModuleHandle );
}
 
Example 6
Source File: StartEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 7
Source File: BotGefBaseEditor.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public EObject getSelectedSemanticElement() {
    final List<SWTBotGefEditPart> selectedEditParts = gmfEditor.getSWTBotGefViewer().selectedEditParts();
    if (selectedEditParts.isEmpty()) {
        throw new EmptyDiagramSelectionException();
    }
    final SWTBotGefEditPart swtBotGefEditPart = selectedEditParts.get(0);
    EditPart part = swtBotGefEditPart.part();
    while (part != null && !(part instanceof IGraphicalEditPart)) {
        part = part.getParent();
    }
    if (part == null) {
        throw new SemanticElementNotFoundException();
    }
    return ((IGraphicalEditPart) part).resolveSemanticElement();
}
 
Example 8
Source File: CustomResizableEditPolicyEx.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private PoolEditPart getPoolEditPart(final EditPart host) {
    if (host instanceof PoolEditPart) {
        return (PoolEditPart) host;
    }
    EditPart current = host;
    while (current != null && !(current instanceof PoolEditPart)) {
        current = current.getParent();
    }
    return (PoolEditPart) current;
}
 
Example 9
Source File: BoundarySignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public java.lang.Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 10
Source File: EndSignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 11
Source File: IntermediateErrorCatchEvent4EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public java.lang.Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 12
Source File: TextAnnotationEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 13
Source File: LaneEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 14
Source File: SendTaskEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 15
Source File: UpdateSizeLaneSelectionEditPolicy.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
private ShapeNodeEditPart findLaneEditPart(final EditPart host) {
    EditPart result = host ;
    final EditPart tempEditPart = result;
    /*first search for a CustomLaneEditPart*/
    while(!(result instanceof CustomLaneEditPart) && result != null){
        result = result.getParent() ;
    }

    if(result == null){
        return null ;
    }

    return (ShapeNodeEditPart) result;
}
 
Example 16
Source File: IntermediateThrowSignalEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 17
Source File: SubProcessEventEditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 18
Source File: CallActivity2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 19
Source File: IntermediateCatchMessageEvent2EditPart.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
/**
 * @Generated BonitaSoft
 */
@Override
public Object getAdapter(Class key) {

	if (key == SnapToHelper.class) {
		EditPart parent = getParent();
		while (!(parent instanceof DiagramEditPart)) {
			parent = parent.getParent();
		}
		return GMFTools.getSnapHelper((GraphicalEditPart) parent);
	}

	return super.getAdapter(key);
}
 
Example 20
Source File: ERDiagramAlignmentAction.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
/**
 * Returns the list of editparts which will participate in alignment.
 * 
 * @param request
 *            the alignment request
 * @return the list of parts which will be aligned
 */
@SuppressWarnings("unchecked")
protected List getOperationSet(final Request request) {
    if (operationSet != null)
        return operationSet;
    List editparts = new ArrayList(getSelectedObjects());
    for (final Iterator iter = editparts.iterator(); iter.hasNext();) {
        if (iter.next() instanceof NormalColumnEditPart) {
            iter.remove();
        }
    }

    if (editparts.isEmpty() || !(editparts.get(0) instanceof GraphicalEditPart))
        return Collections.EMPTY_LIST;
    final Object primary = editparts.get(editparts.size() - 1);
    editparts = ToolUtilities.getSelectionWithoutDependants(editparts);
    ToolUtilities.filterEditPartsUnderstanding(editparts, request);
    if (editparts.size() < 2 || !editparts.contains(primary))
        return Collections.EMPTY_LIST;
    final EditPart parent = ((EditPart) editparts.get(0)).getParent();
    for (int i = 1; i < editparts.size(); i++) {
        final EditPart part = (EditPart) editparts.get(i);
        if (part.getParent() != parent)
            return Collections.EMPTY_LIST;
    }
    return editparts;
}