本文整理汇总了Java中com.intellij.openapi.ui.Messages.showPasswordDialog方法的典型用法代码示例。如果您正苦于以下问题:Java Messages.showPasswordDialog方法的具体用法?Java Messages.showPasswordDialog怎么用?Java Messages.showPasswordDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.ui.Messages
的用法示例。
在下文中一共展示了Messages.showPasswordDialog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPluginSettings
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
public PluginSettings getPluginSettings(boolean mayAskPassphrase) {
if (pluginSettings.privateKeyFile == null) {
throw new RuntimeException("Private key file path is not set up");
}
// when no connection yet or invalid connection
if (pluginSettings.passphrase == null) {
if (mayAskPassphrase) {
pluginSettings.passphrase = Messages.showPasswordDialog(
"Enter passphrase for the private key" + "\n" + "(leave empty if no passphrase)", shortName);
} else {
throw new RuntimeException("Passphrase was not set up");
}
}
return pluginSettings;
}
示例2: requestForPassword
import com.intellij.openapi.ui.Messages; //导入方法依赖的package包/类
@Nullable
private static String requestForPassword(String cvsRoot) {
final String password = Messages.showPasswordDialog(CvsBundle.message("prompt.text.enter.password.for.cvs.root", cvsRoot), CvsBundle.message("prompt.title.enter.password.for.cvs.root"));
return password != null ? PServerPasswordScrambler.getInstance().scramble(password) : null;
}