Last active
August 26, 2019 15:08
Revisions
-
neubig revised this gist
Aug 26, 2019 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.ListPopup; import com.intellij.openapi.ui.popup.PopupStep; @@ -15,9 +16,10 @@ public HelloAction() { public void actionPerformed(AnActionEvent event) { Project project = event.getProject(); final String query = Messages.showInputDialog(project,"Enter your query:","Query", Messages.getQuestionIcon()); ListPopup lp = JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<String>("Your query is " + query, "Choice1", "Choice2") { @Override public PopupStep onChosen(String selectedValue, boolean finalChoice) { -
neubig created this gist
Aug 26, 2019 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ package edu.cmu.empty; import com.intellij.openapi.actionSystem.AnAction; import com.intellij.openapi.actionSystem.AnActionEvent; import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.popup.JBPopupFactory; import com.intellij.openapi.ui.popup.ListPopup; import com.intellij.openapi.ui.popup.PopupStep; import com.intellij.openapi.ui.popup.util.BaseListPopupStep; public class HelloAction extends AnAction { public HelloAction() { super("Hello"); } public void actionPerformed(AnActionEvent event) { Project project = event.getProject(); // Messages.showMessageDialog(project, "Hello world!", "Greeting", Messages.getInformationIcon()); ListPopup lp = JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<String>("Chosen", "Choice1", "Choice2") { @Override public PopupStep onChosen(String selectedValue, boolean finalChoice) { System.err.println(selectedValue); return super.onChosen(selectedValue, finalChoice); } }); lp.showInFocusCenter(); } }