[Jiemamy-notify:1536] commit [2744] PKにアンダーラインが表示されるように修正。

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 2月 27日 (金) 13:10:48 JST


Revision: 2744
          http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2744
Author:   daisuke_m
Date:     2009-02-27 13:10:48 +0900 (Fri, 27 Feb 2009)

Log Message:
-----------
PKにアンダーラインが表示されるように修正。

Modified Paths:
--------------
    vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java


-------------- next part --------------
Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java
===================================================================
--- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java	2009-02-26 09:21:50 UTC (rev 2743)
+++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java	2009-02-27 04:10:48 UTC (rev 2744)
@@ -26,32 +26,28 @@
 import org.eclipse.draw2d.StackLayout;
 import org.eclipse.gef.GraphicalEditPart;
 import org.eclipse.jface.dialogs.Dialog;
-import org.seasar.eclipse.common.util.LogUtil;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
 import org.jiemamy.Migration;
-import org.jiemamy.eclipse.JiemamyPlugin;
 import org.jiemamy.eclipse.editor.DisplayPlace;
 import org.jiemamy.eclipse.editor.dialog.table.TableEditDialog;
 import org.jiemamy.eclipse.editor.figure.ColumnFigure;
 import org.jiemamy.eclipse.editor.figure.TableFigure;
 import org.jiemamy.eclipse.editor.utils.LabelStringUtil;
 import org.jiemamy.eclipse.utils.ConvertUtil;
-import org.jiemamy.exception.ElementNotFoundException;
-import org.jiemamy.exception.TooManyElementsException;
 import org.jiemamy.model.DiagramPresentationModel;
 import org.jiemamy.model.DiagramPresentations;
 import org.jiemamy.model.Level;
 import org.jiemamy.model.NodeProfile;
 import org.jiemamy.model.RootModel;
 import org.jiemamy.model.attribute.ColumnModel;
-import org.jiemamy.model.attribute.constraint.PrimaryKeyModel;
 import org.jiemamy.model.entity.TableModel;
 import org.jiemamy.model.geometory.JmColor;
 import org.jiemamy.model.geometory.JmRectangle;
 import org.jiemamy.model.node.NodeAdapter;
 import org.jiemamy.utils.LogMarker;
+import org.jiemamy.utils.model.ColumnUtil;
 import org.jiemamy.utils.model.TableUtil;
 
 /**
@@ -166,19 +162,7 @@
 	
 	private ColumnFigure[] createColumnFigure(ColumnModel column) {
 		RootModel rootModel = (RootModel) getRoot().getContents().getModel();
-		NodeAdapter node = getModel();
-		TableModel tableModel = (TableModel) node.unwrap();
 		
-		boolean pkColumn = false;
-		try {
-			PrimaryKeyModel primaryKey = TableUtil.getPrimaryKey(tableModel);
-			pkColumn = primaryKey.getKeyColumns().contains(column);
-		} catch (TooManyElementsException e) {
-			LogUtil.log(JiemamyPlugin.getDefault(), "too many primary key");
-		} catch (ElementNotFoundException e) {
-			// ignore
-		}
-		
 		DiagramPresentations diagramPresentations = rootModel.getAdapter(DiagramPresentations.class);
 		DiagramPresentationModel presentation = diagramPresentations.get(Migration.DIAGRAM_INDEX);
 		
@@ -192,7 +176,7 @@
 		nameLabel.setText(LabelStringUtil.getString(rootModel, column, DisplayPlace.FIGURE));
 		typeLabel.setText(LabelStringUtil.getString(rootModel, column.getDataType(), DisplayPlace.FIGURE));
 		
-		if (pkColumn) {
+		if (ColumnUtil.isPartOfPrimaryKeyColumns(column)) {
 			nameLabel.setUnderline(true);
 			typeLabel.setUnderline(true);
 		}



Jiemamy-notify メーリングリストの案内
Back to archive index