@Override public ExprQuestionItem visit(QuestionComputed questionComputeStatement) { Identifier identifier = questionComputeStatement.getIdentifier(); Widget widget = (Widget) questionComputeStatement.getType().accept(this); widget.setIdentifier(identifier); ExprQuestionItem quetionItem = new ExprQuestionItem(questionComputeStatement, widget); formView.addExprQuestionItem(quetionItem); widgetListener.initializeValue(identifier, new UndefinedValue()); return quetionItem; }
@Override public FormFrame visit(Form form) { widgetListener = new WidgetListener(formView); form.getBlock().accept(this); JButton button = new JButton("Done"); formView.addDoneButton(button); button.addActionListener(new DoneButtonListener(widgetListener.getEvaluator())); formView.setFrameVisible(true); return formView; }
@Override public QuestionItem visit(QuestionNormal questionStatement) { Widget widget = (Widget) questionStatement.getType().accept(this); widget.setIdentifier(questionStatement.getIdentifier()); Identifier identifier = questionStatement.getIdentifier(); QuestionItem questionItem = new QuestionItem(questionStatement, widget); formView.addQuestionPanel(questionItem); widgetListener.initializeValue(identifier, new UndefinedValue()); return questionItem; }