cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ntimof...@apache.org
Subject cayenne git commit: Code cleanup: anonymous classes to lambda
Date Mon, 10 Sep 2018 15:06:08 GMT
Repository: cayenne
Updated Branches:
  refs/heads/master eb863c9ae -> 6221d5ec6


Code cleanup: anonymous classes to lambda


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

Branch: refs/heads/master
Commit: 6221d5ec6070fa496357867e569fb1f0363f9e68
Parents: eb863c9
Author: Nikita Timofeev <stariy95@gmail.com>
Authored: Mon Sep 10 18:04:45 2018 +0300
Committer: Nikita Timofeev <stariy95@gmail.com>
Committed: Mon Sep 10 18:04:45 2018 +0300

----------------------------------------------------------------------
 .../cayenne/modeler/dialog/LogConsole.java      |  28 +--
 .../InferRelationshipsPanel.java                |  17 +-
 .../dialog/codegen/GeneratorTabPanel.java       |   9 +-
 .../modeler/dialog/datadomain/FilterDialog.java |  23 +--
 .../dialog/datamap/CatalogUpdateController.java |  18 +-
 .../dialog/datamap/SchemaUpdateController.java  |  18 +-
 .../datamap/SuperclassUpdateController.java     |  18 +-
 .../dialog/db/DbActionOptionsDialog.java        |  16 +-
 .../dialog/db/gen/TableSelectorView.java        |  16 +-
 .../dialog/db/load/DbLoadResultDialog.java      |  13 +-
 .../dialog/db/load/DefaultPopUpMenu.java        |  20 +-
 .../modeler/dialog/db/load/RootPopUpMenu.java   |  66 ++-----
 .../db/merge/MergerTokenSelectorView.java       |  16 +-
 .../dialog/objentity/ClassNameUpdater.java      |  32 ++-
 .../dialog/objentity/EntitySyncController.java  |  18 +-
 .../dialog/pref/ClasspathPreferences.java       |  26 +--
 .../cayenne/modeler/dialog/query/QueryType.java |  52 +----
 .../validator/DuplicatedAttributesDialog.java   |  29 +--
 .../dialog/validator/ValidatorDialog.java       |  28 +--
 .../cayenne/modeler/editor/DataDomainView.java  |  40 ++--
 .../cayenne/modeler/editor/DataMapView.java     | 111 ++---------
 .../cayenne/modeler/editor/ObjEntityTab.java    | 194 ++++++++-----------
 .../editor/ObjectQueryPropertiesPanel.java      |  12 +-
 .../modeler/editor/ProcedureQueryView.java      |  16 +-
 .../cayenne/modeler/editor/ProcedureTab.java    |  15 +-
 .../modeler/editor/RawQueryPropertiesPanel.java |  31 +--
 .../modeler/editor/SelectQueryMainTab.java      |  18 +-
 .../editor/dbentity/PKDBGeneratorPanel.java     |  25 ++-
 .../modeler/util/combo/SuggestionList.java      |   5 +-
 .../apache/cayenne/swing/ItemEventBinding.java  |  17 +-
 30 files changed, 267 insertions(+), 680 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/LogConsole.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/LogConsole.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/LogConsole.java
index cba9988..eec1663 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/LogConsole.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/LogConsole.java
@@ -27,8 +27,6 @@ import javax.swing.text.*;
 import java.awt.*;
 import java.awt.datatransfer.Clipboard;
 import java.awt.datatransfer.StringSelection;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.io.PrintWriter;
 import java.io.StringWriter;
 import java.text.DateFormat;
@@ -139,25 +137,13 @@ public class LogConsole extends CayenneController {
     }
     
     protected void initBindings() {
-        view.getClearItem().addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                clear();
-            }
-        });
-        
-        view.getCopyItem().addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                copy();
-            }
-        });
-        
-        view.getDockItem().addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                // Log console should be visible
-                disappear();
-                setConsoleProperty(DOCKED_PROPERTY, !getConsoleProperty(DOCKED_PROPERTY));
-                appear();
-            }
+        view.getClearItem().addActionListener(e -> clear());
+        view.getCopyItem().addActionListener(e -> copy());
+        view.getDockItem().addActionListener(e -> {
+            // Log console should be visible
+            disappear();
+            setConsoleProperty(DOCKED_PROPERTY, !getConsoleProperty(DOCKED_PROPERTY));
+            appear();
         });
     }
     /*public void showMenu(){

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsPanel.java
index ceb8820..fc4dc35 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/autorelationship/InferRelationshipsPanel.java
@@ -21,8 +21,6 @@ package org.apache.cayenne.modeler.dialog.autorelationship;
 import java.awt.BorderLayout;
 import java.awt.Dimension;
 import java.awt.FlowLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
@@ -45,15 +43,12 @@ public class InferRelationshipsPanel extends JPanel {
         this.checkAll = new JCheckBox();
         this.checkAllLabel = new JLabel("Check All DBRelationships");
 
-        checkAll.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent event) {
-                if (checkAll.isSelected()) {
-                    checkAllLabel.setText("Uncheck All DBRelationships");
-                }
-                else {
-                    checkAllLabel.setText("Check All DBRelationships");
-                }
+        checkAll.addItemListener(event -> {
+            if (checkAll.isSelected()) {
+                checkAllLabel.setText("Uncheck All DBRelationships");
+            }
+            else {
+                checkAllLabel.setText("Check All DBRelationships");
             }
         });
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java
index 99a4cdd..130741d 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/codegen/GeneratorTabPanel.java
@@ -27,8 +27,6 @@ import javax.swing.JPanel;
 import java.awt.BorderLayout;
 import java.awt.CardLayout;
 import java.awt.Component;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 /**
  */
