本文整理匯總了Java中com.intellij.openapi.ui.Messages.showInfoMessage方法的典型用法代碼示例。如果您正苦於以下問題:Java Messages.showInfoMessage方法的具體用法?Java Messages.showInfoMessage怎麽用?Java Messages.showInfoMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.ui.Messages
的用法示例。
在下文中一共展示了Messages.showInfoMessage方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDirectory
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static PsiDirectory createDirectory(Project project, String title, String description) {
final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
descriptor.setTitle(title);
descriptor.setShowFileSystemRoots(false);
descriptor.setDescription(description);
descriptor.setHideIgnored(true);
descriptor.setRoots(project.getBaseDir());
descriptor.setForcedToUseIdeaFileChooser(true);
VirtualFile file = FileChooser.chooseFile(descriptor, project, project.getBaseDir());
if(Objects.isNull(file)){
Messages.showInfoMessage("Cancel " + title, "Error");
return null;
}
PsiDirectory psiDirectory = PsiDirectoryFactory.getInstance(project).createDirectory(file);
if(PsiDirectoryFactory.getInstance(project).isPackage(psiDirectory)){
return psiDirectory;
}else {
Messages.showInfoMessage("請選擇正確的 package 路徑。", "Error");
return createDirectory(project, title, description);
}
}
示例2: run
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public boolean run() {
String filter = arguments.getFilter();
if (filter == null) {
System.err.println("Please check your filter!");
return false;
}
String replacement = Matcher.quoteReplacement(File.separator);
String searchString = Pattern.quote(".");
filterAsPath = filter.replaceAll(searchString, replacement);
File projectFolder = getProjectFolder();
if (projectFolder.exists()) {
traverseSmaliCode(projectFolder);
return true;
} else if (isInstantRunEnabled()) {
System.err.println("Enabled Instant Run feature detected. We cannot decompile it. Please, disable Instant Run and rebuild your app.");
Messages.showInfoMessage(Strings.ERROR_INSTANT_RUN_ENABLED, Strings.TITLE_ERROR_INSTANT_RUN_ENABLED);
} else {
System.err.println("Smali folder cannot be absent!");
}
return false;
}
示例3: refreshFile
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private static void refreshFile(@NotNull final StudyState studyState, @NotNull final Project project) {
final Editor editor = studyState.getEditor();
final TaskFile taskFile = studyState.getTaskFile();
if (!resetTaskFile(editor.getDocument(), project, taskFile, studyState.getVirtualFile().getName())) {
Messages.showInfoMessage("The initial text of task file is unavailable", "Failed to Refresh Task File");
return;
}
WolfTheProblemSolver.getInstance(project).clearProblems(studyState.getVirtualFile());
taskFile.setHighlightErrors(false);
StudyUtils.drawAllWindows(editor, taskFile);
EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile, true);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
IdeFocusManager.getInstance(project).requestFocus(editor.getContentComponent(), true);
}
});
StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
showBalloon(project, "You can start again now", MessageType.INFO);
}
示例4: showError
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static void showError(final Project project, final String message, final boolean error) {
final Application application = ApplicationManager.getApplication();
if (application.isUnitTestMode()) {
return;
}
final String title = VcsBundle.message("patch.apply.dialog.title");
final Runnable messageShower = new Runnable() {
@Override
public void run() {
if (error) {
Messages.showErrorDialog(project, message, title);
}
else {
Messages.showInfoMessage(project, message, title);
}
}
};
WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() {
@Override
public void run() {
messageShower.run();
}
}, null, project);
}
示例5: importWithExtensions
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Nullable
private static AddModuleWizard importWithExtensions(@NotNull VirtualFile file) {
List<ProjectImportProvider> available = getImportProvidersForTarget(file);
if (available.isEmpty()) {
Messages.showInfoMessage((Project) null, "Cannot import anything from " + file.getPath(), "Cannot Import");
return null;
}
String path;
if (available.size() == 1) {
path = available.get(0).getPathToBeImported(file);
}
else {
path = ProjectImportProvider.getDefaultPath(file);
}
ProjectImportProvider[] availableProviders = available.toArray(new ProjectImportProvider[available.size()]);
return new AddModuleWizard(null, path, availableProviders);
}
示例6: doConnDB
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private void doConnDB (){
if(isConnect){
Messages.showInfoMessage("數據庫已經連接,無需再次登錄", "數據庫連接");
//JOptionPane.showMessageDialog(null, "數據庫已經連接,無需再次登錄", "數據庫連接", JOptionPane.INFORMATION_MESSAGE);
return;
}
String tmpIp = ipText.getText();
String tmpPort = portText.getText();
String tmpSchema = schemaText.getText();
String tmpDBUrl = tmpIp + ":" + tmpPort + "/" + tmpSchema;
String tmpDBUser = userNameText.getText();
String tmpDBPasswrd = passwordText.getText();
DatabaseConnection dbc=new DatabaseConnection(tmpDBUser,tmpDBPasswrd,tmpDBUrl);
connButton.setEnabled(false);
if(dbc.testDBConn()) {
connButton.setText("Dis Conn");
isConnect = true;
doEnable(!isConnect);
listDBTable.setModel(new DefaultComboBoxModel(getTableInfo(tmpSchema, tmpDBUser, tmpDBPasswrd, tmpDBUrl)));
setDBConfig(tmpIp,tmpPort,tmpSchema,tmpDBUser,tmpDBPasswrd);
}else {
Messages.showErrorDialog("數據庫連接失敗", "數據庫連接");
//JOptionPane.showMessageDialog(null, "數據庫連接失敗", "數據庫連接", JOptionPane.WARNING_MESSAGE);
}
connButton.setEnabled(true);
}
示例7: submit
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
@NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
log(events, additionalInfo);
consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
return true;
}
示例8: testConnectionButton
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private void testConnectionButton(ActionEvent evt) {
try {
String[] hostParts = getDatabaseHost().split(";");
String[] databaseParts = getDatabaseDB().split(";");
String[] usernameParts = getDatabaseUsername().split(";");
String[] passwordParts = getDatabasePassword().split(";");
for (int i = 0; i < hostParts.length; i++) {
String connUrl;
if (getDatabaseType().equals(DatabaseAdapterType.POSTGRESQL)) {
Class.forName("org.postgresql.Driver");
connUrl = "jdbc:postgresql://" + hostParts[i] + ":" + getDatabasePort() + "/" + databaseParts[i];
} else if (getDatabaseType().equals(DatabaseAdapterType.MYSQL)) {
Class.forName("com.mysql.cj.jdbc.Driver");
connUrl = "jdbc:mysql://" + hostParts[i] + ":" + getDatabasePort() + "/" + databaseParts[i];
} else {
throw new UnsupportedOperationException();
}
Connection connection = DriverManager.getConnection(connUrl, usernameParts[i], passwordParts[i]);
connection.close();
System.out.println("Valid connection settings for database: " + databaseParts[i] + " (Host: " + hostParts[i] + ")");
}
Messages.showInfoMessage("Valid connection established!", "Valid Database Connection");
} catch (Exception ex) {
Messages.showErrorDialog("Invalid connection!\nReason: " + ex.getMessage(), "Invalid Database Connection");
}
}
示例9: doMove
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void doMove(final Project project,
PsiElement[] elements,
@Nullable PsiElement targetContainer,
@Nullable MoveCallback callback) {
Messages.showInfoMessage("This move operation can break the course", "Invalid Move Operation");
}
示例10: refreshFile
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private static void refreshFile(@NotNull final StudyState studyState, @NotNull final Project project) {
final Editor editor = studyState.getEditor();
final TaskFile taskFile = studyState.getTaskFile();
final Task task = taskFile.getTask();
if (task instanceof TaskWithSubtasks) {
for (AnswerPlaceholder placeholder : taskFile.getActivePlaceholders()) {
StudySubtaskUtils.refreshPlaceholder(editor, placeholder);
}
}
else {
if (!resetTaskFile(editor.getDocument(), project, taskFile)) {
Messages.showInfoMessage("The initial text of task file is unavailable", "Failed to Refresh Task File");
return;
}
if (task instanceof ChoiceTask) {
final StudyToolWindow window = StudyUtils.getStudyToolWindow(project);
if (window != null) {
window.setBottomComponent(new StudyChoiceVariantsPanel((ChoiceTask)task));
}
}
}
WolfTheProblemSolver.getInstance(project).clearProblems(studyState.getVirtualFile());
taskFile.setHighlightErrors(false);
StudyUtils.drawAllAnswerPlaceholders(editor, taskFile);
EduAnswerPlaceholderPainter.createGuardedBlocks(editor, taskFile);
ApplicationManager.getApplication().invokeLater(
() -> IdeFocusManager.getInstance(project).requestFocus(editor.getContentComponent(), true));
StudyNavigator.navigateToFirstAnswerPlaceholder(editor, taskFile);
showBalloon(project, MessageType.INFO);
}
示例11: actionPerformed
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
Project project = anActionEvent.getProject();
if (project != null) {
pathHelper = new PathHelper(project);
if (new File(pathHelper.getAnalyzedJsFile()).exists()) {
openBrowser();
} else {
Messages.showInfoMessage(Strings.ERROR_SHOW_GENERATED_DEPENDENCIES, Strings.TITLE_ERROR_SHOW_GENERATED_DEPENDENCIES);
}
}
}
示例12: testConnection
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
/**
* Test availability of the connection
*/
private void testConnection() {
final String executable = getCurrentExecutablePath();
if (myAppSettings != null) {
myAppSettings.setPathToGit(executable);
}
GitVersion version;
try {
version = ProgressManager.getInstance().runProcessWithProgressSynchronously(new ThrowableComputable<GitVersion, Exception>() {
@Override
public GitVersion compute() throws Exception {
return GitVersion.identifyVersion(executable);
}
}, "Testing Git Executable...", true, myVcs.getProject());
}
catch (ProcessCanceledException pce) {
return;
}
catch (Exception e) {
Messages.showErrorDialog(myRootPanel, e.getMessage(), GitBundle.getString("find.git.error.title"));
return;
}
if (version.isSupported()) {
Messages.showInfoMessage(myRootPanel,
String.format("<html>%s<br>Git version is %s</html>", GitBundle.getString("find.git.success.title"),
version.toString()),
GitBundle.getString("find.git.success.title"));
} else {
Messages.showWarningDialog(myRootPanel, GitBundle.message("find.git.unsupported.message", version.toString(), GitVersion.MIN),
GitBundle.getString("find.git.success.title"));
}
}
示例13: submit
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, @Nullable String additionalInfo,
@NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
EventBuilder eventBuilder = createEvent(events, additionalInfo);
sentry.sendEvent(eventBuilder);
consumer.consume(new SubmittedReportInfo(null, null, NEW_ISSUE));
Messages.showInfoMessage(parentComponent, DEFAULT_RESPONSE, DEFAULT_RESPONSE_TITLE);
return true;
}
示例14: preprocessUsages
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
if (refUsages.get().length == 0) {
Messages.showInfoMessage(myProject, RefactoringBundle.message("migration.no.usages.found.in.the.project"), REFACTORING_NAME);
return false;
}
setPreviewUsages(true);
return true;
}
示例15: preprocessUsages
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected boolean preprocessUsages(@NotNull Ref<UsageInfo[]> refUsages) {
if (!ApplicationManager.getApplication().isUnitTestMode() && refUsages.get().length == 0) {
String message = RefactoringBundle.message("no.usages.can.be.replaced", myClass.getQualifiedName(), mySuper.getQualifiedName());
Messages.showInfoMessage(myProject, message, TurnRefsToSuperHandler.REFACTORING_NAME);
return false;
}
return super.preprocessUsages(refUsages);
}