private WebSocketListener getListener() {
        return new WebSocketAdapter() {
            @Override
            public boolean onOpen(final WebSocket webSocket) {
                buttons.onConnect();
                status.setText(bundle.get("connected"));
                return FULLY_HANDLED;
            }

            @Override
            public boolean onMessage(final WebSocket webSocket, final String packet) {
                status.setText(bundle.get("message") + " " + packet);
                return FULLY_HANDLED;
            }

            @Override
            public boolean onClose(final WebSocket webSocket, final WebSocketCloseCode code, final String reason) {
                buttons.onDisconnect();
                status.setText(bundle.get("disconnected"));
                return FULLY_HANDLED;
            }
        };
    }
private WebSocketListener getListener ( ) { return new WebSocketAdapter ( ) { @ Override public boolean onOpen ( final WebSocket webSocket ) { buttons . onConnect ( ) ; status . setText ( bundle . get ( "connected" ) ) ; return FULLY_HANDLED ; } @ Override public boolean onMessage ( final WebSocket webSocket , final String packet ) { status . setText ( bundle . get ( "message" ) + " " + packet ) ; return FULLY_HANDLED ; } @ Override public boolean onClose ( final WebSocket webSocket , final WebSocketCloseCode code , final String reason ) { buttons . onDisconnect ( ) ; status . setText ( bundle . get ( "disconnected" ) ) ; return FULLY_HANDLED ; } } ; }
@return a new instance of {@link WebSocketListener}, displaying status messages in case of any web socket
events.