本文整理匯總了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;
}