Search in sources :

Example 1 with DataMapDisplayListener

use of org.apache.cayenne.modeler.event.DataMapDisplayListener in project cayenne by apache.

the class DataMapView method initController.

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();
        }
    });
    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();
        }
    });
}
Also used : ItemEvent(java.awt.event.ItemEvent) ActionListener(java.awt.event.ActionListener) DataMapDisplayListener(org.apache.cayenne.modeler.event.DataMapDisplayListener) ActionEvent(java.awt.event.ActionEvent) ItemListener(java.awt.event.ItemListener) DataMapDisplayEvent(org.apache.cayenne.modeler.event.DataMapDisplayEvent) DataMap(org.apache.cayenne.map.DataMap)

Aggregations

ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 ItemEvent (java.awt.event.ItemEvent)1 ItemListener (java.awt.event.ItemListener)1 DataMap (org.apache.cayenne.map.DataMap)1 DataMapDisplayEvent (org.apache.cayenne.modeler.event.DataMapDisplayEvent)1 DataMapDisplayListener (org.apache.cayenne.modeler.event.DataMapDisplayListener)1