Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
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 java.util.List;
 
 import  org.apache.cayenne.map.CallbackMap;
 import  org.apache.cayenne.map.EntityListener;
Tab for editing default entity listeners of a DataMap

Version:
1.0 Oct 28, 2007
 
 public class DataMapCallbackListenersTab extends AbstractCallbackListenersTab {


    
Constructor

Parameters:
mediator mediator instance
 
     public DataMapCallbackListenersTab(ProjectController mediator) {
         super(mediator);
     }

    

Returns:
CallbackMap with callback methods
 
     protected CallbackMap getCallbackMap() {
         String listenerClass = (String.getSelectedItem();
         return listenerClass == null ? 
                null : .getCurrentDataMap().getDefaultEntityListener(listenerClass).getCallbackMap();
     }

    

Returns:
returns entity listeners list
 
     protected List getEntityListeners() {
         return .getCurrentDataMap().getDefaultEntityListeners();
     }


    
init listeners
 
     protected void initController() {
         super.initController();
                 new DataMapDisplayListener() {
                    
process DapaMap selection

Parameters:
e event
 
                     public void currentDataMapChanged(DataMapDisplayEvent e) {
                         if (isVisible()) {
                             rebuildListenerClassCombo(null);
                             updateCallbackTypeCounters();
                             .setCurrentCallbackType((CallbackType).getSelectedItem());
                             rebuildTable();
                         }
                     }
                 }
         );
     }

    

Returns:
create callback method action
 
         Application app = Application.getInstance();
     }

    

Returns:
remove callback method action
        Application app = Application.getInstance();
    }

    

Returns:
action for removing entity listeners
        return Application.getInstance().getAction(RemoveEntityListenerForDataMapAction.getActionName());
    }


    

Returns:
action for creating entity listeners
        return Application.getInstance().getAction(CreateDataMapEntityListenerAction.getActionName());
    }
    protected EntityListener getEntityListener(String listenerClass) {
        return .getCurrentDataMap().getDefaultEntityListener(listenerClass);
    }
New to GrepCode? Check out our FAQ X