@@ -43,12 +41,7 @@ public class GeneratorTabPanel extends JPanel {
         this.modeLayout = new CardLayout();
         this.modesPanel = new JPanel(modeLayout);
 
-        generationMode.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent e) {
-                modeLayout.show(modesPanel, generationMode.getSelectedItem().toString());
-            }
-        });
+        generationMode.addItemListener(e -> modeLayout.show(modesPanel, generationMode.getSelectedItem().toString()));
 
         // assemble
         FormLayout layout = new FormLayout("right:70dlu, 3dlu, fill:300, fill:100dlu:grow", "");

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/FilterDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/FilterDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/FilterDialog.java
index 535e41c..d8415c7 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/FilterDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datadomain/FilterDialog.java
@@ -134,19 +134,16 @@ public class FilterDialog extends JPopupMenu {
 		query.addActionListener(new CheckListener("query"));
 
         all.setEnabled(false);
-		all.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-				dbEntity.setSelected(true);
-				objEntity.setSelected(true);
-				embeddable.setSelected(true);
-				procedure.setSelected(true);
-				query.setSelected(true);
-				all.setEnabled(false);
-
-                filterController.getTreeModel().setFiltered(filterController.getFilterMap());
-                filterController.getTree().updateUI();
-            }
+		all.addActionListener(e -> {
+			dbEntity.setSelected(true);
+			objEntity.setSelected(true);
+			embeddable.setSelected(true);
+			procedure.setSelected(true);
+			query.setSelected(true);
+			all.setEnabled(false);
+
+			filterController.getTreeModel().setFiltered(filterController.getFilterMap());
+			filterController.getTree().updateUI();
 		});
 	}
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/CatalogUpdateController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/CatalogUpdateController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/CatalogUpdateController.java
index 98e329c..76ad358 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/CatalogUpdateController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/CatalogUpdateController.java
@@ -19,9 +19,6 @@
 package org.apache.cayenne.modeler.dialog.datamap;
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
 import javax.swing.WindowConstants;
 
 import org.apache.cayenne.configuration.event.ProcedureEvent;
@@ -64,19 +61,8 @@ public class CatalogUpdateController extends DefaultsPreferencesController {
     }
 
     private void initController() {
-        view.getUpdateButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent arg0) {
-                updateCatalog();
-            }
-        });
-
-        view.getCancelButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent arg0) {
-                view.dispose();
-            }
-        });
+        view.getUpdateButton().addActionListener(e -> updateCatalog());
+        view.getCancelButton().addActionListener(e -> view.dispose());
     }
 
     protected void updateCatalog() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SchemaUpdateController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SchemaUpdateController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SchemaUpdateController.java
index 0e9582a..156da3e 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SchemaUpdateController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SchemaUpdateController.java
@@ -20,9 +20,6 @@
 package org.apache.cayenne.modeler.dialog.datamap;
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
 import javax.swing.WindowConstants;
 
 import org.apache.cayenne.configuration.event.ProcedureEvent;
@@ -69,19 +66,8 @@ public class SchemaUpdateController extends DefaultsPreferencesController {
     }
     
     private void initController() {
-        view.getUpdateButton().addActionListener(new ActionListener() {
-            
-            public void actionPerformed(ActionEvent arg0) {
-                updateSchema();
-            }
-        });
-        
-        view.getCancelButton().addActionListener(new ActionListener() {
-            
-            public void actionPerformed(ActionEvent arg0) {
-                view.dispose();
-            }
-        });
+        view.getUpdateButton().addActionListener(e -> updateSchema());
+        view.getCancelButton().addActionListener(e -> view.dispose());
     }
 
     protected void updateSchema() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SuperclassUpdateController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SuperclassUpdateController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SuperclassUpdateController.java
index 02f4cf9..72ac4f5 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SuperclassUpdateController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/datamap/SuperclassUpdateController.java
@@ -20,9 +20,6 @@
 package org.apache.cayenne.modeler.dialog.datamap;
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
 import javax.swing.WindowConstants;
 
 import org.apache.cayenne.map.DataMap;
@@ -69,19 +66,8 @@ public class SuperclassUpdateController extends DefaultsPreferencesController {
     }
     
     private void initController() {
-        view.getUpdateButton().addActionListener(new ActionListener() {
-            
-            public void actionPerformed(ActionEvent e) {
-                updateSuperclass();
-            }
-        });
-        
-        view.getCancelButton().addActionListener(new ActionListener() {
-            
-            public void actionPerformed(ActionEvent arg0) {
-                view.dispose();
-            }
-        });
+        view.getUpdateButton().addActionListener(e -> updateSuperclass());
+        view.getCancelButton().addActionListener(e -> view.dispose());
     }
 
     protected void updateSuperclass() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
index 0a59335..a43c679 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/DbActionOptionsDialog.java
@@ -23,8 +23,6 @@ import java.awt.BorderLayout;
 import java.awt.FlowLayout;
 import java.awt.Frame;
 import java.awt.HeadlessException;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.util.Collection;
 
 import javax.swing.DefaultComboBoxModel;
@@ -92,18 +90,8 @@ public class DbActionOptionsDialog extends CayenneDialog {
     }
 
     protected void initController() {
-        selectButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                processSelect();
-            }
-        });
-        cancelButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                processCancel();
-            }
-        });
+        selectButton.addActionListener(e -> processSelect());
+        cancelButton.addActionListener(e -> processCancel());
     }
 
     protected void initFromModel(Collection<String> catalogs, Collection<String> schemas, String currentCatalog, String currentSchema) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/gen/TableSelectorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/gen/TableSelectorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/gen/TableSelectorView.java
index f618e65..08b1a7c 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/gen/TableSelectorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/gen/TableSelectorView.java
@@ -21,8 +21,6 @@ package org.apache.cayenne.modeler.dialog.db.gen;
 
 import java.awt.BorderLayout;
 import java.awt.FlowLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
@@ -47,15 +45,11 @@ public class TableSelectorView extends JPanel {
         this.checkAll = new JCheckBox();
         this.checkAllLabel = new JLabel("Check All Tables");
 
-        checkAll.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent event) {
-                if (checkAll.isSelected()) {
-                    checkAllLabel.setText("Uncheck All Tables");
-                }
-                else {
-                    checkAllLabel.setText("Check All Tables");
-                }
+        checkAll.addItemListener(event -> {
+            if (checkAll.isSelected()) {
+                checkAllLabel.setText("Uncheck All Tables");
+            } else {
+                checkAllLabel.setText("Check All Tables");
             }
         });
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
index 648219c..9982634 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DbLoadResultDialog.java
@@ -30,16 +30,14 @@ import javax.swing.JTable;
 import javax.swing.ListSelectionModel;
 import javax.swing.table.DefaultTableModel;
 import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 /**
  * @since 4.1
  */
 public class DbLoadResultDialog extends JDialog {
 
-    private static int TABLE_ROW_HIGH = 24;
-    private static int TABLE_ROW_MARGIN = 3;
+    private static final int TABLE_ROW_HIGH = 24;
+    private static final int TABLE_ROW_MARGIN = 3;
 
     private DefaultTableModel tableModel;
     private JTable table;
@@ -76,12 +74,7 @@ public class DbLoadResultDialog extends JDialog {
         table.setRowMargin(TABLE_ROW_MARGIN);
         tableModel.addColumn("");
         okButton = new JButton("OK");
-        okButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                DbLoadResultDialog.this.setVisible(false);
-            }
-        });
+        okButton.addActionListener(e -> DbLoadResultDialog.this.setVisible(false));
     }
 
     private void buildElements() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DefaultPopUpMenu.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DefaultPopUpMenu.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DefaultPopUpMenu.java
