Revision: 3934
Author: [email protected]
Date: Tue Aug 31 10:50:28 2010
Log: Resolved #3030 - TablePane links correctly to TableEditPanel when a
table is created in the playpen.
http://code.google.com/p/power-architect/source/detail?r=3934
Modified:
/trunk/src/main/java/ca/sqlpower/architect/swingui/TableEditPanel.java
/trunk/src/main/java/ca/sqlpower/architect/swingui/action/CreateTableAction.java
=======================================
--- /trunk/src/main/java/ca/sqlpower/architect/swingui/TableEditPanel.java
Wed Jul 21 07:16:53 2010
+++ /trunk/src/main/java/ca/sqlpower/architect/swingui/TableEditPanel.java
Tue Aug 31 10:50:28 2010
@@ -58,12 +58,26 @@
private JCheckBox rounded;
private JCheckBox dashed;
- private final TablePane tablePane;
+ private TablePane tablePane;
final HashMap<String, PropertyChangeEvent> propertyConflicts = new
HashMap<String, PropertyChangeEvent>();
final HashMap<String, JComponent> propertyFields = new HashMap<String,
JComponent>();
+ /**
+ * A constructor that uses the given table pane to set parameters on
instead
+ * of looking one up in the play pen.
+ *
+ * @param session
+ * The session the table and table pane belong to or will
belong
+ * to.
+ * @param tp
+ * The table which has a model that this panel will edit.
+ */
+ public TableEditPanel(ArchitectSwingSession session, TablePane tp) {
+ this(session, tp.getModel());
+ tablePane = tp;
+ }
public TableEditPanel(ArchitectSwingSession session, SQLTable t) {
this.panel = new JPanel(new FormLayout());
=======================================
---
/trunk/src/main/java/ca/sqlpower/architect/swingui/action/CreateTableAction.java
Mon Aug 9 15:23:27 2010
+++
/trunk/src/main/java/ca/sqlpower/architect/swingui/action/CreateTableAction.java
Tue Aug 31 10:50:28 2010
@@ -92,7 +92,7 @@
@Override
public DataEntryPanel place(final Point p) throws
SQLObjectException {
- TableEditPanel editPanel = new
TableEditPanel(playpen.getSession(), tp.getModel()) {
+ TableEditPanel editPanel = new
TableEditPanel(playpen.getSession(), tp) {
@Override
public boolean applyChanges() {
String warnings = generateWarnings();