
package org.openspml.browser;

import java.util.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

import org.openspml.message.*;

public class StatusPanel extends RequestPanel {

    JTextField _reqid;
    LabeledCheckbox _result;

    public StatusPanel(State s) {
        super(s);

        _reqid = new JTextField(25);
        _reqid.addActionListener(this);
        _form.add("Request Id", _reqid);

        _result = new LabeledCheckbox("Return Result");
        _result.addActionListener(this);
        _form.add("", _result);

        addSubmitButton();
    }

    public SpmlRequest getRequest() {

        StatusRequest req = new StatusRequest();
        req.setRequestId(SwingUtil.getText(_reqid));
        req.setReturnResult(_result.isSelected());

        return req;
    }



}
