Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在我的 Eclipse 插件中创建一个弹出菜单(org.eclipse.ui.popupMenus)。现在我想启动一个文本字段或对话框来接受用户输入。根据输入,我将运行与 popupMenu 关联的运行方法。请帮帮我。
在最基本的交互中,您可以使用org.eclipse.jface.dialogs.MessageDialog.openQuestion(Shell, String, String)让用户回答是/否问题。
org.eclipse.jface.dialogs.MessageDialog.openQuestion(Shell, String, String)
如果您希望他们输入一个字符串,您可以使用org.eclipse.jface.dialogs.InputDialog. 关闭后,getValue()返回他们的输入。
org.eclipse.jface.dialogs.InputDialog
getValue()