svnno****@sourc*****
svnno****@sourc*****
2009年 2月 23日 (月) 20:36:05 JST
Revision: 2719 http://svn.sourceforge.jp/view?root=jiemamy&view=rev&rev=2719 Author: daisuke_m Date: 2009-02-23 20:36:04 +0900 (Mon, 23 Feb 2009) Log Message: ----------- ダイアログUIの調整。 Modified Paths: -------------- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateNodeCommand.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java 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/TableEditDialogCheckTab.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.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/dialog/table/TableEditDialogLocalKeyTab.java vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/AbstractTableEditor.java -------------- next part -------------- Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateNodeCommand.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateNodeCommand.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/command/CreateNodeCommand.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -50,6 +50,7 @@ /** * インスタンスを生成する。 + * * @param rootModel 作成ノードの親モデル * @param model 作成するノード * @param rectangle Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDataSetTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -348,7 +348,7 @@ } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtDataSetName.setText(StringUtils.EMPTY); btnEdit.setText(StringUtils.EMPTY); @@ -357,7 +357,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { DataSetModel dataSet = dataSets.get(index); txtDataSetName.setEnabled(true); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/root/RootEditDialogDomainTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -38,7 +38,6 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Combo; import org.eclipse.swt.widgets.Composite; @@ -338,9 +337,9 @@ int index = getTableViewer().getTable().getSelectionIndex(); updateModel(); if (index >= 0) { - enableEditDetailControls(index); + enableEditorControls(index); } else { - disableEditDetailControls(); + disableEditorControls(); } domainEditor.refreshTable(); } @@ -368,9 +367,9 @@ int index = getTableViewer().getTable().getSelectionIndex(); updateModel(); if (index >= 0) { - enableEditDetailControls(index); + enableEditorControls(index); } else { - disableEditDetailControls(); + disableEditorControls(); } domainEditor.refreshTable(); } @@ -454,7 +453,7 @@ Composite cmpNames = new Composite(parent, SWT.NULL); cmpNames.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - GridLayout layout = new GridLayout(2, false); + GridLayout layout = new GridLayout(4, false); layout.marginHeight = 0; layout.marginWidth = 0; cmpNames.setLayout(layout); @@ -465,59 +464,47 @@ txtDomainName = new Text(cmpNames, SWT.BORDER); txtDomainName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite cmpTypes = new Composite(parent, SWT.NULL); - cmpTypes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - layout = new GridLayout(6, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - cmpTypes.setLayout(layout); + label = new Label(cmpNames, SWT.NULL); + label.setText(Messages.Label_Domain_Description); - label = new Label(cmpTypes, SWT.NULL); + txtDescription = new Text(cmpNames, SWT.MULTI | SWT.BORDER); + txtDescription.setLayoutData(new GridData(GridData.FILL_BOTH)); + + label = new Label(cmpNames, SWT.NULL); label.setText(Messages.Label_Domain_DataType); - cmbColumnType = new Combo(cmpTypes, SWT.READ_ONLY); + cmbColumnType = new Combo(cmpNames, SWT.READ_ONLY); cmbColumnType.setVisibleItemCount(20); - label = new Label(cmpTypes, SWT.NULL); + label = new Label(cmpNames, SWT.NULL); label.setText(Messages.Label_Domain_DataTypeSize); - txtColumnSize = new Text(cmpTypes, SWT.BORDER); + txtColumnSize = new Text(cmpNames, SWT.BORDER); gd = new GridData(); gd.widthHint = 60; txtColumnSize.setLayoutData(gd); txtColumnSize.addFocusListener(new TextSelectionAdapter(txtColumnSize)); - label = new Label(cmpTypes, SWT.NULL); + label = new Label(cmpNames, SWT.NULL); label.setText(Messages.Label_Domain_CheckConstraint); - txtCheckExpression = new Text(cmpTypes, SWT.BORDER); + txtCheckExpression = new Text(cmpNames, SWT.BORDER); txtCheckExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - label = new Label(cmpTypes, SWT.NULL); - label.setText("チェック制約名"); // RESOURCE + label = new Label(cmpNames, SWT.NULL); + label.setText("制約名"); // RESOURCE - txtCheckName = new Text(cmpTypes, SWT.BORDER); + txtCheckName = new Text(cmpNames, SWT.BORDER); txtCheckName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite cmpDesc = new Composite(parent, SWT.NULL); - cmpDesc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - layout = new GridLayout(2, false); + Composite cmpOther = new Composite(parent, SWT.NULL); + cmpOther.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + layout = new GridLayout(1, false); layout.marginHeight = 0; layout.marginWidth = 0; - cmpDesc.setLayout(layout); - label = new Label(cmpDesc, SWT.NULL); - label.setText(Messages.Label_Domain_Description); - txtDescription = new Text(cmpDesc, SWT.MULTI | SWT.BORDER); - txtDescription.setLayoutData(new GridData(GridData.FILL_BOTH)); + cmpOther.setLayout(layout); - Composite cmpChecks = new Composite(parent, SWT.NULL); - RowLayout rowLayout = new RowLayout(); - layout.marginHeight = 0; - layout.marginWidth = 0; - cmpChecks.setLayout(rowLayout); - cmpChecks.setLayoutData(new GridData()); - - chkIsNotNull = new Button(cmpChecks, SWT.CHECK); + chkIsNotNull = new Button(cmpOther, SWT.CHECK); chkIsNotNull.setText(Messages.Label_Domain_NotNullConstraint); } @@ -541,7 +528,7 @@ } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtDomainName.setText(StringUtils.EMPTY); cmbColumnType.setText(StringUtils.EMPTY); txtColumnSize.setText(StringUtils.EMPTY); @@ -560,7 +547,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { DomainModel domain = domains.get(index); DataType columnType = domain.getDataType(); 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-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialog.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -43,7 +43,6 @@ import org.jiemamy.eclipse.Images; import org.jiemamy.eclipse.JiemamyPlugin; -import org.jiemamy.eclipse.editor.dialog.root.RootEditDialogDataSetTab; import org.jiemamy.eclipse.ui.helper.TextSelectionAdapter; import org.jiemamy.eclipse.ui.tab.TextEditTab; import org.jiemamy.model.RootModel; @@ -96,7 +95,6 @@ * @param rootModel ルートモデル */ public TableEditDialog(Shell parentShell, TableModel tableModel, RootModel rootModel) { - super(parentShell); setShellStyle(getShellStyle() | SWT.RESIZE); @@ -108,7 +106,7 @@ protected void constrainShellSize() { Shell shell = getShell(); shell.pack(); - int height = 500; + int height = 400; shell.setSize((int) (height * 1.618), height); } Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogCheckTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -359,7 +359,7 @@ } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtCheckName.setText(StringUtils.EMPTY); txtCheckExpression.setText(StringUtils.EMPTY); @@ -368,7 +368,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { CheckConstraintModel check = checks.get(index); txtCheckName.setEnabled(true); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogColumnTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -222,22 +222,20 @@ switch (columnIndex) { case 0: - return null; - - case 1: return ColumnUtil.isPartOfPrimaryKeyColumns(column) ? ir.get(Images.ICON_PK) : null; case 4: - // FIXME ここ、何を表示するんだっけ PKだっけ? ↑にあるじゃん。。 - return null; - - case 5: // FIXME false固定 return ir.get(/* uniqueかどうか */false ? Images.CHECK_ON : Images.CHECK_OFF); - case 6: + case 5: return ir.get(column.getNotNull() != null ? Images.CHECK_ON : Images.CHECK_OFF); + case 6: + ColumnCheckModel check = column.getCheck(); + return ir.get(check != null && StringUtils.isEmpty(check.getExpression()) == false + ? Images.CHECK_ON : Images.CHECK_OFF); + default: return null; } @@ -406,7 +404,7 @@ public void widgetSelected(SelectionEvent e) { int columnEditIndex = getTableViewer().getTable().getSelectionIndex(); updateModel(); - enableEditDetailControls(columnEditIndex); + enableEditorControls(columnEditIndex); columnEditor.refreshTable(); } }); @@ -442,7 +440,7 @@ public void widgetSelected(SelectionEvent e) { int columnEditIndex = getTableViewer().getTable().getSelectionIndex(); updateModel(); - enableEditDetailControls(columnEditIndex); + enableEditorControls(columnEditIndex); columnEditor.refreshTable(); } }); @@ -452,7 +450,7 @@ public void widgetSelected(SelectionEvent e) { int columnEditIndex = getTableViewer().getTable().getSelectionIndex(); updateModel(); - enableEditDetailControls(columnEditIndex); + enableEditorControls(columnEditIndex); columnEditor.refreshTable(); } }); @@ -462,7 +460,7 @@ public void widgetSelected(SelectionEvent e) { int columnEditIndex = getTableViewer().getTable().getSelectionIndex(); updateModel(); - enableEditDetailControls(columnEditIndex); + enableEditorControls(columnEditIndex); columnEditor.refreshTable(); } }); @@ -472,7 +470,7 @@ public void widgetSelected(SelectionEvent e) { int columnEditIndex = getTableViewer().getTable().getSelectionIndex(); updateModel(); - enableEditDetailControls(columnEditIndex); + enableEditorControls(columnEditIndex); columnEditor.refreshTable(); } }); @@ -554,25 +552,6 @@ txtColumnLogicalName = new Text(cmpNames, SWT.BORDER); txtColumnLogicalName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite cmpCheckConstraint = new Composite(parent, SWT.NULL); - cmpCheckConstraint.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - layout = new GridLayout(4, false); - layout.marginHeight = 0; - layout.marginWidth = 0; - cmpCheckConstraint.setLayout(layout); - - label = new Label(cmpCheckConstraint, SWT.NULL); - label.setText("チェック制約名"); // RESOURCE - - txtCheckName = new Text(cmpCheckConstraint, SWT.BORDER); - txtCheckName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - - label = new Label(cmpCheckConstraint, SWT.NULL); - label.setText("チェック制約式"); // RESOURCE - - txtCheckExpression = new Text(cmpCheckConstraint, SWT.BORDER); - txtCheckExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - Composite cmpTypes = new Composite(parent, SWT.NULL); cmpTypes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); layout = new GridLayout(6, false); @@ -600,6 +579,25 @@ txtDefaultValue = new Text(cmpTypes, SWT.BORDER); txtDefaultValue.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + Composite cmpCheckConstraint = new Composite(parent, SWT.NULL); + cmpCheckConstraint.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + layout = new GridLayout(4, false); + layout.marginHeight = 0; + layout.marginWidth = 0; + cmpCheckConstraint.setLayout(layout); + + label = new Label(cmpCheckConstraint, SWT.NULL); + label.setText("チェック制約式"); // RESOURCE + + txtCheckExpression = new Text(cmpCheckConstraint, SWT.BORDER); + txtCheckExpression.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + label = new Label(cmpCheckConstraint, SWT.NULL); + label.setText("制約名"); // RESOURCE + + txtCheckName = new Text(cmpCheckConstraint, SWT.BORDER); + txtCheckName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + Composite cmpDesc = new Composite(parent, SWT.NULL); cmpDesc.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); layout = new GridLayout(2, false); @@ -648,23 +646,23 @@ TableColumn colDefault = new TableColumn(table, SWT.LEFT); colDefault.setText("デフォルト値"); // RESOURCE - colDefault.setWidth(150); + colDefault.setWidth(120); - TableColumn colPrimaryKey = new TableColumn(table, SWT.LEFT); - colPrimaryKey.setText("PK"); // RESOURCE - colPrimaryKey.setWidth(30); - TableColumn colUniqueKey = new TableColumn(table, SWT.LEFT); colUniqueKey.setText("UK"); // RESOURCE colUniqueKey.setWidth(30); TableColumn colNotNull = new TableColumn(table, SWT.LEFT); colNotNull.setText("NN"); - colNotNull.setWidth(30); + colNotNull.setWidth(35); + + TableColumn colCheck = new TableColumn(table, SWT.LEFT); + colCheck.setText("CHK"); // RESOURCE + colCheck.setWidth(35); } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtColumnName.setText(StringUtils.EMPTY); txtColumnLogicalName.setText(StringUtils.EMPTY); txtCheckName.setText(StringUtils.EMPTY); @@ -693,7 +691,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { ColumnModel column = columns.get(index); txtColumnName.setEnabled(true); 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-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogIndexTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -325,14 +325,20 @@ @Override protected void createEditorControls(Composite parent) { + Composite cmpRadio = new Composite(parent, SWT.NULL); + GridLayout layout = new GridLayout(3, false); + layout.marginHeight = 0; + layout.marginWidth = 0; + cmpRadio.setLayout(layout); + cmpRadio.setLayoutData(new GridData(GridData.FILL_BOTH)); - radSortNone = new Button(parent, SWT.RADIO); + radSortNone = new Button(cmpRadio, SWT.RADIO); radSortNone.setText("なし"); // RESOURCE - radSortAsc = new Button(parent, SWT.RADIO); + radSortAsc = new Button(cmpRadio, SWT.RADIO); radSortAsc.setText("ASC"); // RESOURCE - radSortDesc = new Button(parent, SWT.RADIO); + radSortDesc = new Button(cmpRadio, SWT.RADIO); radSortDesc.setText("DESC"); // RESOURCE } @@ -348,7 +354,7 @@ } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { radSortNone.setEnabled(false); radSortAsc.setEnabled(false); radSortDesc.setEnabled(false); @@ -359,7 +365,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { int indexIndex = indexesTableEditor.getTableViewer().getTable().getSelectionIndex(); IndexModel indexModel = tableModel.getIndexes().get(indexIndex); @@ -666,17 +672,14 @@ @Override protected void createEditorControls(Composite parent) { - Label label; - Composite cmpNames = new Composite(parent, SWT.NULL); cmpNames.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); - // 論理名つける場合は 2→4 - GridLayout layout = new GridLayout(2, false); + GridLayout layout = new GridLayout(3, false); layout.marginHeight = 0; layout.marginWidth = 0; cmpNames.setLayout(layout); - label = new Label(cmpNames, SWT.NULL); + Label label = new Label(cmpNames, SWT.NULL); label.setText("インデックス名"); // RESOURCE txtIndexName = new Text(cmpNames, SWT.BORDER); @@ -698,7 +701,7 @@ } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtIndexName.setEnabled(false); chkIsUniqueIndex.setEnabled(false); @@ -707,7 +710,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { IndexModel indexModel = tableModel.getIndexes().get(index); txtIndexName.setEnabled(true); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/editor/dialog/table/TableEditDialogLocalKeyTab.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -382,15 +382,15 @@ TableColumn colName = new TableColumn(table, SWT.LEFT); colName.setText("制約名"); // RESOURCE - colName.setWidth(200); + colName.setWidth(150); TableColumn colExpression = new TableColumn(table, SWT.LEFT); colExpression.setText("構成カラム"); // RESOURCE - colExpression.setWidth(500); + colExpression.setWidth(400); } @Override - protected void disableEditDetailControls() { + protected void disableEditorControls() { txtKeyConstraintName.setText(StringUtils.EMPTY); lstKeyColumns.removeAll(); @@ -399,7 +399,7 @@ } @Override - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { LocalKeyModel unique = localKeys.get(index); txtKeyConstraintName.setEnabled(true); Modified: vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/AbstractTableEditor.java =================================================================== --- vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/AbstractTableEditor.java 2009-02-23 09:59:48 UTC (rev 2718) +++ vesta/trunk/org.jiemamy.eclipse/src/main/java/org/jiemamy/eclipse/ui/AbstractTableEditor.java 2009-02-23 11:36:04 UTC (rev 2719) @@ -134,7 +134,7 @@ */ public void disableEditControls() { disableEditButtons(); - disableEditDetailControls(); + disableEditorControls(); } /** @@ -144,7 +144,7 @@ */ public void enableEditControls(int index) { enableEditButtons(index); - enableEditDetailControls(index); + enableEditorControls(index); } /** @@ -315,7 +315,7 @@ /** * 詳細編集コントロールを無効化する。 */ - protected void disableEditDetailControls() { + protected void disableEditorControls() { // nothing to do } @@ -349,7 +349,7 @@ * * @param index */ - protected void enableEditDetailControls(int index) { + protected void enableEditorControls(int index) { // nothing to do }