From b1aee18d366afb32309caa0ae3d43c968f9b19c9 Mon Sep 17 00:00:00 2001 From: willemc Date: Fri, 24 Aug 2007 23:18:39 +0200 Subject: [PATCH] [svn r276] made import work almost --- src/com/idcanet/vasc/core/VascDataSource.java | 1 - src/com/idcanet/vasc/core/VascTable.java | 1 + src/com/idcanet/vasc/impl/DefaultVascTableController.java | 1 + src/com/idcanet/vasc/impl/swing/SwingVascViewRenderer.java | 7 +++++++ src/com/idcanet/vasc/impl/swing/ui/SwingList.java | 5 ----- src/com/idcanet/vasc/impl/swing/ui/SwingTextField.java | 1 - 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/com/idcanet/vasc/core/VascDataSource.java b/src/com/idcanet/vasc/core/VascDataSource.java index 780118b..4363689 100644 --- a/src/com/idcanet/vasc/core/VascDataSource.java +++ b/src/com/idcanet/vasc/core/VascDataSource.java @@ -29,7 +29,6 @@ package com.idcanet.vasc.core; import java.util.List; import java.util.Set; - /** * * @author Willem Cazander diff --git a/src/com/idcanet/vasc/core/VascTable.java b/src/com/idcanet/vasc/core/VascTable.java index cf436a9..1d168a5 100644 --- a/src/com/idcanet/vasc/core/VascTable.java +++ b/src/com/idcanet/vasc/core/VascTable.java @@ -44,6 +44,7 @@ import com.idcanet.vasc.core.ui.VascUIComponent; */ public class VascTable { + private String name = null; private String headerName = null; private String headerImage = null; diff --git a/src/com/idcanet/vasc/impl/DefaultVascTableController.java b/src/com/idcanet/vasc/impl/DefaultVascTableController.java index 4d91056..862b363 100644 --- a/src/com/idcanet/vasc/impl/DefaultVascTableController.java +++ b/src/com/idcanet/vasc/impl/DefaultVascTableController.java @@ -149,6 +149,7 @@ public class DefaultVascTableController implements VascTableController { * @see com.idcanet.vasc.core.VascTableController#refreshData() */ public void refreshData(VascTable table) throws Exception { + table.setSelectedObject(null); table.setTableData(table.getVascDataSource().execute()); fireVascEvent(VascEventListener.VascEventType.DATA_UPDATE, null); } diff --git a/src/com/idcanet/vasc/impl/swing/SwingVascViewRenderer.java b/src/com/idcanet/vasc/impl/swing/SwingVascViewRenderer.java index 8074dd5..fbd685b 100644 --- a/src/com/idcanet/vasc/impl/swing/SwingVascViewRenderer.java +++ b/src/com/idcanet/vasc/impl/swing/SwingVascViewRenderer.java @@ -147,6 +147,11 @@ public class SwingVascViewRenderer implements VascViewRenderer { try { result = table.getVascDataSource().merge(rowBean); } finally { + // todo: make faster + // add to table at position old old object + // then remove old object + // send refresh + table.getVascTableController().refreshData(table); } } @@ -164,6 +169,8 @@ public class SwingVascViewRenderer implements VascViewRenderer { ); if (response==JOptionPane.YES_OPTION) { table.getVascDataSource().delete(rowBean); + table.getTableData().remove(rowBean); + table.setSelectedObject(null); table.getVascTableController().fireVascEvent(VascEventListener.VascEventType.DATA_UPDATE, rowBean); } } diff --git a/src/com/idcanet/vasc/impl/swing/ui/SwingList.java b/src/com/idcanet/vasc/impl/swing/ui/SwingList.java index 7f2e1ac..e2a13ac 100644 --- a/src/com/idcanet/vasc/impl/swing/ui/SwingList.java +++ b/src/com/idcanet/vasc/impl/swing/ui/SwingList.java @@ -29,22 +29,17 @@ package com.idcanet.vasc.impl.swing.ui; import java.awt.Component; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.ListCellRenderer; -import javax.swing.event.ListSelectionEvent; -import javax.swing.event.ListSelectionListener; import com.idcanet.vasc.core.VascTable; import com.idcanet.vasc.core.ui.AbstractVascUIComponent; import com.idcanet.vasc.core.ui.VascList; import com.idcanet.vasc.core.ui.VascSelectItem; -import com.idcanet.vasc.core.ui.VascUIComponent; import com.idcanet.vasc.core.ui.VascValueModel; diff --git a/src/com/idcanet/vasc/impl/swing/ui/SwingTextField.java b/src/com/idcanet/vasc/impl/swing/ui/SwingTextField.java index 5d8fbbb..f2e0684 100644 --- a/src/com/idcanet/vasc/impl/swing/ui/SwingTextField.java +++ b/src/com/idcanet/vasc/impl/swing/ui/SwingTextField.java @@ -52,7 +52,6 @@ public class SwingTextField extends AbstractVascUIComponent { return def; } - } class TextListener implements DocumentListener {