当前位置: 首页>>代码示例>>Java>>正文


Java EditPart.getParent方法代码示例

本文整理汇总了Java中org.eclipse.gef.EditPart.getParent方法的典型用法代码示例。如果您正苦于以下问题:Java EditPart.getParent方法的具体用法?Java EditPart.getParent怎么用?Java EditPart.getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.gef.EditPart的用法示例。


在下文中一共展示了EditPart.getParent方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getAdapter

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
@Override
public Object getAdapter(Class adapter) {
	EditPart ep = this;
	if (adapter == IFile.class) {
		while (ep!=null && !(ep instanceof GraphPart)) {
			ep  = ep.getParent();
		}
		if (ep!=null) {
			GraphPart  gp = (GraphPart) ep;
			GWGraph model = (GWGraph)gp.getModel();
			return model.getFile();
		}
		return null;
	}
	
	return null;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:18,代码来源:AbstractGW4EEditPart.java

示例2: getOperationSet

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * 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;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:34,代码来源:ERDiagramAlignmentAction.java

示例3: getTargetEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public EditPart getTargetEditPart(final Request request) {
    final EditPart editPart = super.getTargetEditPart(request);

    if (!getDiagram().isDisableSelectColumn()) {
        return editPart;
    }

    if (editPart != null) {
        return editPart.getParent();
    }

    return null;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:18,代码来源:ColumnEditPart.java

示例4: getOperationSet

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * 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(Request request) {
	if (operationSet != null)
		return operationSet;
	List editparts = new ArrayList(getSelectedObjects());
	for (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;
	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;
	EditPart parent = ((EditPart) editparts.get(0)).getParent();
	for (int i = 1; i < editparts.size(); i++) {
		EditPart part = (EditPart) editparts.get(i);
		if (part.getParent() != parent)
			return Collections.EMPTY_LIST;
	}
	return editparts;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:35,代码来源:ERDiagramAlignmentAction.java

示例5: getTargetEditPart

import org.eclipse.gef.EditPart; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public EditPart getTargetEditPart(Request request) {
	EditPart editPart = super.getTargetEditPart(request);

	if (!this.getDiagram().isDisableSelectColumn()) {
		return editPart;
	}

	if (editPart != null) {
		return editPart.getParent();
	}

	return null;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:ColumnEditPart.java


注:本文中的org.eclipse.gef.EditPart.getParent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。