svnno****@sourc*****
svnno****@sourc*****
2009年 4月 7日 (火) 19:45:03 JST
Revision: 3160 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=3160 Author: daisuke_m Date: 2009-04-07 19:45:03 +0900 (Tue, 07 Apr 2009) Log Message: ----------- refactor / javadoc Modified Paths: -------------- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/serializer/JiemamyDomParser.java artemis/trunk/jiemamy-dialect-postgresql/src/main/java/org/jiemamy/dialect/postgresql/PostgreSqlEmitter.java artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewDomSerializerEnhancer.java hestia/trunk/org.jiemamy.eclipse.core/src/main/java/org/jiemamy/eclipse/extension/validator/ModelValidator.java hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/TypeOptionManager.java hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/DataSetEditDialog.java hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/view/ViewEditDialog.java hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/preference/PreferenceKey.java -------------- next part -------------- Modified: artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/serializer/JiemamyDomParser.java =================================================================== --- artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/serializer/JiemamyDomParser.java 2009-04-07 10:32:41 UTC (rev 3159) +++ artemis/trunk/jiemamy-core/src/main/java/org/jiemamy/internal/serializer/JiemamyDomParser.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -91,6 +91,10 @@ */ class JiemamyDomParser { + private static final String EL_CORE_NAME = "core:name"; + + private static final String EL_CORE_LOGICALNAME = "core:logicalName"; + private static Logger logger = LoggerFactory.getLogger(JiemamyDomParser.class); @@ -274,8 +278,8 @@ private void parseColumn(Element columnElement, TableModel tableModel) { ColumnModel columnModel = factory.newModel(ColumnModel.class, DomUtil.getUUID(columnElement, CoreQName.ID)); - columnModel.setName(XpathUtil.getTextContent(columnElement, "core:name")); - columnModel.setLogicalName(XpathUtil.getTextContent(columnElement, "core:logicalName")); + columnModel.setName(XpathUtil.getTextContent(columnElement, EL_CORE_NAME)); + columnModel.setLogicalName(XpathUtil.getTextContent(columnElement, EL_CORE_LOGICALNAME)); columnModel.setDataType(getDataType((Element) XpathUtil.getNode(columnElement, "core:dataType"))); columnModel.setDefaultValue(XpathUtil.getTextContent(columnElement, "core:defaultValue")); @@ -283,7 +287,7 @@ if (nnElement != null) { NotNullConstraint nnModel = factory.newModel(NotNullConstraint.class, DomUtil.getUUID(nnElement, CoreQName.ID)); - nnModel.setName(XpathUtil.getTextContent(nnElement, "core:name")); + nnModel.setName(XpathUtil.getTextContent(nnElement, EL_CORE_NAME)); readAdapter(nnElement, nnModel); columnModel.setNotNullConstraint(nnModel); } @@ -291,7 +295,7 @@ Element ukElement = (Element) XpathUtil.getNode(columnElement, "core:columnUniqueKey"); if (ukElement != null) { UniqueKey uniqueKey = factory.newModel(UniqueKey.class, DomUtil.getUUID(ukElement, CoreQName.ID)); - uniqueKey.setName(XpathUtil.getTextContent(ukElement, "core:name")); + uniqueKey.setName(XpathUtil.getTextContent(ukElement, EL_CORE_NAME)); uniqueKey.getKeyColumns().add(factory.newReference(columnModel)); readAdapter(ukElement, uniqueKey); columnModel.setUniqueKey(uniqueKey); @@ -300,7 +304,7 @@ Element pkElement = (Element) XpathUtil.getNode(columnElement, "core:columnPrimaryKey"); if (pkElement != null) { PrimaryKey primaryKey = factory.newModel(PrimaryKey.class, DomUtil.getUUID(pkElement, CoreQName.ID)); - primaryKey.setName(XpathUtil.getTextContent(pkElement, "core:name")); + primaryKey.setName(XpathUtil.getTextContent(pkElement, EL_CORE_NAME)); primaryKey.getKeyColumns().add(factory.newReference(columnModel)); readAdapter(pkElement, primaryKey); columnModel.setPrimaryKey(primaryKey); @@ -310,7 +314,7 @@ if (checkElement != null) { ColumnCheckConstraint checkConstraint = factory.newModel(ColumnCheckConstraint.class, DomUtil.getUUID(checkElement, CoreQName.ID)); - checkConstraint.setName(XpathUtil.getTextContent(checkElement, "core:name")); + checkConstraint.setName(XpathUtil.getTextContent(checkElement, EL_CORE_NAME)); checkConstraint.setExpression(XpathUtil.getTextContent(checkElement, "core:expression")); readAdapter(checkElement, checkConstraint); columnModel.setCheckConstraint(checkConstraint); @@ -328,7 +332,7 @@ DataSetModel dataSetModel = factory.newModel(DataSetModel.class, DomUtil.getUUID(dataSetNode, CoreQName.ID)); - dataSetModel.setName(XpathUtil.getTextContent(dataSetNode, "core:name")); + dataSetModel.setName(XpathUtil.getTextContent(dataSetNode, EL_CORE_NAME)); NodeList tableRefNodeList = XpathUtil.getNodes(dataSetNode, "core:tableRef"); Iterable<Node> tableRefIterableNodeList = new IterableNodeList(tableRefNodeList); @@ -385,8 +389,8 @@ Iterable<Node> domainsIterableNodeList = new IterableNodeList(domainsNodeList); for (Node domainNode : domainsIterableNodeList) { DomainModel domainModel = factory.newModel(DomainModel.class, DomUtil.getUUID(domainNode, CoreQName.ID)); - domainModel.setName(XpathUtil.getTextContent(domainNode, "core:name")); - domainModel.setLogicalName(XpathUtil.getTextContent(domainNode, "core:logicalName")); + domainModel.setName(XpathUtil.getTextContent(domainNode, EL_CORE_NAME)); + domainModel.setLogicalName(XpathUtil.getTextContent(domainNode, EL_CORE_LOGICALNAME)); domainModel.setDataType(getDataType((Element) XpathUtil.getNode(domainNode, "core:dataType"))); Node nnNode = XpathUtil.getNode(domainNode, "core:notNull"); @@ -394,7 +398,7 @@ Element nnElement = (Element) nnNode; NotNullConstraint nnModel = factory.newModel(NotNullConstraint.class, DomUtil.getUUID(nnNode, CoreQName.ID)); - nnModel.setName(XpathUtil.getTextContent(nnElement, "core:name")); + nnModel.setName(XpathUtil.getTextContent(nnElement, EL_CORE_NAME)); readAdapter(nnElement, nnModel); domainModel.setNotNullConstraint(nnModel); } @@ -406,7 +410,7 @@ factory.newModel(ColumnCheckConstraint.class, DomUtil.getUUID(checkNode, CoreQName.ID)); checkConstraint.setExpression(XpathUtil.getTextContent(checkElement, "core:expression")); readAdapter(checkElement, checkConstraint); - checkConstraint.setName(XpathUtil.getTextContent(checkElement, "core:name")); + checkConstraint.setName(XpathUtil.getTextContent(checkElement, EL_CORE_NAME)); domainModel.setCheckConstraint(checkConstraint); } @@ -444,8 +448,8 @@ private void parseForeignKey(Element fkElement, TableModel tableModel) { ForeignKey foreignKey = factory.newModel(ForeignKey.class, DomUtil.getUUID(fkElement, CoreQName.ID)); - foreignKey.setName(XpathUtil.getTextContent(fkElement, "core:name")); - foreignKey.setLogicalName(XpathUtil.getTextContent(fkElement, "core:logicalName")); + foreignKey.setName(XpathUtil.getTextContent(fkElement, EL_CORE_NAME)); + foreignKey.setLogicalName(XpathUtil.getTextContent(fkElement, EL_CORE_LOGICALNAME)); NodeList columnRefNodeList = XpathUtil.getNodes(fkElement, "core:columnRefs/core:columnRef"); Iterable<Node> columnRefIterableNodeList = new IterableNodeList(columnRefNodeList); for (Node node : columnRefIterableNodeList) { @@ -484,7 +488,7 @@ } Element indexElement = (Element) indexNode; IndexModel indexModel = factory.newModel(IndexModel.class, DomUtil.getUUID(indexElement, CoreQName.ID)); - indexModel.setName(XpathUtil.getTextContent(indexElement, "core:name")); + indexModel.setName(XpathUtil.getTextContent(indexElement, EL_CORE_NAME)); indexModel.setUnique(BooleanUtils.toBoolean(XpathUtil.getTextContent(indexElement, "core:unique"))); NodeList indexColumnNodeList = XpathUtil.getNodes(indexElement, "core:indexColumns/core:indexColumn"); @@ -509,8 +513,8 @@ private void parsePrimaryKey(Element pkElement, TableModel tableModel) { PrimaryKey primaryKey = factory.newModel(PrimaryKey.class, DomUtil.getUUID(pkElement, CoreQName.ID)); - primaryKey.setName(XpathUtil.getTextContent(pkElement, "core:name")); - primaryKey.setLogicalName(XpathUtil.getTextContent(pkElement, "core:logicalName")); + primaryKey.setName(XpathUtil.getTextContent(pkElement, EL_CORE_NAME)); + primaryKey.setLogicalName(XpathUtil.getTextContent(pkElement, EL_CORE_LOGICALNAME)); NodeList columnRefNodeList = XpathUtil.getNodes(pkElement, "core:columnRefs/core:columnRef"); Iterable<Node> columnRefIterableNodeList = new IterableNodeList(columnRefNodeList); for (Node node : columnRefIterableNodeList) { @@ -544,8 +548,8 @@ private TableModel parseTable(Element tableElement) { TableModel tableModel = factory.newModel(TableModel.class, DomUtil.getUUID(tableElement, CoreQName.ID)); - tableModel.setName(XpathUtil.getTextContent(tableElement, "core:name")); - tableModel.setLogicalName(XpathUtil.getTextContent(tableElement, "core:logicalName")); + tableModel.setName(XpathUtil.getTextContent(tableElement, EL_CORE_NAME)); + tableModel.setLogicalName(XpathUtil.getTextContent(tableElement, EL_CORE_LOGICALNAME)); tableModel.setBeginScript(XpathUtil.getTextContent(tableElement, "core:beginScript")); tableModel.setEndScript(XpathUtil.getTextContent(tableElement, "core:endScript")); tableModel.setDescription(XpathUtil.getTextContent(tableElement, "core:description")); @@ -560,8 +564,8 @@ private void parseTableCheckConstraint(Element checkElement, TableModel tableModel) { TableCheckConstraint checkConstraint = factory.newModel(TableCheckConstraint.class, DomUtil.getUUID(checkElement, CoreQName.ID)); - checkConstraint.setName(XpathUtil.getTextContent(checkElement, "core:name")); - checkConstraint.setLogicalName(XpathUtil.getTextContent(checkElement, "core:logicalName")); + checkConstraint.setName(XpathUtil.getTextContent(checkElement, EL_CORE_NAME)); + checkConstraint.setLogicalName(XpathUtil.getTextContent(checkElement, EL_CORE_LOGICALNAME)); checkConstraint.setExpression(XpathUtil.getTextContent(checkElement, "core:expression")); readAdapter(checkElement, checkConstraint); tableModel.getAttributes().add(checkConstraint); @@ -569,8 +573,8 @@ private void parseUniqueKey(Element ukElement, TableModel tableModel) { UniqueKey uniqueKey = factory.newModel(UniqueKey.class, DomUtil.getUUID(ukElement, CoreQName.ID)); - uniqueKey.setName(XpathUtil.getTextContent(ukElement, "core:name")); - uniqueKey.setLogicalName(XpathUtil.getTextContent(ukElement, "core:logicalName")); + uniqueKey.setName(XpathUtil.getTextContent(ukElement, EL_CORE_NAME)); + uniqueKey.setLogicalName(XpathUtil.getTextContent(ukElement, EL_CORE_LOGICALNAME)); NodeList columnRefNodeList = XpathUtil.getNodes(ukElement, "core:columnRefs/core:columnRef"); Iterable<Node> columnRefIterableNodeList = new IterableNodeList(columnRefNodeList); for (Node node : columnRefIterableNodeList) { @@ -586,8 +590,8 @@ private ViewModel parseView(Element viewElement) { ViewModel viewModel = factory.newModel(ViewModel.class, DomUtil.getUUID(viewElement, CoreQName.ID)); - viewModel.setName(XpathUtil.getTextContent(viewElement, "core:name")); - viewModel.setLogicalName(XpathUtil.getTextContent(viewElement, "core:logicalName")); + viewModel.setName(XpathUtil.getTextContent(viewElement, EL_CORE_NAME)); + viewModel.setLogicalName(XpathUtil.getTextContent(viewElement, EL_CORE_LOGICALNAME)); viewModel.setBeginScript(XpathUtil.getTextContent(viewElement, "core:beginScript")); viewModel.setEndScript(XpathUtil.getTextContent(viewElement, "core:endScript")); viewModel.setDescription(XpathUtil.getTextContent(viewElement, "core:description")); Modified: artemis/trunk/jiemamy-dialect-postgresql/src/main/java/org/jiemamy/dialect/postgresql/PostgreSqlEmitter.java =================================================================== --- artemis/trunk/jiemamy-dialect-postgresql/src/main/java/org/jiemamy/dialect/postgresql/PostgreSqlEmitter.java 2009-04-07 10:32:41 UTC (rev 3159) +++ artemis/trunk/jiemamy-dialect-postgresql/src/main/java/org/jiemamy/dialect/postgresql/PostgreSqlEmitter.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -180,6 +180,7 @@ return tokens; } + @SuppressWarnings("unused") private void insertIfExists(SqlStatement stmt) { SqlStatementImpl stmt2 = (SqlStatementImpl) stmt; ArrayList<Token> tokens = CollectionsUtil.newArrayList(); Modified: artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewDomSerializerEnhancer.java =================================================================== --- artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewDomSerializerEnhancer.java 2009-04-07 10:32:41 UTC (rev 3159) +++ artemis/trunk/jiemamy-view/src/main/java/org/jiemamy/internal/enhance/ViewDomSerializerEnhancer.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -220,86 +220,94 @@ presentation.setLevel(Level.valueOf(levelString)); } - NodeList nodeProfileNodeList = XpathUtil.getNodes(dpElement, "view:nodeProfiles/view:nodeProfile"); - Iterable<Node> nodeProfileNodeListIterable = new IterableNodeList(nodeProfileNodeList); - for (Node nodeProfileNode : nodeProfileNodeListIterable) { - NodeAdapter nodeAdapter; - Node objectRefNode = XpathUtil.getNode(nodeProfileNode, "view:nodeObjectRef"); - if (objectRefNode != null) { - UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); - JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); - if (jElement == null) { - logger.error("null element: " + refId.toString()); - continue; - } - nodeAdapter = jElement.getAdapter(NodeAdapter.class); - if (nodeAdapter == null) { - logger.error("null node: " + jElement.getId().toString()); - continue; - } - } else { - Node stickytNode = XpathUtil.getNode(nodeProfileNode, "view:sticky"); - StickyModel stickyModel = - factory.newModel(StickyModel.class, DomUtil.getUUID(stickytNode, CoreQName.ID)); - stickyModel.setContents(XpathUtil.getTextContent(stickytNode, "view:contents")); - nodeAdapter = stickyModel; + processNodeProfile(factory, presentation, dpElement); + processConnectionProfile(factory, presentation, dpElement); + + rootModel.getAdapter(DiagramPresentations.class).add(presentation); + } + return rootModel; + } + + private void processConnectionProfile(JiemamyFactory factory, DiagramPresentationModel presentation, + Element dpElement) { + RootModel rootModel = factory.getRootModel(); + NodeList connectionProfileNodeList = + XpathUtil.getNodes(dpElement, "view:connectionProfiles/view:connectionProfile"); + Iterable<Node> connectionProfileNodeListIterable = new IterableNodeList(connectionProfileNodeList); + for (Node connectionProfileNode : connectionProfileNodeListIterable) { + ConnectionAdapter connectionAdapter; + Node objectRefNode = XpathUtil.getNode(connectionProfileNode, "view:connectionObjectRef"); + if (objectRefNode != null) { + UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); + JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); + if (jElement == null) { + logger.error("null element: " + refId.toString()); + continue; } - int x = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@x").getValue()); - int y = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@y").getValue()); - int width = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@width").getValue()); - int height = - Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@height").getValue()); - - Attr colorAttr = XpathUtil.getAttr(nodeProfileNode, "view:boundary/@color"); - JmColor color = colorAttr == null ? null : JmColor.parse(colorAttr.getValue()); - - NodeProfile nodeProfile = - factory.newModel(NodeProfile.class, DomUtil.getUUID(nodeProfileNode, CoreQName.ID)); - nodeProfile.setBoundary(new JmRectangle(x, y, width, height)); - nodeProfile.setColor(color); - presentation.getNodeProfiles().put(nodeAdapter, nodeProfile); + connectionAdapter = jElement.getAdapter(ConnectionAdapter.class); + if (connectionAdapter == null) { + logger.error("null connection: " + jElement.getId().toString()); + continue; + } + } else { + continue; } - presentation.setName(XpathUtil.getTextContent(dpElement, "core:name")); + ConnectionProfile connectionProfile = + factory.newModel(ConnectionProfile.class, DomUtil.getUUID(connectionProfileNode, CoreQName.ID)); - NodeList connectionProfileNodeList = - XpathUtil.getNodes(dpElement, "view:connectionProfiles/view:connectionProfile"); - Iterable<Node> connectionProfileNodeListIterable = new IterableNodeList(connectionProfileNodeList); - for (Node connectionProfileNode : connectionProfileNodeListIterable) { - ConnectionAdapter connectionAdapter; - Node objectRefNode = XpathUtil.getNode(connectionProfileNode, "view:connectionObjectRef"); - if (objectRefNode != null) { - UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); - JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); - if (jElement == null) { - logger.error("null element: " + refId.toString()); - continue; - } - connectionAdapter = jElement.getAdapter(ConnectionAdapter.class); - if (connectionAdapter == null) { - logger.error("null connection: " + jElement.getId().toString()); - continue; - } - } else { + NodeList bendpointNodeList = + XpathUtil.getNodes(connectionProfileNode, "view:bendpoints/view:bendpoint"); + Iterable<Node> bendpointNodeListIterable = new IterableNodeList(bendpointNodeList); + for (Node bendpointNode : bendpointNodeListIterable) { + int x = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@x").getValue()); + int y = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@y").getValue()); + connectionProfile.getBendpoints().add(new JmPoint(x, y)); + } + presentation.getConnectionProfiles().put(connectionAdapter, connectionProfile); + } + } + + private void processNodeProfile(JiemamyFactory factory, DiagramPresentationModel presentation, Element dpElement) { + RootModel rootModel = factory.getRootModel(); + NodeList nodeProfileNodeList = XpathUtil.getNodes(dpElement, "view:nodeProfiles/view:nodeProfile"); + Iterable<Node> nodeProfileNodeListIterable = new IterableNodeList(nodeProfileNodeList); + for (Node nodeProfileNode : nodeProfileNodeListIterable) { + NodeAdapter nodeAdapter; + Node objectRefNode = XpathUtil.getNode(nodeProfileNode, "view:nodeObjectRef"); + if (objectRefNode != null) { + UUID refId = DomUtil.getUUID(objectRefNode, CoreQName.REF); + JiemamyElement jElement = RootModelUtil.findJiemamyElement(rootModel, refId); + if (jElement == null) { + logger.error("null element: " + refId.toString()); continue; } - ConnectionProfile connectionProfile = - factory.newModel(ConnectionProfile.class, DomUtil.getUUID(connectionProfileNode, - CoreQName.ID)); - - NodeList bendpointNodeList = - XpathUtil.getNodes(connectionProfileNode, "view:bendpoints/view:bendpoint"); - Iterable<Node> bendpointNodeListIterable = new IterableNodeList(bendpointNodeList); - for (Node bendpointNode : bendpointNodeListIterable) { - int x = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@x").getValue()); - int y = Integer.valueOf(XpathUtil.getAttr(bendpointNode, "@y").getValue()); - connectionProfile.getBendpoints().add(new JmPoint(x, y)); + nodeAdapter = jElement.getAdapter(NodeAdapter.class); + if (nodeAdapter == null) { + logger.error("null node: " + jElement.getId().toString()); + continue; } - presentation.getConnectionProfiles().put(connectionAdapter, connectionProfile); + } else { + Node stickytNode = XpathUtil.getNode(nodeProfileNode, "view:sticky"); + StickyModel stickyModel = + factory.newModel(StickyModel.class, DomUtil.getUUID(stickytNode, CoreQName.ID)); + stickyModel.setContents(XpathUtil.getTextContent(stickytNode, "view:contents")); + nodeAdapter = stickyModel; } + int x = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@x").getValue()); + int y = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@y").getValue()); + int width = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@width").getValue()); + int height = Integer.valueOf(XpathUtil.getAttr(nodeProfileNode, "view:boundary/@height").getValue()); - rootModel.getAdapter(DiagramPresentations.class).add(presentation); + Attr colorAttr = XpathUtil.getAttr(nodeProfileNode, "view:boundary/@color"); + JmColor color = colorAttr == null ? null : JmColor.parse(colorAttr.getValue()); + + NodeProfile nodeProfile = + factory.newModel(NodeProfile.class, DomUtil.getUUID(nodeProfileNode, CoreQName.ID)); + nodeProfile.setBoundary(new JmRectangle(x, y, width, height)); + nodeProfile.setColor(color); + presentation.getNodeProfiles().put(nodeAdapter, nodeProfile); } - return rootModel; + presentation.setName(XpathUtil.getTextContent(dpElement, "core:name")); } } } Modified: hestia/trunk/org.jiemamy.eclipse.core/src/main/java/org/jiemamy/eclipse/extension/validator/ModelValidator.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.core/src/main/java/org/jiemamy/eclipse/extension/validator/ModelValidator.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.core/src/main/java/org/jiemamy/eclipse/extension/validator/ModelValidator.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -32,8 +32,8 @@ /** * モデルの検証を行う。 * - * @param resource - * @param rootModel + * @param resource モデルが属するリソース + * @param rootModel 検証対象モデル */ void validate(IResource resource, RootModel rootModel); Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/TypeOptionManager.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/TypeOptionManager.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/TypeOptionManager.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -237,9 +237,9 @@ } /** - * TODO for daisuke + * アダプタからコントロールに値を格納する。 * - * @param clazz + * @param clazz 対象アダプタ */ public void setValue(Class<?> clazz) { DataType dataType = holder.getDataType(); Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/DataSetEditDialog.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/DataSetEditDialog.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/root/DataSetEditDialog.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -238,7 +238,7 @@ FileDialog dialog = new FileDialog(btnImport.getShell(), SWT.OPEN); dialog.setText("CSVインポート"); // RESOURCE dialog.setFileName(filename); - String filename = dialog.open(); + filename = dialog.open(); if (filename == null) { return; @@ -296,7 +296,7 @@ * インスタンスを生成する。 * * @param dataSetModel データセット - * @param menu + * @param menu コンテキストメニュー */ private TabMenuListener(DataSetModel dataSetModel, Menu menu) { this.dataSetModel = dataSetModel; Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -190,43 +190,8 @@ gd.horizontalSpan = 7; tabFolder.setLayoutData(gd); - // ---- B-1. カラム - AbstractTab tabColumn = new TableEditDialogColumnTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); - tabColumn.addKeyListener(editListener); - addTab(tabColumn); + createTabs(tableModel, tabFolder); - // ---- B-2. キー制約 - AbstractTab tabLocalKey = new TableEditDialogLocalKeyTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); - tabLocalKey.addKeyListener(editListener); - addTab(tabLocalKey); - - // ---- B-3. チェック制約 - AbstractTab tabCheck = new TableEditDialogCheckTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); - tabCheck.addKeyListener(editListener); - addTab(tabCheck); - - // ---- B-4. インデックス - AbstractTab tabIndex = new TableEditDialogIndexTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); - tabIndex.addKeyListener(editListener); - addTab(tabIndex); - - // ---- B-6. BeginScript - String beginScript = StringUtils.defaultIfEmpty(tableModel.getBeginScript(), ""); - tabBeginScript = new TextEditTab(tabFolder, Messages.Tab_Table_BeginScript, beginScript); - addTab(tabBeginScript); - - // ---- B-7. EndScript - String endScript = StringUtils.defaultIfEmpty(tableModel.getEndScript(), ""); - tabEndScript = new TextEditTab(tabFolder, Messages.Tab_Table_EndScript, endScript); - addTab(tabEndScript); - - // ---- B-8. Description - String description = StringUtils.defaultIfEmpty(tableModel.getDescription(), ""); - tabDescription = new TextEditTab(tabFolder, Messages.Tab_Table_Description, description); - addTab(tabDescription); - - createAdditionalTabs(tabFolder); - return composite; } @@ -259,14 +224,16 @@ } if (entityNames.contains(txtName.getText())) { - boolean entityCheckOk = MessageDialog.openQuestion(getParentShell(), "Confirm", "エンティティ名が重複しますが、よろしいですか?"); // RESOURCE + // RESOURCE + boolean entityCheckOk = MessageDialog.openQuestion(getParentShell(), "Confirm", "エンティティ名が重複しますが、よろしいですか?"); if (entityCheckOk == false) { return false; } } if (columnNames.size() != columns.size()) { - boolean columnCheckOk = MessageDialog.openQuestion(getParentShell(), "Confirm", "カラム名が重複しますが、よろしいですか?"); // RESOURCE + // RESOURCE + boolean columnCheckOk = MessageDialog.openQuestion(getParentShell(), "Confirm", "カラム名が重複しますが、よろしいですか?"); if (columnCheckOk == false) { return false; } @@ -289,4 +256,43 @@ return true; } + + private void createTabs(final TableModel tableModel, TabFolder tabFolder) { + // ---- B-1. カラム + AbstractTab tabColumn = new TableEditDialogColumnTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); + tabColumn.addKeyListener(editListener); + addTab(tabColumn); + + // ---- B-2. キー制約 + AbstractTab tabLocalKey = new TableEditDialogLocalKeyTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); + tabLocalKey.addKeyListener(editListener); + addTab(tabLocalKey); + + // ---- B-3. チェック制約 + AbstractTab tabCheck = new TableEditDialogCheckTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); + tabCheck.addKeyListener(editListener); + addTab(tabCheck); + + // ---- B-4. インデックス + AbstractTab tabIndex = new TableEditDialogIndexTab(tabFolder, SWT.NULL, tableModel, jiemamyFacade); + tabIndex.addKeyListener(editListener); + addTab(tabIndex); + + // ---- B-6. BeginScript + String beginScript = StringUtils.defaultIfEmpty(tableModel.getBeginScript(), ""); + tabBeginScript = new TextEditTab(tabFolder, Messages.Tab_Table_BeginScript, beginScript); + addTab(tabBeginScript); + + // ---- B-7. EndScript + String endScript = StringUtils.defaultIfEmpty(tableModel.getEndScript(), ""); + tabEndScript = new TextEditTab(tabFolder, Messages.Tab_Table_EndScript, endScript); + addTab(tabEndScript); + + // ---- B-8. Description + String description = StringUtils.defaultIfEmpty(tableModel.getDescription(), ""); + tabDescription = new TextEditTab(tabFolder, Messages.Tab_Table_Description, description); + addTab(tabDescription); + + createAdditionalTabs(tabFolder); + } } Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/view/ViewEditDialog.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/view/ViewEditDialog.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/editor/dialog/view/ViewEditDialog.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -200,36 +200,8 @@ gd.horizontalSpan = 7; tabFolder.setLayoutData(gd); - // ---- B-1. Definition - tabDefinition = - new TextEditTab(tabFolder, Messages.Tab_View_Definition, StringUtils.defaultIfEmpty(viewModel - .getDefinition(), "")); - tabDefinition.addKeyListener(editListener); - addTab(tabDefinition); + createTabs(viewModel, tabFolder); - // ---- B-2. BeginScript - tabBeginScript = - new TextEditTab(tabFolder, Messages.Tab_View_BeginScript, StringUtils.defaultIfEmpty(viewModel - .getBeginScript(), "")); - tabBeginScript.addKeyListener(editListener); - addTab(tabBeginScript); - - // ---- B-3. EndScript - tabEndScript = - new TextEditTab(tabFolder, Messages.Tab_View_EndScript, StringUtils.defaultIfEmpty(viewModel - .getEndScript(), "")); - tabEndScript.addKeyListener(editListener); - addTab(tabEndScript); - - // ---- B-4. Description - tabDescription = - new TextEditTab(tabFolder, Messages.Tab_View_Description, StringUtils.defaultIfEmpty(viewModel - .getDescription(), "")); - tabDefinition.addKeyListener(editListener); - addTab(tabDescription); - - createAdditionalTabs(tabFolder); - return composite; } @@ -262,4 +234,36 @@ return true; } + + private void createTabs(final ViewModel viewModel, TabFolder tabFolder) { + // ---- B-1. Definition + tabDefinition = + new TextEditTab(tabFolder, Messages.Tab_View_Definition, StringUtils.defaultIfEmpty(viewModel + .getDefinition(), "")); + tabDefinition.addKeyListener(editListener); + addTab(tabDefinition); + + // ---- B-2. BeginScript + tabBeginScript = + new TextEditTab(tabFolder, Messages.Tab_View_BeginScript, StringUtils.defaultIfEmpty(viewModel + .getBeginScript(), "")); + tabBeginScript.addKeyListener(editListener); + addTab(tabBeginScript); + + // ---- B-3. EndScript + tabEndScript = + new TextEditTab(tabFolder, Messages.Tab_View_EndScript, StringUtils.defaultIfEmpty(viewModel + .getEndScript(), "")); + tabEndScript.addKeyListener(editListener); + addTab(tabEndScript); + + // ---- B-4. Description + tabDescription = + new TextEditTab(tabFolder, Messages.Tab_View_Description, StringUtils.defaultIfEmpty(viewModel + .getDescription(), "")); + tabDefinition.addKeyListener(editListener); + addTab(tabDescription); + + createAdditionalTabs(tabFolder); + } } Modified: hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/preference/PreferenceKey.java =================================================================== --- hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/preference/PreferenceKey.java 2009-04-07 10:32:41 UTC (rev 3159) +++ hestia/trunk/org.jiemamy.eclipse.ui/src/main/java/org/jiemamy/eclipse/preference/PreferenceKey.java 2009-04-07 10:45:03 UTC (rev 3160) @@ -134,7 +134,7 @@ /** * デフォルト値を取得する。 * - * @param <T> + * @param <T> 設定値の型 * @return デフォルト値 */ @SuppressWarnings("unchecked")