本文整理匯總了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;
}