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 entity listeners of an ObjEntity

Version:
1.0 Oct 28, 2007
 
constructor

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

    

Returns:
CallbackMap with callback methods
 
     protected CallbackMap getCallbackMap() {
         String listenerClass = (String.getSelectedItem();
         if (.getCurrentObjEntity() != null &&
                 .getCurrentObjEntity().getEntityListener(listenerClass) != null) {
             return .getCurrentObjEntity().getEntityListener(listenerClass).getCallbackMap();
         }
         return null;
     }

    
init listener
 
     protected void initController() {
         super.initController();
 
                 new ObjEntityDisplayListener() {
                     public void currentObjEntityChanged(EntityDisplayEvent e) {
                         if (ObjEntityCallbackListenersTab.this.isVisible()) {
                             rebuildListenerClassCombo(null);
                             updateCallbackTypeCounters();
                             .setCurrentCallbackType((CallbackType).getSelectedItem());
                             rebuildTable();
                         }
                     }
                 }
         );
     }

    

Returns:
returns entity listeners list
 
     protected List getEntityListeners() {
         return .getCurrentObjEntity() == null ? null :
                .getCurrentObjEntity().getEntityListeners();
     }

    

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(RemoveEntityListenerAction.getActionName());
    }

    

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