當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。