cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [2/4] cayenne git commit: CAY-2288 Tools > Migrate Database Schema: Options: Add any arrow sign to Direction column to make sure it's a dropdown list
Date Thu, 11 May 2017 12:49:17 GMT
CAY-2288 Tools > Migrate Database Schema: Options: Add any arrow sign to Direction column
to make sure it's a dropdown list


Project: http://git-wip-us.apache.org/repos/asf/cayenne/repo
Commit: http://git-wip-us.apache.org/repos/asf/cayenne/commit/17ec08c6
Tree: http://git-wip-us.apache.org/repos/asf/cayenne/tree/17ec08c6
Diff: http://git-wip-us.apache.org/repos/asf/cayenne/diff/17ec08c6

Branch: refs/heads/master
Commit: 17ec08c618490964cf89d590f3e30765eb55f454
Parents: 09b0fdb
Author: Anton Dreka <drekoas@gmail.com>
Authored: Thu May 11 13:08:25 2017 +0300
Committer: Anton Dreka <drekoas@gmail.com>
Committed: Thu May 11 13:08:25 2017 +0300

----------------------------------------------------------------------
 .../db/merge/MergerTokenSelectorController.java     | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/17ec08c6/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorController.java
b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorController.java
index 66f7cae..9591910 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorController.java
@@ -24,11 +24,13 @@ import org.apache.cayenne.dbsync.merge.token.MergerToken;
 import org.apache.cayenne.dbsync.merge.factory.MergerTokenFactory;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.util.CayenneController;
+import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.swing.BindingBuilder;
 import org.apache.cayenne.swing.ObjectBinding;
 
 import javax.swing.*;
 import javax.swing.table.AbstractTableModel;
+import javax.swing.table.DefaultTableCellRenderer;
 import javax.swing.table.TableColumn;
 import javax.swing.table.TableColumnModel;
 import javax.swing.table.TableModel;
@@ -161,12 +163,24 @@ public class MergerTokenSelectorController extends CayenneController
{
         view.getTokens().setModel(model);
 
         TableColumnModel columnModel = view.getTokens().getColumnModel();
-        
+
         // dropdown for direction column
         JComboBox directionCombo = Application.getWidgetFactory().createComboBox(dirs, false);
         directionCombo.setEditable(false);
         TableColumn directionColumn = columnModel.getColumn(
                 MergerTokenTableModel.COL_DIRECTION);
+
+        directionColumn.setCellRenderer(new DefaultTableCellRenderer() {
+            @Override
+            public Component getTableCellRendererComponent(JTable table, Object value,
+                                                           boolean isSelected, boolean hasFocus,
int row, int column) {
+                super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
column);
+                setHorizontalTextPosition(SwingConstants.LEFT);
+                setIcon(ModelerUtil.buildIcon("icon-arrow-open.png"));
+                return this;
+            }
+        });
+
         directionColumn.setCellEditor(new DefaultCellEditor(directionCombo));
 
         columnModel.getColumn(MergerTokenTableModel.COL_SELECT).setPreferredWidth(50);


Mime
View raw message