eventlistener

Overload the += event operator

Is there a way to overload the event += and -= operators in C#? What I want to do is take an event listener and register it to different events. So something like this: SomeEvent += new Event(EventMethod); Then instead of attaching to SomeEvent, it actually attaches to different events: DifferentEvent += (the listener above); Anot...

Adobe AIR - What is the proper method for using an EventListener on a newly created window?

I'm very new to AIR development, and have just started seriously building my first simply application. I'd like to open a new window to prompt the user for desired settings upon first run. In testing the new window and detecting its closed state, I've done the following (some jQuery code included): The following code is used to open t...

How to disable and re-enable MouseEvents; buttonMode, mouseChildren and enable don't work

Basically the question could more probably be more accurately asked, how do I simply disable a button and then re-enable it? I've tried setting buttonMode to false, mouseChildren to false and enabled to false. Nothing works. I realize I could just remove the event listeners, but surely there is a more elegant and efficient way. As removi...

EventListener to watch for number of itens in DataGrid

Hello everybody. I'm new to Flex, but I've been exploring it with Flex Builder, and its pretty good. Indeed the best for fast building of Web based Apps... I'm trying to do something with eventListeners, but i still do a lot of messy code, so wanted help of those who already know flex. I'm have a DataGrid, and its itens are added b...

Why is EventListenerList traversed backwards in fireFooXXX()?

I don't understand the rationale of this code, taken from javax.swing.event.EventListenerList docs: protected void fireFooXXX() { // Guaranteed to return a non-null array Object[] listeners = listenerList.getListenerList(); // Process the listeners last to first, notifying // those that are interested in this event f...

Rolling back identifiers NHibernate

I would like to get NHibernate to roll back the identifier of any entities saved during a transaction if the transaction is aborted. I am using NHibernate 2.1.0, and it doesn't do this by default. I came up with the following solution, which works up to a point: public class RevertIdentifiersEventListener : DefaultSaveEventListener { ...

Extracting url from anchor tag to use in right click menu

Hey so I set up a right click menu on my site you can see here http://www.jaminproud.com Everything works good except I want to add the abilty to open a link in a new tab. I have looked everywhere and cant find a solid answer for this. I would also need a way to make the menu so that option is only displayed while hovering over an anch...

NHibernate EventListeners - getting the value of a property of the entity being saved

I'm implementing a custom EventListener to save auditing information in NHibernate. I'm currently extending DefaultSaveOrUpdateEventListener, overriding PerformSaveOrUpdate, going through the properties of each entity and saving them elsewhere. This works with simple properties, but fails when cascade-saving a one-to-many relationship....

AS3 dispatch events to objects not related on the display list

So, events bubble up the display list. That's great if that's what you want. But what if you have objects on the stage that are not related that need to listen for events from each other? A simplified example: var objA = new ObjA; addChild(objA); var objB = new ObjB; addChild(objB); var objC = new ObjC; objB.addChild(objC); Object B...

Google Maps: Event Listener only remembering final value of variable

I'm putting together a Google Map which contains the locations of various test centres around my country. It plots a marker on each county, and when you click the county marker, it zooms in and gives an overview of the test centres in that county. I'm also using jQuery with this. Here's the problem: When I plot the county markers and c...

Clarification on NHibernate Event mechanism

i am in the middle of re factoring an application and i've applied an interface on most entities. I want to change the Save/Update behavior of these entities using the Event mechanism of NH2.1.1. As such i'm implementing an NHibernate.Event.ISaveOrUpdateEventListener public class SaveOrUpdate : ISaveOrUpdateEventListener { public v...

Handle flex events without using a framework?

I'm developing an AIR application with Flash Builder 4 Beta 2 (nightly SDK) an am not using a framework like mate. I have a couple of views and components in my application. An outline might look like this: root |- mainview |-- toolbar |-- catalogue view |--- tree |--- datagrid |-- statusbar This is not 100% the structure of my projec...

Actionscript3: add and remove EventListeners (with dynamic name and dynamic variables)

picture: http://yfrog.com/1rcheckerboardflashvraagjg Hey all! I am making a boardgame in flash Action Script 3 each position on the board is a buttons like this: button_1_1, button_1_2 etc. Whenever a character is selected you want to move it so the script has to add event listeners for positions around the selected unit // This f...

Suitable collection class for event listeners in Java

Related: http://stackoverflow.com/questions/1391918/does-java-have-a-linkedconcurrenthashmap-data-structure I am looking for a collection class to hold references to event listeners. Ideally I would like the collection to have the following properties (in order of priority): Maintains insertion order. The earlier listeners may can...

EventListenerList firing order

In a Swing application, I have a number of sub-panels, each listening to a single JSlider. The surrounding parent panel also listens to all the sub-panels. To get consistent results in the example below, I had to add the parent first and then the local listener. This makes sense, given the order prescribed in EventListenerList and explai...

Problems with NHibernate DefaultUpdateEventListener and events

I have a problem with the DefaultUpdateEventListener in NHibernate. I will update 2 objects and then i commit the session. The first object didn't come into the listener and the second object comes there. So i checked with reflector to check what the problem is First NHibernate will call the PerformSaveOrUpdate in the DefeultSaveOrUpd...

Using CreateCriteria within PreInsert/PreUpdate Event Listener

Hello all, I want to have a centralize place to check for inserts or updates to an object, and for certain scenarios, I want to update it's parent based on the information from the child. I have the following code in my event listener: public bool OnPreInsert(PreInsertEvent @event) { UpdateCalcs(@event.Entity); ret...

i cant get my javascript eventlistener to work properly

this has got me stumped, ive tried lots of different things, but cant get this to work. can anyone help? no matter what i try i cant get the click eventlistener on the link to fire. the code is in a greasemonkey script. i believe i have to use the closure method to be able to refer to the function dropit in the greasemonkey script, as it...

GWT Button eventlistener designer

For example I took html from a designer which is given below. How can i add click event which shows alert from GWT? final Button button = new Button("OK"); I dont allow to add button dynamically from GWT by RootPanel.get("sendButtonContainer").add(button); I am searching the syntax something like: RootPane...

java: PropertyChangeSupport for Map or EnumMap?

Is there a version of either java.beans.PropertyChangeSupport or com.jgoodies.binding.beans.ExtendedPropertyChangeSupport which is helpful for supporting change listeners along the lines of a Map or EnumMap? (a key-value store with known limited keys and change listeners for all the values in the map) I don't really need beans-type acce...