index 8603337..2ba1f96 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DefaultPopUpMenu.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/DefaultPopUpMenu.java
@@ -26,8 +26,6 @@ import org.apache.cayenne.modeler.action.dbimport.EditNodeAction;
 import javax.swing.JMenuItem;
 import javax.swing.JPopupMenu;
 import javax.swing.JTree;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 /**
  * @since 4.1
@@ -50,20 +48,14 @@ public class DefaultPopUpMenu extends JPopupMenu {
     }
 
     private void initListeners() {
-        rename.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if ((selectedElement != null) && (parentElement != null)) {
-                    projectController.getApplication().getActionManager().getAction(EditNodeAction.class).actionPerformed(e);
-                }
+        rename.addActionListener(e -> {
+            if ((selectedElement != null) && (parentElement != null)) {
+                projectController.getApplication().getActionManager().getAction(EditNodeAction.class).actionPerformed(e);
             }
         });
-        delete.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if ((selectedElement != null) && (parentElement != null)) {
-                    projectController.getApplication().getActionManager().getAction(DeleteNodeAction.class).actionPerformed(e);
-                }
+        delete.addActionListener(e -> {
+            if ((selectedElement != null) && (parentElement != null)) {
+                projectController.getApplication().getActionManager().getAction(DeleteNodeAction.class).actionPerformed(e);
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/RootPopUpMenu.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/RootPopUpMenu.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/RootPopUpMenu.java
index f32030b..097cc1f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/RootPopUpMenu.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/load/RootPopUpMenu.java
@@ -30,8 +30,6 @@ import org.apache.cayenne.modeler.action.dbimport.AddSchemaAction;
 
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 /**
  * @since 4.1
@@ -60,54 +58,22 @@ public class RootPopUpMenu extends DefaultPopUpMenu {
     }
 
     private void initListeners() {
-        addCatalog.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddCatalogAction.class).actionPerformed(e);
-            }
-        });
-        addSchema.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddSchemaAction.class).actionPerformed(e);
-            }
-        });
-        addIncludeTable.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddIncludeTableAction.class).actionPerformed(e);
-            }
-        });
-        addExcludeTable.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddExcludeTableAction.class).actionPerformed(e);
-            }
-        });
-        addIncludeColumn.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddIncludeColumnAction.class).actionPerformed(e);
-            }
-        });
-        addExcludeColumn.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddExcludeColumnAction.class).actionPerformed(e);
-            }
-        });
-        addIncludeProcedure.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddIncludeProcedureAction.class).actionPerformed(e);
-            }
-        });
-        addExcludeProcedure.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                projectController.getApplication().getActionManager().getAction(AddExcludeProcedureAction.class).actionPerformed(e);
-            }
-        });
+        addCatalog.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddCatalogAction.class).actionPerformed(e));
+        addSchema.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddSchemaAction.class).actionPerformed(e));
+        addIncludeTable.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddIncludeTableAction.class).actionPerformed(e));
+        addExcludeTable.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddExcludeTableAction.class).actionPerformed(e));
+        addIncludeColumn.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddIncludeColumnAction.class).actionPerformed(e));
+        addExcludeColumn.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddExcludeColumnAction.class).actionPerformed(e));
+        addIncludeProcedure.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddIncludeProcedureAction.class).actionPerformed(e));
+        addExcludeProcedure.addActionListener(e -> projectController.getApplication().getActionManager()
+                .getAction(AddExcludeProcedureAction.class).actionPerformed(e));
     }
 
     private void initPopUpMenuElements() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorView.java
index 263fb7c..c3849f4 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/db/merge/MergerTokenSelectorView.java
@@ -21,8 +21,6 @@ package org.apache.cayenne.modeler.dialog.db.merge;
 
 import java.awt.BorderLayout;
 import java.awt.FlowLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 import javax.swing.JButton;
 import javax.swing.JCheckBox;
@@ -51,15 +49,11 @@ public class MergerTokenSelectorView extends JPanel {
         this.checkAllLabel = new JLabel("Check All Operations");
         this.reverseAll = new JButton("Reverse All Operations");
 
-        checkAll.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent event) {
-                if (checkAll.isSelected()) {
-                    checkAllLabel.setText("Uncheck All Operations");
-                }
-                else {
-                    checkAllLabel.setText("Check All Operations");
-                }
+        checkAll.addItemListener(event -> {
+            if (checkAll.isSelected()) {
+                checkAllLabel.setText("Uncheck All Operations");
+            } else {
+                checkAllLabel.setText("Check All Operations");
             }
         });
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdater.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdater.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdater.java
index 449d10a..0827a80 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdater.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/ClassNameUpdater.java
@@ -21,8 +21,6 @@
 package org.apache.cayenne.modeler.dialog.objentity;
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 
 import org.apache.cayenne.map.DataMap;
 import org.apache.cayenne.map.ObjEntity;
@@ -163,29 +161,21 @@ public class ClassNameUpdater extends CayenneController {
             final String suggestedServerName,
             final String suggestedClientName) {
 
-        view.getUpdateButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                if (view.getClientClass().isSelected()) {
-                    entity.setClientClassName(suggestedClientName);
-                    updatePerformed = true;
-                }
-
-                if (view.getServerClass().isSelected()) {
-                    entity.setClassName(suggestedServerName);
-                    updatePerformed = true;
-                }
-
-                view.dispose();
+        view.getUpdateButton().addActionListener(e -> {
+            if (view.getClientClass().isSelected()) {
+                entity.setClientClassName(suggestedClientName);
+                updatePerformed = true;
             }
-        });
 
-        view.getCancelButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                view.dispose();
+            if (view.getServerClass().isSelected()) {
+                entity.setClassName(suggestedServerName);
+                updatePerformed = true;
             }
+
+            view.dispose();
         });
+
+        view.getCancelButton().addActionListener(e -> view.dispose());
     }
 
     public Component getView() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
index 2c68fd2..3319cf0 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/objentity/EntitySyncController.java
@@ -93,20 +93,14 @@ public class EntitySyncController extends CayenneController {
 
         view = new EntitySyncDialog();
 
-        view.getUpdateButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                removeFKs[0] = view.getRemoveFKs().isSelected();
-                view.dispose();
-            }
+        view.getUpdateButton().addActionListener(e -> {
+            removeFKs[0] = view.getRemoveFKs().isSelected();
+            view.dispose();
         });
 
-        view.getCancelButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                cancel[0] = true;
-                view.dispose();
-            }
+        view.getCancelButton().addActionListener(e -> {
+            cancel[0] = true;
+            view.dispose();
         });
 
         view.pack();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/ClasspathPreferences.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/ClasspathPreferences.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/ClasspathPreferences.java
index 96f31bd..eb8fbaa 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/ClasspathPreferences.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/pref/ClasspathPreferences.java
@@ -20,8 +20,6 @@
 package org.apache.cayenne.modeler.dialog.pref;
 
 import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.io.File;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -128,27 +126,9 @@ public class ClasspathPreferences extends CayenneController {
 
     protected void initBindings() {
         view.getTable().setModel(tableModel);
-
-        view.getAddDirButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                addClassDirectoryAction();
-            }
-        });
-
-        view.getRemoveEntryButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                removeEntryAction();
-            }
-        });
-
-        view.getAddJarButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                addJarOrZipAction();
-            }
-        });
+        view.getAddDirButton().addActionListener(e -> addClassDirectoryAction());
+        view.getRemoveEntryButton().addActionListener(e -> removeEntryAction());
+        view.getAddJarButton().addActionListener(e -> addJarOrZipAction());
     }
 
     protected void addJarOrZipAction() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryType.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryType.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryType.java
index 33bff77..3aab713 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryType.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/query/QueryType.java
@@ -18,6 +18,10 @@
  ****************************************************************/
 package org.apache.cayenne.modeler.dialog.query;
 
