Hi
 
How can I migrate the classes below to ULC 6.1.1? These classes allow me to get notified about windowClosed() events. Even though I read the extension guide, I'm still confused in how to achieve this for my scenario of extending existing ULC core classes.
 
Thanks for your help, Etienne
 
 
public class CarinaWindowEvent extends WindowEvent {
    public CarinaWindowEvent(Object inSource, int inEventId) {
        super(inSource);
        _eventId = inEventId;
    }
 
    public void dispatch(IEventListener inListener) {
        if (_eventId == SharedCarinaDialog.WINDOW_CLOSED) {
            if (inListener instanceof ICarinaWindowListener) {
                ((ICarinaWindowListener) inListener).windowClosed(this);
            }
        } else {
            super.dispatch(inListener);
        }
    }
 
    private final int _eventId;
}
public interface ICarinaWindowListener extends IWindowListener {
    void windowClosed(WindowEvent inEvent);
}
 
public class UICarinaFrame extends UIFrame {
    public void windowClosed(WindowEvent inEvent) {
        super.windowClosed(inEvent);
        sendOptionalEventULC(IUlcEventConstants.WINDOW_EVENT, SharedCarinaFrame.WINDOW_CLOSED);
    }
}
 
public abstract class SharedCarinaDialog {
    private SharedCarinaDialog() {
    }
 
    public static final int WINDOW_CLOSED = 2;
}
public class ULCCarinaFrame extends ULCFrame {
    public ULCCarinaFrame() {
    }
 
    public ULCCarinaFrame(String inTitle) {
        super(inTitle);
    }
 
    protected void handleEvent(int inListenerType, int inEventId, Anything inArgs) {
        if (inListenerType == IUlcEventConstants.WINDOW_EVENT) {
            distributeToListeners(new CarinaWindowEvent(this, inEventId));
        } else {
            super.handleEvent(inListenerType, inEventId, inArgs);
        }
    }
 
    protected String typeString() {
        return "com.navis.framework.ulc.client.extension.UICarinaFrame";
    }
}
 
 


Reply via email to