• R/O
  • HTTP
  • SSH
  • HTTPS

tmdmaker: Commit

TMD-Maker(T字形ER図作成ツール)のEclipse Plugin,RCP,Webサイト用


Commit MetaInfo

Revisiona556362c1e9693f7bc18211c77d54c2ac39f3a4a (tree)
Time2018-09-08 22:51:35
Authornakag <nakag@user...>
Commiternakag

Log Message

Refactoring virtual entity build.

Change Summary

Incremental Difference

--- a/bundles/tmdmaker.core/META-INF/MANIFEST.MF
+++ b/bundles/tmdmaker.core/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Export-Package: jp.sourceforge.tmdmaker.core,
1515 jp.sourceforge.tmdmaker.model.relationship,
1616 jp.sourceforge.tmdmaker.model.rule,
1717 jp.sourceforge.tmdmaker.model.subset,
18+ jp.sourceforge.tmdmaker.model.virtual,
1819 org.apache.commons.logging,
1920 org.apache.commons.logging.impl,
2021 org.slf4j,
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/AbstractEntityModel.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/AbstractEntityModel.java
@@ -28,6 +28,7 @@ import jp.sourceforge.tmdmaker.model.constraint.Constraint;
2828 import jp.sourceforge.tmdmaker.model.multivalue.MultivalueAnd;
2929 import jp.sourceforge.tmdmaker.model.multivalue.MultivalueOr;
3030 import jp.sourceforge.tmdmaker.model.subset.Subsets;
31+import jp.sourceforge.tmdmaker.model.virtual.VirtualEntities;
3132
3233 /**
3334 * エンティティ系モデルの基底クラス
@@ -141,7 +142,7 @@ public abstract class AbstractEntityModel extends ConnectableElement {
141142 *
142143 * @return 作成したReused個体指定子
143144 */
144- public abstract ReusedIdentifier createReusedIdentifier();
145+ protected abstract ReusedIdentifier createReusedIdentifier();
145146
146147 /**
147148 * @return the attributes
@@ -620,4 +621,15 @@ public abstract class AbstractEntityModel extends ConnectableElement {
620621 public MultivalueOr multivalueOr() {
621622 return new MultivalueOr(this);
622623 }
624+
625+ /**
626+ * みなしエンティティの集約を返す.
627+ *
628+ * みなしエンティティ生成等の起点となるオブジェクト.
629+ *
630+ * @return
631+ */
632+ public VirtualEntities virtualEntities() {
633+ return new VirtualEntities(this);
634+ }
623635 }
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Entity2VirtualEntityRelationship.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/Entity2VirtualEntityRelationship.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2017 TMD-Maker Project <http://tmdmaker.sourceforge.jp/>
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -18,8 +18,6 @@ package jp.sourceforge.tmdmaker.model;
1818 import org.slf4j.Logger;
1919 import org.slf4j.LoggerFactory;
2020
21-import jp.sourceforge.tmdmaker.model.rule.VirtualEntityRule;
22-
2321 /**
2422 * エンティティ系モデルとみなしエンティティとのリレーションシップ
2523 *
@@ -43,32 +41,37 @@ public class Entity2VirtualEntityRelationship extends TransfarReuseKeysToTargetR
4341 public Entity2VirtualEntityRelationship(AbstractEntityModel source, String virtualEntityName,
4442 VirtualEntityType type) {
4543 setSource(source);
46- ve = VirtualEntityRule.createVirtualEntity(source, virtualEntityName);
44+ ve = VirtualEntity.build(source, virtualEntityName, type);
4745 ve.setVirtualEntityType(type);
4846 setTarget(ve);
49-
5047 }
5148
5249 /**
5350 * {@inheritDoc}
5451 *
55- * @see jp.sourceforge.tmdmaker.model.TransfarReuseKeysToTargetRelationship#attachTarget()
52+ * @see jp.sourceforge.tmdmaker.model.AbstractConnectionModel#connect()
5653 */
5754 @Override
58- public void attachTarget() {
59- getSource().getDiagram().addChild(ve);
60- super.attachTarget();
55+ public void connect() {
56+ Diagram diagram = getSource().getDiagram();
57+ if (diagram != null) {
58+ diagram.addChild(getTarget());
59+ }
60+ super.connect();
6161 }
6262
6363 /**
6464 * {@inheritDoc}
6565 *
66- * @see jp.sourceforge.tmdmaker.model.TransfarReuseKeysToTargetRelationship#detachTarget()
66+ * @see jp.sourceforge.tmdmaker.model.AbstractConnectionModel#disconnect()
6767 */
6868 @Override
69- public void detachTarget() {
70- super.detachTarget();
71- ve.getDiagram().removeChild(ve);
69+ public void disconnect() {
70+ super.disconnect();
71+ Diagram diagram = getSource().getDiagram();
72+ if (diagram != null) {
73+ diagram.removeChild(getTarget());
74+ }
7275 }
7376
7477 /**
@@ -95,4 +98,8 @@ public class Entity2VirtualEntityRelationship extends TransfarReuseKeysToTargetR
9598 logger.debug(r.getName());
9699 }
97100 }
101+
102+ public VirtualEntity getVirtualEntity() {
103+ return (VirtualEntity) getTarget();
104+ }
98105 }
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MultivalueOrEntity.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/MultivalueOrEntity.java
@@ -43,9 +43,12 @@ public class MultivalueOrEntity extends AbstractEntityModel {
4343 * 種別名
4444 * @return 多値のORのモデル
4545 */
46- public static MultivalueOrEntity build(AbstractEntityModel source,
46+ protected static MultivalueOrEntity build(AbstractEntityModel source,
4747 String typeName) {
4848 MultivalueOrEntity target = new MultivalueOrEntity();
49+ if (typeName == null || typeName.isEmpty()) {
50+ typeName = "MO";
51+ }
4952 target.setName(source.getName() + "." + typeName);
5053 target.setEntityType(source.getEntityType());
5154 target.addAttribute(createTypeCode(typeName));
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/VirtualEntity.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/VirtualEntity.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2016 TMD-Maker Project <http://tmdmaker.osdn.jp/>
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
1515 */
1616 package jp.sourceforge.tmdmaker.model;
1717
18+import jp.sourceforge.tmdmaker.model.rule.ImplementRule;
19+
1820 /**
1921 * みなしエンティティ
2022 *
@@ -30,6 +32,30 @@ public class VirtualEntity extends AbstractEntityModel {
3032 private VirtualEntityType virtualEntityType = VirtualEntityType.NORMAL;
3133
3234 /**
35+ * コンストラクタは非公開.
36+ */
37+ protected VirtualEntity() {
38+ }
39+
40+ /**
41+ * みなしエンティティを作成する
42+ *
43+ * @param source
44+ * 派生元モデル
45+ * @param virtualEntityName
46+ * みなしエンティティ名
47+ * @return みなしエンティティ
48+ */
49+ protected static VirtualEntity build(AbstractEntityModel source, String virtualEntityName, VirtualEntityType type) {
50+ VirtualEntity ve = new VirtualEntity();
51+ ve.setName(virtualEntityName);
52+ ve.setOriginalReusedIdentifier(source.createReusedIdentifier());
53+ ve.setVirtualEntityType(type);
54+ ImplementRule.setModelDefaultValue(ve);
55+ return ve;
56+ }
57+
58+ /**
3359 * @return the originalReusedIdentifier
3460 */
3561 public ReusedIdentifier getOriginalReusedIdentifier() {
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/multivalue/MultivalueOrBuilder.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/multivalue/MultivalueOrBuilder.java
@@ -30,7 +30,7 @@ public class MultivalueOrBuilder {
3030 private String typeName;
3131 private MultivalueOrRelationship relationship;
3232
33- public MultivalueOrBuilder(AbstractEntityModel source) {
33+ protected MultivalueOrBuilder(AbstractEntityModel source) {
3434 this.source = source;
3535 }
3636
--- a/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/rule/VirtualEntityRule.java
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/rule/VirtualEntityRule.java
@@ -15,8 +15,6 @@
1515 */
1616 package jp.sourceforge.tmdmaker.model.rule;
1717
18-import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
19-import jp.sourceforge.tmdmaker.model.VirtualEntity;
2018 import jp.sourceforge.tmdmaker.model.VirtualSuperset;
2119
2220 /**
@@ -27,24 +25,6 @@ import jp.sourceforge.tmdmaker.model.VirtualSuperset;
2725 */
2826 public class VirtualEntityRule {
2927 /**
30- * みなしエンティティを作成する
31- *
32- * @param model
33- * 派生元モデル
34- * @param name
35- * みなしエンティティ名
36- * @return みなしエンティティ
37- */
38- public static VirtualEntity createVirtualEntity(AbstractEntityModel model, String name) {
39- VirtualEntity ve = new VirtualEntity();
40- ve.setName(name);
41- ve.setOriginalReusedIdentifier(model.createReusedIdentifier());
42- ImplementRule.setModelDefaultValue(ve);
43-
44- return ve;
45- }
46-
47- /**
4828 * みなしスーパーセットを作成する。
4929 *
5030 * @param name
--- /dev/null
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/virtual/VirtualEntities.java
@@ -0,0 +1,42 @@
1+/*
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package jp.sourceforge.tmdmaker.model.virtual;
17+
18+import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
19+
20+/**
21+ * みなしエンティティの集約クラス.
22+ *
23+ * みなしエンティティ操作の起点になる.
24+ *
25+ * @author nakag
26+ *
27+ */
28+public class VirtualEntities {
29+ private AbstractEntityModel source;
30+
31+ public VirtualEntities(AbstractEntityModel source) {
32+ this.source = source;
33+ }
34+
35+ public VirtualEntityBuilder builder() {
36+ return new VirtualEntityBuilder(this.source);
37+ }
38+
39+ public VirtualEntityQuery query() {
40+ return new VirtualEntityQuery(this.source);
41+ }
42+}
--- /dev/null
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/virtual/VirtualEntityBuilder.java
@@ -0,0 +1,65 @@
1+/*
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package jp.sourceforge.tmdmaker.model.virtual;
17+
18+import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
19+import jp.sourceforge.tmdmaker.model.Entity2VirtualEntityRelationship;
20+import jp.sourceforge.tmdmaker.model.VirtualEntity;
21+import jp.sourceforge.tmdmaker.model.VirtualEntityType;
22+import jp.sourceforge.tmdmaker.model.parts.ModelName;
23+
24+/**
25+ * みなしエンティティを生成するクラス.
26+ *
27+ * @author nakag
28+ *
29+ */
30+public class VirtualEntityBuilder {
31+ private AbstractEntityModel source;
32+ private ModelName virtualEntityName = new ModelName("VE");
33+ private VirtualEntityType type = VirtualEntityType.NORMAL;
34+ private Entity2VirtualEntityRelationship relationship;
35+
36+ protected VirtualEntityBuilder(AbstractEntityModel source) {
37+ this.source = source;
38+ }
39+
40+ public VirtualEntityBuilder virtualEntityName(ModelName virtualEntityName) {
41+ this.virtualEntityName = virtualEntityName;
42+ return this;
43+ }
44+
45+ public VirtualEntityBuilder virtualEntityType(VirtualEntityType type) {
46+ this.type = type;
47+ return this;
48+ }
49+
50+ public void build() {
51+ if (this.relationship == null) {
52+ this.relationship = new Entity2VirtualEntityRelationship(this.source,
53+ this.virtualEntityName.getValue(), this.type);
54+ }
55+ this.relationship.connect();
56+ }
57+
58+ public void rollback() {
59+ this.relationship.disconnect();
60+ }
61+
62+ public VirtualEntity getVirtualEntity() {
63+ return this.relationship.getVirtualEntity();
64+ }
65+}
--- /dev/null
+++ b/bundles/tmdmaker.core/src/jp/sourceforge/tmdmaker/model/virtual/VirtualEntityQuery.java
@@ -0,0 +1,53 @@
1+/*
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package jp.sourceforge.tmdmaker.model.virtual;
17+
18+import java.util.ArrayList;
19+import java.util.List;
20+
21+import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
22+import jp.sourceforge.tmdmaker.model.Entity2VirtualEntityRelationship;
23+import jp.sourceforge.tmdmaker.model.ModelQuery;
24+import jp.sourceforge.tmdmaker.model.VirtualEntity;
25+import jp.sourceforge.tmdmaker.model.parts.ModelName;
26+
27+/**
28+ * みなしエンティティを検索するクラス.
29+ *
30+ * @author nakag
31+ *
32+ */
33+public class VirtualEntityQuery implements ModelQuery<VirtualEntity> {
34+ private AbstractEntityModel source;
35+
36+ protected VirtualEntityQuery(AbstractEntityModel source) {
37+ this.source = source;
38+ }
39+
40+ @Override
41+ public List<VirtualEntity> findByName(ModelName name) {
42+ List<VirtualEntity> results = new ArrayList<VirtualEntity>();
43+ for (Entity2VirtualEntityRelationship r : this.source
44+ .findRelationshipFromSourceConnections(Entity2VirtualEntityRelationship.class)) {
45+ VirtualEntity ve = r.getVirtualEntity();
46+ if (ve.getName().equals(name.getValue())) {
47+ results.add(ve);
48+ }
49+ }
50+ return results;
51+ }
52+
53+}
--- a/bundles/tmdmaker/src/jp/sourceforge/tmdmaker/ui/actions/VirtualEntityCreateAction.java
+++ b/bundles/tmdmaker/src/jp/sourceforge/tmdmaker/ui/actions/VirtualEntityCreateAction.java
@@ -1,5 +1,5 @@
11 /*
2- * Copyright 2009-2017 TMD-Maker Project <http://tmdmaker.osdn.jp/>
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -15,15 +15,13 @@
1515 */
1616 package jp.sourceforge.tmdmaker.ui.actions;
1717
18-import org.eclipse.gef.commands.CompoundCommand;
1918 import org.eclipse.jface.dialogs.Dialog;
2019 import org.eclipse.ui.IWorkbenchPart;
2120
2221 import jp.sourceforge.tmdmaker.Messages;
23-import jp.sourceforge.tmdmaker.model.Entity2VirtualEntityRelationship;
22+import jp.sourceforge.tmdmaker.model.parts.ModelName;
2423 import jp.sourceforge.tmdmaker.ui.dialogs.VirtualEntityCreateDialog;
25-import jp.sourceforge.tmdmaker.ui.editor.gef3.commands.ConstraintAdjusterCommand;
26-import jp.sourceforge.tmdmaker.ui.editor.gef3.commands.RelationshipConnectionCommand;
24+import jp.sourceforge.tmdmaker.ui.editor.gef3.commands.VirtualEntityCreateCommand;
2725 import jp.sourceforge.tmdmaker.ui.editor.gef3.editparts.node.AbstractModelEditPart;
2826
2927 /**
@@ -58,13 +56,9 @@ public class VirtualEntityCreateAction extends AbstractEntitySelectionAction {
5856 VirtualEntityCreateDialog dialog = new VirtualEntityCreateDialog(
5957 getPart().getViewer().getControl().getShell());
6058 if (dialog.open() == Dialog.OK) {
61- CompoundCommand ccommand = new CompoundCommand();
62- Entity2VirtualEntityRelationship relationship = new Entity2VirtualEntityRelationship(
63- getModel(), dialog.getInputVirtualEntityName(),
64- dialog.getInputVirtualEntityType());
65- ccommand.add(new RelationshipConnectionCommand(relationship));
66- ccommand.add(new ConstraintAdjusterCommand(relationship, 100, 0));
67- execute(ccommand);
59+ execute(new VirtualEntityCreateCommand(getModel(),
60+ new ModelName(dialog.getInputVirtualEntityName()),
61+ dialog.getInputVirtualEntityType()));
6862 }
6963 }
7064
--- a/bundles/tmdmaker/src/jp/sourceforge/tmdmaker/ui/editor/gef3/commands/ConstraintAdjusterCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
1-/*
2- * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
3- *
4- * Licensed under the Apache License, Version 2.0 (the "License");
5- * you may not use this file except in compliance with the License.
6- * You may obtain a copy of the License at
7- *
8- * http://www.apache.org/licenses/LICENSE-2.0
9- *
10- * Unless required by applicable law or agreed to in writing, software
11- * distributed under the License is distributed on an "AS IS" BASIS,
12- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13- * See the License for the specific language governing permissions and
14- * limitations under the License.
15- */
16-package jp.sourceforge.tmdmaker.ui.editor.gef3.commands;
17-
18-import org.eclipse.draw2d.geometry.Rectangle;
19-import org.eclipse.gef.commands.Command;
20-
21-import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
22-import jp.sourceforge.tmdmaker.model.AbstractRelationship;
23-import jp.sourceforge.tmdmaker.model.ConnectableElement;
24-import jp.sourceforge.tmdmaker.ui.editor.draw2d.ConstraintConverter;
25-
26-/**
27- * モデル生成時に位置を調整するCommand
28- *
29- * @author nakag
30- *
31- */
32-public class ConstraintAdjusterCommand extends Command {
33- private AbstractEntityModel source;
34- private ConnectableElement target;
35- private Rectangle oldConstraint;
36- private int x;
37- private int y;
38-
39- public ConstraintAdjusterCommand(AbstractRelationship connection, int x, int y) {
40- this.source = connection.getSource();
41- this.target = connection.getTarget();
42- this.x = x;
43- this.y = y;
44- }
45-
46- /**
47- *
48- * {@inheritDoc}
49- *
50- * @see org.eclipse.gef.commands.Command#execute()
51- */
52- @Override
53- public void execute() {
54- oldConstraint = ConstraintConverter.getRectangle(target);
55- ConstraintConverter.setTranslatedConstraint(target, source, x, y);
56- }
57-
58- /**
59- *
60- * {@inheritDoc}
61- *
62- * @see org.eclipse.gef.commands.Command#undo()
63- */
64- @Override
65- public void undo() {
66- ConstraintConverter.setConstraint(target, oldConstraint);
67- }
68-
69-}
--- /dev/null
+++ b/bundles/tmdmaker/src/jp/sourceforge/tmdmaker/ui/editor/gef3/commands/VirtualEntityCreateCommand.java
@@ -0,0 +1,59 @@
1+/*
2+ * Copyright 2009-2018 TMD-Maker Project <https://tmdmaker.osdn.jp/>
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+package jp.sourceforge.tmdmaker.ui.editor.gef3.commands;
17+
18+import org.eclipse.gef.commands.Command;
19+
20+import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
21+import jp.sourceforge.tmdmaker.model.VirtualEntityType;
22+import jp.sourceforge.tmdmaker.model.parts.ModelName;
23+import jp.sourceforge.tmdmaker.model.virtual.VirtualEntityBuilder;
24+import jp.sourceforge.tmdmaker.ui.editor.draw2d.adjuster.ModelConstraintAdjuster;
25+
26+/**
27+ * みなしエンティティを作成するCommand.
28+ *
29+ * @author nakag
30+ *
31+ */
32+public class VirtualEntityCreateCommand extends Command {
33+ private AbstractEntityModel model;
34+ private VirtualEntityBuilder builder;
35+
36+ public VirtualEntityCreateCommand(AbstractEntityModel model, ModelName virtualEntityName,
37+ VirtualEntityType type) {
38+ this.model = model;
39+ this.builder = this.model.virtualEntities().builder().virtualEntityName(virtualEntityName)
40+ .virtualEntityType(type);
41+ }
42+
43+ @Override
44+ public void execute() {
45+ this.builder.build();
46+ new ModelConstraintAdjuster(this.builder.getVirtualEntity(), this.model, 150, 0).adjust();
47+ }
48+
49+ @Override
50+ public void undo() {
51+ this.builder.rollback();
52+ }
53+
54+ @Override
55+ public void redo() {
56+ this.builder.build();
57+ }
58+
59+}
--- a/tests/tmdmaker.test/src/jp/sourceforge/tmdmaker/editpart/TMDEditPartFactoryTest.java
+++ b/tests/tmdmaker.test/src/jp/sourceforge/tmdmaker/editpart/TMDEditPartFactoryTest.java
@@ -42,7 +42,6 @@ import jp.sourceforge.tmdmaker.model.ModelElement;
4242 import jp.sourceforge.tmdmaker.model.RecursiveRelationship;
4343 import jp.sourceforge.tmdmaker.model.RecursiveTable;
4444 import jp.sourceforge.tmdmaker.model.RelatedRelationship;
45-import jp.sourceforge.tmdmaker.model.VirtualEntity;
4645 import jp.sourceforge.tmdmaker.model.VirtualSuperset;
4746 import jp.sourceforge.tmdmaker.model.VirtualSupersetType;
4847 import jp.sourceforge.tmdmaker.model.parts.ModelName;
@@ -165,8 +164,9 @@ public class TMDEditPartFactoryTest {
165164 editPart = factory.createEditPart(null, o);
166165 assertThat(editPart, instanceOf(MultivalueAndSupersetEditPart.class));
167166
168- ev1.multivalueOr().builder().typeName("テスト種別").build();
169- o = ev1.multivalueOr().query().findByName(new ModelName("テスト種別")).get(0);
167+ Entity ev2 = Entity.ofEvent(new Identifier("イベント番号"));
168+ ev2.multivalueOr().builder().typeName("テスト種別").build();
169+ o = ev2.multivalueOr().query().findByName(new ModelName("イベント.テスト種別")).get(0);
170170 editPart = factory.createEditPart(null, o);
171171 assertThat(editPart, instanceOf(MultivalueOrEditPart.class));
172172
@@ -181,7 +181,9 @@ public class TMDEditPartFactoryTest {
181181 editPart = factory.createEditPart(null, o);
182182 assertThat(editPart, instanceOf(SubsetEntityEditPart.class));
183183
184- o = new VirtualEntity();
184+ ModelName searchName = new ModelName("みなし");
185+ e.virtualEntities().builder().virtualEntityName(searchName).build();
186+ o = e.virtualEntities().query().findByName(searchName).get(0);
185187 editPart = factory.createEditPart(null, o);
186188 assertThat(editPart, instanceOf(VirtualEntityEditPart.class));
187189
Show on old repository browser