+import java.awt.Component;
+
+import javax.swing.WindowConstants;
+
 import org.apache.cayenne.configuration.DataChannelDescriptor;
 import org.apache.cayenne.configuration.event.QueryEvent;
 import org.apache.cayenne.dbsync.naming.NameBuilder;
@@ -29,12 +33,6 @@ import org.apache.cayenne.modeler.event.QueryDisplayEvent;
 import org.apache.cayenne.modeler.undo.CreateQueryUndoableEdit;
 import org.apache.cayenne.modeler.util.CayenneController;
 
-import javax.swing.*;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-
 public class QueryType extends CayenneController{
 
     protected ProjectController mediator;
@@ -63,42 +61,12 @@ public class QueryType extends CayenneController{
     } 
     
     private void initController() {
-        view.getCancelButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                view.dispose();
-            }
-        });
-        view.getSaveButton().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                createQuery();
-            }
-        });
-        view.getObjectSelect().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                 setObjectSelectQuery();
-            }
-        });
-        view.getSqlSelect().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-               setRawSQLQuery();
-            }
-        });
-        view.getProcedureSelect().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                setProcedureQuery();
-            }
-        });
-        view.getEjbqlSelect().addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                setEjbqlQuery();
-            }
-        });
+        view.getCancelButton().addActionListener(e -> view.dispose());
+        view.getSaveButton().addActionListener(e -> createQuery());
+        view.getObjectSelect().addActionListener(e -> setObjectSelectQuery());
+        view.getSqlSelect().addActionListener(e -> setRawSQLQuery());
+        view.getProcedureSelect().addActionListener(e -> setProcedureQuery());
+        view.getEjbqlSelect().addActionListener(e -> setEjbqlQuery());
     }
     
     public void startupAction() {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
index 3af0698..6e5afca 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/DuplicatedAttributesDialog.java
@@ -124,23 +124,17 @@ public class DuplicatedAttributesDialog extends CayenneDialog {
 
     private void initController() {
         setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        cancelButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                result = CANCEL_RESULT;
-                setVisible(false);
-                dispose();
-            }
+        cancelButton.addActionListener(e -> {
+            result = CANCEL_RESULT;
+            setVisible(false);
+            dispose();
         });
 
-        proceedButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                applyChanges();
-                result = PROCEEDED_RESULT;
-                setVisible(false);
-                dispose();
-            }
+        proceedButton.addActionListener(e -> {
+            applyChanges();
+            result = PROCEEDED_RESULT;
+            setVisible(false);
+            dispose();
         });
     }
 
@@ -246,10 +240,7 @@ public class DuplicatedAttributesDialog extends CayenneDialog {
         }
 
         public boolean isCellEditable(int row, int column) {
-            if (column == ACTION || column == ATTRIBUTE_NAME) {
-                return true;
-            }
-            return false;
+            return column == ACTION || column == ATTRIBUTE_NAME;
         }
 
         public String getColumnName(int column) {

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
index 8e83718..9db842f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/dialog/validator/ValidatorDialog.java
@@ -34,16 +34,12 @@ import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JTable;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
 import javax.swing.table.AbstractTableModel;
 import javax.swing.table.DefaultTableCellRenderer;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Component;
 import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.util.Collections;
@@ -130,27 +126,15 @@ public class ValidatorDialog extends CayenneDialog {
     private void initController() {
 
         setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        problemsTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
+        problemsTable.getSelectionModel().addListSelectionListener(e -> showFailedObject());
 
-            public void valueChanged(ListSelectionEvent e) {
-                showFailedObject();
-            }
-        });
-
-        closeButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                setVisible(false);
-                dispose();
-            }
+        closeButton.addActionListener(e -> {
+            setVisible(false);
+            dispose();
         });
 
-        refreshButton.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                Application.getInstance().getActionManager().getAction(ValidateAction.class).actionPerformed(e);
-            }
-        });
+        refreshButton.addActionListener(e -> Application.getInstance().getActionManager()
+                .getAction(ValidateAction.class).actionPerformed(e));
 
         this.problemsTable.addMouseListener(new MouseAdapter() {
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataDomainView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataDomainView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataDomainView.java
index f216b5a..ec015ae 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataDomainView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataDomainView.java
@@ -39,8 +39,6 @@ import javax.swing.JCheckBox;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 import java.awt.BorderLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.Map;
 import java.util.prefs.Preferences;
 
@@ -105,28 +103,20 @@ public class DataDomainView extends JPanel implements DomainDisplayListener {
         projectController.addDomainDisplayListener(this);
 
         // add item listener to checkboxes
-        objectValidation.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                String value = objectValidation.isSelected() ? "true" : "false";
-                setDomainProperty(
-                        DataDomain.VALIDATING_OBJECTS_ON_COMMIT_PROPERTY,
-                        value,
-                        Boolean.toString(DataDomain.VALIDATING_OBJECTS_ON_COMMIT_DEFAULT));
-            }
+        objectValidation.addItemListener(e -> {
+            String value = objectValidation.isSelected() ? "true" : "false";
+            setDomainProperty(
+                    DataDomain.VALIDATING_OBJECTS_ON_COMMIT_PROPERTY,
+                    value,
+                    Boolean.toString(DataDomain.VALIDATING_OBJECTS_ON_COMMIT_DEFAULT));
         });
 
-        sharedCache.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                String value = sharedCache.isSelected() ? "true" : "false";
-                setDomainProperty(
-                        DataDomain.SHARED_CACHE_ENABLED_PROPERTY,
-                        value,
-                        Boolean.toString(DataDomain.SHARED_CACHE_ENABLED_DEFAULT));
-            }
+        sharedCache.addItemListener(e -> {
+            String value = sharedCache.isSelected() ? "true" : "false";
+            setDomainProperty(
+                    DataDomain.SHARED_CACHE_ENABLED_PROPERTY,
+                    value,
+                    Boolean.toString(DataDomain.SHARED_CACHE_ENABLED_DEFAULT));
         });
 
     }
