svnno****@sourc*****
svnno****@sourc*****
2009年 2月 18日 (水) 08:11:21 JST
Revision: 2683 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2683 Author: daisuke_m Date: 2009-02-18 08:11:20 +0900 (Wed, 18 Feb 2009) Log Message: ----------- null引数対策 / refactor Modified Paths: -------------- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 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/dialog/table/TableEditDialog.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 2009-02-17 18:03:22 UTC (rev 2682) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 2009-02-17 23:11:20 UTC (rev 2683) @@ -113,7 +113,7 @@ txtLogicalName = new Text(composite, SWT.BORDER | SWT.SINGLE); txtLogicalName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - txtLogicalName.setText(tableModel.getLogicalName()); + txtLogicalName.setText(StringUtils.defaultIfEmpty(tableModel.getLogicalName(), "")); txtLogicalName.addFocusListener(new TextSelectionAdapter(txtLogicalName)); // ---- A-3. 色 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-17 18:03:22 UTC (rev 2682) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/editpart/diagram/TableEditPart.java 2009-02-17 23:11:20 UTC (rev 2683) @@ -18,12 +18,14 @@ */ package org.jiemamy.eclipse.editor.editpart.diagram; +import org.apache.commons.lang.StringUtils; import org.eclipse.draw2d.ColorConstants; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.Label; import org.eclipse.draw2d.Panel; 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; @@ -32,6 +34,7 @@ import org.jiemamy.eclipse.JiemamyPlugin; import org.jiemamy.eclipse.editor.DisplayPlace; import org.jiemamy.eclipse.editor.DisplayTarget; +import org.jiemamy.eclipse.editor.dialog.table.TableEditDialog; import org.jiemamy.eclipse.editor.extraprocessor.IsDisplayedProcessor; import org.jiemamy.eclipse.editor.figure.ColumnFigure; import org.jiemamy.eclipse.editor.figure.TableFigure; @@ -79,22 +82,22 @@ NodeAdapter node = getModel(); TableModel tableModel = (TableModel) node.unwrap(); -// TableEditDialog dialog = new TableEditDialog(getViewer().getControl().getShell(), tableModel, rootModel); + TableEditDialog dialog = new TableEditDialog(getViewer().getControl().getShell(), tableModel, rootModel); // // // 編集前のスナップショットを保存 // 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 EditTableModelCommand(tableModel, beforeEditMemento, afterEditMemento)); -// } else { + } else { // // 編集前にロールバック // dialog.setMemento(beforeEditMemento); -// } + } } /** @@ -106,7 +109,7 @@ NodeAdapter node = getModel(); String description = ((TableModel) node.unwrap()).getDescription(); - if (description != null && description.length() > 0) { + if (StringUtils.isEmpty(description) == false) { Panel tooltip = new Panel(); tooltip.setLayoutManager(new StackLayout()); tooltip.setBackgroundColor(ColorConstants.tooltipBackground);