// (c) MIT 2003.  All rights reserved.

// $Id: WQuestion.java,v 1.2 2003/03/06 00:40:48 moltmans Exp $
// WQuestion.java -- 
// Author: Michael Oltmans <moltmans@ai.mit.edu> 
// Created: <Thu Jul 13 16:58:46 2000> 
// Time-stamp: <2000-07-13 22:48:59 moltmans> 
package rec.annotate.widgets;

import java.util.*;
import rec.sys.*;
import rec.util.*;
import rec.annotate.facts.*;
import rec.annotate.rules.*;
import rec.annotate.answers.*;

/**
 * Question widget for asking about the device
 **/
public class WQuestion extends Widget
{
  private WUtterance m_utterance;

  public WQuestion( Surface s, WUtterance utterance )
  {
    m_utterance = utterance;
  }

  public void makeDefaultSuitcase( Surface s )
  {
    DoTransition dt = new DoTransition(s) {
      public void doDo( )
      {
	Notebook book = m_Surface.getNotebook();
	Answer a = new Answer( book );
	a.answer( m_utterance );
      }
      public void doUndo( )
      {
      }
      public String getAction( )
      {
	return "WQuestion: " + m_utterance;
      }
    };
    addToSuitcase( dt );
  }
}

