cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aadamc...@apache.org
Subject svn commit: r591617 [2/2] - in /cayenne/main/trunk/framework/cayenne-modeler/src/main: java/org/apache/cayenne/modeler/ java/org/apache/cayenne/modeler/action/ java/org/apache/cayenne/modeler/editor/ java/org/apache/cayenne/modeler/event/ resources/org...
Date Sat, 03 Nov 2007 13:17:31 GMT
Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackDescriptorTableModel.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,189 @@
+/*****************************************************************
+ *   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.editor;
+
+import org.apache.cayenne.modeler.util.CayenneTableModel;
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.event.CallbackMethodEvent;
+import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.map.CallbackDescriptor;
+import org.apache.cayenne.map.event.MapEvent;
+
+import java.util.List;
+
+
+/**
+ * Table model for displaying methods list for a particular CallbackDescriptor
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 23, 2007
+ */
+public class CallbackDescriptorTableModel extends CayenneTableModel {
+    private static final int COLUMN_COUNT = 1;
+    public static final int METHOD_NAME = 0;
+    protected ObjEntity entity;
+    protected CallbackDescriptor callbackDescriptor;
+
+    /**
+     * constructor
+     *
+     * @param mediator mediator instance
+     * @param eventSource event source
+     * @param objectList default objects list
+     * @param callbackDescriptor callback descriptor instance
+     */
+    public CallbackDescriptorTableModel(
+            ProjectController mediator,
+            Object eventSource,
+            List objectList,
+            CallbackDescriptor callbackDescriptor) {
+        super(mediator, eventSource, objectList);
+        this.callbackDescriptor = callbackDescriptor;
+    }
+
+    /**
+     * does nothing
+     * @param newVal newVal
+     * @param row row
+     * @param col col
+     */
+    public void setUpdatedValueAt(Object newVal, int row, int col) {
+        //do nothing
+    }
+
+    /**
+     * Returns Java class of the internal list elements.
+     */
+    public Class getElementsClass() {
+        return String.class;
+    }
+
+    /**
+     * @param rowIndex method index
+     * @return callback method for the specified index
+     */
+    public String getCallbackMethod(int rowIndex) {
+        return (String) objectList.get(rowIndex);
+    }
+
+    /**
+     * Returns the number of columns in the model. A
+     * <code>JTable</code> uses this method to determine how many columns it
+     * should create and display by default.
+     *
+     * @return the number of columns in the model
+     * @see #getRowCount
+     */
+    public int getColumnCount() {
+        return COLUMN_COUNT;
+    }
+
+
+    /**
+     * Returns the value for the cell at <code>columnIndex</code> and
+     * <code>rowIndex</code>.
+     *
+     * @param	rowIndex	the row whose value is to be queried
+     * @param	columnIndex 	the column whose value is to be queried
+     * @return	the value Object at the specified cell
+     */
+    public Object getValueAt(int rowIndex, int columnIndex) {
+        switch (columnIndex) {
+            case METHOD_NAME:
+                return getCallbackMethod(rowIndex);
+        }
+
+        return null;
+    }
+
+    /**
+     * sorting disabled
+     */
+    protected void orderList() {
+        // NOOP
+    }
+
+    /**
+     * @param column column index
+     * @return column name
+     */
+    public String getColumnName(int column) {
+        switch (column) {
+            case METHOD_NAME:
+                return "Method";
+        }
+
+        return null;
+    }
+
+    /**
+     * all cells are editable
+     *
+     * @param rowIndex row index
+     * @param columnIndex column index
+     * @return true
+     */
+    public boolean isCellEditable(int rowIndex, int columnIndex) {
+        return true;
+    }
+
+    /**
+     * stores edited value
+     *
+     * @param newVal new value
+     * @param row row
+     * @param col column
+     */
+    public void setValueAt(Object newVal, int row, int col) {
+        String method = (String) newVal;
+        if (method != null) {
+            method = method.trim();
+        }
+        String prevMethod = (String) 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)) {
+                //update model
+                getObjectList().set(row, method);
+
+                //update entity
+                getCallbackDescriptor().setCallbackMethodAt(row, method);
+
+                fireTableRowsUpdated(row, row);
+
+                mediator.fireCallbackMethodEvent(new CallbackMethodEvent(
+                        eventSource,
+                        prevMethod,
+                        method,
+                        MapEvent.CHANGE
+                ));
+            }
+        }
+    }
+
+    /**
+     * @return CallbackDescriptor of the model
+     */
+    public CallbackDescriptor getCallbackDescriptor() {
+        return callbackDescriptor;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackType.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackType.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackType.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/CallbackType.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,72 @@
+/*****************************************************************
+ *   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.editor;
+
+
+/**
+ * Entity for callback type.
+ * Contains type and type name
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 26, 2007
+ */
+
+public class CallbackType {
+    /**
+     * callback type ID
+     */
+    private int type;
+
+    /**
+     * callback type name
+     */
+    private String name;
+
+    /**
+     * constructor
+     * @param type type id
+     * @param name name
+     */
+    public CallbackType(int type, String name) {
+        this.type = type;
+        this.name = name;
+    }
+
+    /**
+     * @return callback type id
+     */
+    public int getType() {
+        return type;
+    }
+
+    /**
+     * @return callback name
+     */
+    public String getName() {
+        return name;
+    }
+
+    /**
+     * @return callback name
+     */
+    public String toString() {
+        return name;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapCallbackListenersTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapCallbackListenersTab.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapCallbackListenersTab.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapCallbackListenersTab.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,135 @@
+/*****************************************************************
+ *   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.editor;
+
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.action.*;
+import org.apache.cayenne.modeler.util.CayenneAction;
+import org.apache.cayenne.modeler.event.*;
+import org.apache.cayenne.map.CallbackMap;
+
+import java.util.List;
+
+
+/**
+ * Tab for editing default entity listeners of a DataMap
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+public class DataMapCallbackListenersTab extends AbstractCallbackListenersTab
+        implements DataMapDisplayListener {
+
+
+    /**
+     * Constructor
+     * @param mediator mediator instance
+     */
+    public DataMapCallbackListenersTab(ProjectController mediator) {
+        super(mediator);
+    }
+
+    /**
+     * @return CallbackMap with callback methods
+     */
+    protected CallbackMap getCallbackMap() {
+        String listenerClass = (String) listenerClassCombo.getSelectedItem();
+        return listenerClass == null ? 
+               null : mediator.getCurrentDataMap().getDefaultEntityListener(listenerClass).getCallbackMap();
+    }
+
+    /**
+     * process DapaMap selection
+     * @param e event
+     */
+    public void currentDataMapChanged(DataMapDisplayEvent e) {
+        if (e.getSource() == this) {
+            return;
+        }
+
+        if (e.getDataMap() != null) {
+            rebuildListenerClassCombo();
+
+            mediator.fireCallbackTypeSelectionEvent(
+                new CallbackTypeSelectionEvent(
+                    e.getSource(),
+                    (CallbackType)callbackTypeCombo.getItemAt(0))
+            );
+
+            rebuildTable();
+        }
+    }
+
+
+    /**
+     * @return returns entity listeners list
+     */
+    protected List getEntityListeners() {
+        return mediator.getCurrentDataMap().getDefaultEntityListeners();
+    }
+
+
+    /**
+     * init listeners
+     */
+    protected void initController() {
+        super.initController();
+        mediator.addDataMapDisplayListener(this);
+    }
+
+    /**
+     * @return create callback method action
+     */
+    protected CayenneAction getCreateCallbackMethodAction() {
+        Application app = Application.getInstance();
+        return app.getAction(CreateCallbackMethodForDataMapListenerAction.ACTION_NAME);
+    }
+
+    /**
+     * @return remove callback method action
+     */
+    protected AbstractRemoveCallbackMethodAction getRemoveCallbackMethodAction() {
+        Application app = Application.getInstance();
+        return (AbstractRemoveCallbackMethodAction) app.getAction(RemoveCallbackMethodForDataMapListenerAction.ACTION_NAME);
+    }
+
+    /**
+     * @return action for removing entity listeners
+     */
+    protected CayenneAction getRemoveEntityListenerAction() {
+        return Application.getInstance().getAction(RemoveEntityListenerForDataMapAction.getActionName());
+    }
+
+
+    /**
+     * @return action for creating entity listeners
+     */
+    public CayenneAction getCreateEntityListenerAction() {
+        return Application.getInstance().getAction(CreateDataMapEntityListenerAction.getActionName());
+    }
+
+    /**
+     * @return action for changing entity listeners
+     */
+    public CayenneAction getChangeEntityListenerAction() {
+        return Application.getInstance().getAction(ChangeDataMapEntityListenerClassAction.getActionName());
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapTabbedView.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapTabbedView.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapTabbedView.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/DataMapTabbedView.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,62 @@
+/*****************************************************************
+ *   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.editor;
+
+import org.apache.cayenne.modeler.ProjectController;
+
+import javax.swing.*;
+
+
+/**
+ * Data map editing tabs container
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+
+public class DataMapTabbedView extends JTabbedPane {
+    ProjectController mediator;
+
+    /**
+     * constructor
+     * @param mediator mediator instance
+     */
+    public DataMapTabbedView(ProjectController mediator) {
+        this.mediator = mediator;
+
+        initView();
+    }
+
+    /**
+     * create tabs
+     */
+    private void initView() {
+        setTabPlacement(JTabbedPane.TOP);
+
+        // add panels to tabs
+        // note that those panels that have no internal scrollable tables
+        // must be wrapped in a scroll pane
+        JScrollPane dataMapView = new JScrollPane(new DataMapView(mediator));
+        addTab("DataMap", dataMapView);
+
+        DataMapCallbackListenersTab listenersPanel = new DataMapCallbackListenersTab(mediator);
+        addTab("Listeners", listenersPanel);
+    }
+}
+

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java?rev=591617&r1=591616&r2=591617&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/EditorView.java Sat Nov  3 06:17:28 2007
@@ -125,7 +125,7 @@
         DataNodeEditor nodeController = new DataNodeEditor(eventController);
         detailPanel.add(new JScrollPane(nodeController.getView()), NODE_VIEW);
 
-        Component dataMapView = new DataMapView(eventController);
+        Component dataMapView = new DataMapTabbedView(eventController);
         detailPanel.add(new JScrollPane(dataMapView), DATA_MAP_VIEW);
 
         Component procedureView = new ProcedureTabbedView(eventController);

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackListenersTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackListenersTab.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackListenersTab.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackListenersTab.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,148 @@
+/*****************************************************************
+ *   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.editor;
+
+import org.apache.cayenne.modeler.util.CayenneAction;
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.Application;
+import org.apache.cayenne.modeler.action.*;
+import org.apache.cayenne.modeler.event.*;
+import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.map.CallbackMap;
+
+import java.util.List;
+
+
+/**
+ * Tab for editing entity listeners of an ObjEntity
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+public class ObjEntityCallbackListenersTab extends AbstractCallbackListenersTab
+    implements ObjEntityDisplayListener {
+
+    /**
+     * constructor
+     * @param mediator mediator instance
+     */
+    public ObjEntityCallbackListenersTab(ProjectController mediator) {
+        super(mediator);
+    }
+
+    /**
+     * @return CallbackMap with callback methods
+     */
+    protected CallbackMap getCallbackMap() {
+        String listenerClass = (String) listenerClassCombo.getSelectedItem();
+        if (mediator.getCurrentObjEntity() != null &&
+                mediator.getCurrentObjEntity().getEntityListener(listenerClass) != null) {
+            return mediator.getCurrentObjEntity().getEntityListener(listenerClass).getCallbackMap();
+        }
+        return null;
+    }
+
+
+    /**
+     * Current obj entity used as a model has changed.
+     *
+     * @param e event
+     */
+    public void currentObjEntityChanged(EntityDisplayEvent e) {
+        if (e.getSource() == this) {
+            return;
+        }
+
+        ObjEntity entity = (ObjEntity) e.getEntity();
+        // Important: process event even if this is the same entity,
+        // since the inheritance structure might have changed
+        if (entity != null) {
+            rebuildListenerClassCombo();
+
+            mediator.fireCallbackTypeSelectionEvent(
+                new CallbackTypeSelectionEvent(
+                    e.getSource(),
+                    (CallbackType)callbackTypeCombo.getItemAt(0))
+            );
+
+            rebuildTable();
+        }
+
+        // if an entity was selected on a tree,
+        // unselect currently selected row
+        if (e.isUnselectAttributes()) {
+            table.clearSelection();
+        }
+    }
+
+    /**
+     * init listener
+     */
+    protected void initController() {
+        super.initController();
+        mediator.addObjEntityDisplayListener(this);
+    }
+
+    /**
+     * @return returns entity listeners list
+     */
+    protected List getEntityListeners() {
+        return mediator.getCurrentObjEntity() == null ? null :
+               mediator.getCurrentObjEntity().getEntityListeners();
+    }
+
+    /**
+     * @return create callback method action
+     */
+    protected CayenneAction getCreateCallbackMethodAction() {
+        Application app = Application.getInstance();
+        return app.getAction(CreateCallbackMethodForListenerAction.ACTION_NAME);
+    }
+
+
+    /**
+     * @return remove callback method action
+     */
+    protected AbstractRemoveCallbackMethodAction getRemoveCallbackMethodAction() {
+        Application app = Application.getInstance();
+        return (AbstractRemoveCallbackMethodAction)app.getAction(RemoveCallbackMethodForListenerAction.ACTION_NAME);
+    }
+
+    /**
+     * @return action for removing entity listeners
+     */
+    protected CayenneAction getRemoveEntityListenerAction() {
+        return Application.getInstance().getAction(RemoveEntityListenerAction.getActionName());
+    }
+
+    /**
+     * @return action for creating entity listeners
+     */
+    public CayenneAction getCreateEntityListenerAction() {
+        return Application.getInstance().getAction(CreateObjEntityListenerAction.getActionName());
+    }
+
+    /**
+     * @return action for changing entity listeners
+     */
+    public CayenneAction getChangeEntityListenerAction() {
+        return Application.getInstance().getAction(ChangeObjEntityListenerClassAction.getActionName());
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackMethodsTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackMethodsTab.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackMethodsTab.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityCallbackMethodsTab.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,94 @@
+/*****************************************************************
+ *   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.editor;
+
+import org.apache.cayenne.modeler.ProjectController;
+import org.apache.cayenne.modeler.event.ObjEntityDisplayListener;
+import org.apache.cayenne.modeler.event.EntityDisplayEvent;
+import org.apache.cayenne.modeler.event.CallbackTypeSelectionEvent;
+import org.apache.cayenne.map.ObjEntity;
+import org.apache.cayenne.map.CallbackMap;
+
+
+/**
+ * Tab for editing callback methods on an ObjEntity
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+public class ObjEntityCallbackMethodsTab extends AbstractCallbackMethodsTab implements
+        ObjEntityDisplayListener {
+
+    /**
+     * constructor
+     * @param mediator mediator instance
+     */
+    public ObjEntityCallbackMethodsTab(ProjectController mediator) {
+        super(mediator);
+    }
+
+    /**
+     * Processes selection of a new ObjEntity
+     */
+    public void currentObjEntityChanged(EntityDisplayEvent e) {
+        if (e.getSource() == this) {
+            return;
+        }
+
+        ObjEntity entity = (ObjEntity) e.getEntity();
+        // Important: process event even if this is the same entity,
+        // since the inheritance structure might have changed
+        if (entity != null) {
+            mediator.fireCallbackTypeSelectionEvent(
+                new CallbackTypeSelectionEvent(
+                    e.getSource(),
+                    (CallbackType)callbackTypeCombo.getItemAt(0))
+            );
+
+            rebuildTable();
+        }
+
+        // if an entity was selected on a tree,
+        // unselect currently selected row
+        if (e.isUnselectAttributes()) {
+            table.clearSelection();
+        }
+    }
+
+
+    /**
+     * listeners initialization
+     */
+    protected void initController() {
+        super.initController();
+        mediator.addObjEntityDisplayListener(this);
+    }
+
+
+    /**
+     * @return CallbackMap with callback methods
+     */
+    protected CallbackMap getCallbackMap() {
+        if (mediator.getCurrentObjEntity() != null) {
+            return mediator.getCurrentObjEntity().getCallbackMap();
+        }
+        return null;
+    }
+}
+

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java?rev=591617&r1=591616&r2=591617&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTab.java Sat Nov  3 06:17:28 2007
@@ -102,6 +102,8 @@
     protected JButton tableLabel;
     protected JCheckBox readOnly;
     protected JCheckBox optimisticLocking;
+    protected JCheckBox excludeSuperclassListeners;
+    protected JCheckBox excludeDefaultListeners;
 
     protected JComponent clientSeparator;
     protected JLabel serverOnlyLabel;
@@ -162,6 +164,8 @@
 
         readOnly = new JCheckBox();
         optimisticLocking = new JCheckBox();
+        excludeSuperclassListeners = new JCheckBox();
+        excludeDefaultListeners = new JCheckBox();
 
         tableLabel = CayenneWidgetFactory.createLabelButton("Table/View:");
         syncWithDbEntityButton = CayenneWidgetFactory.createButton("Sync w/DbEntity");
@@ -184,7 +188,7 @@
 
         // assemble
         FormLayout layout = new FormLayout(
-                "right:70dlu, 3dlu, fill:135dlu, 3dlu, pref",
+                "right:100dlu, 3dlu, fill:135dlu, 3dlu, pref",
                 "");
         DefaultFormBuilder builder = new DefaultFormBuilder(layout);
         builder.setDefaultDialogBorder();
@@ -201,6 +205,9 @@
         builder.append("Qualifier:", qualifier.getComponent(), 3);
         builder.append("Read-Only:", readOnly, 3);
         builder.append("Optimistic Locking:", optimisticLocking, 3);
+        //add callback-related stuff
+        builder.append("Exclude superclass listeners:", excludeSuperclassListeners, 3);
+        builder.append("Exclude default listeners:", excludeDefaultListeners, 3);
 
         clientSeparator = builder.appendSeparator("Java Client");
         serverOnlyLabel = builder.append("Not for Client Use:", serverOnly, 3);
@@ -312,6 +319,32 @@
             }
         });
 
