cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject [3/5] cayenne git commit: Global Modeler update and bug fixing. Major changes: - CAY-2300 New icons and design improvements - alert istead of silent fail for edit relationship without target - closes #206 CAY-2287 - closes #209 inheritance icon allow
Date Wed, 10 May 2017 14:17:40 GMT
http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
index 1af8a03..00eb888 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/AbstractCallbackMethodsTab.java
@@ -184,11 +184,12 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
         this.setLayout(new BorderLayout());
 
         toolBar = new JToolBar();
+        toolBar.setFloatable(false);
         toolBar.add(getRemoveCallbackMethodAction().buildButton());
         toolBar.addSeparator(new Dimension(10, 0));
-	    toolBar.add(getCopyCallbackMethodAction().buildButton());
-	    toolBar.add(getCutCallbackMethodAction().buildButton());
-        toolBar.add(getPasteCallbackMethodAction().buildButton());
+	    toolBar.add(getCopyCallbackMethodAction().buildButton(1));
+	    toolBar.add(getCutCallbackMethodAction().buildButton(2));
+        toolBar.add(getPasteCallbackMethodAction().buildButton(3));
 
         add(toolBar, BorderLayout.NORTH);
 
@@ -246,12 +247,12 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
             	tables[i].changeSelection(row, 0, false, false);
             }
         });
-        
-        for(int i = 0; i < tables.length; i++) {
-	        mediator.getApplication().getActionManager().setupCutCopyPaste(
-	                tables[i],
-	                CutCallbackMethodAction.class,
-	                CopyCallbackMethodAction.class);
+
+        for (CayenneTable table : tables) {
+            mediator.getApplication().getActionManager().setupCutCopyPaste(
+                    table,
+                    CutCallbackMethodAction.class,
+                    CopyCallbackMethodAction.class);
         }
     }
 
@@ -266,14 +267,12 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
        		
        		CallbackType callbackType = callbackTypes[i];
   
-       		List<String> methods = new ArrayList<String>();
+       		List<String> methods = new ArrayList<>();
        		CallbackDescriptor descriptor = null;
        		
        		if (callbackMap != null && callbackType != null) {
        			descriptor = callbackMap.getCallbackDescriptor(callbackType.getType());
-       	        for (String callbackMethod : descriptor.getCallbackMethods()) {
-       	        	methods.add(callbackMethod);
-       	        }
+                methods.addAll(descriptor.getCallbackMethods());
        	    }
         		
             CallbackDescriptorTableModel model = new CallbackDescriptorTableModel(
@@ -285,9 +284,10 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
             
             tables[i].setModel(model);
         }
-       	
-       	for(int i = 0; i < tables.length; i++)
-       		tablePreferences.bind(tables[i], null, null, null);
+
+        for (CayenneTable table : tables) {
+            tablePreferences.bind(table, null, null, null);
+        }
     }
     
     private void createTables() {
@@ -311,7 +311,8 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
 
         // drag-and-drop initialization
     	cayenneTable.setDragEnabled(true);
-    	
+
+    	cayenneTable.setSortable(false);
 	    cayenneTable.setRowHeight(25);
 	    cayenneTable.setRowMargin(3);
 	    cayenneTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
@@ -329,7 +330,7 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
         		cayenneTable, 
         		getCreateCallbackMethodAction().buildButton(),
         		new ButtonListener(callbackType), 
-        		ModelerUtil.buildIcon("icon-create-method.gif"));
+        		ModelerUtil.buildIcon("icon-create-method.png"));
 	    
 	    return cayenneTable;
     }
@@ -357,7 +358,7 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
     }
     
     private void addButtonAtHeader(JTable table, JButton button, ActionListener buttonListener, ImageIcon buttonIcon){
-        PanelBuilder builder = new PanelBuilder(new FormLayout("left:10dlu, 2dlu", "center:10dlu"));
+        PanelBuilder builder = new PanelBuilder(new FormLayout("left:10dlu, 2dlu", "center:14dlu"));
         CellConstraints cc = new CellConstraints();
         
         button.setIcon(buttonIcon);
@@ -374,15 +375,14 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
         JTableHeader header = table.getTableHeader();
         header.setLayout(new BorderLayout());
         header.setReorderingAllowed(false);
-        header.setPreferredSize(new Dimension(150, 20));
+        header.setPreferredSize(new Dimension(150, 22));
         header.add(buttonPanel, BorderLayout.EAST);
     }
 
-    class ButtonListener implements ActionListener  
-    {  
+    class ButtonListener implements ActionListener {
     	private CallbackType callbackType;
     	
-    	public ButtonListener(CallbackType callbackType){
+    	public ButtonListener(CallbackType callbackType) {
     		this.callbackType = callbackType;
     	}
     	
@@ -449,20 +449,17 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
             if (canImport(comp, t.getTransferDataFlavors())) {
                 String callbackMethod;
                 try {
-                    callbackMethod = (String) t
-                            .getTransferData(DataFlavor.stringFlavor);
-                }
-                catch (Exception e) {
+                    callbackMethod = (String) t.getTransferData(DataFlavor.stringFlavor);
+                } catch (Exception e) {
                     logger.warn("Error transferring", e);
                     return false;
                 }
 
                 int rowIndex = table.getSelectedRow();
 
-                CallbackDescriptor callbackDescriptor = ((CallbackDescriptorTableModel)table.getCayenneModel()).getCallbackDescriptor();
-                mediator.setDirty(callbackDescriptor.moveMethod(
-                        callbackMethod,
-                        rowIndex));
+                CallbackDescriptor callbackDescriptor =
+                        ((CallbackDescriptorTableModel)table.getCayenneModel()).getCallbackDescriptor();
+                mediator.setDirty(callbackDescriptor.moveMethod(callbackMethod, rowIndex));
                 rebuildTables();
                 return true;
             }
@@ -493,19 +490,18 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
             	ObjCallbackMethod[] methods = new ObjCallbackMethod[0];
 
                 if(!((ListSelectionModel)e.getSource()).isSelectionEmpty()) {
-	                for(int i = 0; i < tables.length; i++) {
-	                	if(!tables[i].equals(table)) {
-	                		tables[i].clearSelection();
-	                		if(tables[i].getCellEditor() != null) {
-	                			tables[i].getCellEditor().stopCellEditing();
-	                		}
-	                	}
-	                }
+                    for (CayenneTable nextTable : tables) {
+                        if (!nextTable.equals(table)) {
+                            nextTable.clearSelection();
+                            if (nextTable.getCellEditor() != null) {
+                                nextTable.getCellEditor().stopCellEditing();
+                            }
+                        }
+                    }
 
 	                mediator.setCurrentCallbackType(((CallbackDescriptorTableModel)table.getCayenneModel()).getCallbackType());
                 }
 
-            	
                 if (table.getSelectedRow() != -1) {
                     int[] sel = table.getSelectedRows();
                     CallbackType callbackType = mediator.getCurrentCallbackType();
@@ -513,28 +509,23 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
                     methods = new ObjCallbackMethod[sel.length];
                                         
                     for (int i = 0; i < sel.length; i++) {
-                    	String methodName = (String) table
-                                .getValueAt(
-                                        sel[i],
-                                        table
-                                                .convertColumnIndexToView(CallbackDescriptorTableModel.METHOD_NAME));
+                    	String methodName = (String) table.getValueAt(
+                    	        sel[i],
+                                table.convertColumnIndexToView(CallbackDescriptorTableModel.METHOD_NAME));
                     	methods[i] = new ObjCallbackMethod(methodName, callbackType);
                     }
                 }
 
                 mediator.setCurrentCallbackMethods(methods);
-                getRemoveCallbackMethodAction().setEnabled(methods.length > 0);
-                getRemoveCallbackMethodAction().setName(
-                        getRemoveCallbackMethodAction().getActionName(
-                                methods.length > 1));
-                getCopyCallbackMethodAction().setEnabled(methods.length > 0);
-                getCopyCallbackMethodAction().setName(
-                		getCopyCallbackMethodAction().getActionName(
-                                methods.length > 1));
-                getCutCallbackMethodAction().setEnabled(methods.length > 0);
-                getCutCallbackMethodAction().setName(
-                		getCutCallbackMethodAction().getActionName(
-                                methods.length > 1));            
+                boolean enabled = methods.length > 0;
+                boolean multiple = methods.length > 1;
+
+                getRemoveCallbackMethodAction().setEnabled(enabled);
+                getRemoveCallbackMethodAction().setName(getRemoveCallbackMethodAction().getActionName(multiple));
+                getCopyCallbackMethodAction().setEnabled(enabled);
+                getCopyCallbackMethodAction().setName(getCopyCallbackMethodAction().getActionName(multiple));
+                getCutCallbackMethodAction().setEnabled(enabled);
+                getCutCallbackMethodAction().setName(getCutCallbackMethodAction().getActionName(multiple));
             }
         }
     }