@@ -155,8 +145,8 @@ public class DataDomainView extends JPanel implements DomainDisplayListener {
             value = null;
         }
 
-        Map properties = domain.getProperties();
-        Object oldValue = properties.get(property);
+        Map<String, String> properties = domain.getProperties();
+        String oldValue = properties.get(property);
         if (!Util.nullSafeEquals(value, oldValue)) {
             properties.put(property, value);
 
@@ -175,7 +165,7 @@ public class DataDomainView extends JPanel implements DomainDisplayListener {
             return null;
         }
 
-        String value = (String) domain.getProperties().get(property);
+        String value = domain.getProperties().get(property);
         return value != null ? value : defaultValue;
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapView.java
index a313bd0..95862bb 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapView.java
@@ -35,8 +35,6 @@ import org.apache.cayenne.modeler.dialog.datamap.LockingUpdateController;
 import org.apache.cayenne.modeler.dialog.datamap.PackageUpdateController;
 import org.apache.cayenne.modeler.dialog.datamap.SchemaUpdateController;
 import org.apache.cayenne.modeler.dialog.datamap.SuperclassUpdateController;
-import org.apache.cayenne.modeler.event.DataMapDisplayEvent;
-import org.apache.cayenne.modeler.event.DataMapDisplayListener;
 import org.apache.cayenne.modeler.pref.DataMapDefaults;
 import org.apache.cayenne.modeler.util.CellRenderers;
 import org.apache.cayenne.modeler.util.Comparators;
@@ -54,10 +52,6 @@ import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JTextField;
 import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.Arrays;
 
 /**
@@ -219,97 +213,26 @@ public class DataMapView extends JPanel {
     }
 
     private void initController() {
-        eventController.addDataMapDisplayListener(new DataMapDisplayListener() {
-
-            public void currentDataMapChanged(DataMapDisplayEvent e) {
-                DataMap map = e.getDataMap();
-                if (map != null) {
-                    initFromModel(map);
-                }
-            }
-        });
-
-        nodeSelector.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                setDataNode();
-            }
-        });
-
-        quoteSQLIdentifiers.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                setQuoteSQLIdentifiers(quoteSQLIdentifiers.isSelected());
-            }
-        });
-
-        defaultLockType.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                setDefaultLockType(defaultLockType.isSelected()
-                        ? ObjEntity.LOCK_TYPE_OPTIMISTIC
-                        : ObjEntity.LOCK_TYPE_NONE);
-            }
-        });
-
-        clientSupport.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                setClientSupport(clientSupport.isSelected());
-            }
-        });
-
-        updateDefaultClientPackage.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultClientPackage();
+        eventController.addDataMapDisplayListener(e -> {
+            DataMap map = e.getDataMap();
+            if (map != null) {
+                initFromModel(map);
             }
         });
 
-        updateDefaultClientSuperclass.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultClientSuperclass();
-            }
-        });
-
-        updateDefaultCatalog.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultCatalog();
-            }
-        });
-
-        updateDefaultSchema.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultSchema();
-            }
-        });
-
-        updateDefaultPackage.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultPackage();
-            }
-        });
-
-        updateDefaultSuperclass.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultSuperclass();
-            }
-        });
-
-        updateDefaultLockType.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                updateDefaultLockType();
-            }
-        });
+        nodeSelector.addActionListener(e -> setDataNode());
+        quoteSQLIdentifiers.addItemListener(e -> setQuoteSQLIdentifiers(quoteSQLIdentifiers.isSelected()));
+        defaultLockType.addItemListener(e -> setDefaultLockType(defaultLockType.isSelected()
+                ? ObjEntity.LOCK_TYPE_OPTIMISTIC
+                : ObjEntity.LOCK_TYPE_NONE));
+        clientSupport.addItemListener(e -> setClientSupport(clientSupport.isSelected()));
+        updateDefaultClientPackage.addActionListener(e -> updateDefaultClientPackage());
+        updateDefaultClientSuperclass.addActionListener(e -> updateDefaultClientSuperclass());
+        updateDefaultCatalog.addActionListener(e -> updateDefaultCatalog());
+        updateDefaultSchema.addActionListener(e -> updateDefaultSchema());
+        updateDefaultPackage.addActionListener(e -> updateDefaultPackage());
+        updateDefaultSuperclass.addActionListener(e -> updateDefaultSuperclass());
+        updateDefaultLockType.addActionListener(e -> updateDefaultLockType());
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/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 8c6272f..1fddebe 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
@@ -22,16 +22,10 @@ package org.apache.cayenne.modeler.editor;
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.EventObject;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import javax.swing.BorderFactory;
@@ -236,144 +230,118 @@ public class ObjEntityTab extends JPanel implements ObjEntityDisplayListener, Ex
 
         mediator.addObjEntityDisplayListener(this);
 
-        dbEntityCombo.addActionListener(new ActionListener() {
+        dbEntityCombo.addActionListener(e -> {
+            // Change DbEntity for current ObjEntity
+            ObjEntity entity = mediator.getCurrentObjEntity();
+            DbEntity dbEntity = (DbEntity) dbEntityCombo.getSelectedItem();
 
-            public void actionPerformed(ActionEvent e) {
-                // Change DbEntity for current ObjEntity
-                ObjEntity entity = mediator.getCurrentObjEntity();
-                DbEntity dbEntity = (DbEntity) dbEntityCombo.getSelectedItem();
-       
 
-                if (dbEntity != entity.getDbEntity()) {
-                    entity.setDbEntity(dbEntity);
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                }
+            if (dbEntity != entity.getDbEntity()) {
+                entity.setDbEntity(dbEntity);
+                mediator.fireObjEntityEvent(new EntityEvent(ObjEntityTab.this, entity));
             }
         });
 
-        superEntityCombo.addActionListener(new ActionListener() {
+        superEntityCombo.addActionListener(e -> {
+            // Change super-entity
+            ObjEntity superEntity = (ObjEntity) superEntityCombo.getSelectedItem();
+            String name = (superEntity == null || superEntity == NO_INHERITANCE)
+                    ? null
+                    : superEntity.getName();
 
-            public void actionPerformed(ActionEvent e) {
-                // Change super-entity
-                ObjEntity superEntity = (ObjEntity) superEntityCombo.getSelectedItem();
-                String name = (superEntity == null || superEntity == NO_INHERITANCE)
-                        ? null
-                        : superEntity.getName();
+            ObjEntity entity = mediator.getCurrentObjEntity();
 
-                ObjEntity entity = mediator.getCurrentObjEntity();
+            if (!Util.nullSafeEquals(name, entity.getSuperEntityName())) {
+                List<ObjAttribute> duplicateAttributes = null;
+                if (name != null) {
+                    duplicateAttributes = getDuplicatedAttributes(superEntity);
+                }
 
-                if (!Util.nullSafeEquals(name, entity.getSuperEntityName())) {
-                    List<ObjAttribute> duplicateAttributes = null;
-                    if (name != null) {
-                        duplicateAttributes = getDuplicatedAttributes(superEntity);
+                if (duplicateAttributes != null && duplicateAttributes.size() > 0) {
+                    DuplicatedAttributesDialog.showDialog(
+                            Application.getFrame(), duplicateAttributes, superEntity, entity);
+                    if (DuplicatedAttributesDialog.getResult().equals(DuplicatedAttributesDialog.CANCEL_RESULT)) {
+                        superEntityCombo.setSelectedItem(entity.getSuperEntity());
+                        superClassName.setText(entity.getSuperClassName());
+                        return;
                     }
+                }
+                entity.setSuperEntityName(name);
 
-                    if (duplicateAttributes != null && duplicateAttributes.size() > 0) {
-                        DuplicatedAttributesDialog.showDialog(
-                                Application.getFrame(), duplicateAttributes, superEntity, entity);
-                        if (DuplicatedAttributesDialog.getResult().equals(DuplicatedAttributesDialog.CANCEL_RESULT)) {
-                            superEntityCombo.setSelectedItem(entity.getSuperEntity());
-                            superClassName.setText(entity.getSuperClassName());
-                            return;
+                // drop not valid dbAttributePath
+                if (name == null) {
+                    for (ObjAttribute objAttribute : entity.getAttributes()) {
+                        if (objAttribute.getDbAttribute() == null) {
+                            objAttribute.setDbAttributePath(null);
                         }
                     }
-                    entity.setSuperEntityName(name);
-
-                    // drop not valid dbAttributePath
-                    if (name == null) {
-                        for (ObjAttribute objAttribute : entity.getAttributes()) {
-                            if (objAttribute.getDbAttribute() == null) {
-                                objAttribute.setDbAttributePath(null);
-                            }
-                        }
-                    }
-                    
-                    if (name == null) {
-                        dbEntityCombo.setEnabled(true);
-                    } else {
-                        dbEntityCombo.setEnabled(false);
-                        dbEntityCombo.getModel().setSelectedItem(null);
-                    }
+                }
 
-                    // if a super-entity selected, disable table selection
-                    // and also update parent DbEntity selection...
-                    toggleEnabled(name == null, !serverOnly.isSelected());
-                    dbEntityCombo.getModel().setSelectedItem(entity.getDbEntity());
-                    superClassName.setText(entity.getSuperClassName());
+                if (name == null) {
+                    dbEntityCombo.setEnabled(true);
+                } else {
+                    dbEntityCombo.setEnabled(false);
+                    dbEntityCombo.getModel().setSelectedItem(null);
+                }
 
-                    // fire both EntityEvent and EntityDisplayEvent;
-                    // the later is to update attribute and relationship display
+                // if a super-entity selected, disable table selection
+                // and also update parent DbEntity selection...
+                toggleEnabled(name == null, !serverOnly.isSelected());
+                dbEntityCombo.getModel().setSelectedItem(entity.getDbEntity());
+                superClassName.setText(entity.getSuperClassName());
 
-                    DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
-                    DataMap map = mediator.getCurrentDataMap();
+                // fire both EntityEvent and EntityDisplayEvent;
+                // the later is to update attribute and relationship display
 
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                    mediator.fireObjEntityDisplayEvent(new EntityDisplayEvent(this, entity, map, domain));
-                }
+                DataChannelDescriptor domain = (DataChannelDescriptor) mediator.getProject().getRootNode();
+                DataMap map = mediator.getCurrentDataMap();
+
+                mediator.fireObjEntityEvent(new EntityEvent(this, entity));
+                mediator.fireObjEntityDisplayEvent(new EntityDisplayEvent(this, entity, map, domain));
             }
         });
 
-        tableLabel.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent e) {
-                // Jump to DbEntity of the current ObjEntity
-                DbEntity entity = mediator.getCurrentObjEntity().getDbEntity();
-                if (entity != null) {
-                    DataChannelDescriptor dom = (DataChannelDescriptor) mediator.getProject().getRootNode();
-                    mediator.fireDbEntityDisplayEvent(new EntityDisplayEvent(this, entity, entity.getDataMap(), dom));
-                }
+        tableLabel.addActionListener(e -> {
+            // Jump to DbEntity of the current ObjEntity
+            DbEntity entity = mediator.getCurrentObjEntity().getDbEntity();
+            if (entity != null) {
+                DataChannelDescriptor dom = (DataChannelDescriptor) mediator.getProject().getRootNode();
+                mediator.fireDbEntityDisplayEvent(new EntityDisplayEvent(this, entity, entity.getDataMap(), dom));
             }
         });
 
- 
-
-        readOnly.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                ObjEntity entity = mediator.getCurrentObjEntity();
-                if (entity != null) {
-                    entity.setReadOnly(readOnly.isSelected());
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                }
+        readOnly.addItemListener(e -> {
+            ObjEntity entity = mediator.getCurrentObjEntity();
+            if (entity != null) {
+                entity.setReadOnly(readOnly.isSelected());
+                mediator.fireObjEntityEvent(new EntityEvent(this, entity));
             }
         });
 
-        optimisticLocking.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                ObjEntity entity = mediator.getCurrentObjEntity();
-                if (entity != null) {
-                    entity.setDeclaredLockType(optimisticLocking.isSelected()
-                            ? ObjEntity.LOCK_TYPE_OPTIMISTIC
-                            : ObjEntity.LOCK_TYPE_NONE);
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                }
+        optimisticLocking.addItemListener(e -> {
+            ObjEntity entity = mediator.getCurrentObjEntity();
+            if (entity != null) {
+                entity.setDeclaredLockType(optimisticLocking.isSelected()
+                        ? ObjEntity.LOCK_TYPE_OPTIMISTIC
+                        : ObjEntity.LOCK_TYPE_NONE);
+                mediator.fireObjEntityEvent(new EntityEvent(this, entity));
             }
         });
 
-        serverOnly.addItemListener(new ItemListener() {
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                ObjEntity entity = mediator.getCurrentObjEntity();
-                if (entity != null) {
-                    entity.setServerOnly(serverOnly.isSelected());
-                    toggleEnabled(dbEntityCombo.isEnabled(), !serverOnly.isSelected());
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                }
+        serverOnly.addItemListener(e -> {
+            ObjEntity entity = mediator.getCurrentObjEntity();
+            if (entity != null) {
+                entity.setServerOnly(serverOnly.isSelected());
+                toggleEnabled(dbEntityCombo.isEnabled(), !serverOnly.isSelected());
+                mediator.fireObjEntityEvent(new EntityEvent(this, entity));
             }
         });
 
-        isAbstract.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                ObjEntity entity = mediator.getCurrentObjEntity();
-                if (entity != null) {
-                    entity.setAbstract(isAbstract.isSelected());
-                    mediator.fireObjEntityEvent(new EntityEvent(this, entity));
-                }
+        isAbstract.addItemListener(e -> {
+            ObjEntity entity = mediator.getCurrentObjEntity();
+            if (entity != null) {
+                entity.setAbstract(isAbstract.isSelected());
+                mediator.fireObjEntityEvent(new EntityEvent(this, entity));
             }
         });
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
index 53524b6..a0e0636 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjectQueryPropertiesPanel.java
@@ -20,8 +20,6 @@
 package org.apache.cayenne.modeler.editor;
 
 import java.awt.BorderLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 import javax.swing.JCheckBox;
 
@@ -80,13 +78,9 @@ public class ObjectQueryPropertiesPanel extends SelectPropertiesPanel {
     protected void initController() {
         super.initController();
 
-        dataRows.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                Boolean b = dataRows.isSelected() ? Boolean.TRUE : Boolean.FALSE;
-                setQueryProperty(QueryMetadata.FETCHING_DATA_ROWS_PROPERTY, String.valueOf(b));
-            }
+        dataRows.addItemListener(e -> {
+            Boolean b = dataRows.isSelected() ? Boolean.TRUE : Boolean.FALSE;
+            setQueryProperty(QueryMetadata.FETCHING_DATA_ROWS_PROPERTY, String.valueOf(b));
         });
     }
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureQueryView.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureQueryView.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureQueryView.java
index 787f515..505ae30 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureQueryView.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureQueryView.java
@@ -139,12 +139,7 @@ public class ProcedureQueryView extends JPanel {
             }
         });
 
-        mediator.addQueryDisplayListener(new QueryDisplayListener() {
-
-            public void currentQueryChanged(QueryDisplayEvent e) {
-                initFromModel();
-            }
-        });
+        mediator.addQueryDisplayListener(e -> initFromModel());
     }
 
     /**
@@ -282,12 +277,9 @@ public class ProcedureQueryView extends JPanel {
         protected PanelBuilder createPanelBuilder() {
             labelCase = Application.getWidgetFactory().createUndoableComboBox();
             labelCase.setRenderer(new LabelCapsRenderer());
-            labelCase.addActionListener(new ActionListener() {
-                @Override
-                public void actionPerformed(ActionEvent event) {
-                    String value = labelCase.getModel().getSelectedItem().toString();
-                    setQueryProperty(ProcedureQuery.COLUMN_NAME_CAPITALIZATION_PROPERTY, value);
-                }
+            labelCase.addActionListener(event -> {
+                String value = labelCase.getModel().getSelectedItem().toString();
+                setQueryProperty(ProcedureQuery.COLUMN_NAME_CAPITALIZATION_PROPERTY, value);
             });
 
             PanelBuilder builder = super.createPanelBuilder();

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java
index 57b2f61..0d5c0d8 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ProcedureTab.java
@@ -20,8 +20,6 @@
 package org.apache.cayenne.modeler.editor;
 
 import java.awt.BorderLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.EventObject;
 
 import javax.swing.JCheckBox;
@@ -114,14 +112,11 @@ public class ProcedureTab extends JPanel implements ProcedureDisplayListener, Ex
     }
 
     private void initController() {
-        returnsValue.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent e) {
-                Procedure procedure = eventController.getCurrentProcedure();
-                if (procedure != null && !ignoreChange) {
-                    procedure.setReturningValue(returnsValue.isSelected());
-                    eventController.fireProcedureEvent(new ProcedureEvent(ProcedureTab.this, procedure));
-                }
+        returnsValue.addItemListener(e -> {
+            Procedure procedure = eventController.getCurrentProcedure();
+            if (procedure != null && !ignoreChange) {
+                procedure.setReturningValue(returnsValue.isSelected());
+                eventController.fireProcedureEvent(new ProcedureEvent(ProcedureTab.this, procedure));
             }
         });
 

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java
index 4e42f35..f8d867f 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/RawQueryPropertiesPanel.java
@@ -20,12 +20,7 @@
 package org.apache.cayenne.modeler.editor;
 
 import java.awt.BorderLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.List;
 
 import javax.swing.DefaultComboBoxModel;
@@ -54,7 +49,7 @@ import org.apache.cayenne.query.QueryMetadata;
 public abstract class RawQueryPropertiesPanel extends SelectPropertiesPanel {
 
     protected JCheckBox dataObjects;
-    protected JComboBox entities;
+    protected JComboBox<ObjEntity> entities;
 
     public RawQueryPropertiesPanel(ProjectController mediator) {
         super(mediator);
@@ -62,20 +57,11 @@ public abstract class RawQueryPropertiesPanel extends SelectPropertiesPanel {
 
     protected void initController() {
         super.initController();
-        dataObjects.addItemListener(new ItemListener() {
+        dataObjects.addItemListener(e -> setFetchingDataObjects(dataObjects.isSelected()));
 
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                setFetchingDataObjects(dataObjects.isSelected());
-            }
-        });
-
-        entities.addActionListener(new ActionListener() {
-
-            public void actionPerformed(ActionEvent event) {
-                ObjEntity entity = (ObjEntity) entities.getModel().getSelectedItem();
-                setEntity(entity);
-            }
+        entities.addActionListener(event -> {
+            ObjEntity entity = (ObjEntity) entities.getModel().getSelectedItem();
+            setEntity(entity);
         });
     }
 
@@ -134,15 +120,14 @@ public abstract class RawQueryPropertiesPanel extends SelectPropertiesPanel {
         // making it impossible to reference other DataMaps.
 
         DataMap map = mediator.getCurrentDataMap();
-        List objEntities = new ArrayList();
-        objEntities.addAll(map.getObjEntities());
+        List<ObjEntity> objEntities = new ArrayList<>(map.getObjEntities());
 
         if (objEntities.size() > 1) {
-            Collections.sort(objEntities, Comparators.getDataMapChildrenComparator());
+            objEntities.sort(Comparators.getDataMapChildrenComparator());
         }
 
         entities.setEnabled(fetchingDO && isEnabled());
-        DefaultComboBoxModel model = new DefaultComboBoxModel(objEntities.toArray());
+        DefaultComboBoxModel<ObjEntity> model = new DefaultComboBoxModel<>(objEntities.toArray(new ObjEntity[0]));
         model.setSelectedItem(getEntity(query));
         entities.setModel(model);
     }

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/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 c0bc6d1..8becf4c 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
@@ -20,8 +20,6 @@
 package org.apache.cayenne.modeler.editor;
 
 import java.awt.BorderLayout;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 import java.util.Arrays;
 import java.util.Iterator;
 
@@ -133,19 +131,13 @@ public class SelectQueryMainTab extends BaseQueryMainTab {
     }
 
     private void initController() {
-
-        distinct.addItemListener(new ItemListener() {
-
-            @Override
-            public void itemStateChanged(ItemEvent e) {
-                QueryDescriptor query = getQuery();
-                if (query != null) {
-                    query.setProperty(SelectQuery.DISTINCT_PROPERTY, Boolean.toString(distinct.isSelected()));
-                    mediator.fireQueryEvent(new QueryEvent(this, query));
-                }
+        distinct.addItemListener(e -> {
+            QueryDescriptor query = getQuery();
+            if (query != null) {
+                query.setProperty(SelectQuery.DISTINCT_PROPERTY, Boolean.toString(distinct.isSelected()));
+                mediator.fireQueryEvent(new QueryEvent(this, query));
             }
         });
-
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/PKDBGeneratorPanel.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/PKDBGeneratorPanel.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/PKDBGeneratorPanel.java
index a523a73..0d92dbd 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/PKDBGeneratorPanel.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/dbentity/PKDBGeneratorPanel.java
@@ -42,7 +42,7 @@ import com.jgoodies.forms.layout.FormLayout;
 
 public class PKDBGeneratorPanel extends PKGeneratorPanel {
 
-    private JComboBox attributes;
+    private JComboBox<Object> attributes;
 
     public PKDBGeneratorPanel(ProjectController mediator) {
         super(mediator);
@@ -51,7 +51,7 @@ public class PKDBGeneratorPanel extends PKGeneratorPanel {
 
     private void initView() {
 
-        attributes = new JComboBox();
+        attributes = new JComboBox<>();
         attributes.setEditable(false);
         attributes.setRenderer(new AttributeRenderer());
 
@@ -104,7 +104,7 @@ public class PKDBGeneratorPanel extends PKGeneratorPanel {
         else {
 
             attributes.setEnabled(true);
-            MutableComboBoxModel model = new DefaultComboBoxModel(pkAttributes.toArray());
+            MutableComboBoxModel<Object> model = new DefaultComboBoxModel<>(pkAttributes.toArray());
             String noSelection = "<Select Generated Column>";
             model.insertElementAt(noSelection, 0);
             model.setSelectedItem(noSelection);
@@ -118,19 +118,16 @@ public class PKDBGeneratorPanel extends PKGeneratorPanel {
             }
 
             // listen for selection changes of the new entity
-            attributes.addItemListener(new ItemListener() {
+            attributes.addItemListener(e -> {
+                Object item = e.getItem();
+                if (item instanceof DbAttribute) {
 
-                public void itemStateChanged(ItemEvent e) {
-                    Object item = e.getItem();
-                    if (item instanceof DbAttribute) {
+                    boolean generated = e.getStateChange() == ItemEvent.SELECTED;
+                    DbAttribute a = (DbAttribute) item;
 
-                        boolean generated = e.getStateChange() == ItemEvent.SELECTED;
-                        DbAttribute a = (DbAttribute) item;
-
-                        if (a.isGenerated() != generated) {
-                            a.setGenerated(generated);
-                            mediator.fireDbEntityEvent(new EntityEvent(this, entity));
-                        }
+                    if (a.isGenerated() != generated) {
+                        a.setGenerated(generated);
+                        mediator.fireDbEntityEvent(new EntityEvent(this, entity));
                     }
                 }
             });

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/combo/SuggestionList.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/combo/SuggestionList.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/combo/SuggestionList.java
index e1d99ab..810eec2 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/combo/SuggestionList.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/util/combo/SuggestionList.java
@@ -19,7 +19,6 @@
 package org.apache.cayenne.modeler.util.combo;
 
 import java.awt.Color;
-import java.awt.event.ItemEvent;
 import java.awt.event.ItemListener;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
@@ -150,9 +149,7 @@ public class SuggestionList extends BasicComboPopup {
      */
     @Override
     protected ItemListener createItemListener() {
-        return new ItemListener() {
-            public void itemStateChanged(ItemEvent e) {}
-        };
+        return e -> {};
     }
     
     /**

http://git-wip-us.apache.org/repos/asf/cayenne/blob/6221d5ec/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/swing/ItemEventBinding.java
----------------------------------------------------------------------
diff --git a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/swing/ItemEventBinding.java b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/swing/ItemEventBinding.java
index 9ce80dc..b87dff5 100644
--- a/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/swing/ItemEventBinding.java
+++ b/modeler/cayenne-modeler/src/main/java/org/apache/cayenne/swing/ItemEventBinding.java
@@ -20,8 +20,6 @@
 package org.apache.cayenne.swing;
 
 import java.awt.Component;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
 
 import javax.swing.AbstractButton;
 
@@ -37,12 +35,7 @@ public class ItemEventBinding extends BindingBase {
         super(expression);
         this.boundItem = boundItem;
 
-        boundItem.addItemListener(new ItemListener() {
-
-            public void itemStateChanged(ItemEvent e) {
-                updateModel();
-            }
-        });
+        boundItem.addItemListener(e -> updateModel());
     }
 
     public Component getView() {
@@ -56,9 +49,8 @@ public class ItemEventBinding extends BindingBase {
         // convert to boolean
         if (value != null) {
             if (value instanceof Boolean) {
-                b = ((Boolean) value).booleanValue();
-            }
-            else if (value instanceof Number) {
+                b = (Boolean) value;
+            } else if (value instanceof Number) {
                 b = ((Number) value).intValue() != 0;
             }
         }
@@ -66,8 +58,7 @@ public class ItemEventBinding extends BindingBase {
         modelUpdateDisabled = true;
         try {
             boundItem.setSelected(b);
-        }
-        finally {
+        } finally {
             modelUpdateDisabled = false;
         }
     }


Mime
View raw message