Hi, probably in future we should be able to simplify this with Java 8 and Lambda Expressions ( http://docs.oracle.com/javase/tutorial/java/javaOO/lambdaexpressions.html ), or maybe today using something like Scala Functions ...
For Pivot 2.1 I'm thinking to add some utility classes to simulate Scala-like Functions (for simple cases) in Java, I hope to be able soon to add something ... or maybe someone of us using Pivot from Scala could already use this feature (but I didn't tried up to now). This is the related issue: https://issues.apache.org/jira/browse/PIVOT-799 For comments, suggestions, etc tell to us. Bye, Sandro 2013/8/29 Ajay Bhat <[email protected]>: > Just a quick question. Is there any way I could do to make the following > code defining various actions somewhat cleaner and more compact? > > Action.getNamedActions().put("something", new Action() { > public void perform(Component source) { > System.out.println("Default"); > //more stuff > } > }); > //defined many more actions in similar format for options in the menu > > >
