How to freeze CountdownClock component and read state


I would like to freeze CountdownClock component before Count Down is ended on click button. Can you help me to understand, which listeners or events can I establish/fire? After stop count down I would like to know if Count down is 0 or it was stopped.

There is code for button and reset Count Down

    // button for stop count down table
    stopCountDown.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;
        public void buttonClick(ClickEvent event) {
          try {
            // hide count down clock, better would to freeze the text
            // force stop count down
  "Inside click listener of stopCountDown button." + countDownClock.getState().);
            // TODO manage confirmation - get the actual course and realize conversion
          catch (Exception ex) {
              LOGGER.error("Exception inside refresh table listener", ex);
            showNotification("Error:" + ex.getLocalizedMessage(), Type.ERROR_MESSAGE);

Count Down establish:

    private void resetTimer() {
        countDownClock = new CountdownClock();


        countDownClockEndEvent = new EndEventListener() {
            public void countDownEnded(CountdownClock clock) {
      "Inside countDownEnded.");
                                "Time is out or confirmed <br />"
                                + "next try... <br />", Type.HUMANIZED_MESSAGE);


        System.out.println("State of clock: " +  countDownClock.getState().enabled);
        Calendar c = Calendar.getInstance();
        c.add(Calendar.SECOND, 3);
        countDownClock.setFormat("<span style='font: bold 20px Arial; margin: 10px'>"
                        + "Countdown in %s.%ts seconds.</span>");


Thank you forward for advice.

Still I don’t know how to do it. I solved it to stop CountDwn and hide text, but it is not what I would like.

I reviewed my question and it is not explained clearly. It is not needed necessarily to freeze the count down, but ony the count down text.