Skip to content

Commit

Permalink
#20052 の修正漏れ
Browse files Browse the repository at this point in the history
  • Loading branch information
nakag committed Oct 14, 2015
1 parent a30bbba commit 0b82998
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.junit.Test;

import jp.sourceforge.tmdmaker.model.other.Memo;
import jp.sourceforge.tmdmaker.model.other.TurboFile;

/**
* モデル毎の特徴の差異のテスト
Expand Down Expand Up @@ -69,6 +70,8 @@ public void testCanCreateSubset() {
Memo mm = new Memo();
assertEquals(false, mm.canCreateSubset());

TurboFile tb = new TurboFile();
assertEquals(false, tb.canCreateSubset());
}

/**
Expand Down Expand Up @@ -112,6 +115,8 @@ public void testCanCreateMultivalueOr() {
Memo mm = new Memo();
assertEquals(false, mm.canCreateMultivalueOr());

TurboFile tb = new TurboFile();
assertEquals(false, tb.canCreateMultivalueOr());
}

/**
Expand Down Expand Up @@ -154,7 +159,9 @@ public void testCanCreateVirtualEntity() {

Memo mm = new Memo();
assertEquals(false, mm.canCreateVirtualEntity());


TurboFile tb = new TurboFile();
assertEquals(false, tb.canCreateVirtualEntity());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,34 @@ public void accept(IVisitor visitor) {
public EntityType getEntityType() {
return EntityType.TURBO;
}

/**
* {@inheritDoc}
*
* @see jp.sourceforge.tmdmaker.model.ModelElement#canCreateVirtualEntity()
*/
@Override
public boolean canCreateVirtualEntity() {
return false;
}

/**
* {@inheritDoc}
*
* @see jp.sourceforge.tmdmaker.model.ModelElement#canCreateMultivalueOr()
*/
@Override
public boolean canCreateMultivalueOr() {
return false;
}

/**
* {@inheritDoc}
*
* @see jp.sourceforge.tmdmaker.model.ModelElement#canCreateSubset()
*/
@Override
public boolean canCreateSubset() {
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@
import java.util.List;
import java.util.Map;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.views.properties.IPropertySource;
import org.slf4j.LoggerFactory;

import jp.sourceforge.tmdmaker.TMDEditor;
import jp.sourceforge.tmdmaker.TMDPlugin;
import jp.sourceforge.tmdmaker.model.AbstractEntityModel;
Expand All @@ -41,15 +47,10 @@
import jp.sourceforge.tmdmaker.model.SubsetEntity;
import jp.sourceforge.tmdmaker.model.VirtualEntity;
import jp.sourceforge.tmdmaker.model.VirtualSuperset;
import jp.sourceforge.tmdmaker.model.other.TurboFile;
import jp.sourceforge.tmdmaker.property.AbstractEntityModelPropertySource;
import jp.sourceforge.tmdmaker.property.IPropertyAvailable;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.editparts.AbstractTreeEditPart;
import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.views.properties.IPropertySource;
import org.slf4j.LoggerFactory;

/**
* Entity系モデルのtreeeditpartクラス
*
Expand All @@ -74,6 +75,7 @@ public class AbstractEntityModelTreeEditPart<T extends AbstractEntityModel>
icons.put(MappingList.class, "icons/outline/mapping_list.png");
icons.put(Laputa.class, "icons/outline/laputa.png");
icons.put(VirtualSuperset.class, "icons/outline/virtual_entity.png");
icons.put(TurboFile.class, "icons/outline/virtual_entity.png");
}

public AbstractEntityModelTreeEditPart(T model) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ public void visit(Memo type) {
*/
@Override
public void visit(TurboFile entity) {
part = new AbstractEntityModelTreeEditPart<AbstractEntityModel>(entity);
part = new AbstractEntityModelTreeEditPart<TurboFile>(entity);
}

/**
Expand Down

0 comments on commit 0b82998

Please sign in to comment.