listeners

Flash AS3 EventDispatcher - any way of getting a list of registered listeners?

Is there any way of getting a list of registered listeners for an EventDispatcher? I know that EventDispatcher has the hasEventListener method to tell you if any listeners are registered, but is there an easy way of interrogating the EventDispatcher to find out what the listeners are? One way I figured to do this was to subclass Event...

Swing: listeners execution order on custom component.

My custom component is composed of three JTrees inside a JPanel. Only one JTree should be selected at a time, so I've added a TreeSelectionListener to each of them that calls clearSelection on the previously selected JTree. I'd like to add other TreeSelectionListeners to the JTrees being sure that the selection- handling listeners alway...

What should I return from an NHibernate Event Listener?

public class MyUpdateListener : IPreUpdateListener { public bool OnPreUpdate(PreUpdateEvent @event) { // What do I return from this method - true or false? } } ...

Java AWT/Swing: Get notified on change of position/size of my window

Hello I've got a window and I would like to get notified when the position or the size has changed. Which type of listener ist the best to take? WindowListener didn't work for me... Any way? Thanks and regards ...

Is there a better practice for Listeners?

Say I have a swing GUI, and I want to listen MouseEvents. Who do you think should be the Listener class, who should be responsible? What is the best-or preferred way to implement it? Any opinions? I usually go like this: public class MyPanel extends JPanel implements MouseListener{ private JTable table; public void foo(){ ...

How to resolve swing listener memory leaks?

Background So I read that often memory leaks within Swing applications originate from the use of various listeners (mouse, key, focus, etc). Essentially, you register an object as a listener and forget to deregister the object, the notifier ends up holding onto the reference of the object, leaking a bit of memory. I knew our applicatio...

Is it possible to define initial parameter arguments for Java webapp listeners?

In a web application's web.xml file, one can define initial parameters for servlets and filters by using the init-param element. Parameters defined here can then be retrieved by calling getServletConfig(). It does not seem possible to do the same with listeners, as the DTD only defines the listener-class element there. I would really ...

Nhibernate listeners does not work correctly

I am using NHibernate (v 2.1.0.4000) and try to use an event Listener for an update action. I used the following code to add a listener to the Nhibernate Configuration. var configuration = new Configuration(); configuration.SetListener(ListenerType.Update, new UpdateListener()); _sessionFactory = configuration.BuildSessionFactory...

Actionscript on change handlers

I have a text box (dynamic) whose value is being changed by javascript using the setVariable method. Bascially I'm now stuck in getting the flash application to recognise when the text box value has been changed, onKeyUp etc.. do not seem to work. The below code works if the user types in to the box, but if it is changed via JS it doe...

How to override preUpdate action to not modify my `updated_at` field in Doctrine?

Hi, I want to disable the automatic behaviour of changing the 'updated_at' field when an object is updated. I want to do it manually; or at least, have the posibility to disable it as wanted. I know I can do this by building my own behaviour as in this great answer. But I was searching for something 'cleaner' modifying a listener of th...

Closure problem with Listener and Google Maps markers

I want to add a Listener event to each generated marker, so that when you click a marker you are redirected to the permalink url. With the code below the permalink value is the same for every marker(it get's the last value). I've read about closure problems and that seems to be what I'm having. I don't really get the examples I've looked...

How can we listen for UIKitApplication notices?

I'm trying to get my app to see and respond to event notices like the following: Sun Mar 7 00:29:31 unknown UIKitApplication:com.yourcompany.blah[0xac61][594] <Notice>: Connected to 10.0.1.8:55937! Sun Mar 7 00:29:31 unknown UIKitApplication:com.yourcompany.blah[0xac61][594] <Notice>: Connection request from 10.0.1.8:55938... Sun Mar ...

Object can not be resolved.

I have this code: public class Window extends JFrame { public Window(){ ... JButton button = new JButton("OK"); getContentPane().add(button); ButtonHandler handler = new ButtonHandler(); button.addActionListener(handler); ... } private class ButtonHandler implements ActionListener { public void actionPerf...

How to inject dependencies into HttpSessionListener, using Spring?

How to inject dependencies into HttpSessionListener, using Spring and without calls, like context.getBean("foo-bar") ? ...

Java - Is it possible to override an ActionListener in the SuperClass?

If have two classes, Class A and Class B, B is a subclass of A...if my Class A(the superclass) has a JButton with an ActionListener which is implemented by an anonymous inner class, how can I override what the button does in the subclass? ...

Adding Listeners at runtime? - Java MVC

My model in my MVC pattern, generates components at runtime and gives them to the View to be displayed on the screen through update() method (you know, model is the observable and the view is the observer). But I also need to add listeners to these components, and the controller has the listener methods (because they say the MVC pattern ...

can adding jQuery listeners slow down browser performance?

I have application that brings response via Ajax and creates 5-20 new jQuery click listeners on each refresh. Both IE and mozilla browsers seem to be slowing down with usage. Can this slow down browser performance significantly. Can listeners be "released"? ...

How to write the code for listeners in TestNG?

Hi, I want to know how can i use listeners in my java code? Also what changes are to made in the xml file if i want to incorporate the listeners? I added org.testng.ITestNGListener then too the program is throwing errors? ...

What does addListener do in node.js?

I am trying to understand the purpose of addListener in node.js. Can someone explain please? Thanks! A simple example would be: var tcp = require('tcp'); var server = tcp.createServer(function (socket) { socket.setEncoding("utf8"); socket.addListener("connect", function () { socket.write("hello\r\n"); }); socket.addListener(...

Cancel onKey Event from onKey method

Is it possible to cancel an event from within the onKey method. I only want to allow numbers 0 through 9. If another key was pressed then I want to cancel the key press public boolean onKey(View v, int keyCode, KeyEvent ev) { // TODO Auto-generated method stub if(keyCode <30 || keyCode > 39){ //Ca...