/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public boolean validateProductsCount(DiagnosticChain diagnostics, Map contex) {
// TODO: implement this method
// -> specify the condition that violates the invariant
// -> verify the details of the diagnostic, including severity and message
// Ensure that you remove @generated or mark it @generated NOT
if (false) {
if (diagnostics != null) {
diagnostics.add
(new BasicDiagnostic
(Diagnostic.ERROR,
ShopValidator.DIAGNOSTIC_SOURCE,
ShopValidator.CATEGORY__VALIDATE_PRODUCTS_COUNT,
EcorePlugin.INSTANCE.getString("_UI_GenericInvariant_diagnostic", new Object[] { "validateProductsCount", EObjectValidator.getObjectLabel(this, contex) }),
new Object [] { this }));
}
return false;
}
return true;
}
2、(3-24)既然明确了StarGen的输入,一个是类图,另一个是暂时称作流程图的东西,那么使用者应该怎样提供这些输入呢?首先看一下类图方面,这里使用者至少要能够定义出应用里应该有哪些对象类型,它们的成员变量、方法等等,还有类与类之间的联系。如果说他(使用者)定义的是一个模型,那么我首先要有一个元模型,元模型好比模型的语言,在元模型里我要定义“类”、“成员变量”、“方法”等等这些概念。按照这个想法,我想到平时使用emf建模时用的“语言”不就是ecore吗,没错,ecore是一个元模型,和uml一样,都可以用来定义模型。那么我可不可以就让使用者直接用ecore建模呢,因为使用ecore建模的工具已经有不少了,最起码也有随emf一起来的“Sample Ecore Model Editor”,想图形化可以用EclipseUML或者gmf的ecore editor都行,这样我可以节约很多工作量。
向导的第二部分就由Importer决定,对于Ecore的情况对应EcoreImporterWizard,它是ModelImporterWizard的子类,包含两个向导页ModelImporterDetailPage和ModelImporterPackagePage,分别让用户选择一个.ecore文件和选择要生成或引用的包。ModelImporterWizard的子类都要实现createModelConverter()方法,返回一个ModelConverter类的实例,例如return new EcoreImporter(),EcoreImporter是ModelImporter的子类,ModelImporter则是ModelConverter的子类。
java.lang.NoSuchMethodError: org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.addElement(Ljava/lang/Object;)V
at com.omondo.uml.obf.bte.a(SourceFile:352)
at com.omondo.uml.obf.bte.a(SourceFile:63)
at com.omondo.uml.obf.yt.customButtonPressed(SourceFile:315)
at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.buttonPressed(ListDialogField.java:204)
at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.doButtonSelected(ListDialogField.java:458)
at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField.access$0(ListDialogField.java:454)
at org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField$2.widgetSelected(ListDialogField.java:420)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1074)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3158)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2838)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:811)
at org.eclipse.jface.window.Window.open(Window.java:789)
at com.omondo.uml.obf.ahk.c(SourceFile:167)
at com.omondo.uml.obf.le.d(SourceFile:572)
at com.omondo.uml.obf.fkr.execute(SourceFile:86)
at org.eclipse.gef.commands.CommandStack.execute(CommandStack.java:149)
at org.eclipse.gef.tools.AbstractTool.executeCommand(AbstractTool.java:388)
at org.eclipse.gef.tools.AbstractTool.executeCurrentCommand(AbstractTool.java:400)
at org.eclipse.gef.tools.CreationTool.performCreation(CreationTool.java:254)
at org.eclipse.gef.tools.CreationTool.handleButtonUp(CreationTool.java:178)
at org.eclipse.gef.tools.AbstractTool.mouseUp(AbstractTool.java:1053)
at org.eclipse.gef.EditDomain.mouseUp(EditDomain.java:259)
今天用EclipseUML画类图遇到一个很郁闷的问题,为了保险起见我还是边画边保存的,画了一上午,有一次关闭了编辑器,再想打开时提示“Impossible to load the diagram xxx.ecd”。我这汗一下子就下来了,一上午的工作啊!赶紧查看一下Eclipse的errorlog,异常信息如下:
java.lang.NullPointerException
at com.omondo.uml.obf.cba.setInput(SourceFile:1153)
at com.omondo.uml.obf.cba.init(SourceFile:1109)
at com.omondo.uml.emf.ClassDiagramEditor.init(SourceFile:1013)
at org.eclipse.ui.internal.EditorManager.createSite(EditorManager.java:784)
at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:585)
at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:374)
at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:552)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:285)
at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:140)
at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:264)
at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:394)
at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1140)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1093)
找不到任何与类图有关的信息,试着修改.ecd和.ecore文件,几次均没有效果。想到昨天晚上做过备份(万幸),只好恢复到那时的类图重新画。画完了保存,试着关闭编辑器再打开,竟然又提示“Impossible to load the diagram xxx.ecd”!!