@@ -547,14 +538,9 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
     		this.table = table;
     	}
     	
-	    public void columnMarginChanged(ChangeEvent e)
-	    {
-	        if(!table.getColumnWidthChanged())
-	        {
-	            if(table.getTableHeader().getResizingColumn() != null)
-	            {
-	            	table.setColumnWidthChanged(true);
-	            }
+	    public void columnMarginChanged(ChangeEvent e) {
+	        if(!table.getColumnWidthChanged() && table.getTableHeader().getResizingColumn() != null) {
+                table.setColumnWidthChanged(true);
 	        }
 	    }
 	
@@ -584,13 +570,11 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
     	}
     	
     	@Override
-	    public void mouseReleased(MouseEvent e)
-	    {
-	    	if(table.getColumnWidthChanged())
-	        {
-		    	for(int i=0; i<tables.length; i++) {
-	    			tables[i].getColumnModel().getColumn(0).setPreferredWidth(table.getWidth());
-		    	}
+	    public void mouseReleased(MouseEvent e) {
+	    	if(table.getColumnWidthChanged()) {
+                for (CayenneTable nextTable : tables) {
+                    nextTable.getColumnModel().getColumn(0).setPreferredWidth(table.getWidth());
+                }
 		    	
 		    	initTablePreferences();
 	        	table.setColumnWidthChanged(false);
@@ -598,8 +582,7 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
 	    }
 	    
     	@Override
-	    public void mousePressed(MouseEvent e)
-	    {
+	    public void mousePressed(MouseEvent e) {
     		if (e.isPopupTrigger() && e.getComponent() instanceof JTableHeader ) {
 
     			unselectAll();
@@ -622,14 +605,13 @@ public abstract class AbstractCallbackMethodsTab extends JPanel {
 		}
 		
 		public void mouseDragged(MouseEvent e) {
-	    	if(table.getColumnWidthChanged())
-	        {
+	    	if(table.getColumnWidthChanged()) {
 	    		tablePreferences.bind(table, null, null, null);
-		    	for(int i=0; i<tables.length; i++) {
-		    		if(!table.equals(tables[i])) {
-		    			tables[i].getColumnModel().getColumn(0).setPreferredWidth(table.getWidth());
-		    		}
-		    	}
+                for (CayenneTable nextTable : tables) {
+                    if (!table.equals(nextTable)) {
+                        nextTable.getColumnModel().getColumn(0).setPreferredWidth(table.getWidth());
+                    }
+                }
 	        }
 		}
 	}

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java
index 36591f4..fb22972 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java
@@ -29,10 +29,8 @@ import org.apache.cayenne.modeler.util.CayenneTableModel;
 
 /**
  * Table model for displaying methods list for a particular CallbackDescriptor
- * 
- * @version 1.0 Oct 23, 2007
  */
-public class CallbackDescriptorTableModel extends CayenneTableModel {
+public class CallbackDescriptorTableModel extends CayenneTableModel<String> {
 
     private static final int COLUMN_COUNT = 1;
     public static final int METHOD_NAME = 0;
@@ -49,7 +47,7 @@ public class CallbackDescriptorTableModel extends CayenneTableModel {
      * @param callbackDescriptor callback descriptor instance
      */
     public CallbackDescriptorTableModel(ProjectController mediator, Object eventSource,
-            List objectList, CallbackDescriptor callbackDescriptor, CallbackType callbackType) {
+            List<String> objectList, CallbackDescriptor callbackDescriptor, CallbackType callbackType) {
         super(mediator, eventSource, objectList);
         this.callbackDescriptor = callbackDescriptor;
         this.callbackType = callbackType;
@@ -78,7 +76,7 @@ public class CallbackDescriptorTableModel extends CayenneTableModel {
      * @return callback method for the specified index
      */
     public String getCallbackMethod(int rowIndex) {
-        return (String) objectList.get(rowIndex);
+        return objectList.get(rowIndex);
     }
 
     /**
@@ -105,13 +103,6 @@ public class CallbackDescriptorTableModel extends CayenneTableModel {
     }
 
     /**
-     * sorting disabled
-     */
-    protected void orderList() {
-        // NOOP
-    }
-
-    /**
      * @param column column index
      * @return column name
      */
@@ -142,12 +133,11 @@ public class CallbackDescriptorTableModel extends CayenneTableModel {
         if (method != null) {
             method = method.trim();
         }
-        String prevMethod = (String) getObjectList().get(row);
+        String prevMethod = getObjectList().get(row);
 
         if (method != null && method.length() > 0) {
             // check that method changed and name is not duplicate
-            if (!method.equals(prevMethod)
-                    && !getCallbackDescriptor().getCallbackMethods().contains(method)) {
+            if (!method.equals(prevMethod) && !getCallbackDescriptor().getCallbackMethods().contains(method)) {
                 // update model
                 getObjectList().set(row, method);
 
@@ -163,7 +153,6 @@ public class CallbackDescriptorTableModel extends CayenneTableModel {
                         MapEvent.CHANGE));
             }
         }
-
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
index f80d2b7..e9b3290 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
@@ -51,7 +51,6 @@ import org.slf4j.LoggerFactory;
 
 import javax.swing.Action;
 import javax.swing.BorderFactory;
-import javax.swing.Box;
 import javax.swing.JButton;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -174,22 +173,23 @@ public class EditorView extends JPanel implements ObjEntityDisplayListener,
 	}
 
 	private void initView() {
-
+	    setBorder(BorderFactory.createEmptyBorder(1, 0, 0, 1));
         // init widgets
-        JButton collapseButton = getAction(CollapseTreeAction.class).buildButton();
-        collapseButton.setPreferredSize(new Dimension(30, 20));
-        JButton filterButton = getAction(FilterAction.class).buildButton();
-        filterButton.setPreferredSize(new Dimension(30, 20));
         actionManager.getAction(CollapseTreeAction.class).setAlwaysOn(true);
         actionManager.getAction(FilterAction.class).setAlwaysOn(true);
+        actionManager.getAction(FilterAction.class).resetDialog();
 
         JToolBar barPanel = new JToolBar();
-        barPanel.setMinimumSize(new Dimension(75, 25));
-        barPanel.setBorder(BorderFactory.createEtchedBorder());
+        barPanel.setFloatable(false);
+        barPanel.setMinimumSize(new Dimension(75, 30));
+        barPanel.setBorder(BorderFactory.createEmptyBorder());
         barPanel.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
-        barPanel.add(Box.createHorizontalStrut(3));
+
+        JButton collapseButton = getAction(CollapseTreeAction.class).buildButton(1);
+        JButton filterButton = getAction(FilterAction.class).buildButton(3);
+        filterButton.setPreferredSize(new Dimension(30, 30));
+        collapseButton.setPreferredSize(new Dimension(30, 30));
         barPanel.add(filterButton);
-        barPanel.addSeparator();
         barPanel.add(collapseButton);
 
         treePanel = new ProjectTreeView(eventController);
@@ -199,12 +199,14 @@ public class EditorView extends JPanel implements ObjEntityDisplayListener,
         treeNavigatePanel.setLayout(new BorderLayout());
         treeNavigatePanel.add(treePanel, BorderLayout.CENTER);
 
-        this.detailPanel = new JPanel();
-        this.splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
-        this.leftPanel = new JPanel(new BorderLayout());
+        detailPanel = new JPanel();
+        splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true);
+        splitPane.setDividerSize(2);
+        splitPane.setBorder(BorderFactory.createEmptyBorder());
+        leftPanel = new JPanel(new BorderLayout());
         // assemble...
 
-        this.detailLayout = new CardLayout();
+        detailLayout = new CardLayout();
         detailPanel.setLayout(detailLayout);
 
         // some but not all panels must be wrapped in a scroll pane
@@ -249,14 +251,15 @@ public class EditorView extends JPanel implements ObjEntityDisplayListener,
         detailPanel.add(dbDetailView, DB_VIEW);
 
         leftPanel.add(barPanel, BorderLayout.NORTH);
-        leftPanel.add(new JScrollPane(treeNavigatePanel), BorderLayout.CENTER);
+        leftPanel.setBorder(BorderFactory.createEmptyBorder());
+        JScrollPane scrollPane = new JScrollPane(treeNavigatePanel);
+        scrollPane.setBorder(BorderFactory.createEmptyBorder());
+        leftPanel.add(scrollPane, BorderLayout.CENTER);
         splitPane.setLeftComponent(leftPanel);
         splitPane.setRightComponent(detailPanel);
 
         setLayout(new BorderLayout());
         add(splitPane, BorderLayout.CENTER);
-        
-       
     }
     
     private <T extends Action> T getAction(Class<T> type) {
@@ -276,63 +279,38 @@ public class EditorView extends JPanel implements ObjEntityDisplayListener,
         eventController.addQueryDisplayListener(this);
         eventController.addMultipleObjectsDisplayListener(this);
         eventController.addEmbeddableDisplayListener(this);
-          
-        /**
-         * Moving this to try-catch block per CAY-940. Exception will be stack-traced
-         */
-        try {
-            ComponentGeometry geometry = new ComponentGeometry(
-                    this.getClass(),
-                    "splitPane/divider");
 
-            geometry
-                    .bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 150);
-        }
-        catch (Exception ex) {
+        // Moving this to try-catch block per CAY-940. Exception will be stack-traced
+        try {
+            ComponentGeometry geometry = new ComponentGeometry(this.getClass(), "splitPane/divider");
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, 150);
+        } catch (Exception ex) {
             LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
         }
     }
 
     public void currentProcedureChanged(ProcedureDisplayEvent e) {
-        if (e.getProcedure() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, PROCEDURE_VIEW);
+        detailLayout.show(detailPanel, e.getProcedure() == null ? EMPTY_VIEW : PROCEDURE_VIEW);
     }
 
     public void currentDomainChanged(DomainDisplayEvent e) {
-        if (e.getDomain() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, DOMAIN_VIEW);
+        detailLayout.show(detailPanel, e.getDomain() == null ? EMPTY_VIEW : DOMAIN_VIEW);
     }
 
     public void currentDataNodeChanged(DataNodeDisplayEvent e) {
-        if (e.getDataNode() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, NODE_VIEW);
+        detailLayout.show(detailPanel, e.getDataNode() == null ? EMPTY_VIEW : NODE_VIEW);
     }
 
     public void currentDataMapChanged(DataMapDisplayEvent e) {
-        if (e.getDataMap() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, DATA_MAP_VIEW);
+        detailLayout.show(detailPanel, e.getDataMap() == null ? EMPTY_VIEW : DATA_MAP_VIEW);
     }
 
     public void currentObjEntityChanged(EntityDisplayEvent e) {
-        if (e.getEntity() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, OBJ_VIEW);
+	    detailLayout.show(detailPanel, e.getEntity() == null ? EMPTY_VIEW : OBJ_VIEW);
     }
 
     public void currentDbEntityChanged(EntityDisplayEvent e) {
-        if (e.getEntity() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, DB_VIEW);
+        detailLayout.show(detailPanel, e.getEntity() == null ? EMPTY_VIEW : DB_VIEW);
     }
 
     public void currentQueryChanged(QueryDisplayEvent e) {
@@ -356,16 +334,11 @@ public class EditorView extends JPanel implements ObjEntityDisplayListener,
         }
     }
 
-    public void currentObjectsChanged(
-            MultipleObjectsDisplayEvent e,
-            Application application) {
+    public void currentObjectsChanged(MultipleObjectsDisplayEvent e, Application application) {
         detailLayout.show(detailPanel, EMPTY_VIEW);
     }
 
     public void currentEmbeddableChanged(EmbeddableDisplayEvent e) {
-        if (e.getEmbeddable() == null)
-            detailLayout.show(detailPanel, EMPTY_VIEW);
-        else
-            detailLayout.show(detailPanel, EMBEDDABLE_VIEW);
+        detailLayout.show(detailPanel, e.getEmbeddable() == null ? EMPTY_VIEW : EMBEDDABLE_VIEW);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java
index 098cf82..805851d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableAttributeTab.java
@@ -79,6 +79,7 @@ public class EmbeddableAttributeTab extends JPanel implements
         this.setLayout(new BorderLayout());
 
         JToolBar toolBar = new JToolBar();
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
 
         toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
@@ -87,9 +88,9 @@ public class EmbeddableAttributeTab extends JPanel implements
         toolBar.add(actionManager.getAction(RemoveAttributeAction.class).buildButton());
         toolBar.addSeparator();
 
-        toolBar.add(actionManager.getAction(CutAttributeAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CopyAttributeAction.class).buildButton());
-        toolBar.add(actionManager.getAction(PasteAction.class).buildButton());
+        toolBar.add(actionManager.getAction(CutAttributeAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CopyAttributeAction.class).buildButton(2));
+        toolBar.add(actionManager.getAction(PasteAction.class).buildButton(3));
 
         add(toolBar, BorderLayout.NORTH);
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java
index c32a0e4..cf2040b 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EmbeddableTab.java
@@ -23,6 +23,7 @@ import java.util.Collection;
 import java.util.EventObject;
 import java.util.Iterator;
 
+import javax.swing.BorderFactory;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 import javax.swing.JToolBar;
@@ -66,6 +67,8 @@ public class EmbeddableTab extends JPanel implements EmbeddableDisplayListener {
         this.setLayout(new BorderLayout());
 
         JToolBar toolBar = new JToolBar();
+        toolBar.setBorder(BorderFactory.createEmptyBorder());
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
         toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
index f50143b..2e160f8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributePanel.java
@@ -32,6 +32,7 @@ import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.action.ActionManager;
 import org.apache.cayenne.modeler.action.CopyAttributeRelationshipAction;
 import org.apache.cayenne.modeler.action.CutAttributeRelationshipAction;
+import org.apache.cayenne.modeler.action.ObjEntityToSuperEntityAction;
 import org.apache.cayenne.modeler.action.PasteAction;
 import org.apache.cayenne.modeler.action.RemoveAttributeRelationshipAction;
 import org.apache.cayenne.modeler.dialog.objentity.ObjAttributeInfoDialog;
@@ -51,6 +52,7 @@ import org.apache.cayenne.modeler.util.PanelFactory;
 import org.apache.cayenne.modeler.util.ProjectUtil;
 import org.apache.cayenne.modeler.util.UIUtil;
 import org.apache.cayenne.modeler.util.combo.AutoCompletion;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 
 import javax.swing.BorderFactory;
 import javax.swing.Icon;
@@ -63,6 +65,7 @@ import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
+import javax.swing.UIManager;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.table.DefaultTableCellRenderer;
@@ -74,6 +77,8 @@ import java.awt.Component;
 import java.awt.Font;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashMap;
@@ -130,8 +135,23 @@ public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayL
                 ObjAttributeTableModel.class,
                 "objEntity/attributeTable");
 
+        // go to SuperEntity from ObjEntity by inheritance icon
+        table.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseReleased(MouseEvent e) {
+                int row = table.rowAtPoint(e.getPoint());
+                int col = table.columnAtPoint(e.getPoint());
+                if (row >= 0 && col == ObjAttributeTableModel.INHERITED) {
+                    if (Boolean.TRUE.equals(table.getValueAt(row, col))) {
+                        ActionManager actionManager = Application.getInstance().getActionManager();
+                        actionManager.getAction(ObjEntityToSuperEntityAction.class).performAction(null);
+                    }
+                }
+            }
+        });
+
         // Create and install a popup
-        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
+        Icon ico = ModelerUtil.buildIcon("icon-edit.png");
         resolveMenu = new JMenuItem("Database Mapping", ico);
 
         JPopupMenu popup = new JPopupMenu();
@@ -441,11 +461,16 @@ public class ObjEntityAttributePanel extends JPanel implements ObjEntityDisplayL
                 setIcon(null);
             } else {
                 if (attribute.isInherited()) {
-                    ImageIcon objEntityIcon = ModelerUtil.buildIcon("icon-override.gif");
+                    Icon objEntityIcon = ModelerUtil.buildIcon("icon-inheritance.png");
+                    if(isSelected) {
+                        objEntityIcon = FilteredIconFactory
+                                .createIcon(objEntityIcon, FilteredIconFactory.FilterType.SELECTION);
+                    }
                     setIcon(objEntityIcon);
                 }
                 setText("");
             }
+            setFont(UIManager.getFont("Label.font"));
             setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
 
             return this;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeRelationshipTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeRelationshipTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeRelationshipTab.java
index e44af8d..3e939a8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeRelationshipTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityAttributeRelationshipTab.java
@@ -34,7 +34,9 @@ import org.apache.cayenne.modeler.action.RemoveAttributeRelationshipAction;
 import org.apache.cayenne.modeler.event.EntityDisplayEvent;
 import org.apache.cayenne.modeler.event.ObjEntityDisplayListener;
 import org.apache.cayenne.modeler.pref.ComponentGeometry;
+import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.ModelerUtil;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 import org.slf4j.LoggerFactory;
 
 import javax.swing.Icon;
@@ -53,7 +55,7 @@ public class ObjEntityAttributeRelationshipTab extends JPanel implements ObjEnti
 
     public ObjEntityAttributePanel attributePanel;
     public ObjEntityRelationshipPanel relationshipPanel;
-    public JButton resolve = new JButton();
+    public JButton resolve = new CayenneAction.CayenneToolbarButton(null, 0);
     private JSplitPane splitPane;
 
     private ProjectController mediator;
@@ -85,8 +87,7 @@ public class ObjEntityAttributeRelationshipTab extends JPanel implements ObjEnti
                     this.getClass(),
                     "objEntityAttrRelTab/splitPane/divider");
 
-            geometry
-                    .bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
         }
         catch (Exception ex) {
             LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
@@ -97,17 +98,20 @@ public class ObjEntityAttributeRelationshipTab extends JPanel implements ObjEnti
 
     private void initToolBar() {
         toolBar = new JToolBar();
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
 
-        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton());
-        toolBar.add(actionManager.getAction(ObjEntitySyncAction.class).buildButton());
-        toolBar.add(actionManager.getAction(ObjEntityCounterpartAction.class).buildButton());
+        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton(3));
+        toolBar.addSeparator();
+        toolBar.add(actionManager.getAction(ObjEntitySyncAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(ObjEntityCounterpartAction.class).buildButton(3));
         toolBar.addSeparator();
 
-        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
+        Icon ico = ModelerUtil.buildIcon("icon-edit.png");
         resolve.setToolTipText("Edit");
         resolve.setIcon(ico);
+        resolve.setDisabledIcon(FilteredIconFactory.createDisabledIcon(ico));
         toolBar.add(resolve).setEnabled(false);
 
         cut = actionManager.getAction(CutAttributeRelationshipAction.class);
@@ -117,9 +121,9 @@ public class ObjEntityAttributeRelationshipTab extends JPanel implements ObjEnti
         toolBar.addSeparator();
         toolBar.add(remove.buildButton());
         toolBar.addSeparator();
-        toolBar.add(cut.buildButton());
-        toolBar.add(copy.buildButton());
-        toolBar.add(actionManager.getAction(PasteAction.class).buildButton());
+        toolBar.add(cut.buildButton(1));
+        toolBar.add(copy.buildButton(2));
+        toolBar.add(actionManager.getAction(PasteAction.class).buildButton(3));
 
         add(toolBar, BorderLayout.NORTH);
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
index 3d15491..133eb72 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityRelationshipPanel.java
@@ -44,6 +44,7 @@ import org.apache.cayenne.modeler.util.DbRelationshipPathComboBoxEditor;
 import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.modeler.util.PanelFactory;
 import org.apache.cayenne.modeler.util.UIUtil;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -58,6 +59,7 @@ import javax.swing.JPanel;
 import javax.swing.JPopupMenu;
 import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
+import javax.swing.UIManager;
 import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;
 import javax.swing.event.TableModelEvent;
@@ -67,6 +69,7 @@ import javax.swing.table.TableColumn;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
+import java.awt.Font;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
 import java.util.Collection;
@@ -128,10 +131,8 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
                 ObjRelationshipTableModel.class,
                 "objEntity/relationshipTable");
 
-        /**
-         * Create and install a popup
-         */
-        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
+        // Create and install a popup
+        Icon ico = ModelerUtil.buildIcon("icon-edit.png");
         resolveMenu = new JMenuItem("Database Mapping", ico);
 
         JPopupMenu popup = new JPopupMenu();
@@ -384,7 +385,12 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
                     row,
                     column);
 
-            setIcon(CellRenderers.iconForObject(oldValue));
+            Icon icon = CellRenderers.iconForObject(oldValue);
+            if(isSelected) {
+                icon = FilteredIconFactory.createIcon(icon, FilteredIconFactory.FilterType.SELECTION);
+                setForeground(UIManager.getColor("Table.selectionForeground"));
+            }
+            setIcon(icon);
             return this;
         }
     }
@@ -427,6 +433,7 @@ public class ObjEntityRelationshipPanel extends JPanel implements ObjEntityDispl
                         : table.getForeground());
             }
             setBorder(BorderFactory.createEmptyBorder(0,5,0,0));
+            setFont(UIManager.getFont("Label.font"));
 
             return this;
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
index e9bc159..e720bd8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
@@ -29,6 +29,7 @@ import java.util.EventObject;
 import java.util.LinkedList;
 import java.util.List;
 
+import javax.swing.BorderFactory;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -130,17 +131,18 @@ public class ObjEntityTab extends JPanel implements ObjEntityDisplayListener,
         this.setLayout(new BorderLayout());
 
         JToolBar toolBar = new JToolBar();
+        toolBar.setBorder(BorderFactory.createEmptyBorder());
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
 
-        toolBar.add(actionManager.getAction(ObjEntitySyncAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
-        toolBar
-                .add(actionManager
-                        .getAction(CreateRelationshipAction.class)
-                        .buildButton());
+        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton(3));
+        toolBar.addSeparator();
+        toolBar.add(actionManager.getAction(ObjEntitySyncAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(ObjEntityCounterpartAction.class).buildButton(3));
         toolBar.addSeparator();
         toolBar.add(actionManager.getAction(ShowGraphEntityAction.class).buildButton());
-        toolBar.add(actionManager.getAction(ObjEntityCounterpartAction.class).buildButton());
+
         add(toolBar, BorderLayout.NORTH);
 
         // create widgets
@@ -234,11 +236,8 @@ public class ObjEntityTab extends JPanel implements ObjEntityDisplayListener,
 
         clientSeparator = builder.appendSeparator("Java Client");
         serverOnlyLabel = builder.append("Not for Client Use:", serverOnly);
-        clientClassNameLabel = builder.append("Client Java Class:", clientClassName
-                .getComponent());
-        clientSuperClassNameLabel = builder.append(
-                "Client Superclass:",
-                clientSuperClassName.getComponent());
+        clientClassNameLabel = builder.append("Client Java Class:", clientClassName.getComponent());
+        clientSuperClassNameLabel = builder.append("Client Superclass:", clientSuperClassName.getComponent());
 
         add(builder.getPanel(), BorderLayout.CENTER);
     }
@@ -476,7 +475,6 @@ public class ObjEntityTab extends JPanel implements ObjEntityDisplayListener,
         dbEntityCombo.setEnabled(!isUsedInheritance);
 
         // toggle visibilty and editability rules
-        
         toggleClientFieldsVisible(map.isClientSupported());
         toggleEnabled(entity.getSuperEntityName() == null, !entity.isServerOnly());
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java
index 6db7b65..c1be0d4 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTab.java
@@ -60,15 +60,15 @@ import org.apache.cayenne.modeler.event.ProcedureDisplayListener;
 import org.apache.cayenne.modeler.event.ProcedureParameterDisplayEvent;
 import org.apache.cayenne.modeler.event.TablePopupHandler;
 import org.apache.cayenne.modeler.pref.TableColumnPreferences;
+import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.CayenneCellEditor;
 import org.apache.cayenne.modeler.util.CayenneTable;
 import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.modeler.util.PanelFactory;
 import org.apache.cayenne.modeler.util.UIUtil;
 import org.apache.cayenne.modeler.util.combo.AutoCompletion;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 
-/**
- */
 public class ProcedureParameterTab extends JPanel implements ProcedureParameterListener,
         ProcedureDisplayListener, ExistingSelectionProcessor, ActionListener {
 
@@ -81,7 +81,7 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
     protected JButton moveDown;
 
     /**
-     * By now popup menu items are made similiar to toolbar button. (i.e. all
+     * By now popup menu items are made similar to toolbar button. (i.e. all
      * functionality is here) This should be probably refactored as Action.
      */
     protected JMenuItem removeParameterMenu;
@@ -114,37 +114,33 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
         setLayout(new BorderLayout());
 
         JToolBar toolBar = new JToolBar();
+        toolBar.setFloatable(false);
 
         ActionManager actionManager = Application.getInstance().getActionManager();
-        toolBar.add(actionManager
-                .getAction(CreateProcedureParameterAction.class)
-                .buildButton());
-        removeParameterButton = actionManager.getAction(
-                RemoveProcedureParameterAction.class).buildButton();
+        toolBar.add(actionManager.getAction(CreateProcedureParameterAction.class).buildButton(1));
+        removeParameterButton = actionManager.getAction(RemoveProcedureParameterAction.class).buildButton(3);
         toolBar.add(removeParameterButton);
         toolBar.addSeparator();
 
-        Icon up = ModelerUtil.buildIcon("icon-move_up.gif");
-        Icon down = ModelerUtil.buildIcon("icon-move_down.gif");
+        Icon up = ModelerUtil.buildIcon("icon-up.png");
+        Icon down = ModelerUtil.buildIcon("icon-down.png");
 
-        moveUp = new JButton();
+        moveUp = new CayenneAction.CayenneToolbarButton(null, 1);
         moveUp.setIcon(up);
+        moveUp.setDisabledIcon(FilteredIconFactory.createDisabledIcon(up));
         moveUp.setToolTipText("Move Parameter Up");
         toolBar.add(moveUp);
 
-        moveDown = new JButton();
+        moveDown = new CayenneAction.CayenneToolbarButton(null, 3);
         moveDown.setIcon(down);
+        moveDown.setDisabledIcon(FilteredIconFactory.createDisabledIcon(down));
         moveDown.setToolTipText("Move Parameter Down");
         toolBar.add(moveDown);
 
         toolBar.addSeparator();
-        toolBar.add(actionManager
-                .getAction(CutProcedureParameterAction.class)
-                .buildButton());
-        toolBar.add(actionManager
-                .getAction(CopyProcedureParameterAction.class)
-                .buildButton());
-        toolBar.add(actionManager.getAction(PasteAction.class).buildButton());
+        toolBar.add(actionManager.getAction(CutProcedureParameterAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CopyProcedureParameterAction.class).buildButton(2));
+        toolBar.add(actionManager.getAction(PasteAction.class).buildButton(3));
 
         add(toolBar, BorderLayout.NORTH);
 
@@ -201,8 +197,7 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
         int selectedRow = table.getSelectedRow();
         if (selectedRow >= 0) {
             enableRemoveButton = true;
-            ProcedureParameterTableModel model = (ProcedureParameterTableModel) table
-                    .getModel();
+            ProcedureParameterTableModel model = (ProcedureParameterTableModel) table.getModel();
 
             int[] sel = table.getSelectedRows();
             parameters = new ProcedureParameter[sel.length];
@@ -260,12 +255,12 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
                 parameters.length,
                 RemoveProcedureParameterAction.class,
                 CutProcedureParameterAction.class,
-                CopyProcedureParameterAction.class);
+                CopyProcedureParameterAction.class
+        );
 
-        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table
-                .getModel();
+        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table.getModel();
 
-        List listAttrs = model.getObjectList();
+        List<ProcedureParameter> listAttrs = model.getObjectList();
         int[] newSel = new int[parameters.length];
 
         for (int i = 0; i < parameters.length; i++) {
@@ -286,27 +281,25 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
         table.setRowMargin(3);
 
         // number column tweaking
-        TableColumn numberColumn = table.getColumnModel().getColumn(
-                ProcedureParameterTableModel.PARAMETER_NUMBER);
+        TableColumn numberColumn = table.getColumnModel()
+                .getColumn(ProcedureParameterTableModel.PARAMETER_NUMBER);
         DefaultTableCellRenderer renderer = new DefaultTableCellRenderer();
         renderer.setHorizontalAlignment(SwingConstants.CENTER);
         numberColumn.setCellRenderer(renderer);
 
-        TableColumn typesColumn = table.getColumnModel().getColumn(
-                ProcedureParameterTableModel.PARAMETER_TYPE);
-        JComboBox typesEditor = Application.getWidgetFactory().createComboBox(
-                TypesMapping.getDatabaseTypes(),
-                true);
+        TableColumn typesColumn = table.getColumnModel()
+                .getColumn(ProcedureParameterTableModel.PARAMETER_TYPE);
+        JComboBox typesEditor = Application.getWidgetFactory()
+                .createComboBox(TypesMapping.getDatabaseTypes(), true);
         AutoCompletion.enable(typesEditor);
-        typesColumn.setCellEditor(Application.getWidgetFactory().createCellEditor(
-                typesEditor));
+        typesColumn.setCellEditor(Application.getWidgetFactory()
+                .createCellEditor(typesEditor));
 
         // direction column tweaking
-        TableColumn directionColumn = table.getColumnModel().getColumn(
-                ProcedureParameterTableModel.PARAMETER_DIRECTION);
-        JComboBox directionEditor = Application.getWidgetFactory().createComboBox(
-                ProcedureParameterTableModel.PARAMETER_DIRECTION_NAMES,
-                false);
+        TableColumn directionColumn = table.getColumnModel()
+                .getColumn(ProcedureParameterTableModel.PARAMETER_DIRECTION);
+        JComboBox directionEditor = Application.getWidgetFactory()
+                .createComboBox(ProcedureParameterTableModel.PARAMETER_DIRECTION_NAMES, false);
         directionEditor.setEditable(false);
         directionColumn.setCellEditor(new CayenneCellEditor(directionEditor));
 
@@ -326,24 +319,21 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
     }
 
     public void procedureParameterRemoved(ProcedureParameterEvent e) {
-        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table
-                .getModel();
+        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table.getModel();
         int ind = model.getObjectList().indexOf(e.getParameter());
         model.removeRow(e.getParameter());
         table.select(ind);
     }
 
     public void actionPerformed(ActionEvent e) {
-        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table
-                .getModel();
+        ProcedureParameterTableModel model = (ProcedureParameterTableModel) table.getModel();
         ProcedureParameter parameter = model.getParameter(table.getSelectedRow());
 
         int index = -1;
 
         if (e.getSource() == moveUp || e.getSource() == moveUpMenu) {
             index = model.moveRowUp(parameter);
-        }
-        else if (e.getSource() == moveDown || e.getSource() == moveDownMenu) {
+        } else if (e.getSource() == moveDown || e.getSource() == moveDownMenu) {
             index = model.moveRowDown(parameter);
         }
 
@@ -352,8 +342,9 @@ public class ProcedureParameterTab extends JPanel implements ProcedureParameterL
 
             // note that 'setCallParameters' is donw by copy internally
             parameter.getProcedure().setCallParameters(model.getObjectList());
-            eventController.fireProcedureEvent(new ProcedureEvent(this, parameter
-                    .getProcedure(), MapEvent.CHANGE));
+            eventController.fireProcedureEvent(
+                    new ProcedureEvent(this, parameter.getProcedure(), MapEvent.CHANGE)
+            );
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
index adbe505..40005fc 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureParameterTableModel.java
@@ -31,43 +31,36 @@ import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.util.CayenneTableModel;
 import org.apache.cayenne.modeler.util.ProjectUtil;
 
-/**
- */
-public class ProcedureParameterTableModel extends CayenneTableModel {
-    public static final int PARAMETER_NUMBER = 0;
-    public static final int PARAMETER_NAME = 1;
+public class ProcedureParameterTableModel extends CayenneTableModel<ProcedureParameter> {
+
+    public static final int PARAMETER_NUMBER    = 0;
+    public static final int PARAMETER_NAME      = 1;
     public static final int PARAMETER_DIRECTION = 2;
-    public static final int PARAMETER_TYPE = 3;
-    public static final int PARAMETER_LENGTH = 4;
+    public static final int PARAMETER_TYPE      = 3;
+    public static final int PARAMETER_LENGTH    = 4;
     public static final int PARAMETER_PRECISION = 5;
 
-    public static final String IN_PARAMETER = "IN";
-    public static final String OUT_PARAMETER = "OUT";
+    public static final String IN_PARAMETER     = "IN";
+    public static final String OUT_PARAMETER    = "OUT";
     public static final String IN_OUT_PARAMETER = "INOUT";
 
-    public static final String[] PARAMETER_DIRECTION_NAMES =
-        new String[] { "", IN_PARAMETER, OUT_PARAMETER, IN_OUT_PARAMETER };
+    public static final String[] PARAMETER_DIRECTION_NAMES = { "", IN_PARAMETER, OUT_PARAMETER, IN_OUT_PARAMETER };
 
-    private static final int[] PARAMETER_INDEXES =
-        new int[] {
+    private static final int[] PARAMETER_INDEXES = {
             PARAMETER_NUMBER,
             PARAMETER_NAME,
             PARAMETER_DIRECTION,
             PARAMETER_TYPE,
             PARAMETER_LENGTH,
-            PARAMETER_PRECISION };
+            PARAMETER_PRECISION
+    };
 
-    private static final String[] PARAMETER_NAMES =
-        new String[] { "No.", "Name", "Direction", "Type", "Max Length", "Precision" };
+    private static final String[] PARAMETER_NAMES = { "No.", "Name", "Direction", "Type", "Max Length", "Precision" };
 
     protected Procedure procedure;
 
-    public ProcedureParameterTableModel(
-        Procedure procedure,
-        ProjectController mediator,
-        Object eventSource) {
-
-        super(mediator, eventSource, new ArrayList(procedure.getCallParameters()));
+    public ProcedureParameterTableModel(Procedure procedure, ProjectController mediator, Object eventSource) {
+        super(mediator, eventSource, new ArrayList<>(procedure.getCallParameters()));
         this.procedure = procedure;
     }
 
@@ -76,37 +69,35 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
      * Returns NULL if row index is outside the valid range.
      */
     public ProcedureParameter getParameter(int row) {
-        return (row >= 0 && row < objectList.size())
-            ? (ProcedureParameter) objectList.get(row)
-            : null;
+        return (row >= 0 && row < objectList.size()) ? objectList.get(row) : null;
     }
 
+    @Override
     public void setUpdatedValueAt(Object newVal, int rowIndex, int columnIndex) {
         ProcedureParameter parameter = getParameter(rowIndex);
-
         if (parameter == null) {
             return;
         }
 
-        ProcedureParameterEvent event =
-            new ProcedureParameterEvent(eventSource, parameter);
+        String value = (String)newVal;
+        ProcedureParameterEvent event = new ProcedureParameterEvent(eventSource, parameter);
         switch (columnIndex) {
             case PARAMETER_NAME :
                 event.setOldName(parameter.getName());
-                setParameterName((String) newVal, parameter);
+                setParameterName(value, parameter);
                 fireTableCellUpdated(rowIndex, columnIndex);
                 break;
             case PARAMETER_DIRECTION :
-                setParameterDirection((String) newVal, parameter);
+                setParameterDirection(value, parameter);
                 break;
             case PARAMETER_TYPE :
-                setParameterType((String) newVal, parameter);
+                setParameterType(value, parameter);
                 break;
             case PARAMETER_LENGTH :
-                setMaxLength((String) newVal, parameter);
+                setMaxLength(value, parameter);
                 break;
             case PARAMETER_PRECISION :
-                setPrecision((String) newVal, parameter);
+                setPrecision(value, parameter);
                 break;
         }
         mediator.fireProcedureParameterEvent(event);
@@ -115,12 +106,10 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
     protected void setPrecision(String newVal, ProcedureParameter parameter) {
         if (newVal == null || newVal.trim().length() <= 0) {
             parameter.setPrecision(-1);
-        }
-        else {
+        } else {
             try {
                 parameter.setPrecision(Integer.parseInt(newVal));
-            }
-            catch (NumberFormatException ex) {
+            } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
                     null,
                     "Invalid precision (" + newVal + "), only numbers are allowed.",
@@ -133,18 +122,15 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
     protected void setMaxLength(String newVal, ProcedureParameter parameter) {
         if (newVal == null || newVal.trim().length() <= 0) {
             parameter.setMaxLength(-1);
-        }
-        else {
+        } else {
             try {
                 parameter.setMaxLength(Integer.parseInt(newVal));
-            }
-            catch (NumberFormatException ex) {
+            } catch (NumberFormatException ex) {
                 JOptionPane.showMessageDialog(
                     null,
                     "Invalid Max Length (" + newVal + "), only numbers are allowed",
                     "Invalid Maximum Length",
                     JOptionPane.ERROR_MESSAGE);
-                return;
             }
         }
     }
@@ -153,35 +139,31 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
         parameter.setType(TypesMapping.getSqlTypeByName(newVal));
     }
 
-    protected void setParameterDirection(
-        String direction,
-        ProcedureParameter parameter) {
+    protected void setParameterDirection(String direction, ProcedureParameter parameter) {
         if (ProcedureParameterTableModel.IN_PARAMETER.equals(direction)) {
             parameter.setDirection(ProcedureParameter.IN_PARAMETER);
-        }
-        else if (ProcedureParameterTableModel.OUT_PARAMETER.equals(direction)) {
+        } else if (ProcedureParameterTableModel.OUT_PARAMETER.equals(direction)) {
             parameter.setDirection(ProcedureParameter.OUT_PARAMETER);
-        }
-        else if (ProcedureParameterTableModel.IN_OUT_PARAMETER.equals(direction)) {
+        } else if (ProcedureParameterTableModel.IN_OUT_PARAMETER.equals(direction)) {
             parameter.setDirection(ProcedureParameter.IN_OUT_PARAMETER);
         }
-        else {
-            parameter.setDirection(-1);
-        }
     }
 
     protected void setParameterName(String newVal, ProcedureParameter parameter) {
         ProjectUtil.setProcedureParameterName(parameter, newVal.trim());
     }
 
+    @Override
     public Class getElementsClass() {
         return ProcedureParameter.class;
     }
 
+    @Override
     public int getColumnCount() {
         return PARAMETER_INDEXES.length;
     }
 
+    @Override
     public Object getValueAt(int rowIndex, int columnIndex) {
         ProcedureParameter parameter = getParameter(rowIndex);
 
@@ -207,56 +189,48 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
         }
     }
 
-    protected Object getParameterNumber(int rowIndex, ProcedureParameter parameter) {
+    protected String getParameterNumber(int rowIndex, ProcedureParameter parameter) {
         boolean hasReturnValue = parameter.getProcedure().isReturningValue();
 
         if (hasReturnValue) {
             return (rowIndex == 0) ? "R" : "" + rowIndex;
-        }
-        else {
+        } else {
             return "" + (rowIndex + 1);
         }
     }
 
-    protected Object getParameterPrecision(ProcedureParameter parameter) {
+    protected String getParameterPrecision(ProcedureParameter parameter) {
         return (parameter.getPrecision() >= 0)
             ? String.valueOf(parameter.getPrecision())
             : "";
     }
 
-    protected Object getParameterLength(ProcedureParameter parameter) {
+    protected String getParameterLength(ProcedureParameter parameter) {
         return (parameter.getMaxLength() >= 0)
             ? String.valueOf(parameter.getMaxLength())
             : "";
     }
 
-    protected Object getParameterType(ProcedureParameter parameter) {
+    protected String getParameterType(ProcedureParameter parameter) {
         return TypesMapping.getSqlNameByType(parameter.getType());
     }
 
-    protected Object getParameterDirection(ProcedureParameter parameter) {
+    protected String getParameterDirection(ProcedureParameter parameter) {
         int direction = parameter.getDirection();
-        switch (direction) {
-            case ProcedureParameter.IN_PARAMETER :
-                return ProcedureParameterTableModel.IN_PARAMETER;
-            case ProcedureParameter.OUT_PARAMETER :
-                return ProcedureParameterTableModel.OUT_PARAMETER;
-            case ProcedureParameter.IN_OUT_PARAMETER :
-                return ProcedureParameterTableModel.IN_OUT_PARAMETER;
-            default :
-                return "";
-        }
+        return PARAMETER_DIRECTION_NAMES[direction == -1 ? 0 : direction];
     }
 
-    protected Object getParameterName(ProcedureParameter parameter) {
+    protected String getParameterName(ProcedureParameter parameter) {
         return parameter.getName();
     }
 
+    @Override
     public String getColumnName(int col) {
         return PARAMETER_NAMES[col];
     }
 
-    public Class getColumnClass(int col) {
+    @Override
+    public Class<?> getColumnClass(int col) {
         return String.class;
     }
 
@@ -269,6 +243,7 @@ public class ProcedureParameterTableModel extends CayenneTableModel {
         // NOOP
     }
 
+    @Override
     public boolean isCellEditable(int row, int col) {
         return col != PARAMETER_NUMBER;
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryMainTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryMainTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryMainTab.java
index 7575a56..0b8255d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryMainTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryMainTab.java
@@ -200,6 +200,9 @@ public class SelectQueryMainTab extends JPanel {
     }
 
     protected SelectQueryDescriptor getQuery() {
+        if(mediator.getCurrentQuery() == null) {
+            return null;
+        }
         return QueryDescriptor.SELECT_QUERY.equals(mediator.getCurrentQuery().getType())
                 ? (SelectQueryDescriptor) mediator.getCurrentQuery()
                 : null;

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryOrderingTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryOrderingTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryOrderingTab.java
index c6328d2..d6b7c4e 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryOrderingTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryOrderingTab.java
@@ -28,6 +28,8 @@ import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
 import java.util.prefs.Preferences;
 
+import javax.swing.BorderFactory;
+import javax.swing.Icon;
 import javax.swing.JButton;
 import javax.swing.JComponent;
 import javax.swing.JLabel;
@@ -49,11 +51,14 @@ import org.apache.cayenne.map.QueryDescriptor;
 import org.apache.cayenne.map.SelectQueryDescriptor;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.EntityTreeModel;
 import org.apache.cayenne.modeler.util.ModelerUtil;
 import org.apache.cayenne.modeler.util.MultiColumnBrowser;
 import org.apache.cayenne.modeler.util.UIUtil;
-import org.apache.cayenne.query.*;
+import org.apache.cayenne.query.Ordering;
+import org.apache.cayenne.query.SortOrder;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 import org.apache.cayenne.util.CayenneMapEntry;
 
 /**
@@ -103,9 +108,7 @@ public class SelectQueryOrderingTab extends JPanel implements PropertyChangeList
                 getDividerLocationProperty(),
                 defLocation) : defLocation;
 
-        /**
-         * As of CAY-888 #3 main pane is now a JSplitPane. Top component is a bit larger.
-         */
+        //As of CAY-888 #3 main pane is now a JSplitPane. Top component is a bit larger.
         JSplitPane mainPanel = new JSplitPane(JSplitPane.VERTICAL_SPLIT);
         mainPanel.addPropertyChangeListener(JSplitPane.DIVIDER_LOCATION_PROPERTY, this);
         mainPanel.setDividerLocation(location);
@@ -197,8 +200,11 @@ public class SelectQueryOrderingTab extends JPanel implements PropertyChangeList
 
     protected JComponent createToolbar() {
 
-        JButton add = new JButton("Add Ordering", ModelerUtil
-                .buildIcon("icon-move_up.gif"));
+        JButton add = new CayenneAction.CayenneToolbarButton(null, 1);
+        add.setText("Add Ordering");
+        Icon addIcon = ModelerUtil.buildIcon("icon-plus.png");
+        add.setIcon(addIcon);
+        add.setDisabledIcon(FilteredIconFactory.createDisabledIcon(addIcon));
         add.addActionListener(new ActionListener() {
 
             public void actionPerformed(ActionEvent e) {
@@ -207,8 +213,11 @@ public class SelectQueryOrderingTab extends JPanel implements PropertyChangeList
 
         });
 
-        JButton remove = new JButton("Remove Ordering", ModelerUtil
-                .buildIcon("icon-move_down.gif"));
+        JButton remove = new CayenneAction.CayenneToolbarButton(null, 3);
+        remove.setText("Remove Ordering");
+        Icon removeIcon = ModelerUtil.buildIcon("icon-trash.png");
+        remove.setIcon(removeIcon);
+        remove.setDisabledIcon(FilteredIconFactory.createDisabledIcon(removeIcon));
         remove.addActionListener(new ActionListener() {
 
             public void actionPerformed(ActionEvent e) {
@@ -217,10 +226,12 @@ public class SelectQueryOrderingTab extends JPanel implements PropertyChangeList
 
         });
 
-        JToolBar toolbar = new JToolBar();
-        toolbar.add(add);
-        toolbar.add(remove);
-        return toolbar;
+        JToolBar toolBar = new JToolBar();
+        toolBar.setBorder(BorderFactory.createEmptyBorder());
+        toolBar.setFloatable(false);
+        toolBar.add(add);
+        toolBar.add(remove);
+        return toolBar;
     }
 
     protected TreeModel createBrowserModel(Entity entity) {
@@ -236,11 +247,11 @@ public class SelectQueryOrderingTab extends JPanel implements PropertyChangeList
 
         // first item in the path is Entity, so we must have
         // at least two elements to constitute a valid ordering path
-        if (path != null && path.length < 2) {
+        if (path.length < 2) {
             return null;
         }
 
-        StringBuffer buffer = new StringBuffer();
+        StringBuilder buffer = new StringBuilder();
 
         // attribute or relationships
         CayenneMapEntry first = (CayenneMapEntry) path[1];

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryPrefetchTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryPrefetchTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryPrefetchTab.java
index 677d185..2a24789 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryPrefetchTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/SelectQueryPrefetchTab.java
@@ -29,9 +29,11 @@ import org.apache.cayenne.map.Relationship;
 import org.apache.cayenne.modeler.Application;
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.undo.AddPrefetchUndoableEdit;
+import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.EntityTreeFilter;
 import org.apache.cayenne.modeler.util.EntityTreeModel;
 import org.apache.cayenne.modeler.util.ModelerUtil;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 
 import javax.swing.*;
 import javax.swing.table.AbstractTableModel;
@@ -52,8 +54,11 @@ public class SelectQueryPrefetchTab extends SelectQueryOrderingTab {
 
     protected JComponent createToolbar() {
 
-        JButton add = new JButton("Add Prefetch", ModelerUtil
-                .buildIcon("icon-move_up.gif"));
+        JButton add = new CayenneAction.CayenneToolbarButton(null, 1);
+        add.setText("Add Prefetch");
+        Icon addIcon = ModelerUtil.buildIcon("icon-plus.png");
+        add.setIcon(addIcon);
+        add.setDisabledIcon(FilteredIconFactory.createDisabledIcon(addIcon));
         
         add.addActionListener(new ActionListener() {
             public void actionPerformed(ActionEvent e) {
@@ -70,8 +75,11 @@ public class SelectQueryPrefetchTab extends SelectQueryOrderingTab {
 
         });
 
-        JButton remove = new JButton("Remove Prefetch", ModelerUtil
-                .buildIcon("icon-move_down.gif"));
+        JButton remove = new CayenneAction.CayenneToolbarButton(null, 3);
+        remove.setText("Remove Prefetch");
+        Icon removeIcon = ModelerUtil.buildIcon("icon-trash.png");
+        remove.setIcon(removeIcon);
+        remove.setDisabledIcon(FilteredIconFactory.createDisabledIcon(removeIcon));
         
         remove.addActionListener(new ActionListener() {
 
@@ -89,10 +97,12 @@ public class SelectQueryPrefetchTab extends SelectQueryOrderingTab {
 
         });
 
-        JToolBar toolbar = new JToolBar();
-        toolbar.add(add);
-        toolbar.add(remove);
-        return toolbar;
+        JToolBar toolBar = new JToolBar();
+        toolBar.setBorder(BorderFactory.createEmptyBorder());
+        toolBar.setFloatable(false);
+        toolBar.add(add);
+        toolBar.add(remove);
+        return toolBar;
     }
 
     protected TreeModel createBrowserModel(Entity entity) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
index e84b6bf..337ebe7 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributePanel.java
@@ -84,9 +84,7 @@ public class DbEntityAttributePanel extends JPanel implements DbEntityDisplayLis
                 "attributeTable");
         table.setDefaultRenderer(String.class, new BoardTableCellRenderer());
 
-        /**
-         * Create and install a popup
-         */
+        // Create and install a popup
         JPopupMenu popup = new JPopupMenu();
         popup.add(actionManager.getAction(RemoveAttributeRelationshipAction.class).buildMenu());
 
@@ -153,8 +151,7 @@ public class DbEntityAttributePanel extends JPanel implements DbEntityDisplayLis
             rebuildTable(entity);
         }
 
-        // if an entity was selected on a tree,
-        // unselect currently selected row
+        // if an entity was selected on a tree, unselect currently selected row
         if (e.isUnselectAttributes()) {
             table.clearSelection();
         }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeRelationshipTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeRelationshipTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeRelationshipTab.java
index 428e9dd..e417f88 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeRelationshipTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityAttributeRelationshipTab.java
@@ -37,7 +37,9 @@ import org.apache.cayenne.modeler.action.RemoveAttributeRelationshipAction;
 import org.apache.cayenne.modeler.event.DbEntityDisplayListener;
 import org.apache.cayenne.modeler.event.EntityDisplayEvent;
 import org.apache.cayenne.modeler.pref.ComponentGeometry;
+import org.apache.cayenne.modeler.util.CayenneAction;
 import org.apache.cayenne.modeler.util.ModelerUtil;
+import org.apache.cayenne.swing.components.image.FilteredIconFactory;
 import org.slf4j.LoggerFactory;
 
 import javax.swing.Icon;
@@ -55,7 +57,7 @@ public class DbEntityAttributeRelationshipTab extends JPanel implements DbEntity
 
     public DbEntityAttributePanel attributePanel;
     public DbEntityRelationshipPanel relationshipPanel;
-    public JButton resolve = new JButton();
+    public JButton resolve = new CayenneAction.CayenneToolbarButton(null, 0);
     private JSplitPane splitPane;
 
     private ProjectController mediator;
@@ -88,10 +90,8 @@ public class DbEntityAttributeRelationshipTab extends JPanel implements DbEntity
                     this.getClass(),
                     "dbEntityAttrRelTab/splitPane/divider");
 
-            geometry
-                    .bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
-        }
-        catch (Exception ex) {
+            geometry.bindIntProperty(splitPane, JSplitPane.DIVIDER_LOCATION_PROPERTY, -1);
+        } catch (Exception ex) {
             LoggerFactory.getLogger(getClass()).error("Cannot bind divider property", ex);
         }
 
@@ -100,18 +100,22 @@ public class DbEntityAttributeRelationshipTab extends JPanel implements DbEntity
 
     private void initToolBar() {
         toolBar = new JToolBar();
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
 
-        toolBar.add(actionManager.getAction(CreateObjEntityAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton());
-        toolBar.add(actionManager.getAction(DbEntitySyncAction.class).buildButton());
-        toolBar.add(actionManager.getAction(DbEntityCounterpartAction.class).buildButton());
+        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton(3));
+        toolBar.addSeparator();
+
+        toolBar.add(actionManager.getAction(CreateObjEntityAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(DbEntitySyncAction.class).buildButton(2));
+        toolBar.add(actionManager.getAction(DbEntityCounterpartAction.class).buildButton(3));
         toolBar.addSeparator();
 
-        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
+        Icon ico = ModelerUtil.buildIcon("icon-edit.png");
         resolve.setToolTipText("Database Mapping");
         resolve.setIcon(ico);
+        resolve.setDisabledIcon(FilteredIconFactory.createDisabledIcon(ico));
         toolBar.add(resolve).setEnabled(false);
 
         cut = actionManager.getAction(CutAttributeRelationshipAction.class);
@@ -121,9 +125,9 @@ public class DbEntityAttributeRelationshipTab extends JPanel implements DbEntity
         toolBar.addSeparator();
         toolBar.add(remove.buildButton());
         toolBar.addSeparator();
-        toolBar.add(cut.buildButton());
-        toolBar.add(copy.buildButton());
-        toolBar.add(actionManager.getAction(PasteAction.class).buildButton());
+        toolBar.add(cut.buildButton(1));
+        toolBar.add(copy.buildButton(2));
+        toolBar.add(actionManager.getAction(PasteAction.class).buildButton(3));
 
         add(toolBar, BorderLayout.NORTH);
     }
@@ -170,11 +174,11 @@ public class DbEntityAttributeRelationshipTab extends JPanel implements DbEntity
     public void currentDbEntityChanged(EntityDisplayEvent e) {
         DbEntity entity = (DbEntity) e.getEntity();
         if(entity.getDataMap().getMappedEntities(entity).isEmpty()) {
-            toolBar.getComponentAtIndex(3).setEnabled(false);
             toolBar.getComponentAtIndex(4).setEnabled(false);
+            toolBar.getComponentAtIndex(5).setEnabled(false);
         } else {
-            toolBar.getComponentAtIndex(3).setEnabled(true);
             toolBar.getComponentAtIndex(4).setEnabled(true);
+            toolBar.getComponentAtIndex(5).setEnabled(true);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
index bae752d..a37131c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityRelationshipPanel.java
@@ -109,10 +109,8 @@ public class DbEntityRelationshipPanel extends JPanel implements DbEntityDisplay
                 DbRelationshipTableModel.class,
                 "relationshipTable");
 
-        /**
-         * Create and install a popup
-         */
-        Icon ico = ModelerUtil.buildIcon("icon-info.gif");
+        // Create and install a popup
+        Icon ico = ModelerUtil.buildIcon("icon-edit.png");
         resolveMenu = new JMenuItem("Database Mapping", ico);
 
         JPopupMenu popup = new JPopupMenu();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java
index 9cbae0e..d772a46 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/DbEntityTab.java
@@ -24,6 +24,7 @@ import java.awt.CardLayout;
 import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.util.EventObject;
+import javax.swing.BorderFactory;
 import javax.swing.DefaultComboBoxModel;
 import javax.swing.JComboBox;
 import javax.swing.JLabel;
@@ -65,8 +66,7 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
     static final String PK_DB_GENERATOR = "Database-Generated";
     static final String PK_CUSTOM_SEQUENCE_GENERATOR = "Custom Sequence";
 
-    static final String[] PK_GENERATOR_TYPES = new String[] { PK_DEFAULT_GENERATOR, PK_DB_GENERATOR,
-            PK_CUSTOM_SEQUENCE_GENERATOR };
+    static final String[] PK_GENERATOR_TYPES = { PK_DEFAULT_GENERATOR, PK_DB_GENERATOR, PK_CUSTOM_SEQUENCE_GENERATOR };
 
     protected ProjectController mediator;
 
@@ -78,7 +78,7 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
     protected JLabel catalogLabel;
     protected JLabel schemaLabel;
 
-    protected JComboBox pkGeneratorType;
+    protected JComboBox<String> pkGeneratorType;
     protected JPanel pkGeneratorDetail;
     protected CardLayout pkGeneratorDetailLayout;
 
@@ -95,20 +95,23 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
     private void initView() {
 
         toolBar = new JToolBar();
+        toolBar.setBorder(BorderFactory.createEmptyBorder());
+        toolBar.setFloatable(false);
         ActionManager actionManager = Application.getInstance().getActionManager();
-        toolBar.add(actionManager.getAction(CreateObjEntityAction.class).buildButton());
-        toolBar.add(actionManager.getAction(DbEntitySyncAction.class).buildButton());
+
+        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton(3));
         toolBar.addSeparator();
 
-        toolBar.add(actionManager.getAction(CreateAttributeAction.class).buildButton());
-        toolBar.add(actionManager.getAction(CreateRelationshipAction.class).buildButton());
+        toolBar.add(actionManager.getAction(CreateObjEntityAction.class).buildButton(1));
+        toolBar.add(actionManager.getAction(DbEntitySyncAction.class).buildButton(2));
+        toolBar.add(actionManager.getAction(DbEntityCounterpartAction.class).buildButton(3));
         toolBar.addSeparator();
+
         toolBar.add(actionManager.getAction(ShowGraphEntityAction.class).buildButton());
-        toolBar.add(actionManager.getAction(DbEntityCounterpartAction.class).buildButton());
 
         // create widgets
         name = new TextAdapter(new JTextField()) {
-
             protected void updateModel(String text) {
                 setEntityName(text);
             }
@@ -116,7 +119,6 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
 
         catalogLabel = new JLabel("Catalog:");
         catalog = new TextAdapter(new JTextField()) {
-
             protected void updateModel(String text) throws ValidationException {
                 setCatalog(text);
             }
@@ -124,21 +126,20 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
 
         schemaLabel = new JLabel("Schema:");
         schema = new TextAdapter(new JTextField()) {
-
             protected void updateModel(String text) throws ValidationException {
                 setSchema(text);
             }
         };
-        qualifier = new TextAdapter(new JTextField()) {
 
+        qualifier = new TextAdapter(new JTextField()) {
             protected void updateModel(String qualifier) {
                 setQualifier(qualifier);
             }
         };
 
-        pkGeneratorType = new JComboBox();
+        pkGeneratorType = new JComboBox<>();
         pkGeneratorType.setEditable(false);
-        pkGeneratorType.setModel(new DefaultComboBoxModel(PK_GENERATOR_TYPES));
+        pkGeneratorType.setModel(new DefaultComboBoxModel<>(PK_GENERATOR_TYPES));
 
         pkGeneratorDetailLayout = new CardLayout();
         pkGeneratorDetail = new JPanel(pkGeneratorDetailLayout);
@@ -243,11 +244,11 @@ public class DbEntityTab extends JPanel implements ExistingSelectionProcessor, D
         pkGeneratorDetailLayout.show(pkGeneratorDetail, type);
 
         if(entity.getDataMap().getMappedEntities(entity).isEmpty()) {
-            toolBar.getComponentAtIndex(1).setEnabled(false);
-            toolBar.getComponentAtIndex(7).setEnabled(false);
+            toolBar.getComponentAtIndex(4).setEnabled(false);
+            toolBar.getComponentAtIndex(5).setEnabled(false);
         } else {
-            toolBar.getComponentAtIndex(1).setEnabled(true);
-            toolBar.getComponentAtIndex(7).setEnabled(true);
+            toolBar.getComponentAtIndex(4).setEnabled(true);
+            toolBar.getComponentAtIndex(5).setEnabled(true);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/09b0fdb0/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java
deleted file mode 100644
index 073f484..0000000
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*****************************************************************
- *   Licensed to the Apache Software Foundation (ASF) under one
- *  or more contributor license agreements.  See the NOTICE file
- *  distributed with this work for additional information
- *  regarding copyright ownership.  The ASF licenses this file
- *  to you under the Apache License, Version 2.0 (the
- *  "License"); you may not use this file except in compliance
- *  with the License.  You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing,
- *  software distributed under the License is distributed on an
- *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  KIND, either express or implied.  See the License for the
- *  specific language governing permissions and limitations
- *  under the License.
- ****************************************************************/
-package org.apache.cayenne.modeler.event;
-
-import org.apache.cayenne.event.CayenneEvent;
-
-
-/**
- * Class for processing listener class selection
- *
- * @version 1.0 Oct 28, 2007
- */
-
-public class ListenerClassSelectionEvent extends CayenneEvent {
-    /**
-     * selected listener class
-     */
-    private String listenerClass;
-
-    /**
-     * constructor
-     * @param source event source
-     * @param listenerClass listener class
-     */
-    public ListenerClassSelectionEvent(Object source, String listenerClass) {
-        super(source);
-        this.listenerClass = listenerClass;
-    }
-
-    /**
-     * @return selected listener class
-     */
-    public String getListenerClass() {
-        return listenerClass;
-    }
-}
-


Mime
View raw message