本文整理汇总了Java中org.eclipse.gmf.runtime.notation.View.isSetElement方法的典型用法代码示例。如果您正苦于以下问题:Java View.isSetElement方法的具体用法?Java View.isSetElement怎么用?Java View.isSetElement使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gmf.runtime.notation.View
的用法示例。
在下文中一共展示了View.isSetElement方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getStatemachine_1000SemanticChildren
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* @generated
*/
public static List<StatemachineNodeDescriptor> getStatemachine_1000SemanticChildren(
View view) {
if (!view.isSetElement()) {
return Collections.emptyList();
}
Statemachine modelElement = (Statemachine) view.getElement();
LinkedList<StatemachineNodeDescriptor> result = new LinkedList<StatemachineNodeDescriptor>();
for (Iterator<?> it = modelElement.getStates().iterator(); it.hasNext();) {
State childElement = (State) it.next();
int visualID = StatemachineVisualIDRegistry.getNodeVisualID(view,
childElement);
if (visualID == StateEditPart.VISUAL_ID) {
result.add(new StatemachineNodeDescriptor(childElement,
visualID));
continue;
}
}
return result;
}
示例2: validate
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* @generated
*/
private static void validate(DiagramEditPart diagramEditPart, View view) {
IFile target = view.eResource() != null ? WorkspaceSynchronizer
.getFile(view.eResource()) : null;
if (target != null) {
StatemachineMarkerNavigationProvider.deleteMarkers(target);
}
Diagnostic diagnostic = runEMFValidator(view);
createMarkers(target, diagnostic, diagramEditPart);
IBatchValidator validator = (IBatchValidator) ModelValidationService
.getInstance().newValidator(EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);
if (view.isSetElement() && view.getElement() != null) {
IStatus status = validator.validate(view.getElement());
createMarkers(target, status, diagramEditPart);
}
}
示例3: buildElement2ViewMap
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* @generated
*/
private static boolean buildElement2ViewMap(View parentView,
Map<EObject, View> element2ViewMap,
Set<? extends EObject> elements) {
if (elements.size() == element2ViewMap.size()) {
return true;
}
if (parentView.isSetElement()
&& !element2ViewMap.containsKey(parentView.getElement())
&& elements.contains(parentView.getElement())) {
element2ViewMap.put(parentView.getElement(), parentView);
if (elements.size() == element2ViewMap.size()) {
return true;
}
}
boolean complete = false;
for (Iterator<?> it = parentView.getChildren().iterator(); it
.hasNext() && !complete;) {
complete = buildElement2ViewMap((View) it.next(),
element2ViewMap, elements);
}
for (Iterator<?> it = parentView.getSourceEdges().iterator(); it
.hasNext() && !complete;) {
complete = buildElement2ViewMap((View) it.next(),
element2ViewMap, elements);
}
for (Iterator<?> it = parentView.getTargetEdges().iterator(); it
.hasNext() && !complete;) {
complete = buildElement2ViewMap((View) it.next(),
element2ViewMap, elements);
}
return complete;
}
示例4: runEMFValidator
import org.eclipse.gmf.runtime.notation.View; //导入方法依赖的package包/类
/**
* @generated
*/
private static Diagnostic runEMFValidator(View target) {
if (target.isSetElement() && target.getElement() != null) {
return new Diagnostician() {
public String getObjectLabel(EObject eObject) {
return EMFCoreUtil.getQualifiedName(eObject, true);
}
}.validate(target.getElement());
}
return Diagnostic.OK_INSTANCE;
}