[Nextobjects-devel] nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects A
Status: Alpha
Brought to you by:
eflorent
Update of /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects In directory sc8-pr-cvs1:/tmp/cvs-serv974/src/org/devaki/nextobjects/ui/workspace/models/objects Modified Files: AssociationEdit.java DataDictionaryEdit.java EntityEdit.java TableEdit.java Log Message: Fixed 'cancel button' bug (XXXEdit.java). Fixed 'label button' behaviour. Fixed remove field number -1 execption. Fixed bung in intelligent FK creation. Index: AssociationEdit.java =================================================================== RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects/AssociationEdit.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** AssociationEdit.java 9 Jun 2003 17:43:11 -0000 1.8 --- AssociationEdit.java 5 Jul 2003 12:26:10 -0000 1.9 *************** *** 453,456 **** --- 453,458 ---- public void actionPerformed(ActionEvent e) { + dataDict.model.resetColumns(); + myAssociation.setData(dataDict.model.getColumns()); closingWindow(false); } Index: DataDictionaryEdit.java =================================================================== RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects/DataDictionaryEdit.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DataDictionaryEdit.java 9 Jun 2003 17:43:11 -0000 1.4 --- DataDictionaryEdit.java 5 Jul 2003 12:26:10 -0000 1.5 *************** *** 412,429 **** } ! /* * Unused: Cancel edition if 'DataDictionaryEdit' was * edited in its previous call ! * public void cancelCellEditing() { ! if(this.jTableField.isEditing()) { ! int tmpInt1 = this.jTableField.getEditingRow(); ! int tmpInt2 = this.jTableField.getEditingColumn(); ! this.jTableField.getCellEditor(tmpInt1, tmpInt2).cancelCellEditing(); } } ! */ /** --- 412,429 ---- } ! /** * Unused: Cancel edition if 'DataDictionaryEdit' was * edited in its previous call ! */ public void cancelCellEditing() { ! if(this.jTableColumns.isEditing()) { ! int tmpInt1 = this.jTableColumns.getEditingRow(); ! int tmpInt2 = this.jTableColumns.getEditingColumn(); ! this.jTableColumns.getCellEditor(tmpInt1, tmpInt2).cancelCellEditing(); } } ! /** *************** *** 450,453 **** --- 450,455 ---- public class ObjectColumnsTableModel extends AbstractTableModel { + /** The data stored to be restored with cancel button */ + private Vector oldData=new Vector(); /** * The column name *************** *** 522,525 **** --- 524,535 ---- return this.columns; } + /** + * Reset the TableModel to its old values + */ + public void resetColumns() + { + cancelCellEditing(); + this.columns = new Vector(oldData); + } /** *************** *** 529,532 **** --- 539,549 ---- public void setColumns(Vector pData) { + // store the old data + oldData.removeAllElements(); + for (int i=0;i<pData.size();i++) + { + oldData.addElement(new Column((Column)pData.elementAt(i))); + } + //fix the new data. this.columns = new Vector(pData); } *************** *** 563,570 **** public void removeField(int i) { ! this.columns.removeElementAt(i); ! this.fireTableRowsDeleted( ! this.columns.size() - 1, ! this.columns.size() - 1); } --- 580,590 ---- public void removeField(int i) { ! if (i >= 0 && i < columns.size()) ! { ! this.columns.removeElementAt(i); ! this.fireTableRowsDeleted( ! this.columns.size() - 1, ! this.columns.size() - 1); ! } } Index: EntityEdit.java =================================================================== RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects/EntityEdit.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** EntityEdit.java 9 Jun 2003 17:43:11 -0000 1.8 --- EntityEdit.java 5 Jul 2003 12:26:10 -0000 1.9 *************** *** 62,66 **** private Entity myEntity; - /** Components **/ // Labels --- 62,65 ---- *************** *** 316,338 **** } }); - this.jButtonOK.addActionListener(new ActionListener() - { - // When calling 'jButtonOK', save data and close the window - public void actionPerformed(ActionEvent e) - { - closingWindow(true); - } - }); - this.jButtonCancel.addActionListener(new ActionListener() - { - // When calling 'jButtonCancel', close the dialog without saving - public void actionPerformed(ActionEvent e) - { - closingWindow(false); - } - }); - - - /** Assembling components **/ --- 315,318 ---- *************** *** 520,523 **** --- 500,522 ---- GridBagConstraints.NONE, new Insets(5, 0, 5, 5), 0, 0)); + + this.jButtonOK.addActionListener(new ActionListener() + { + // When calling 'jButtonOK', save data and close the window + public void actionPerformed(ActionEvent e) + { + closingWindow(true); + } + }); + this.jButtonCancel.addActionListener(new ActionListener() + { + // When calling 'jButtonCancel', close the dialog without saving + public void actionPerformed(ActionEvent e) + { + dataDict.model.resetColumns(); + myEntity.setData(dataDict.model.getColumns()); + closingWindow(false); + } + }); } // End of 'EntityEdit()' *************** *** 572,576 **** // Initialize the local reference of the edited object this.myEntity = pEntity; - // Initialize components values this.jTextFieldName.setText(this.myEntity.getName()); --- 571,574 ---- *************** *** 578,581 **** --- 576,580 ---- this.jTextFieldAlias.setText(this.myEntity.getAlias()); this.jTextAreaDescription.setText(this.myEntity.getDescription()); + this.dataDict.model.setColumns(this.myEntity.getData()); this.jTextAreaNotes.setText(this.myEntity.getNotes()); *************** *** 589,593 **** this.jComboBoxJavaNamingMethod .setSelectedItem(this.myEntity.getJavaNamingMethod()); - // Enable/Disable components inside 'jPanelSqlProperites' according to the --- 588,591 ---- Index: TableEdit.java =================================================================== RCS file: /cvsroot/nextobjects/nextobjects/nextobjects/src/org/devaki/nextobjects/ui/workspace/models/objects/TableEdit.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** TableEdit.java 9 Jun 2003 17:43:11 -0000 1.6 --- TableEdit.java 5 Jul 2003 12:26:10 -0000 1.7 *************** *** 322,326 **** public void actionPerformed(ActionEvent e) { ! closingWindow(false); } }); --- 322,328 ---- public void actionPerformed(ActionEvent e) { ! dataDict.model.resetColumns(); ! myTable.setData(dataDict.model.getColumns()); ! closingWindow(false); } }); |