+        excludeSuperclassListeners.addActionListener(
+                new ActionListener() {
+
+                    public void actionPerformed(ActionEvent e) {
+                        ObjEntity entity = mediator.getCurrentObjEntity();
+                        if (entity != null) {
+                            entity.setExcludingSuperclassListeners(excludeSuperclassListeners.isSelected());
+                            mediator.fireObjEntityEvent(new EntityEvent(this, entity));
+                        }
+                    }
+                }
+        );
+
+        excludeDefaultListeners.addActionListener(
+                new ActionListener() {
+
+                    public void actionPerformed(ActionEvent e) {
+                        ObjEntity entity = mediator.getCurrentObjEntity();
+                        if (entity != null) {
+                            entity.setExcludingDefaultListeners(excludeDefaultListeners.isSelected());
+                            mediator.fireObjEntityEvent(new EntityEvent(this, entity));
+                        }
+                    }
+                }
+        );
+
         serverOnly.addActionListener(new ActionListener() {
 
             public void actionPerformed(ActionEvent e) {
@@ -328,6 +361,8 @@
     /**
      * Updates the view from the current model state. Invoked when a currently displayed
      * ObjEntity is changed.
+     *
+     * @param entity current entity
      */
     private void initFromModel(final ObjEntity entity) {
         // TODO: this is a hack until we implement a real MVC
@@ -350,6 +385,8 @@
         // otherwise we must keep this checked in but not editable.
         optimisticLocking
                 .setSelected(entity.getDeclaredLockType() == ObjEntity.LOCK_TYPE_OPTIMISTIC);
+        excludeSuperclassListeners.setSelected(entity.isExcludingSuperclassListeners());
+        excludeDefaultListeners.setSelected(entity.isExcludingDefaultListeners());
 
         // init DbEntities
         DataMap map = mediator.getCurrentDataMap();

Modified: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTabbedView.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTabbedView.java?rev=591617&r1=591616&r2=591617&view=diff
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTabbedView.java (original)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/ObjEntityTabbedView.java Sat Nov  3 06:17:28 2007
@@ -21,8 +21,7 @@
 
 import java.awt.Component;
 
-import javax.swing.JScrollPane;
-import javax.swing.JTabbedPane;
+import javax.swing.*;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
 
@@ -31,12 +30,8 @@
 import org.apache.cayenne.modeler.ProjectController;
 import org.apache.cayenne.modeler.action.RemoveAttributeAction;
 import org.apache.cayenne.modeler.action.RemoveRelationshipAction;
-import org.apache.cayenne.modeler.event.AttributeDisplayEvent;
-import org.apache.cayenne.modeler.event.EntityDisplayEvent;
-import org.apache.cayenne.modeler.event.ObjAttributeDisplayListener;
-import org.apache.cayenne.modeler.event.ObjEntityDisplayListener;
-import org.apache.cayenne.modeler.event.ObjRelationshipDisplayListener;
-import org.apache.cayenne.modeler.event.RelationshipDisplayEvent;
+import org.apache.cayenne.modeler.action.RemoveCallbackMethodAction;
+import org.apache.cayenne.modeler.event.*;
 
 /**
  * Tabbed ObjEntity editor panel.
@@ -52,6 +47,14 @@
     protected Component entityPanel;
     protected ObjEntityRelationshipTab relationshipsPanel;
     protected ObjEntityAttributeTab attributesPanel;
+    /**
+     * callback methods on ObjEntity tab
+     */
+    protected AbstractCallbackMethodsTab callbacksPanel;
+    /**
+     * callback methods on ObjEntity's entity listeners tab
+     */
+    protected JPanel listenersPanel;
 
     public ObjEntityTabbedView(ProjectController mediator) {
         this.mediator = mediator;
@@ -72,9 +75,15 @@
         
         attributesPanel = new ObjEntityAttributeTab(mediator);
         addTab("Attributes", attributesPanel);
-        
+
         relationshipsPanel = new ObjEntityRelationshipTab(mediator);
         addTab("Relationships", relationshipsPanel);
+
+        callbacksPanel = new ObjEntityCallbackMethodsTab(mediator);
+        addTab("Callbacks", callbacksPanel);
+
+        listenersPanel = new ObjEntityCallbackListenersTab(mediator);
+        addTab("Listeners", listenersPanel);
     }
 
     private void initController() {
@@ -101,6 +110,7 @@
         Application app = Application.getInstance();
         app.getAction(RemoveAttributeAction.getActionName()).setEnabled(false);
         app.getAction(RemoveRelationshipAction.getActionName()).setEnabled(false);
+        app.getAction(RemoveCallbackMethodAction.getActionName()).setEnabled(false);
     }
 
     public void currentObjEntityChanged(EntityDisplayEvent e) {

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/StringTransferHandler.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/StringTransferHandler.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/StringTransferHandler.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/editor/StringTransferHandler.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,51 @@
+package org.apache.cayenne.modeler.editor;
+
+/*
+ * StringTransferHandler.java is used by the 1.4
+ * ExtendedDnDDemo.java example.
+ */
+import java.awt.datatransfer.*;
+import javax.swing.*;
+import java.io.IOException;
+
+public abstract class StringTransferHandler extends TransferHandler {
+
+    protected abstract String exportString(JComponent c);
+    protected abstract void importString(JComponent c, String str);
+    protected abstract void cleanup(JComponent c, boolean remove);
+
+    protected Transferable createTransferable(JComponent c) {
+        return new StringSelection(exportString(c));
+    }
+
+    public int getSourceActions(JComponent c) {
+        return COPY_OR_MOVE;
+    }
+
+    public boolean importData(JComponent c, Transferable t) {
+        if (canImport(c, t.getTransferDataFlavors())) {
+            try {
+                String str = (String)t.getTransferData(DataFlavor.stringFlavor);
+                importString(c, str);
+                return true;
+            } catch (UnsupportedFlavorException ufe) {
+            } catch (IOException ioe) {
+            }
+        }
+
+        return false;
+    }
+
+    protected void exportDone(JComponent c, Transferable data, int action) {
+        cleanup(c, action == MOVE);
+    }
+
+    public boolean canImport(JComponent c, DataFlavor[] flavors) {
+        for (int i = 0; i < flavors.length; i++) {
+            if (DataFlavor.stringFlavor.equals(flavors[i])) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayEvent.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayEvent.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayEvent.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,51 @@
+/*****************************************************************
+ *   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;
+
+
+/**
+ * Display event for callback method
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 24, 2007
+ */
+
+public class CallbackMethodDisplayEvent extends CayenneEvent {
+    private String callbackMethod;
+
+    /**
+     * constructor
+     * @param src event source
+     * @param callbackMethod callback method name
+     */
+    public CallbackMethodDisplayEvent(Object src, String callbackMethod) {
+        super(src);
+        this.callbackMethod = callbackMethod;
+    }
+
+    /**
+     * @return callback method name
+     */
+    public String getCallbackMethod() {
+        return callbackMethod;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayListener.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayListener.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodDisplayListener.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,38 @@
+/*****************************************************************
+ *   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 java.util.EventListener;
+
+
+/**
+ * Listener for callback methods selection
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 24, 2007
+ */
+
+public interface CallbackMethodDisplayListener extends EventListener {
+    /**
+     * current callback method changed
+     * @param e event
+     */
+    public void currentCallbackMethodCahnged(CallbackMethodDisplayEvent e);
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodEvent.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodEvent.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodEvent.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,61 @@
+/*****************************************************************
+ *   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.map.event.MapEvent;
+
+
+/**
+ * Event for creating/removing/modifying callback methods
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 25, 2007
+ */
+
+public class CallbackMethodEvent extends MapEvent {
+    /**
+     * callbacm method name
+     */
+    private String callbackMethod;
+
+    /**
+     * constructor
+     * @param source event source
+     * @param prevCallbackMethod previous callback method name (for renaming)
+     * @param callbackMethod (new) callback method name
+     * @param id event type id
+     */
+    public CallbackMethodEvent(
+                Object source,
+                String prevCallbackMethod,
+                String callbackMethod,
+                int id) {
+        super(source, prevCallbackMethod);
+        this.callbackMethod = callbackMethod;
+        setId(id);
+    }
+
+    /**
+     * @return new callback method name
+     */
+    public String getNewName() {
+        return callbackMethod;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodListener.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodListener.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackMethodListener.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,44 @@
+/*****************************************************************
+ *   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 java.util.EventListener;
+
+
+/**
+ * Listener for manipulation on a callback method
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 25, 2007
+ */
+public interface CallbackMethodListener extends EventListener {
+
+    /** Callback method changed.
+     * @param e event */
+    public void callbackMethodChanged(CallbackMethodEvent e);
+
+    /** Callback method has been created/added.
+     * @param e event*/
+    public void callbackMethodAdded(CallbackMethodEvent e);
+
+    /** Callback method has been removed.
+     * @param e event*/
+    public void callbackMethodRemoved(CallbackMethodEvent e);
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionEvent.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionEvent.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionEvent.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,55 @@
+/*****************************************************************
+ *   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;
+import org.apache.cayenne.modeler.editor.CallbackType;
+
+
+/**
+ * Event for callback type selection change
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+
+public class CallbackTypeSelectionEvent extends CayenneEvent {
+    /**
+     * selected calback type
+     */
+    private CallbackType callbackType;
+
+    /**
+     * constructor
+     * @param source event source
+     * @param callbackType selected callback type
+     */
+    public CallbackTypeSelectionEvent(Object source, CallbackType callbackType) {
+        super(source);
+        this.callbackType = callbackType;
+    }
+
+    /**
+     * @return selected callback type
+     */
+    public CallbackType getCallbackType() {
+        return callbackType;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionListener.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionListener.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/CallbackTypeSelectionListener.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,37 @@
+/*****************************************************************
+ *   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 java.util.EventListener;
+
+
+/**
+ * Listener for callback type selection
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+public interface CallbackTypeSelectionListener extends EventListener {
+    /**
+     * callback type selection changed
+     * @param e newly selected callback type
+     */
+    public void callbackTypeSelected(CallbackTypeSelectionEvent e);
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerEvent.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerEvent.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerEvent.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,55 @@
+/*****************************************************************
+ *   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.map.event.MapEvent;
+
+/**
+ * Event for creating/removing/modifying entity listeners
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 25, 2007
+ */
+public class EntityListenerEvent extends MapEvent{
+    /**
+     * new entity listener class name
+     */
+    private String newName;
+
+    /**
+     * constructor
+     * @param source event source
+     * @param oldName old entity listener class name
+     * @param newName new entity listener class name
+     * @param eventId event type id
+     */
+    public EntityListenerEvent(Object source, String oldName, String newName, int eventId) {
+        super(source, oldName);
+        this.newName = newName;
+        setId(eventId);
+    }
+
+    /**
+     * @return new entity listener class name
+     */
+    public String getNewName() {
+        return newName;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerListener.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerListener.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/EntityListenerListener.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,50 @@
+/*****************************************************************
+ *   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 java.util.EventListener;
+
+
+/**
+ * Listener for manipulations on entity listeners
+ *
+ * @author tarasevichv
+ * @version 1.0 Oct 28, 2007
+ */
+
+public interface EntityListenerListener extends EventListener {
+    /**
+     * entity listener was added
+     * @param e event
+     */
+    public void entityListenerAdded(EntityListenerEvent e);
+
+    /**
+     * entity listener was edited
+     * @param e event
+     */
+    public void entityListenerChanged(EntityListenerEvent e);
+
+    /**
+     * entity listener was removed
+     * @param e event
+     */
+    public void entityListenerRemoved(EntityListenerEvent e);
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionEvent.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,54 @@
+/*****************************************************************
+ *   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
+ *
+ * @author Vasil Tarasevich
+ * @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;
+    }
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionListener.java
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionListener.java?rev=591617&view=auto
==============================================================================
--- cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionListener.java (added)
+++ cayenne/main/trunk/framework/cayenne-modeler/src/main/java/org/apache/cayenne/modeler/event/ListenerClassSelectionListener.java Sat Nov  3 06:17:28 2007
@@ -0,0 +1,37 @@
+/*****************************************************************
+ *   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 java.util.EventListener;
+
+
+/**
+ * Listener for listener class selection
+ *
+ * @author Vasil Tarasevich
+ * @version 1.0 Oct 28, 2007
+ */
+public interface ListenerClassSelectionListener extends EventListener {
+    /**
+     * listener class selection changed
+     * @param e event
+     */
+    public void listenerClassSelected(ListenerClassSelectionEvent e);
+}
+

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-change-listener.gif
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-change-listener.gif?rev=591617&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-change-listener.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-listener.gif
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-listener.gif?rev=591617&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-listener.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-method.gif
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-method.gif?rev=591617&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-create-method.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-listener.gif
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-listener.gif?rev=591617&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-listener.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-method.gif
URL: http://svn.apache.org/viewvc/cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-method.gif?rev=591617&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cayenne/main/trunk/framework/cayenne-modeler/src/main/resources/org/apache/cayenne/modeler/images/icon-remove-method.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream



Mime
View raw message