本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}