"Is this advised ?" I'd imagine not, but a lot will depend on the size of you project.
I think the statement "all your eggs in one basket" comes to mind.
The size of the if
statement could become unimaginably huge as you add new action branches to it. As you're project increases in complexity, so will you action handler.
Debugging potential problems could also become a headache.
Maintenance of the code would become tedious and prone to misunderstandings and cause no end of new errors in the logic.
You break the isolation of responsibility rule (you should try and isolate responsibility for the management of an action/event within it's own object/class)
If you're looking for a way to re-use action handlers, look at the Action API instead. If you're really eager, you could use a Factory to produce well know actions through out your code. This would allow for re-use while maintaining responsibility isolation.
On a personal note, having had to spend the last 3 years unraveling the mess of a inexperience graduate who wrote the core libraries to our system and liked to code like this, please don't. It's so easy to break, so hard to read and is just a plain mess.
IMHO it speaks of a lack of/or inability to design.
That's just my personal opinion based on my experience