Examples of QuestionAction


Examples of com.agiletec.plugins.jpsurvey.apsadmin.survey.QuestionAction

    }
  }
 
  public void testTrashQuestion() throws Throwable {
    String result = null;
    QuestionAction action = null;
    try {
      this.setUserOnSession("admin");
     
      // test with no question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.INPUT, result);
     
      // test with no question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      this.addParameter("QuestionId", -1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (QuestionAction) this.getAction();
      assertNotNull(action.getQuestions());
      assertTrue(action.getQuestions().isEmpty());
     
      // test with valid question ID
      this.initAction("/do/jpsurvey/Survey", "trashQuestion");
      this.addParameter("QuestionId", 1);
      result = this.executeAction();
      assertNotNull(result);
      assertEquals(Action.SUCCESS, result);
      action = (QuestionAction) this.getAction();
      assertNotNull(action.getQuestion());
      assertEquals(3, action.getQuestion().getChoices().size());
    } catch (Throwable t) {
      throw t;
    }
  }
View Full Code Here

Examples of com.intellij.codeInsight.hint.QuestionAction

        HintManager.getInstance().showQuestionHint(editor, "Import symbol", range.getStartOffset(), range.getEndOffset(), createAddImportAction(editor));
        return true;
    }

    private QuestionAction createAddImportAction(final Editor editor) {
        return new QuestionAction() {
            public boolean execute() {
                final Module module = DeclarationPosition.getDeclModule(psiFile);
                final Project project = module.getProject();
                PsiDocumentManager.getInstance(project).commitAllDocuments();
                final BaseListPopupStep<String> step = new BaseListPopupStep<String>("Module to import", modules) {
View Full Code Here

Examples of com.intellij.codeInsight.hint.QuestionAction

    HintManager.getInstance().showQuestionHint(
      editor,
      message,
      hintRange.getStartOffset(),
      hintRange.getEndOffset(),
      new QuestionAction() {
        @Override
        public boolean execute() {
          myDelegate.invoke(myPsiElement.getProject(), editor, myPsiElement.getContainingFile());
          return true;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.