本文整理汇总了Java中org.eclipse.gef.requests.DirectEditRequest.setDirectEditFeature方法的典型用法代码示例。如果您正苦于以下问题:Java DirectEditRequest.setDirectEditFeature方法的具体用法?Java DirectEditRequest.setDirectEditFeature怎么用?Java DirectEditRequest.setDirectEditFeature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.requests.DirectEditRequest
的用法示例。
在下文中一共展示了DirectEditRequest.setDirectEditFeature方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDirectEditRequest
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
/**
* Creates and returns the DirectEditRequest.
*
* @return the direct edit request
*/
protected DirectEditRequest createDirectEditRequest() {
DirectEditRequest req = new DirectEditRequest();
req.setCellEditor(getCellEditor());
req.setDirectEditFeature(getDirectEditFeature());
return req;
}
示例2: openDiagram
import org.eclipse.gef.requests.DirectEditRequest; //导入方法依赖的package包/类
protected boolean openDiagram(Resource diagram) throws PartInitException {
String path = diagram.getURI().toPlatformString(true);
IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot().findMember(new Path(path));
if (workspaceResource instanceof IFile) {
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
StatechartDiagramEditor editor = (StatechartDiagramEditor) page
.openEditor(new FileEditorInput((IFile) workspaceResource), getEditorID());
if (editor != null) {
List<EObject> allNotationElements = EcoreUtil2.eAllContentsAsList(diagram);
for (EObject eObject : allNotationElements) {
if (eObject instanceof View && ((View) eObject).getType().equals(SemanticHints.STATE_NAME)) {
IGraphicalEditPart editPart = EditPartUtils.findEditPartForSemanticElement(
editor.getDiagramGraphicalViewer().getRootEditPart(), ((View) eObject).getElement());
editPart = editPart.getChildBySemanticHint(SemanticHints.STATE_NAME);
if (editPart != null) {
final DirectEditRequest request = new DirectEditRequest();
request.setDirectEditFeature(BasePackage.Literals.NAMED_ELEMENT__NAME);
editPart.performRequest(request);
break;
}
}
}
return false;
}
}
return false;
}