svnno****@sourc*****
svnno****@sourc*****
2009年 2月 26日 (木) 00:30:58 JST
Revision: 2736 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2736 Author: daisuke_m Date: 2009-02-26 00:30:58 +0900 (Thu, 26 Feb 2009) Log Message: ----------- J-eclipseのgenerics対応漏れ。 / refactor Modified Paths: -------------- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseImporter.java artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReader.java artemis/trunk/jiemamy-composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/AttributeComparator.java artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/builder/DataTypeBuilder.java artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/utils/model/RootModelUtilTest.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseExporterProvider.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseImporterProvider.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/JiemamyPlugin.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ExportAction.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ImportAction.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/composer/SqlExportWizard.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditorContextMenuProvider.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/TableTreeEditPart.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/ViewTreeEditPart.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ExporterWizard.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ImporterWizard.java Added Paths: ----------- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingConfig.java artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportConfig.java Removed Paths: ------------- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingContext.java artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportContext.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/exporter/SqlExporter.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -32,13 +32,13 @@ import org.apache.commons.lang.builder.ToStringBuilder; import org.apache.commons.lang.builder.ToStringStyle; -import org.jiemamy.Jiemamy; import org.jiemamy.composer.ExportException; import org.jiemamy.composer.Exporter; import org.jiemamy.dialect.Dialect; import org.jiemamy.dialect.EmitConfig; import org.jiemamy.model.RootModel; import org.jiemamy.model.sql.SqlStatement; +import org.jiemamy.utils.model.RootModelUtil; /** * モデルからSQLを構築するエクスポータ。 @@ -59,11 +59,9 @@ Validate.notNull(ctx); Validate.notNull(ctx.getOutputFile()); - Jiemamy jiemamy = rootModel.getJiemamy(); - Writer writer = null; try { - Dialect dialect = jiemamy.getDialect(rootModel); + Dialect dialect = RootModelUtil.getDialect(rootModel); EmitConfig config = null; // FIXME ctxより生成 List<SqlStatement> statements = dialect.emitStatements(rootModel, config); @@ -85,7 +83,7 @@ } catch (IOException e) { throw new ExportException(e); } catch (ClassNotFoundException e) { - throw new ExportException(e); + throw new ExportException("Dialect not found: " + rootModel.getDialectClassName(), e); } finally { IOUtils.closeQuietly(writer); } Modified: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseImporter.java =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseImporter.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseImporter.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -59,7 +59,7 @@ * * @author daisuke */ -public class DatabaseImporter implements Importer<DefaultDatabaseImportContext> { +public class DatabaseImporter implements Importer<DefaultDatabaseImportConfig> { /** ContextKey: SQL方言 (Dialect) */ public static final String DIALECT = "dialect"; @@ -99,7 +99,7 @@ return "Database Importer"; } - public boolean importModel(RootModel rootModel, DefaultDatabaseImportContext ctx) throws ImportException { + public boolean importModel(RootModel rootModel, DefaultDatabaseImportConfig ctx) throws ImportException { Validate.notNull(rootModel); Validate.notNull(ctx); @@ -122,7 +122,7 @@ DatabaseMetaData meta = connection.getMetaData(); // 詰め替え - DatabaseReadingContext readingCtx = new DatabaseReadingContext(); + DatabaseReadingConfig readingCtx = new DatabaseReadingConfig(); BeanUtils.copyProperties(ctx, readingCtx); DatabaseReader reader = new DatabaseReader(dialect, readingCtx, meta); Modified: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReader.java =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReader.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReader.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -51,7 +51,7 @@ private final Dialect dialect; - private final DatabaseReadingContext ctx; + private final DatabaseReadingConfig ctx; private final DatabaseMetaData meta; @@ -63,7 +63,7 @@ * @param ctx コンテキスト情報 * @param meta DBメタデータ */ - public DatabaseReader(Dialect dialect, DatabaseReadingContext ctx, DatabaseMetaData meta) { + public DatabaseReader(Dialect dialect, DatabaseReadingConfig ctx, DatabaseMetaData meta) { Validate.notNull(dialect); Validate.notNull(ctx); Validate.notNull(meta); Copied: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingConfig.java (from rev 2735, artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingContext.java) =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingConfig.java (rev 0) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingConfig.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -0,0 +1,82 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on 2008/07/04 + * + * 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.composer.importer; + +import java.util.Map; + +import org.jiemamy.utils.CollectionsUtil; + +/** + * データベースからモデルにインポートを行う際のコンテキスト情報。 + * + * @author daisuke + */ +class DatabaseReadingConfig { + + /** コンテキスト値のマップ */ + private Map<String, Object> properties = CollectionsUtil.newHashMap(); + + + /** + * コンテキスト値のマップを取得する。 + * + * @return コンテキスト値のマップ + */ + public Map<String, Object> getProperties() { + assert properties != null; + return properties; + } + + /** + * コンテキスト値を取得する。 + * + * @param <T> コンテキスト値の型 + * @param key キー + * @return コンテキスト値 + */ + @SuppressWarnings("unchecked") + // TODO キャスト安全性の根拠提示 + public <T>T getValue(String key) { + assert properties != null; + return (T) properties.get(key); + } + + /** + * コンテキスト値のマップを設定する。 + * + * @param properties コンテキスト値のマップ + */ + public void setProperties(Map<String, Object> properties) { + assert properties != null; + this.properties = properties; + } + + /** + * コンテキスト値を設定する。 + * + * @param <T> コンテキスト値の型 + * @param key キー + * @param value コンテキスト値 + */ + public <T>void setValue(String key, T value) { + assert properties != null; + properties.put(key, value); + } + +} Deleted: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingContext.java =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingContext.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DatabaseReadingContext.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -1,82 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on 2008/07/04 - * - * 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.composer.importer; - -import java.util.Map; - -import org.jiemamy.utils.CollectionsUtil; - -/** - * データベースからモデルにインポートを行う際のコンテキスト情報。 - * - * @author daisuke - */ -class DatabaseReadingContext { - - /** コンテキスト値のマップ */ - private Map<String, Object> properties = CollectionsUtil.newHashMap(); - - - /** - * コンテキスト値のマップを取得する。 - * - * @return コンテキスト値のマップ - */ - public Map<String, Object> getProperties() { - assert properties != null; - return properties; - } - - /** - * コンテキスト値を取得する。 - * - * @param <T> コンテキスト値の型 - * @param key キー - * @return コンテキスト値 - */ - @SuppressWarnings("unchecked") - // TODO キャスト安全性の根拠提示 - public <T>T getValue(String key) { - assert properties != null; - return (T) properties.get(key); - } - - /** - * コンテキスト値のマップを設定する。 - * - * @param properties コンテキスト値のマップ - */ - public void setProperties(Map<String, Object> properties) { - assert properties != null; - this.properties = properties; - } - - /** - * コンテキスト値を設定する。 - * - * @param <T> コンテキスト値の型 - * @param key キー - * @param value コンテキスト値 - */ - public <T>void setValue(String key, T value) { - assert properties != null; - properties.put(key, value); - } - -} Copied: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportConfig.java (from rev 2735, artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportContext.java) =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportConfig.java (rev 0) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportConfig.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -0,0 +1,228 @@ +/* + * Copyright 2007-2009 Jiemamy Project and the Others. + * Created on 2008/07/12 + * + * 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.composer.importer; + +import java.net.URL; + +import org.jiemamy.dialect.Dialect; + +/** + * {@link DatabaseImporter}に関する設定情報保持クラス。 + * + * @author daisuke + */ +public class DefaultDatabaseImportConfig implements DatabaseImportConfig { + + private Dialect dialect; + + private String driverClassName; + + private URL[] driverJarPath; + + private String[] entityTypes; + + private String password; + + private String[] selectedEntities; + + private String uri; + + private String username; + + private String databaseName; + + private String schema; + + + /** + * TODO for daisuke + * + * @return + */ + public String getDatabaseName() { + return databaseName; + } + + /** + * TODO for daisuke + * + * @return + */ + public Dialect getDialect() { + return dialect; + } + + /** + * TODO for daisuke + * + * @return + */ + public String getDriverClassName() { + return driverClassName; + } + + /** + * TODO for daisuke + * + * @return + */ + public URL[] getDriverJarPath() { + return driverJarPath; + } + + /** + * TODO for daisuke + * + * @return + */ + public String[] getEntityTypes() { + return entityTypes; + } + + /** + * TODO for daisuke + * + * @return + */ + public String getPassword() { + return password; + } + + public String getSchema() { + return schema; + } + + /** + * TODO for daisuke + * + * @return + */ + public String[] getSelectedEntities() { + return selectedEntities; + } + + /** + * TODO for daisuke + * + * @return + */ + public String getUri() { + return uri; + } + + /** + * TODO for daisuke + * + * @return + */ + public String getUsername() { + return username; + } + + /** + * TODO for daisuke + * + * @param databaseName + */ + public void setDatabaseName(String databaseName) { + this.databaseName = databaseName; + } + + /** + * TODO for daisuke + * + * @param dialect + */ + public void setDialect(Dialect dialect) { + this.dialect = dialect; + } + + /** + * TODO for daisuke + * + * @param driverClassName + */ + public void setDriverClassName(String driverClassName) { + this.driverClassName = driverClassName; + } + + /** + * TODO for daisuke + * + * @param driverJarPath + */ + public void setDriverJarPath(URL[] driverJarPath) { + this.driverJarPath = driverJarPath; + } + + /** + * TODO for daisuke + * + * @param entityTypes + */ + public void setEntityTypes(String[] entityTypes) { + this.entityTypes = entityTypes; + } + + /** + * TODO for daisuke + * + * @param password + */ + public void setPassword(String password) { + this.password = password; + } + + /** + * TODO for daisuke + * + * @param schema + */ + public void setSchema(String schema) { + this.schema = schema; + } + + /** + * TODO for daisuke + * + * @param selectedEntities + */ + public void setSelectedEntities(String[] selectedEntities) { + this.selectedEntities = selectedEntities; + } + + /** + * TODO for daisuke + * + * @param uri + */ + public void setUri(String uri) { + this.uri = uri; + } + + /** + * TODO for daisuke + * + * @param username + */ + public void setUsername(String username) { + this.username = username; + } + +} Deleted: artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportContext.java =================================================================== --- artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportContext.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/main/java/org/jiemamy/composer/importer/DefaultDatabaseImportContext.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -1,228 +0,0 @@ -/* - * Copyright 2007-2009 Jiemamy Project and the Others. - * Created on 2008/07/12 - * - * 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.composer.importer; - -import java.net.URL; - -import org.jiemamy.dialect.Dialect; - -/** - * {@link DatabaseImporter}に関する設定情報保持クラス。 - * - * @author daisuke - */ -public class DefaultDatabaseImportContext implements DatabaseImportConfig { - - private Dialect dialect; - - private String driverClassName; - - private URL[] driverJarPath; - - private String[] entityTypes; - - private String password; - - private String[] selectedEntities; - - private String uri; - - private String username; - - private String databaseName; - - private String schema; - - - /** - * TODO for daisuke - * - * @return - */ - public String getDatabaseName() { - return databaseName; - } - - /** - * TODO for daisuke - * - * @return - */ - public Dialect getDialect() { - return dialect; - } - - /** - * TODO for daisuke - * - * @return - */ - public String getDriverClassName() { - return driverClassName; - } - - /** - * TODO for daisuke - * - * @return - */ - public URL[] getDriverJarPath() { - return driverJarPath; - } - - /** - * TODO for daisuke - * - * @return - */ - public String[] getEntityTypes() { - return entityTypes; - } - - /** - * TODO for daisuke - * - * @return - */ - public String getPassword() { - return password; - } - - public String getSchema() { - return schema; - } - - /** - * TODO for daisuke - * - * @return - */ - public String[] getSelectedEntities() { - return selectedEntities; - } - - /** - * TODO for daisuke - * - * @return - */ - public String getUri() { - return uri; - } - - /** - * TODO for daisuke - * - * @return - */ - public String getUsername() { - return username; - } - - /** - * TODO for daisuke - * - * @param databaseName - */ - public void setDatabaseName(String databaseName) { - this.databaseName = databaseName; - } - - /** - * TODO for daisuke - * - * @param dialect - */ - public void setDialect(Dialect dialect) { - this.dialect = dialect; - } - - /** - * TODO for daisuke - * - * @param driverClassName - */ - public void setDriverClassName(String driverClassName) { - this.driverClassName = driverClassName; - } - - /** - * TODO for daisuke - * - * @param driverJarPath - */ - public void setDriverJarPath(URL[] driverJarPath) { - this.driverJarPath = driverJarPath; - } - - /** - * TODO for daisuke - * - * @param entityTypes - */ - public void setEntityTypes(String[] entityTypes) { - this.entityTypes = entityTypes; - } - - /** - * TODO for daisuke - * - * @param password - */ - public void setPassword(String password) { - this.password = password; - } - - /** - * TODO for daisuke - * - * @param schema - */ - public void setSchema(String schema) { - this.schema = schema; - } - - /** - * TODO for daisuke - * - * @param selectedEntities - */ - public void setSelectedEntities(String[] selectedEntities) { - this.selectedEntities = selectedEntities; - } - - /** - * TODO for daisuke - * - * @param uri - */ - public void setUri(String uri) { - this.uri = uri; - } - - /** - * TODO for daisuke - * - * @param username - */ - public void setUsername(String username) { - this.username = username; - } - -} Modified: artemis/trunk/jiemamy-composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java =================================================================== --- artemis/trunk/jiemamy-composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-composer/src/test/java/org/jiemamy/composer/importer/DatabaseImporterTest.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -77,7 +77,7 @@ private static Logger logger = LoggerFactory.getLogger(DatabaseImporterTest.class); /** {@link DatabaseImporter} */ - public Importer<DefaultDatabaseImportContext> importer = new DatabaseImporter(); + public Importer<DefaultDatabaseImportConfig> importer = new DatabaseImporter(); /** SQL方言 */ private Dialect dialect; @@ -126,7 +126,7 @@ @Test @Ignore("H2Dialectが無いとテストできない") public void test01_DBからのインポートテスト() throws Exception { - DefaultDatabaseImportContext ctx = createContext(); + DefaultDatabaseImportConfig ctx = createConfig(); logger.info("START import..."); importer.importModel(rootModel, ctx); logger.info("FINISH import."); @@ -202,8 +202,8 @@ * @return インポートコンテキスト情報 * @throws MalformedURLException */ - private DefaultDatabaseImportContext createContext() throws MalformedURLException { - DefaultDatabaseImportContext ctx = new DefaultDatabaseImportContext(); + private DefaultDatabaseImportConfig createConfig() throws MalformedURLException { + DefaultDatabaseImportConfig ctx = new DefaultDatabaseImportConfig(); ctx.setDialect(dialect); ctx.setDatabaseName("jpoll"); ctx.setDriverJarPath(new URL[] { @@ -220,8 +220,8 @@ return ctx; } -// private ImportContext createContext() throws MalformedURLException { -// ImportContext ctx = new ImportContextImpl(); +// private DefaultDatabaseImportConfig createConfig() throws MalformedURLException { +// ImportConfig ctx = new ImportConfigImpl(); // ctx.setValue(DatabaseImporter.DIALECT, dialect); // ctx.setValue(DatabaseImporter.DATABASE_NAME, "jpoll"); // ctx.setValue(DatabaseImporter.DRIVER_JAR_PATH, new URL[] { Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/AttributeComparator.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/AttributeComparator.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/AttributeComparator.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -35,6 +35,8 @@ /** * 属性の出力順を整列させるコンパレータ。 * + * <p>カラム, PK, UK, FK, CHECKの順にならべ、同種内では元の順序を維持する。</p> + * * @author daisuke */ public class AttributeComparator implements Comparator<AttributeModel> { @@ -63,7 +65,7 @@ } - private final TableModel tableModel; + private final List<AttributeModel> originalOrder; /** @@ -72,7 +74,7 @@ * @param tableModel */ public AttributeComparator(TableModel tableModel) { - this.tableModel = tableModel; + originalOrder = CollectionsUtil.newArrayList(tableModel.getAttributes()); } public int compare(AttributeModel o1, AttributeModel o2) { @@ -82,7 +84,6 @@ return i1 - i2; } - List<AttributeModel> attributes = tableModel.getAttributes(); - return attributes.indexOf(o1) - attributes.indexOf(o2); + return originalOrder.indexOf(o1) - originalOrder.indexOf(o2); } } Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/builder/DataTypeBuilder.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/builder/DataTypeBuilder.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/utils/builder/DataTypeBuilder.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -91,9 +91,12 @@ * 精度を設定する。 * * @param precision 精度 - * @return this + * @return {@code this} */ public DataTypeBuilder setPrecision(int precision) { + if (dataType.hasAdapter(PrecisionedDataTypeAdapter.class) == false) { + dataType.registerAdapter(new PrecisionedDataTypeAdapter()); + } dataType.getAdapter(PrecisionedDataTypeAdapter.class).setPrecision(precision); return this; } @@ -102,9 +105,12 @@ * スケールを設定する。 * * @param scale スケール - * @return this + * @return {@code this} */ public DataTypeBuilder setScale(int scale) { + if (dataType.hasAdapter(PrecisionedDataTypeAdapter.class) == false) { + dataType.registerAdapter(new PrecisionedDataTypeAdapter()); + } dataType.getAdapter(PrecisionedDataTypeAdapter.class).setScale(scale); return this; } @@ -113,9 +119,12 @@ * 自動採番型かどうかを設定する。 * * @param serial 自動採番であれば{@code true} - * @return this + * @return {@code this} */ public DataTypeBuilder setSerial(boolean serial) { + if (dataType.hasAdapter(SerialDataTypeAdapter.class) == false) { + dataType.registerAdapter(new SerialDataTypeAdapter()); + } dataType.getAdapter(SerialDataTypeAdapter.class).setSerial(serial); return this; } @@ -124,9 +133,12 @@ * サイズを設定する。 * * @param size サイズ - * @return this + * @return {@code this} */ public DataTypeBuilder setSize(int size) { + if (dataType.hasAdapter(SizedDataTypeAdapter.class) == false) { + dataType.registerAdapter(new SizedDataTypeAdapter()); + } dataType.getAdapter(SizedDataTypeAdapter.class).setSize(size); return this; } Modified: artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/utils/model/RootModelUtilTest.java =================================================================== --- artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/utils/model/RootModelUtilTest.java 2009-02-25 10:34:06 UTC (rev 2735) +++ artemis/trunk/jiemamy-core/src/test/java/org/jiemamy/utils/model/RootModelUtilTest.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -106,24 +106,30 @@ // empIdはPKである assertThat(ColumnUtil.isPartOfPrimaryKeyColumns(mb.empId), is(true)); - // PKを外すと + // PKはカラムに対して設定されたものではなく + assertThat(mb.empId.getPrimaryKey(), is(nullValue())); + + // テーブルに対して属性として設定されたものである + assertThat(mb.tableEmp.getAttributes().contains(mb.empPk), is(true)); + + // このPKを外すと assertThat(mb.tableEmp.getAttributes().remove(mb.empPk), is(true)); // empIdはPKではなくなる assertThat(ColumnUtil.isPartOfPrimaryKeyColumns(mb.empId), is(false)); - // カラムに対してPKは設定されていない - assertThat(mb.empId.getPrimaryKey(), is(nullValue())); - - // そこにPKを設定する + // 今度はPKカラムに対して設定し mb.empId.setPrimaryKey(mb.empPk); - // そするとPK扱いとなる + // カラムに対するgetPrimaryKeyで取得できることを確認する + assertThat(mb.empId.getPrimaryKey(), is(mb.empPk)); + + // PKはテーブルに対して属性として設定されたものではないが + assertThat(mb.tableEmp.getAttributes().contains(mb.empPk), is(false)); + + // empIdがPK扱いとなる assertThat(ColumnUtil.isPartOfPrimaryKeyColumns(mb.empId), is(true)); - // カラムに対するgetPrimaryKeyでそれが取れる - assertThat(mb.empId.getPrimaryKey(), is(mb.empPk)); - // ここでノーマライズすると RootModelUtil.normalize(mb.rootModel); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseExporterProvider.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseExporterProvider.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseExporterProvider.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.CoreException; import org.jiemamy.InstanceProvider; +import org.jiemamy.composer.ExportConfig; import org.jiemamy.composer.Exporter; /** @@ -28,9 +29,9 @@ * * @author daisuke */ -public class EclipseExporterProvider implements InstanceProvider<Exporter> { +public class EclipseExporterProvider implements InstanceProvider<Exporter<ExportConfig>> { - public Exporter getInstance(String fqcn) { + public Exporter<ExportConfig> getInstance(String fqcn) { try { return JiemamyPlugin.getExporterResolver().getInstance(fqcn); } catch (CoreException e) { Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseImporterProvider.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseImporterProvider.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/EclipseImporterProvider.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -21,6 +21,7 @@ import org.eclipse.core.runtime.CoreException; import org.jiemamy.InstanceProvider; +import org.jiemamy.composer.ImportConfig; import org.jiemamy.composer.Importer; /** @@ -28,9 +29,9 @@ * * @author daisuke */ -public class EclipseImporterProvider implements InstanceProvider<Importer> { +public class EclipseImporterProvider implements InstanceProvider<Importer<ImportConfig>> { - public Importer getInstance(String fqcn) { + public Importer<ImportConfig> getInstance(String fqcn) { try { return JiemamyPlugin.getImporterResolver().getInstance(fqcn); } catch (CoreException e) { Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/JiemamyPlugin.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/JiemamyPlugin.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/JiemamyPlugin.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -36,7 +36,9 @@ import org.seasar.eclipse.common.util.ImageManager; import org.seasar.eclipse.common.util.StatusUtil; +import org.jiemamy.composer.ExportConfig; import org.jiemamy.composer.Exporter; +import org.jiemamy.composer.ImportConfig; import org.jiemamy.composer.Importer; import org.jiemamy.dialect.Dialect; import org.jiemamy.eclipse.extension.ExtensionResolver; @@ -67,10 +69,10 @@ private static ExtensionResolver<Dialect> dialectResolver; /** 拡張ポイントに設定されたImporterのリゾルバ */ - private static ExtensionResolver<Importer> importerResolver; + private static ExtensionResolver<Importer<ImportConfig>> importerResolver; /** 拡張ポイントに設定されたExporterのリゾルバ */ - private static ExtensionResolver<Exporter> exporterResolver; + private static ExtensionResolver<Exporter<ExportConfig>> exporterResolver; /** 拡張ポイントに設定されたModelValidatorのリゾルバ */ private static ExtensionResolver<ModelValidator> validatorResolver; @@ -99,7 +101,7 @@ * 拡張ポイントに設定されたExporterのリゾルバを取得する。 * @return 拡張ポイントに設定されたExporterのリゾルバ */ - public static ExtensionResolver<Exporter> getExporterResolver() { + public static ExtensionResolver<Exporter<ExportConfig>> getExporterResolver() { assert exporterResolver != null; return exporterResolver; } @@ -120,7 +122,7 @@ * 拡張ポイントに設定されたImporterのリゾルバを取得する。 * @return 拡張ポイントに設定されたImporterのリゾルバ */ - public static ExtensionResolver<Importer> getImporterResolver() { + public static ExtensionResolver<Importer<ImportConfig>> getImporterResolver() { assert importerResolver != null; return importerResolver; } @@ -140,7 +142,7 @@ * * @return 拡張ポイントに設定されたサービスViewのリゾルバ */ - public static ExtensionResolver<Exporter> getServiceViewResolver() { + public static ExtensionResolver<Exporter<ExportConfig>> getServiceViewResolver() { assert exporterResolver != null; return exporterResolver; } @@ -196,8 +198,8 @@ plugin = this; pref = new JiemamyPreferenceImpl(); dialectResolver = new ExtensionResolver<Dialect>(PLUGIN_ID, "dialects", "dialect", "class"); - importerResolver = new ExtensionResolver<Importer>(PLUGIN_ID, "importers", "importer", "class"); - exporterResolver = new ExtensionResolver<Exporter>(PLUGIN_ID, "exporters", "exporter", "class"); + importerResolver = new ExtensionResolver<Importer<ImportConfig>>(PLUGIN_ID, "importers", "importer", "class"); + exporterResolver = new ExtensionResolver<Exporter<ExportConfig>>(PLUGIN_ID, "exporters", "exporter", "class"); validatorResolver = new ExtensionResolver<ModelValidator>(PLUGIN_ID, "validators", "dialect", "class"); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ExportAction.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ExportAction.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ExportAction.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -36,7 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.jiemamy.composer.ExportContext; +import org.jiemamy.composer.ExportConfig; import org.jiemamy.composer.ExportException; import org.jiemamy.composer.Exporter; import org.jiemamy.eclipse.editor.JiemamyEditor; @@ -54,9 +54,9 @@ private static Logger logger = LoggerFactory.getLogger(ExportAction.class); - private final Exporter<ExportContext> exporter; + private final Exporter<ExportConfig> exporter; - private final ExporterWizard<Exporter<ExportContext>, ExportContext> wizard; + private final ExporterWizard<Exporter<ExportConfig>, ExportConfig> wizard; private final JiemamyEditor editor; @@ -71,8 +71,8 @@ * @throws NullPointerException 引数importerに{@code null}を与えた場合 * @throws IllegalArgumentException その他引数に{@code null}を与えた場合 */ - public ExportAction(Exporter<ExportContext> exporter, - ExporterWizard<Exporter<ExportContext>, ExportContext> wizard, GraphicalViewer viewer, JiemamyEditor editor) { + public ExportAction(Exporter<ExportConfig> exporter, + ExporterWizard<Exporter<ExportConfig>, ExportConfig> wizard, GraphicalViewer viewer, JiemamyEditor editor) { super(exporter.getName(), viewer); Validate.notNull(wizard); @@ -109,7 +109,7 @@ logger.debug(LogMarker.LIFECYCLE, "canceled " + exporter.getName()); return; } - ExportContext ctx = wizard.getConfig(); + ExportConfig ctx = wizard.getConfig(); // 実行 exporter.exportModel(rootModel, ctx); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ImportAction.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ImportAction.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/action/ImportAction.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -36,7 +36,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.jiemamy.composer.ImportContext; +import org.jiemamy.composer.ImportConfig; import org.jiemamy.composer.ImportException; import org.jiemamy.composer.Importer; import org.jiemamy.eclipse.editor.JiemamyEditor; @@ -54,9 +54,9 @@ private static Logger logger = LoggerFactory.getLogger(ImportAction.class); - private final Importer importer; + private final Importer<ImportConfig> importer; - private final ImporterWizard wizard; + private final ImporterWizard<Importer<ImportConfig>, ImportConfig> wizard; private final JiemamyEditor editor; @@ -71,7 +71,8 @@ * @throws NullPointerException 引数importerに{@code null}を与えた場合 * @throws IllegalArgumentException その他引数に{@code null}を与えた場合 */ - public ImportAction(Importer importer, ImporterWizard wizard, GraphicalViewer viewer, JiemamyEditor editor) { + public ImportAction(Importer<ImportConfig> importer, ImporterWizard<Importer<ImportConfig>, ImportConfig> wizard, + GraphicalViewer viewer, JiemamyEditor editor) { super(importer.getName(), viewer); Validate.notNull(wizard); @@ -89,6 +90,7 @@ logger.debug(LogMarker.LIFECYCLE, "run " + importer.getName()); RootModel rootModel = (RootModel) getViewer().getContents().getModel(); IFileEditorInput input = (IFileEditorInput) editor.getEditorInput(); + wizard.setInput(input); IStructuredSelection selection = (IStructuredSelection) getViewer().getSelection(); List<Object> selectedModels = new ArrayList<Object>(); @@ -107,7 +109,7 @@ logger.debug(LogMarker.LIFECYCLE, "canceled " + importer.getName()); return; } - ImportContext ctx = wizard.getConfig(); + ImportConfig ctx = wizard.getConfig(); // 実行 importer.importModel(rootModel, ctx); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/composer/SqlExportWizard.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/composer/SqlExportWizard.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/composer/SqlExportWizard.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -27,7 +27,7 @@ import org.eclipse.ui.IWorkbenchWizard; import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; -import org.jiemamy.composer.exporter.SqlExportContext; +import org.jiemamy.composer.exporter.SqlExportConfig; import org.jiemamy.composer.exporter.SqlExporter; import org.jiemamy.eclipse.JiemamyPlugin; import org.jiemamy.eclipse.ui.ExporterWizard; @@ -38,13 +38,13 @@ * * @author daisuke */ -public class SqlExportWizard extends Wizard implements ExporterWizard<SqlExporter, SqlExportContext>, IWorkbenchWizard { +public class SqlExportWizard extends Wizard implements ExporterWizard<SqlExporter, SqlExportConfig>, IWorkbenchWizard { private FolderSelectWizardPage mainPage; - IFileEditorInput input; + private IFileEditorInput input; - String defaultFolder = "/"; + private String defaultFolder = "/"; /** @@ -52,9 +52,9 @@ */ public SqlExportWizard() { IDialogSettings workbenchSettings = JiemamyPlugin.getDefault().getDialogSettings(); - IDialogSettings section = workbenchSettings.getSection("ExportWizard");//$NON-NLS-1$ + IDialogSettings section = workbenchSettings.getSection("ExportWizard"); // $NON-NLS-1$ if (section == null) { - section = workbenchSettings.addNewSection("ExportWizard");//$NON-NLS-1$ + section = workbenchSettings.addNewSection("ExportWizard"); // $NON-NLS-1$ } setDialogSettings(section); } @@ -67,14 +67,14 @@ addPage(mainPage); } - public SqlExportContext getConfig() { + public SqlExportConfig getConfig() { // TODO Auto-generated method stub return null; } public void init(IWorkbench workbench, IStructuredSelection currentSelection) { setWindowTitle("SQLにエクスポート"); // RESOURCE - setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png"));//$NON-NLS-1$ + setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png")); // $NON-NLS-1$ setNeedsProgressMonitor(true); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditorContextMenuProvider.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditorContextMenuProvider.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/DiagramEditorContextMenuProvider.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -33,7 +33,9 @@ import org.eclipse.jface.action.Separator; import org.eclipse.ui.actions.ActionFactory; +import org.jiemamy.composer.ExportConfig; import org.jiemamy.composer.Exporter; +import org.jiemamy.composer.ImportConfig; import org.jiemamy.composer.Importer; import org.jiemamy.eclipse.JiemamyPlugin; import org.jiemamy.eclipse.action.AutoLayoutAction; @@ -116,11 +118,16 @@ MenuManager importMenu = new MenuManager("インポート(&I)"); // RESOURCE for (IConfigurationElement importerElement : importerElements) { try { - Importer importer = (Importer) importerElement.createExecutableExtension("class"); - ImporterWizard wizard = (ImporterWizard) importerElement.createExecutableExtension("wizard"); + @SuppressWarnings("unchecked") + Importer<ImportConfig> importer = + (Importer<ImportConfig>) importerElement.createExecutableExtension("class"); + @SuppressWarnings("unchecked") + ImporterWizard<Importer<ImportConfig>, ImportConfig> wizard = + (ImporterWizard<Importer<ImportConfig>, ImportConfig>) importerElement + .createExecutableExtension("wizard"); importMenu.add(new ImportAction(importer, wizard, viewer, editorPart)); } catch (CoreException e) { - e.printStackTrace(); + JiemamyPlugin.log(e); } } menu.add(importMenu); @@ -132,11 +139,16 @@ MenuManager exportMenu = new MenuManager("エクスポート(&E)"); // RESOURCE for (IConfigurationElement exporterElement : exporterElements) { try { - Exporter exporter = (Exporter) exporterElement.createExecutableExtension("class"); - ExporterWizard wizard = (ExporterWizard) exporterElement.createExecutableExtension("wizard"); + @SuppressWarnings("unchecked") + Exporter<ExportConfig> exporter = + (Exporter<ExportConfig>) exporterElement.createExecutableExtension("class"); + @SuppressWarnings("unchecked") + ExporterWizard<Exporter<ExportConfig>, ExportConfig> wizard = + (ExporterWizard<Exporter<ExportConfig>, ExportConfig>) exporterElement + .createExecutableExtension("wizard"); exportMenu.add(new ExportAction(exporter, wizard, viewer, editorPart)); } catch (CoreException e) { - e.printStackTrace(); + JiemamyPlugin.log(e); } } menu.add(exportMenu); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -607,7 +607,7 @@ public void widgetSelected(SelectionEvent e) { int index = table.getSelectionIndex(); if (index >= 0) { - (indexColumnsTableEditor).updateInput(); + indexColumnsTableEditor.updateInput(); } else { indexColumnsTableEditor.disableEditControls(); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/TableTreeEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/TableTreeEditPart.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/TableTreeEditPart.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -21,11 +21,13 @@ import java.util.List; import org.eclipse.gef.EditPolicy; +import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.resource.ImageRegistry; import org.jiemamy.eclipse.Images; import org.jiemamy.eclipse.JiemamyPlugin; import org.jiemamy.eclipse.editor.DisplayPlace; +import org.jiemamy.eclipse.editor.dialog.table.TableEditDialog; import org.jiemamy.eclipse.editor.editpolicy.JmTreeComponentEditPolicy; import org.jiemamy.eclipse.editor.utils.LabelStringUtil; import org.jiemamy.model.JiemamyElement; @@ -60,14 +62,13 @@ public void openEditDialog() { TableModel tableModel = getModel(); - RootModel rootModel = (RootModel) getRoot().getContents().getModel(); -// TableEditDialog dialog = new TableEditDialog(getViewer().getControl().getShell(), tableModel, rootModel); + TableEditDialog dialog = new TableEditDialog(getViewer().getControl().getShell(), tableModel); // // // 編集前のスナップショットを保存 // Memento beforeEditMemento = dialog.createMemento(); // -// if (dialog.open() == Dialog.OK) { + if (dialog.open() == Dialog.OK) { // // 編集後のスナップショットを保存 // Memento afterEditMemento = dialog.createMemento(); // @@ -75,7 +76,7 @@ // // viewer.getEditDomain().getCommandStack().execute( // new EditTableModelCommand(tableModel, beforeEditMemento, afterEditMemento)); -// } + } } @Override Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/ViewTreeEditPart.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/ViewTreeEditPart.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/outlinetree/ViewTreeEditPart.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -19,11 +19,13 @@ package org.jiemamy.eclipse.editor.editpart.outlinetree; import org.eclipse.gef.EditPolicy; +import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.resource.ImageRegistry; import org.jiemamy.eclipse.Images; import org.jiemamy.eclipse.JiemamyPlugin; import org.jiemamy.eclipse.editor.DisplayPlace; +import org.jiemamy.eclipse.editor.dialog.view.ViewEditDialog; import org.jiemamy.eclipse.editor.editpart.DoubleClickSupport; import org.jiemamy.eclipse.editor.editpart.EditDialogSupport; import org.jiemamy.eclipse.editor.editpolicy.JmTreeComponentEditPolicy; @@ -66,22 +68,22 @@ public void openEditDialog() { ViewModel viewModel = getModel(); -// ViewEditDialog dialog = new ViewEditDialog(getViewer().getControl().getShell(), viewModel); + ViewEditDialog dialog = new ViewEditDialog(getViewer().getControl().getShell(), viewModel); // // // 編集前のスナップショットを保存 // Memento beforeEditMemento = dialog.createMemento(); // -// if (dialog.open() == Dialog.OK) { + if (dialog.open() == Dialog.OK) { // // 編集後のスナップショットを保存 // Memento afterEditMemento = dialog.createMemento(); // // GraphicalViewer viewer = (GraphicalViewer) getViewer(); // viewer.getEditDomain().getCommandStack().execute( // new EditViewModelCommand(viewModel, beforeEditMemento, afterEditMemento)); -// } else { + } else { // // 編集前にロールバック // dialog.setMemento(beforeEditMemento); -// } + } } @Override Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ExporterWizard.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ExporterWizard.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ExporterWizard.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -21,7 +21,7 @@ import org.eclipse.jface.wizard.IWizard; import org.eclipse.ui.IFileEditorInput; -import org.jiemamy.composer.ExportContext; +import org.jiemamy.composer.ExportConfig; import org.jiemamy.composer.Exporter; /** @@ -29,7 +29,7 @@ * * @author daisuke */ -public interface ExporterWizard<T extends Exporter<C>, C extends ExportContext> extends IWizard { +public interface ExporterWizard<T extends Exporter<C>, C extends ExportConfig> extends IWizard { /** * TODO for daisuke @@ -38,5 +38,10 @@ */ C getConfig(); + /** + * TODO for daisuke + * + * @param input + */ void setInput(IFileEditorInput input); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ImporterWizard.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ImporterWizard.java 2009-02-25 10:34:06 UTC (rev 2735) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/ImporterWizard.java 2009-02-25 15:30:58 UTC (rev 2736) @@ -19,21 +19,29 @@ package org.jiemamy.eclipse.ui; import org.eclipse.jface.wizard.IWizard; +import org.eclipse.ui.IFileEditorInput; -import org.jiemamy.composer.ImportContext; +import org.jiemamy.composer.ImportConfig; +import org.jiemamy.composer.Importer; /** * TODO for daisuke * * @author daisuke */ -public interface ImporterWizard extends IWizard { +public interface ImporterWizard<T extends Importer<C>, C extends ImportConfig> extends IWizard { /** * TODO for daisuke * * @return */ - ImportContext getConfig(); + C getConfig(); + /** + * TODO for daisuke + * + * @param input + */ + void setInput(IFileEditorInput input); }