svnno****@sourc*****
svnno****@sourc*****
2009年 3月 11日 (水) 03:17:31 JST
Revision: 2872 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2872 Author: daisuke_m Date: 2009-03-11 03:17:31 +0900 (Wed, 11 Mar 2009) Log Message: ----------- [ECL-21] ダイアログの、ファサードによる編集実行実装を進めているところ。 Modified Paths: -------------- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/facade/JiemamyFacadeImpl.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/model/datatype/DomainModelImpl.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/serializer/JiemamyDomBuilder.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/RootModelUtil.java artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/JiemamyPropertyTest.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/foreignkey/ForeignKeyEditDialog.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ForeignKeyEditPart.java zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/JiemamyProperty.java zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/facade/JiemamyFacade.java zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/datatype/DomainModel.java Added Paths: ----------- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveDownListCommand.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveUpListCommand.java vesta/trunk/jiemamy-vesta/team_svn.psf vesta/trunk/jiemamy-vesta/vesta.launch -------------- next part -------------- Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/CommandProcessorImpl.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -39,6 +39,8 @@ import org.jiemamy.editcommand.impl.AddForeignKeyCommand; import org.jiemamy.editcommand.impl.AddPrimaryKeyCommand; import org.jiemamy.editcommand.impl.ModifyModelPropertyCommand; +import org.jiemamy.editcommand.impl.MoveDownListCommand; +import org.jiemamy.editcommand.impl.MoveUpListCommand; import org.jiemamy.editcommand.impl.RemoveColumnCommand; import org.jiemamy.editcommand.impl.RemoveColumnFromColumnRefListCommand; import org.jiemamy.editcommand.impl.RemoveDataSetFromRootCommand; @@ -59,6 +61,7 @@ import org.jiemamy.model.datatype.DomainModel; import org.jiemamy.model.entity.EntityModel; import org.jiemamy.model.entity.TableModel; +import org.jiemamy.utils.ListUtil; /** * コマンドを実行するクラス。 @@ -216,6 +219,30 @@ } /** + * TODO for daisuke + * + * @param command コマンド + */ + public void process(MoveDownListCommand command) { + ListUtil.moveUp(command.getList(), command.getIndex()); + + // 面倒だけど、全部のprocessメソッドに入れる(Interceptorで手を抜きたい)。 + eventBroker.fireCommandProcessed(command); + } + + /** + * TODO for daisuke + * + * @param command コマンド + */ + public void process(MoveUpListCommand command) { + ListUtil.moveDown(command.getList(), command.getIndex()); + + // 面倒だけど、全部のprocessメソッドに入れる(Interceptorで手を抜きたい)。 + eventBroker.fireCommandProcessed(command); + } + + /** * {@link TableModel}から{@link ColumnModel}を削除するEDITコマンドを実行する。 * * @param command コマンド Added: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveDownListCommand.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveDownListCommand.java (rev 0) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveDownListCommand.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -0,0 +1,90 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on 2009/01/19 + * + * This file is part of Jiemamy. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.jiemamy.editcommand.impl; + +import java.util.List; + +import org.jiemamy.editcommand.Command; +import org.jiemamy.model.JiemamyElement; + +/** + * TODO for daisuke + * + * @author daisuke + */ +public class MoveDownListCommand extends AbstractCommand { + + private final JiemamyElement target; + + /** 変更対象のリスト */ + private final List<?> list; + + /** 要素のインデックス */ + private final int index; + + + /** + * インスタンスを生成する。 + * + * @param target + * @param list + * @param index + */ + public MoveDownListCommand(JiemamyElement target, List<?> list, int index) { + this.target = target; + this.list = list; + this.index = index; + } + + /** + * 要素のインデックスを取得する。 + * + * @return 要素のインデックス + */ + public int getIndex() { + return index; + } + + /** + * 変更対象のリストを取得する。 + * + * @return 変更対象のリスト + */ + public List<?> getList() { + return list; + } + + public Command getNegateCommand() { + return new MoveUpListCommand(target, list, index + 1); + } + + /** + * 属性を変更する対象のモデルを取得する。 + * + * @return 属性を変更する対象のモデル + */ + public JiemamyElement getTarget() { + return target; + } + + @Override + public String toString() { + return "MoveDownListCommand(" + target + "." + index + ")"; + } +} Property changes on: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveDownListCommand.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveUpListCommand.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveUpListCommand.java (rev 0) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveUpListCommand.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -0,0 +1,85 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on 2009/01/19 + * + * This file is part of Jiemamy. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, + * either express or implied. See the License for the specific language + * governing permissions and limitations under the License. + */ +package org.jiemamy.editcommand.impl; + +import java.util.List; + +import org.jiemamy.editcommand.Command; +import org.jiemamy.model.JiemamyElement; + +/** + * TODO for daisuke + * + * @author daisuke + */ +public class MoveUpListCommand extends AbstractCommand { + + private final JiemamyElement target; + + /** 変更対象のリスト */ + private final List<?> list; + + /** 要素のインデックス */ + private final int index; + + + /** + * インスタンスを生成する。 + * + * @param target + * @param list + * @param index + */ + public MoveUpListCommand(JiemamyElement target, List<?> list, int index) { + this.target = target; + this.list = list; + this.index = index; + } + + /** + * 要素のインデックスを取得する。 + * + * @return 要素のインデックス + */ + public int getIndex() { + return index; + } + + /** + * 変更対象のリストを取得する。 + * + * @return 変更対象のリスト + */ + public List<?> getList() { + return list; + } + + public Command getNegateCommand() { + return new MoveDownListCommand(target, list, index - 1); + } + + public JiemamyElement getTarget() { + return target; + } + + @Override + public String toString() { + return "MoveUpListCommand(" + target + "." + index + ")"; + } +} Property changes on: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/editcommand/impl/MoveUpListCommand.java ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/facade/JiemamyFacadeImpl.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/facade/JiemamyFacadeImpl.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/facade/JiemamyFacadeImpl.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -19,6 +19,7 @@ package org.jiemamy.facade; import java.util.Collection; +import java.util.List; import org.apache.commons.lang.Validate; @@ -34,6 +35,8 @@ import org.jiemamy.editcommand.impl.AddForeignKeyCommand; import org.jiemamy.editcommand.impl.AddPrimaryKeyCommand; import org.jiemamy.editcommand.impl.ModifyModelPropertyCommand; +import org.jiemamy.editcommand.impl.MoveDownListCommand; +import org.jiemamy.editcommand.impl.MoveUpListCommand; import org.jiemamy.editcommand.impl.RemoveEntityFromRootCommand; import org.jiemamy.editcommand.impl.RemoveForeignKeyCommand; import org.jiemamy.exception.ElementNotFoundException; @@ -125,11 +128,23 @@ } public <T extends JiemamyElement>void changeModelProperty(T element, JiemamyProperty<T> property, Object newValue) { - ModifyModelPropertyCommand<T> command = new ModifyModelPropertyCommand<T>(element, property, newValue); + Command command = new ModifyModelPropertyCommand<T>(element, property, newValue); command.execute(getCommandProcessor()); undoStack.push(command.getNegateCommand()); } + public void moveDownList(JiemamyElement targetElement, List<?> list, int targetIndex) { + Command command = new MoveDownListCommand(targetElement, list, targetIndex); + command.execute(getCommandProcessor()); + undoStack.push(command.getNegateCommand()); + } + + public void moveUpList(JiemamyElement targetElement, List<?> list, int targetIndex) { + Command command = new MoveUpListCommand(targetElement, list, targetIndex); + command.execute(getCommandProcessor()); + undoStack.push(command.getNegateCommand()); + } + public void removeEntity(EntityModel entityModel) { RemoveEntityFromRootCommand command = new RemoveEntityFromRootCommand(jiemamy.getFactory().getRootModel(), entityModel); Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/model/datatype/DomainModelImpl.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/model/datatype/DomainModelImpl.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/model/datatype/DomainModelImpl.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -45,9 +45,9 @@ /** 説明文 */ private String description; - private ColumnCheckConstraint check; + private ColumnCheckConstraint checkConstraint; - private NotNullConstraint notNull; + private NotNullConstraint notNullConstraint; /** @@ -77,8 +77,8 @@ return dataType.getAdapters(); } - public ColumnCheckConstraint getCheck() { - return check; + public ColumnCheckConstraint getCheckConstraint() { + return checkConstraint; } public BuiltinDataType getDataType() { @@ -97,8 +97,8 @@ return name; } - public NotNullConstraint getNotNull() { - return notNull; + public NotNullConstraint getNotNullConstraint() { + return notNullConstraint; } @Override @@ -118,7 +118,7 @@ } public void setCheck(ColumnCheckConstraint check) { - this.check = check; + checkConstraint = check; } public void setDataType(BuiltinDataType dataType) { @@ -138,7 +138,7 @@ } public void setNotNull(NotNullConstraint notNull) { - this.notNull = notNull; + this.notNullConstraint = notNull; } @Override Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/serializer/JiemamyDomBuilder.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/serializer/JiemamyDomBuilder.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/serializer/JiemamyDomBuilder.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -320,7 +320,7 @@ DomUtil.newChild(domainElement, DESCRIPTION, domainModel.getDescription()); newDataTypeElement(domainElement, domainModel.getDataType()); - NotNullConstraint notNull = domainModel.getNotNull(); + NotNullConstraint notNull = domainModel.getNotNullConstraint(); if (notNull != null) { Element notNullElement = DomUtil.newChild(domainElement, NOT_NULL); notNullElement.setAttribute(CoreQName.ID.getQNameString(), notNull.getId().toString()); @@ -328,7 +328,7 @@ writeAdapters(notNullElement, notNull.getAdapters()); } - ColumnCheckConstraint check = domainModel.getCheck(); + ColumnCheckConstraint check = domainModel.getCheckConstraint(); if (check != null) { writeColumnCheckConstrait(domainElement, check); } Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/RootModelUtil.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/RootModelUtil.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/model/RootModelUtil.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -73,12 +73,12 @@ result = domainModel; break; } - NotNullConstraint notNull = domainModel.getNotNull(); + NotNullConstraint notNull = domainModel.getNotNullConstraint(); if (notNull != null && refId.equals(notNull.getId())) { result = notNull; break; } - ColumnCheckConstraint check = domainModel.getCheck(); + ColumnCheckConstraint check = domainModel.getCheckConstraint(); if (check != null && refId.equals(check.getId())) { result = check; break; Modified: artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/JiemamyPropertyTest.java =================================================================== --- artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/JiemamyPropertyTest.java 2009-03-10 17:02:52 UTC (rev 2871) +++ artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/JiemamyPropertyTest.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -25,6 +25,7 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.util.Arrays; import org.apache.commons.lang.ClassUtils; import org.junit.Test; @@ -143,7 +144,9 @@ try { clazz.getField(fieldName); } catch (NoSuchFieldException e) { - fail(clazz.getName() + " is not have " + fieldName); + if (Arrays.asList("adapter", "adapters").contains(fieldName) == false) { + fail(clazz.getName() + " is not have " + fieldName); + } } } } Added: vesta/trunk/jiemamy-vesta/team_svn.psf =================================================================== --- vesta/trunk/jiemamy-vesta/team_svn.psf (rev 0) +++ vesta/trunk/jiemamy-vesta/team_svn.psf 2009-03-10 18:17:31 UTC (rev 2872) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<psf version="2.0"> +<provider id="org.eclipse.team.svn.core.svnnature"> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-artemis,jiemamy-artemis,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-artemis-test,jiemamy-artemis-test,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-composer,jiemamy-composer,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-core,jiemamy-core,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-dialect-mysql,jiemamy-dialect-mysql,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/sandbox/jiemamy-dialect-openjpa,jiemamy-dialect-openjpa,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-dialect-postgresql,jiemamy-dialect-postgresql,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-dialect-sql99,jiemamy-dialect-sql99,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/zeus/trunk/jiemamy-spec-core,jiemamy-spec-core,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/zeus/trunk/jiemamy-spec-diff,jiemamy-spec-diff,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/zeus/trunk/jiemamy-spec-view,jiemamy-spec-view,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/zeus/trunk/jiemamy-specs,jiemamy-specs,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/jiemamy-vesta,jiemamy-vesta,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/artemis/trunk/jiemamy-view,jiemamy-view,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/eros/trunk/maven-jiemamy-plugin,maven-jiemamy-plugin,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.core,org.jiemamy.eclipse.core,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.mysql,org.jiemamy.eclipse.dialect.mysql,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.mysql.feature,org.jiemamy.eclipse.dialect.mysql.feature,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.postgresql,org.jiemamy.eclipse.dialect.postgresql,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.postgresql.feature,org.jiemamy.eclipse.dialect.postgresql.feature,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.sql99,org.jiemamy.eclipse.dialect.sql99,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.dialect.sql99.feature,org.jiemamy.eclipse.dialect.sql99.feature,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.feature,org.jiemamy.eclipse.feature,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.site,org.jiemamy.eclipse.site,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +<project reference="1.0.1,svn+ssh://svn.sourceforge.jp/svnroot/jiemamy/vesta/trunk/org.jiemamy.eclipse.ui,org.jiemamy.eclipse.ui,00341e87c5f9001d1885c9771489812a;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;Jiemamy;branches;tags;trunk;true;88575b0f-9633-0410-8b48-8d76c060f582;svn+ssh://svn.sourceforge.jp/svnroot/jiemamy;;false;svn+ssh://svn.sourceforge.jp;;22"/> +</provider> +</psf> \ No newline at end of file Added: vesta/trunk/jiemamy-vesta/vesta.launch =================================================================== --- vesta/trunk/jiemamy-vesta/vesta.launch (rev 0) +++ vesta/trunk/jiemamy-vesta/vesta.launch 2009-03-10 18:17:31 UTC (rev 2872) @@ -0,0 +1,35 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<launchConfiguration type="org.eclipse.pde.ui.RuntimeWorkbench"> +<booleanAttribute key="append.args" value="true"/> +<booleanAttribute key="askclear" value="false"/> +<booleanAttribute key="automaticAdd" value="true"/> +<booleanAttribute key="automaticValidate" value="false"/> +<stringAttribute key="bootstrap" value=""/> +<stringAttribute key="checked" value="[NONE]"/> +<booleanAttribute key="clearConfig" value="true"/> +<booleanAttribute key="clearws" value="true"/> +<booleanAttribute key="clearwslog" value="true"/> +<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Jiemamy Vesta"/> +<booleanAttribute key="default" value="false"/> +<stringAttribute key="deselected_workspace_plugins" value="org.jiemamy.eclipse.test"/> +<booleanAttribute key="includeOptional" value="true"/> +<stringAttribute key="location" value="${workspace_loc}/../runtime-jiemamy-vesta"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_id" value="org.eclipse.pde.ui.launcher.PDESourceLookupDirector"/> +<stringAttribute key="org.eclipse.debug.core.source_locator_memento" value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <sourceLookupDirector> <sourceContainers duplicates="false"> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-spec-core&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-dialect-mysql&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-spec-view&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-spec-diff&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-vesta&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-composer&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-specs&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.jiemamy.eclipse.dialect.mysql&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;generic-tree&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-artemis-test&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-dialect-postgresql&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-artemis&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;org.jiemamy.eclipse&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-core&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;factory-enhancer&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-view&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;javaProject name=&quot;jiemamy-dialect-sql99&quot;/&gt;&#13;&#10;" typeId="org.eclipse.jdt.launching.sourceContainer.javaProject"/> <container memento="&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&#13;&#10;&lt;default/&gt;&#13;&#10;" typeId="org.eclipse.debug.core.containerType.default"/> </sourceContainers> </sourceLookupDirector> "/> +<listAttribute key="org.eclipse.debug.ui.favoriteGroups"> +<listEntry value="org.eclipse.debug.ui.launchGroup.debug"/> +</listAttribute> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl}"/> +<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/> +<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/> +<stringAttribute key="pde.version" value="3.3"/> +<stringAttribute key="product" value="org.eclipse.platform.ide"/> +<stringAttribute key="selected_target_plugins" value="javax.servlet.jsp,org.eclipse.ui.win32,org.eclipse.equinox.jsp.jasper,org.eclipse.gef.doc.isv,org.eclipse.ui.editors,org.eclipse.core.runtime.compatibility.registry,org.eclipse.help.appserver,org.eclipse.core.net,org.eclipse.platform.source,org.eclipse.equinox.http.jetty,org.eclipse.core.runtime.compatibility,org.eclipse.tomcat,org.eclipse.search,org.eclipse.ui.forms,org.eclipse.ant.core,org.eclipse.core.runtime,com.jcraft.jsch,org.eclipse.jdt.source,org.eclipse.jdt.core.manipulation,org.apache.commons.el,org.apache.jasper.source,org.eclipse.ui.presentations.r21,org.eclipse.equinox.http.registry,javax.servlet.jsp.source,org.eclipse.ui.cheatsheets,org.eclipse.jdt.debug.ui,org.eclipse.ui,javax.servlet.source,org.eclipse.ui.ide.application,org.eclipse.equinox.common,org.eclipse.core.databinding.beans,org.eclipse.text,org.eclipse.jdt,org.eclipse.ui.views,org.eclipse.ui.console,org.mortbay.jetty.source,org.eclipse.help.webapp,org.eclipse.core.resources.compatibility,org.eclipse.core.expressions,org.eclipse.equinox.http.servlet,org.eclipse.help.base,org.eclipse.jdt.launching,org.eclipse.ui.workbench,org.eclipse.platform.doc.isv,org.eclipse.update.scheduler,org.eclipse.ui.ide,org.eclipse.debug.ui,org.eclipse.jdt.junit,org.apache.ant,org.eclipse.jsch.ui,org.eclipse.ui.intro,org.eclipse.jdt.apt.ui,org.eclipse.ltk.ui.refactoring,org.apache.commons.logging.source,org.junit,org.eclipse.core.contenttype,org.junit4,org.eclipse.swt.win32.win32.x86,org.eclipse.core.filesystem,org.eclipse.jdt.apt.pluggable.core,org.eclipse.platform.source.win32.win32.x86,ch.qos.logback.eclipse,org.eclipse.jdt.ui,org.eclipse.ui.intro.universal,org.eclipse.jdt.compiler.tool,org.eclipse.osgi,org.eclipse.jdt.doc.user,org.eclipse.equinox.app,org.eclipse.jdt.doc.isv,org.eclipse.equinox.launcher.win32.win32.x86,org.eclipse.ui.navigator,org.eclipse.help.ui,org.eclipse.jsch.core,org.mortbay.jetty,org.eclipse.draw2d,org.eclipse.equinox.launcher,org.eclipse.core.boot,org.eclipse.rcp,org.eclipse.core.jobs,org.eclipse.team.ui,org.eclipse.core.runtime.compatibility.auth,org.apache.commons.logging,org.eclipse.core.resources,org.eclipse.core.filesystem.win32.x86,org.eclipse.ant.ui,org.apache.lucene.analysis,org.eclipse.jface,com.ibm.icu,org.eclipse.jdt.debug,org.eclipse.jface.text,org.eclipse.compare,org.eclipse.core.resources.win32,org.eclipse.gef,org.eclipse.update.core.win32,org.junit.source,org.eclipse.update.configurator,org.apache.jasper,org.eclipse.ui.workbench.compatibility,org.eclipse.debug.core,org.eclipse.rcp.source,org.eclipse.update.core,org.eclipse.ui.workbench.texteditor,org.eclipse.ui.browser,org.eclipse.osgi.services,org.eclipse.core.filebuffers,javax.servlet,com.ibm.icu.source,org.eclipse.ui.views.properties.tabbed,org.eclipse.ui.net,org.eclipse.swt,org.eclipse.update.ui,org.eclipse.ltk.core.refactoring,org.eclipse.jdt.core,org.eclipse.core.variables,org.eclipse.jdt.compiler.apt,org.eclipse.rcp.source.win32.win32.x86,org.eclipse.gef.examples.ui.pde,org.eclipse.jdt.junit.runtime,org.eclipse.equinox.registry,org.eclipse.jdt.apt.core,org.eclipse.team.core,org.eclipse.ui.externaltools,org.eclipse.osgi.util,org.apache.lucene.source,org.eclipse.jdt.junit4.runtime,org.eclipse.gef.source,org.eclipse.platform.doc.user,org.eclipse.core.databinding,org.eclipse.equinox.preferences,org.apache.commons.el.source,org.eclipse.jface.databinding,org.eclipse.draw2d.doc.isv,org.eclipse.help,org.apache.ant.source,org.apache.lucene.analysis.source,org.eclipse.ui.navigator.resources,org.eclipse.equinox.jsp.jasper.registry,org.eclipse.platform,org.eclipse.core.commands,org.apache.lucene"/> +<booleanAttribute key="show_selected_only" value="false"/> +<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/> +<booleanAttribute key="tracing" value="false"/> +<booleanAttribute key="useDefaultConfig" value="true"/> +<booleanAttribute key="useDefaultConfigArea" value="true"/> +<booleanAttribute key="useProduct" value="true"/> +<booleanAttribute key="usefeatures" value="false"/> +</launchConfiguration> Property changes on: vesta/trunk/jiemamy-vesta/vesta.launch ___________________________________________________________________ Added: svn:mime-type + text/plain Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/foreignkey/ForeignKeyEditDialog.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/foreignkey/ForeignKeyEditDialog.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/foreignkey/ForeignKeyEditDialog.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -40,7 +40,12 @@ import org.slf4j.LoggerFactory; import org.jiemamy.Jiemamy; +import org.jiemamy.JiemamyProperty.AttributeProperty; +import org.jiemamy.JiemamyProperty.DeferrabilityProperty; +import org.jiemamy.JiemamyProperty.ForeignKeyProperty; +import org.jiemamy.JiemamyProperty.KeyConstraintModelProperty; import org.jiemamy.eclipse.ui.JiemamyEditDialog; +import org.jiemamy.facade.JiemamyFacade; import org.jiemamy.model.attribute.ColumnModel; import org.jiemamy.model.attribute.constraint.Deferrability; import org.jiemamy.model.attribute.constraint.ForeignKey; @@ -52,6 +57,7 @@ import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.AttributeUtil; import org.jiemamy.utils.model.ForeignKeyUtil; +import org.jiemamy.utils.model.JiemamyPropertyUtil; import org.jiemamy.utils.model.KeyConstraintUtil; import org.jiemamy.utils.model.TableUtil; @@ -92,15 +98,19 @@ private Group grpMapping; + private final JiemamyFacade jiemamyFacade; + /** * コンストラクタ。 * * @param shell シェルオブジェクト * @param foreignKey 編集対象外部キー + * @param jiemamyFacade */ - public ForeignKeyEditDialog(Shell shell, ForeignKey foreignKey) { + public ForeignKeyEditDialog(Shell shell, ForeignKey foreignKey, JiemamyFacade jiemamyFacade) { super(shell, foreignKey, ForeignKey.class); + this.jiemamyFacade = jiemamyFacade; setShellStyle(getShellStyle() | SWT.RESIZE); jiemamy = foreignKey.getJiemamy(); TableModel sourceTableModel = AttributeUtil.getDefinedTable(foreignKey); @@ -285,39 +295,53 @@ // } // } + String name = JiemamyPropertyUtil.careNull(txtKeyName.getText(), true); + jiemamyFacade.changeModelProperty(foreignKey, AttributeProperty.name, name); + + MatchType matchType = null; try { + matchType = MatchType.valueOf(cmbMatchType.getText()); foreignKey.setMatchType(MatchType.valueOf(cmbMatchType.getText())); } catch (IllegalArgumentException e) { logger.warn(cmbMatchType.getText() + " is not MatchType element."); - foreignKey.setMatchType(null); } + jiemamyFacade.changeModelProperty(foreignKey, ForeignKeyProperty.matchType, matchType); + + ReferentialAction onDelete = null; try { - foreignKey.setOnDelete(ReferentialAction.valueOf(cmbOnDelete.getText())); + onDelete = ReferentialAction.valueOf(cmbOnDelete.getText()); } catch (IllegalArgumentException e) { logger.warn(cmbOnDelete.getText() + " is not ReferentialAction element."); - foreignKey.setOnDelete(null); } + jiemamyFacade.changeModelProperty(foreignKey, ForeignKeyProperty.onDelete, onDelete); + + ReferentialAction onUpdate = null; try { - foreignKey.setOnUpdate(ReferentialAction.valueOf(cmbOnUpdate.getText())); + onUpdate = ReferentialAction.valueOf(cmbOnUpdate.getText()); } catch (IllegalArgumentException e) { logger.warn(cmbOnUpdate.getText() + " is not ReferentialAction element."); - foreignKey.setOnUpdate(null); } + jiemamyFacade.changeModelProperty(foreignKey, ForeignKeyProperty.onDelete, onUpdate); if (chkDeferrable.getSelection()) { Deferrability deferrability = foreignKey.getDeferrability(); if (deferrability == null) { deferrability = jiemamy.getFactory().newModel(Deferrability.class); - foreignKey.setDeferrability(deferrability); + jiemamyFacade.changeModelProperty(foreignKey, KeyConstraintModelProperty.deferrability, deferrability); } - deferrability.setDeferrable(true); + + jiemamyFacade.changeModelProperty(deferrability, DeferrabilityProperty.deferrable, true); + + InitiallyCheckTime initiallyCheckTime = null; if (radImmediate.getSelection()) { - deferrability.setInitiallyCheckTime(InitiallyCheckTime.IMMEDIATE); + initiallyCheckTime = InitiallyCheckTime.IMMEDIATE; } else if (radDeferred.getSelection()) { - deferrability.setInitiallyCheckTime(InitiallyCheckTime.DEFERRED); + initiallyCheckTime = InitiallyCheckTime.DEFERRED; } - + jiemamyFacade.changeModelProperty(deferrability, DeferrabilityProperty.initiallyCheckTime, + initiallyCheckTime); } + return true; } Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -59,7 +59,6 @@ import org.jiemamy.model.JiemamyElement; import org.jiemamy.model.RootModel; import org.jiemamy.model.dataset.DataSetModel; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; /** @@ -392,7 +391,8 @@ return; } - ListUtil.moveDown(dataSets, index); + jiemamyFacade.moveDownList(rootModel, dataSets, index); +// ListUtil.moveDown(dataSets, index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -406,7 +406,8 @@ return; } - ListUtil.moveUp(dataSets, index); + jiemamyFacade.moveUpList(rootModel, dataSets, index); +// ListUtil.moveUp(dataSets, index); table.setSelection(index - 1); enableEditControls(index - 1); Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -52,6 +52,7 @@ import org.jiemamy.EventBroker; import org.jiemamy.Jiemamy; import org.jiemamy.JiemamyFactory; +import org.jiemamy.JiemamyProperty.DomainProperty; import org.jiemamy.dialect.Dialect; import org.jiemamy.dialect.Dialect.BuiltinDataTypeMold; import org.jiemamy.eclipse.Images; @@ -75,7 +76,6 @@ import org.jiemamy.model.datatype.DomainModel; import org.jiemamy.model.datatype.adapter.SizedDataTypeAdapter; import org.jiemamy.utils.CollectionsUtil; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.DataTypeUtil; import org.jiemamy.utils.model.RootModelUtil; @@ -210,7 +210,7 @@ } /** - * Domain用LabelProvider + * Domain用LabelProviderの実装クラス。 * * @author daisuke */ @@ -221,7 +221,7 @@ DomainModel domainModel = (DomainModel) element; if (columnIndex == 2) { - return ir.get(domainModel.getNotNull() != null ? Images.CHECK_ON : Images.CHECK_OFF); + return ir.get(domainModel.getNotNullConstraint() != null ? Images.CHECK_ON : Images.CHECK_OFF); } return null; } @@ -280,7 +280,7 @@ try { dialect = RootModelUtil.getDialect(rootModel.getJiemamy().getFactory().getRootModel()); } catch (ClassNotFoundException e) { - // THINK どうにか。。。w + // TODO GenericDialectをセットするように dialect = JiemamyCorePlugin.getDialectResolver().getAllInstance().get(0); } @@ -552,8 +552,8 @@ txtColumnSize.setText(ObjectUtils.toString(domainModel.getDataType().getAdapter(SizedDataTypeAdapter.class) .getSize(), "")); txtDescription.setText(StringUtils.defaultIfEmpty(domainModel.getDescription(), "")); - chkIsNotNull.setSelection(domainModel.getNotNull() != null); - CheckConstraint checkConstraint = domainModel.getCheck(); + chkIsNotNull.setSelection(domainModel.getNotNullConstraint() != null); + CheckConstraint checkConstraint = domainModel.getCheckConstraint(); txtCheckName.setText(StringUtils.defaultIfEmpty(checkConstraint.getName(), "")); txtCheckExpression.setText(checkConstraint.getExpression()); @@ -564,7 +564,9 @@ chkIsNotNull.setEnabled(true); txtCheckName.setEnabled(true); txtCheckExpression.setEnabled(true); + // 現在値の設定 + // UNDONE } @Override @@ -574,11 +576,14 @@ JiemamyFactory factory = jiemamy.getFactory(); DomainModel domainModel = factory.newModel(DomainModel.class); - domainModel.setName("DOMAIN_" + (domains.size() + 1)); + String newName = "DOMAIN_" + (domains.size() + 1); + jiemamyFacade.changeModelProperty(domainModel, DomainProperty.name, newName); if (index < 0 || index > table.getItemCount()) { + // FIXME facadeで操作 domains.add(domainModel); } else { + // FIXME facadeで操作 domains.add(index, domainModel); } @@ -598,7 +603,8 @@ return; } - ListUtil.moveDown(domains, index); + jiemamyFacade.moveUpList(rootModel, domains, index); +// ListUtil.moveDown(domains, index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -612,7 +618,8 @@ return; } - ListUtil.moveUp(domains, index); + jiemamyFacade.moveDownList(rootModel, domains, index); +// ListUtil.moveUp(domains, index); table.setSelection(index - 1); enableEditControls(index - 1); @@ -626,6 +633,8 @@ if (index < 0 || index > table.getItemCount()) { return null; } + + // FIXME facadeで操作 DomainModel domainToRemove = domains.remove(index); tableViewer.remove(domainToRemove); table.setSelection(index); @@ -653,11 +662,11 @@ // } domainModel.setDescription(txtDescription.getText()); - if (chkIsNotNull.getSelection() && domainModel.getNotNull() == null) { + if (chkIsNotNull.getSelection() && domainModel.getNotNullConstraint() == null) { JiemamyFactory factory = rootModel.getJiemamy().getFactory(); NotNullConstraint nnModel = factory.newModel(NotNullConstraint.class); domainModel.setNotNull(nnModel); - } else if (chkIsNotNull.getSelection() == false && domainModel.getNotNull() != null) { + } else if (chkIsNotNull.getSelection() == false && domainModel.getNotNullConstraint() != null) { domainModel.setNotNull(null); } } Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -18,8 +18,6 @@ */ package org.jiemamy.eclipse.editor.dialog.table; -import java.util.List; - import org.apache.commons.lang.StringUtils; import org.eclipse.jface.viewers.ArrayContentProvider; import org.eclipse.jface.viewers.BaseLabelProvider; @@ -59,7 +57,6 @@ import org.jiemamy.model.attribute.constraint.CheckConstraint; import org.jiemamy.model.attribute.constraint.TableCheckConstraint; import org.jiemamy.model.entity.TableModel; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.JiemamyPropertyUtil; import org.jiemamy.utils.model.TableUtil; @@ -213,8 +210,6 @@ private final Jiemamy jiemamy; - private final List<TableCheckConstraint> checks; - private Text txtCheckName; private Text txtCheckExpression; @@ -224,10 +219,8 @@ super(parent, style, new DefaultTableEditorConfig("チェック制約情報")); // RESOURCE jiemamy = tableModel.getJiemamy(); - checks = TableUtil.getAttributes(tableModel, TableCheckConstraint.class); assert jiemamy != null; - assert checks != null; } @Override @@ -237,10 +230,9 @@ TableCheckConstraint check = factory.newModel(TableCheckConstraint.class); // FIXME facadeで操作 - checks.add(check); tableModel.getAttributes().add(check); - int addedIndex = checks.indexOf(check); + int addedIndex = TableUtil.getAttributes(tableModel, TableCheckConstraint.class).indexOf(check); table.setSelection(addedIndex); enableEditControls(addedIndex); txtCheckName.setFocus(); @@ -307,7 +299,7 @@ tableViewer.setLabelProvider(new CheckLabelProvider()); final CheckContentProvider contentProvider = new CheckContentProvider(); tableViewer.setContentProvider(contentProvider); - tableViewer.setInput(checks); + tableViewer.setInput(TableUtil.getAttributes(tableModel, TableCheckConstraint.class)); // FIXME 都度入れ替え? final EventBroker eventBroker = jiemamy.getEventBroker(); eventBroker.addListener(contentProvider); @@ -368,7 +360,7 @@ @Override protected void enableEditorControls(int index) { - CheckConstraint check = checks.get(index); + CheckConstraint check = TableUtil.getAttributes(tableModel, TableCheckConstraint.class).get(index); txtCheckName.setEnabled(true); txtCheckExpression.setEnabled(true); @@ -389,15 +381,13 @@ if (index < 0 || index > table.getItemCount()) { // FIXME facadeで操作 tableModel.getAttributes().add(checkConstraint); - checks.add(checkConstraint); } else { // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 tableModel.getAttributes().add(index, checkConstraint); - checks.add(index, checkConstraint); } - int addedIndex = checks.indexOf(checkConstraint); + int addedIndex = TableUtil.getAttributes(tableModel, TableCheckConstraint.class).indexOf(checkConstraint); table.setSelection(addedIndex); enableEditControls(addedIndex); txtCheckName.setFocus(); @@ -413,10 +403,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveDown(tableModel.getAttributes(), index); - ListUtil.moveDown(checks, index); + jiemamyFacade.moveDownList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveDown(tableModel.getAttributes(), index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -430,10 +419,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveUp(tableModel.getAttributes(), index); - ListUtil.moveUp(checks, index); + jiemamyFacade.moveUpList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveUp(tableModel.getAttributes(), index); table.setSelection(index - 1); enableEditControls(index - 1); @@ -447,7 +435,8 @@ if (index < 0 || index > table.getItemCount()) { return null; } - TableCheckConstraint checkToRemove = checks.remove(index); + TableCheckConstraint checkToRemove = + TableUtil.getAttributes(tableModel, TableCheckConstraint.class).get(index); // FIXME facadeで操作 tableModel.getAttributes().remove(checkToRemove); @@ -463,7 +452,7 @@ int editIndex = getTableViewer().getTable().getSelectionIndex(); if (editIndex != -1) { - CheckConstraint check = checks.get(editIndex); + CheckConstraint check = TableUtil.getAttributes(tableModel, TableCheckConstraint.class).get(editIndex); String checkName = JiemamyPropertyUtil.careNull(txtCheckName.getText(), true); jiemamyFacade.changeModelProperty(check, ConstraintProperty.name, checkName); Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -85,7 +85,6 @@ import org.jiemamy.model.datatype.adapter.SizedDataTypeAdapter; import org.jiemamy.model.entity.TableModel; import org.jiemamy.utils.CollectionsUtil; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.ColumnUtil; import org.jiemamy.utils.model.JiemamyPropertyUtil; @@ -284,8 +283,6 @@ private Dialect dialect; - private final List<ColumnModel> columns; - private Text txtColumnName; private Text txtColumnLogicalName; @@ -321,17 +318,15 @@ super(parent, style, new DefaultTableEditorConfig("カラム情報")); // RESOURCE jiemamy = tableModel.getJiemamy(); - columns = TableUtil.getColumns(tableModel); try { dialect = RootModelUtil.getDialect(rootModel.getJiemamy().getFactory().getRootModel()); } catch (ClassNotFoundException e) { - // THINK どうにか。。。w + // TODO GeneriDialectをセットするように dialect = JiemamyCorePlugin.getDialectResolver().getAllInstance().get(0); } assert jiemamy != null; - assert columns != null; assert dialect != null; } @@ -340,18 +335,16 @@ Table table = getTableViewer().getTable(); JiemamyFactory factory = jiemamy.getFactory(); ColumnModel columnModel = factory.newModel(ColumnModel.class); - // FIXME facadeで操作 - columnModel.setName("COLUMN_" + (columns.size() + 1)); + String newName = "COLUMN_" + (TableUtil.getColumns(tableModel).size() + 1); + jiemamyFacade.changeModelProperty(columnModel, AttributeProperty.name, newName); + BuiltinDataType builtinDataType = factory.newBuiltinDataType(allTypes.get(0)); - // FIXME facadeで操作 - columnModel.setDataType(builtinDataType); + jiemamyFacade.changeModelProperty(columnModel, ColumnProperty.dataType, builtinDataType); - // FIXME facadeで操作 - columns.add(columnModel); - tableModel.getAttributes().add(columnModel); + jiemamyFacade.addColumn(tableModel, columnModel); - int addedIndex = columns.indexOf(columnModel); + int addedIndex = TableUtil.getColumns(tableModel).indexOf(columnModel); table.setSelection(addedIndex); enableEditControls(addedIndex); txtColumnName.setFocus(); @@ -436,7 +429,7 @@ tableViewer.setLabelProvider(new ColumnLabelProvider()); final ColumnContentProvider contentProvider = new ColumnContentProvider(); tableViewer.setContentProvider(contentProvider); - tableViewer.setInput(columns); + tableViewer.setInput(TableUtil.getColumns(tableModel)); // FIXME 都度入れ替え? final EventBroker eventBroker = jiemamy.getEventBroker(); eventBroker.addListener(contentProvider); @@ -615,7 +608,7 @@ @Override protected void enableEditorControls(int index) { - ColumnModel columnModel = columns.get(index); + ColumnModel columnModel = TableUtil.getColumns(tableModel).get(index); txtColumnName.setEnabled(true); txtColumnLogicalName.setEnabled(true); @@ -673,23 +666,21 @@ JiemamyFactory factory = jiemamy.getFactory(); ColumnModel columnModel = factory.newModel(ColumnModel.class); - columnModel.setName("COLUMN_" + (columns.size() + 1)); + columnModel.setName("COLUMN_" + (TableUtil.getColumns(tableModel).size() + 1)); BuiltinDataType builtinDataType = factory.newBuiltinDataType(allTypes.get(0)); columnModel.setDataType(builtinDataType); if (index < 0 || index > table.getItemCount()) { - // FIXME facadeで操作 - tableModel.getAttributes().add(columnModel); - columns.add(columnModel); + jiemamyFacade.addColumn(tableModel, columnModel); } else { // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 +// jiemamyFacade.addColumn(tableModel, index, columnModel); tableModel.getAttributes().add(index, columnModel); - columns.add(index, columnModel); } - int addedIndex = columns.indexOf(columnModel); + int addedIndex = TableUtil.getColumns(tableModel).indexOf(columnModel); table.setSelection(addedIndex); enableEditControls(addedIndex); txtColumnName.setFocus(); @@ -705,10 +696,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveDown(tableModel.getAttributes(), index); - ListUtil.moveDown(columns, index); + jiemamyFacade.moveDownList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveDown(tableModel.getAttributes(), index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -722,10 +712,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveUp(tableModel.getAttributes(), index); - ListUtil.moveUp(columns, index); + jiemamyFacade.moveUpList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveUp(tableModel.getAttributes(), index); table.setSelection(index - 1); enableEditControls(index - 1); @@ -739,7 +728,7 @@ if (index < 0 || index > table.getItemCount()) { return null; } - ColumnModel columnToRemove = columns.remove(index); + ColumnModel columnToRemove = TableUtil.getColumns(tableModel).get(index); tableModel.getAttributes().remove(columnToRemove); tableViewer.remove(columnToRemove); table.setSelection(index); @@ -754,7 +743,7 @@ int selectionInedx = cmbColumnType.getSelectionIndex(); if (columnEditIndex != -1 && selectionInedx != -1) { - ColumnModel columnModel = columns.get(columnEditIndex); + ColumnModel columnModel = TableUtil.getColumns(tableModel).get(columnEditIndex); JiemamyFactory factory = columnModel.getJiemamy().getFactory(); Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -60,11 +60,11 @@ import org.jiemamy.facade.JiemamyFacade; import org.jiemamy.model.JiemamyElement; import org.jiemamy.model.attribute.ColumnModel; +import org.jiemamy.model.attribute.ColumnRef; import org.jiemamy.model.entity.TableModel; import org.jiemamy.model.index.IndexColumnModel; import org.jiemamy.model.index.IndexModel; import org.jiemamy.model.index.IndexColumnModel.SortType; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.JiemamyPropertyUtil; import org.jiemamy.utils.model.TableUtil; @@ -251,8 +251,8 @@ JiemamyFactory factory = jiemamy.getFactory(); IndexColumnModel indexColumnModel = factory.newModel(IndexColumnModel.class); - // FIXME facadeで操作 - indexColumnModel.setColumn(factory.newReference(dialog.getResult())); + ColumnRef newColumnRef = factory.newReference(dialog.getResult()); + jiemamyFacade.changeModelProperty(indexColumnModel, IndexColumnProperty.columnRef, newColumnRef); // FIXME facadeで操作 tableModel.getIndexes().get(indexIndex).getColumns().add(indexColumnModel); @@ -427,8 +427,9 @@ return; } - // FIXME facadeで操作 - ListUtil.moveDown(indexColumns, indexIndex); + IndexModel indexModel = tableModel.getIndexes().get(indexIndex); + jiemamyFacade.moveDownList(indexModel, indexColumns, index); +// ListUtil.moveDown(indexColumns, indexIndex); table.setSelection(index + 1); enableEditControls(index + 1); @@ -443,8 +444,9 @@ return; } - // FIXME facadeで操作 - ListUtil.moveUp(indexColumns, indexIndex); + IndexModel indexModel = tableModel.getIndexes().get(indexIndex); + jiemamyFacade.moveUpList(indexModel, indexColumns, index); +// ListUtil.moveUp(indexColumns, indexIndex); table.setSelection(index - 1); enableEditControls(index - 1); @@ -719,9 +721,10 @@ JiemamyFactory factory = jiemamy.getFactory(); IndexModel indexModel = factory.newModel(IndexModel.class); - // FIXME facadeで操作 - indexModel.setName("idx_" + tableModel.getName() + "_" + (tableModel.getIndexes().size() + 1)); + String newName = "idx_" + tableModel.getName() + "_" + (tableModel.getIndexes().size() + 1); + jiemamyFacade.changeModelProperty(indexModel, IndexProperty.name, newName); + if (index < 0 || index > table.getItemCount()) { // FIXME facadeで操作 tableModel.getIndexes().add(indexModel); @@ -746,8 +749,8 @@ return; } - // FIXME facadeで操作 - ListUtil.moveDown(indexes, index); + jiemamyFacade.moveDownList(tableModel, indexes, index); +// ListUtil.moveDown(indexes, index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -761,8 +764,8 @@ return; } - // FIXME facadeで操作 - ListUtil.moveUp(indexes, index); + jiemamyFacade.moveUpList(tableModel, indexes, index); +// ListUtil.moveUp(indexes, index); table.setSelection(index - 1); enableEditControls(index - 1); Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -68,7 +68,6 @@ import org.jiemamy.model.attribute.constraint.UniqueKey; import org.jiemamy.model.entity.TableModel; import org.jiemamy.utils.CollectionsUtil; -import org.jiemamy.utils.ListUtil; import org.jiemamy.utils.LogMarker; import org.jiemamy.utils.model.TableUtil; @@ -238,8 +237,6 @@ private final Jiemamy jiemamy; - private final List<LocalKeyConstraint> localKeys; - private Text txtKeyConstraintName; private org.eclipse.swt.widgets.List lstKeyColumns; @@ -249,10 +246,8 @@ super(parent, style, new DefaultTableEditorConfig("ローカルキー情報")); // RESOURCE jiemamy = tableModel.getJiemamy(); - localKeys = TableUtil.getAttributes(tableModel, LocalKeyConstraint.class); assert jiemamy != null; - assert localKeys != null; } @Override @@ -262,10 +257,9 @@ LocalKeyConstraint unique = factory.newModel(UniqueKey.class); // FIXME facadeで操作 - localKeys.add(unique); tableModel.getAttributes().add(unique); - int addedIndex = localKeys.indexOf(unique); + int addedIndex = TableUtil.getAttributes(tableModel, LocalKeyConstraint.class).indexOf(unique); table.setSelection(addedIndex); enableEditControls(addedIndex); txtKeyConstraintName.setFocus(); @@ -331,7 +325,7 @@ tableViewer.setLabelProvider(new LocalKeyConstraintLabelProvider()); final LocalKeyConstraintContentProvider contentProvider = new LocalKeyConstraintContentProvider(); tableViewer.setContentProvider(contentProvider); - tableViewer.setInput(localKeys); + tableViewer.setInput(TableUtil.getAttributes(tableModel, LocalKeyConstraint.class)); // FIXME 都度入れ替え? final EventBroker eventBroker = jiemamy.getEventBroker(); eventBroker.addListener(contentProvider); @@ -396,7 +390,7 @@ @Override protected void enableEditorControls(int index) { - LocalKeyConstraint unique = localKeys.get(index); + LocalKeyConstraint unique = TableUtil.getAttributes(tableModel, LocalKeyConstraint.class).get(index); txtKeyConstraintName.setEnabled(true); lstKeyColumns.setEnabled(true); @@ -434,15 +428,13 @@ if (index < 0 || index > table.getItemCount()) { // FIXME facadeで操作 tableModel.getAttributes().add(unique); - localKeys.add(unique); } else { // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 tableModel.getAttributes().add(index, unique); - localKeys.add(index, unique); } - int addedIndex = localKeys.indexOf(unique); + int addedIndex = TableUtil.getAttributes(tableModel, LocalKeyConstraint.class).indexOf(unique); table.setSelection(addedIndex); enableEditControls(addedIndex); txtKeyConstraintName.setFocus(); @@ -458,10 +450,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveDown(tableModel.getAttributes(), index); - ListUtil.moveDown(localKeys, index); + jiemamyFacade.moveDownList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveDown(tableModel.getAttributes(), index); table.setSelection(index + 1); enableEditControls(index + 1); @@ -475,10 +466,9 @@ return; } - // FIXME facadeで操作 // FIXME attributesに対しては、indexを調整しないと。 - ListUtil.moveUp(tableModel.getAttributes(), index); - ListUtil.moveUp(localKeys, index); + jiemamyFacade.moveUpList(tableModel, tableModel.getAttributes(), index); +// ListUtil.moveUp(tableModel.getAttributes(), index); table.setSelection(index - 1); enableEditControls(index - 1); @@ -493,7 +483,7 @@ return null; } - LocalKeyConstraint keyToRemove = localKeys.remove(index); + LocalKeyConstraint keyToRemove = TableUtil.getAttributes(tableModel, LocalKeyConstraint.class).get(index); // FIXME facadeで操作 tableModel.getAttributes().remove(keyToRemove); @@ -510,7 +500,8 @@ if (editIndex != -1) { JiemamyFactory factory = jiemamy.getFactory(); - LocalKeyConstraint unique = localKeys.get(editIndex); + LocalKeyConstraint unique = + TableUtil.getAttributes(tableModel, LocalKeyConstraint.class).get(editIndex); unique.setName(StringUtils.defaultIfEmpty(txtKeyConstraintName.getText(), null)); List<ColumnRef> keyColumns = unique.getKeyColumns(); keyColumns.clear(); Modified: vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ForeignKeyEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ForeignKeyEditPart.java 2009-03-10 17:02:52 UTC (rev 2871) +++ vesta/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/ForeignKeyEditPart.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -86,7 +86,7 @@ JiemamyFacade facade = new JiemamyViewFacadeImpl(rootModel.getJiemamy()); SavePoint beforeEditSavePoint = facade.save(); - ForeignKeyEditDialog dialog = new ForeignKeyEditDialog(getViewer().getControl().getShell(), foreignKey); + ForeignKeyEditDialog dialog = new ForeignKeyEditDialog(getViewer().getControl().getShell(), foreignKey, facade); if (dialog.open() == Dialog.OK) { // 編集後のスナップショットを保存 Modified: zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/JiemamyProperty.java =================================================================== --- zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/JiemamyProperty.java 2009-03-10 17:02:52 UTC (rev 2871) +++ zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/JiemamyProperty.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -35,6 +35,7 @@ import org.jiemamy.model.attribute.constraint.ValueConstraint; import org.jiemamy.model.dataset.DataSetModel; import org.jiemamy.model.dataset.RecordModel; +import org.jiemamy.model.datatype.DomainModel; import org.jiemamy.model.entity.EntityModel; import org.jiemamy.model.entity.TableModel; import org.jiemamy.model.entity.ViewModel; @@ -176,6 +177,34 @@ } /** + * {@link DomainModel}のプロパティを表す列挙型。 + * + * @since 0.2 + * @author daisuke + */ + @TargetModel(DomainModel.class) + public enum DomainProperty implements JiemamyProperty<DomainModel> { + + /** {@link DomainModel#getName()}で取得できるプロパティ */ + name, + + /** {@link DomainModel#getLogicalName()}で取得できるプロパティ */ + logicalName, + + /** {@link DomainModel#getDescription()}で取得できるプロパティ */ + description, + + /** {@link DomainModel#getDataType()}で取得できるプロパティ */ + dataType, + + /** {@link DomainModel#getNotNullConstraint()}で取得できるプロパティ */ + notNullConstraint, + + /** {@link DomainModel#getCheckConstraint()}で取得できるプロパティ */ + checkConstraint + } + + /** * {@link EntityModel}のプロパティを表す列挙型。 * * @since 0.2 Modified: zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/facade/JiemamyFacade.java =================================================================== --- zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/facade/JiemamyFacade.java 2009-03-10 17:02:52 UTC (rev 2871) +++ zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/facade/JiemamyFacade.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -18,6 +18,8 @@ */ package org.jiemamy.facade; +import java.util.List; + import org.jiemamy.JiemamyProperty; import org.jiemamy.model.JiemamyElement; import org.jiemamy.model.RootModel; @@ -44,6 +46,8 @@ /** * {@link TableModel}に{@link ColumnModel}を追加する。 * + * <p>THINK addColumn, addForeignKey, addPrimaryKey などを addAttributeに統合できないか?</p> + * * @param tableModel 追加先のテーブル * @param columnModel 追加するカラム * @throws IllegalArgumentException 引数に{@code null}を与えた場合 @@ -75,6 +79,8 @@ /** * {@link TableModel}のPrimaryKeyに{@link ColumnModel}を追加する。 * + * <p>THINK addColumn, addForeignKey, addPrimaryKey などを addAttributeに統合できないか?</p> + * * @param tableModel * @param columnModel * @throws IllegalArgumentException {@code column}が{@code table}が保持する{@link ColumnModel}に含まれていない時。 @@ -98,6 +104,28 @@ <T extends JiemamyElement>void changeModelProperty(T element, JiemamyProperty<T> property, Object newValue); /** + * TODO for daisuke + * + * @param targetElement + * @param list + * @param targetIndex + * @throws IndexOutOfBoundsException + * @since 0.2 + */ + void moveDownList(JiemamyElement targetElement, List<?> list, int targetIndex); + + /** + * TODO for daisuke + * + * @param targetElement + * @param list + * @param targetIndex + * @throws IndexOutOfBoundsException + * @since 0.2 + */ + void moveUpList(JiemamyElement targetElement, List<?> list, int targetIndex); + + /** * {@link RootModel}から{@link EntityModel}を削除する。 * * @param entityModel 削除するエンティティ @@ -109,6 +137,8 @@ /** * TODO for daisuke * + * <p>THINK removeColumn, removeForeignKey, removePrimaryKey などを removeAttributeに統合できないか?</p> + * * @param tableModel * @param foreignKey * @throws IllegalArgumentException 引数に{@code null}を与えた場合 Modified: zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/datatype/DomainModel.java =================================================================== --- zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/datatype/DomainModel.java 2009-03-10 17:02:52 UTC (rev 2871) +++ zeus/trunk/jiemamy-spec-core/src/main/java/org/jiemamy/model/datatype/DomainModel.java 2009-03-10 18:17:31 UTC (rev 2872) @@ -50,7 +50,7 @@ * @return チェック制約. 未設定の場合は{@code null} * @since 0.2 */ - ColumnCheckConstraint getCheck(); + ColumnCheckConstraint getCheckConstraint(); /** * ドメインとして定義された型記述子を取得する。 @@ -90,7 +90,7 @@ * @return NOT NULL制約. 未設定の場合は{@code null} * @since 0.2 */ - NotNullConstraint getNotNull(); + NotNullConstraint getNotNullConstraint(); /** * {@inheritDoc}