Forget the last message it was my fault, the controller map seems a simple solution, simply a map variable and one call in my shown method like:
Application.addController("scaffold", this);
In my case i use an application class like this to initialize the event namespace, the look and feel and so.... it will have to be changed when the next version of sdlswing is released but for the moment it works.
public class Application {
private static Map<String,FormController> map=new HashMap<String, FormController>();
public void start(String frameTitle, String sdlFileName) {
try {
UIManager
.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
initializeDeclarativeListeners();
UI.startApplication(frameTitle, sdlFileName);
}
protected void initializeDeclarativeListeners() {
UI.registerPropertyHandler("event", new ComponentPropertyHandler() {
@Override
public void set(final Component component, String key, final Object value)
throws UIBindingException {
if (key.equalsIgnoreCase("doubleClicked")) {
addDoubleClickListener(component, value);
}
}
});
}
private void addDoubleClickListener(final Component component,
final Object value) {
component.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
FormController controller = UI
.getFormForComponent(component)
.getController();
try {
Method m = controller.getClass()
.getDeclaredMethod(value.toString(),
new Class[] {});
m.invoke(controller, new Object[] {});
} catch (Exception e1) {
throw new UIBindingException("Problem trying to execute method "+value+"as double click listener for "+component.getName(), e1);
}
}
}
});
}
public static FormController getControllerByID(String id){
return Application.map.get(id);
}
public static synchronized void addController(String id, FormController controller){
Application.map.put(id, controller);
}
}
El 27/07/2010 13:25, Raúl Arabaolaza <
raul.ar...@gmail.com> escribió:
> After taking a good look at the source code i think i can use the Ui.showInDialog method instead of creating a new jFrame for the details and hopefu
>
> 2010/7/27 Raul_Arabaolaza
raul.ar...@gmail.com>