本文整理了Java中com.intellij.openapi.ui.Messages.getWarningIcon()
方法的一些代码示例,展示了Messages.getWarningIcon()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Messages.getWarningIcon()
方法的具体详情如下:
包路径:com.intellij.openapi.ui.Messages
类名称:Messages
方法名:getWarningIcon
暂无
代码示例来源:origin: go-lang-plugin-org/go-lang-idea-plugin
@Override
public void run(AnActionButton button) {
String packageName =
Messages.showInputDialog("Enter the import path to exclude from auto-import and completion:",
"Exclude Import Path",
Messages.getWarningIcon());
addExcludedPackage(packageName);
}
代码示例来源:origin: ballerina-platform/ballerina-lang
public MiscGUI() {
resetCustomAssociationsButton.addActionListener((e) -> {
if (Messages.showYesNoCancelDialog(rootPanel, "This will remove all manually added associations. Proceed?", "Remove all associations", Messages.getWarningIcon()) == Messages.YES) {
PluginMain$.MODULE$.resetAssociations();
}
});
}
代码示例来源:origin: SonarSource/sonarlint-intellij
@Override
public void run(AnActionButton anActionButton) {
SonarQubeServer server = getSelectedServer();
int selectedIndex = serverList.getSelectedIndex();
if (server == null) {
return;
}
Project[] openProjects = ProjectManager.getInstance().getOpenProjects();
List<String> projectsUsingNames = getOpenProjectNames(openProjects, server);
if (!projectsUsingNames.isEmpty()) {
String projects = projectsUsingNames.stream().collect(Collectors.joining("<br>"));
int response = Messages.showYesNoDialog(serversPanel,
"<html>The following opened projects are bound to this server configuration:<br><b>" +
projects + "</b><br>Delete the server?</html>", "Server Configuration In Use", Messages.getWarningIcon());
if (response == Messages.NO) {
return;
}
}
CollectionListModel model = (CollectionListModel) serverList.getModel();
// it's not removed from serverIds and editorList
model.remove(server);
servers.remove(server);
serverChangeListener.changed(servers);
if (model.getSize() > 0) {
int newIndex = Math.min(model.getSize() - 1, Math.max(selectedIndex - 1, 0));
serverList.setSelectedValue(model.getElementAt(newIndex), true);
}
}
代码示例来源:origin: SonarSource/sonarlint-intellij
static boolean showWarning() {
if (!ApplicationManager.getApplication().isUnitTestMode() && !PropertiesComponent.getInstance().getBoolean(HIDE_WARNING_PROPERTY, false)) {
int result = Messages.showYesNoDialog("Analysing all files may take a considerable amount of time to complete.\n"
+ "To get the best from SonarLint, you should preferably use the automatic analysis of the file you're working on.",
"SonarLint - Analyze All Files",
"Proceed", "Cancel", Messages.getWarningIcon(), new DoNotShowAgain());
return result == Messages.OK;
}
return true;
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testDeleteWorkspaceWithProgress_UserCancel() throws Exception {
final MockObserver observer = new MockObserver(manageWorkspacesModel);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_MSG, workspace1.getName()),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_TITLE), Messages.getWarningIcon())).thenReturn(Messages.NO);
manageWorkspacesModel.deleteWorkspaceWithProgress(workspace1);
observer.assertUpdateNeverOccurred(ManageWorkspacesModel.REFRESH_WORKSPACE);
verifyStatic(never());
VcsUtil.runVcsProcessWithProgress(any(VcsRunnable.class), any(String.class), any(Boolean.class), any(Project.class));
Messages.showErrorDialog(any(Project.class), any(String.class), any(String.class));
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testDeleteWorkspaceWithProgress_Happy() throws Exception {
final MockObserver observer = new MockObserver(manageWorkspacesModel);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_MSG, workspace1.getName()),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_TITLE), Messages.getWarningIcon())).thenReturn(Messages.YES);
manageWorkspacesModel.deleteWorkspaceWithProgress(workspace1);
observer.assertAndClearLastUpdate(manageWorkspacesModel, ManageWorkspacesModel.REFRESH_WORKSPACE);
verifyStatic(never());
Messages.showErrorDialog(any(Project.class), any(String.class), any(String.class));
}
代码示例来源:origin: GoogleCloudPlatform/google-cloud-intellij
@Override
public boolean ensureLoggedIn(String username) {
Optional<CredentialedUser> projectUser = getLoggedInUser(username);
while (!projectUser.isPresent()) {
int addUserResult =
Messages.showOkCancelDialog(
AccountMessageBundle.message("login.credentials.missing.message", username),
AccountMessageBundle.message("login.credentials.missing.dialog.title"),
AccountMessageBundle.message("login.credentials.missing.dialog.addaccount.button"),
AccountMessageBundle.message("login.credentials.missing.dialog.cancel.button"),
Messages.getWarningIcon());
if (addUserResult == Messages.OK) {
logIn();
projectUser = getLoggedInUser(username);
} else {
return false;
}
}
return true;
}
代码示例来源:origin: Microsoft/azure-devops-intellij
@Test
public void testDeleteWorkspaceWithProgress_Exception() throws Exception {
final MockObserver observer = new MockObserver(manageWorkspacesModel);
when(Messages.showYesNoDialog(mockProject, TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_MSG, workspace1.getName()),
TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_CONFIRM_TITLE), Messages.getWarningIcon())).thenReturn(Messages.YES);
when(VcsUtil.runVcsProcessWithProgress(any(VcsRunnable.class), eq(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_MSG, workspace1.getName())), eq(true), eq(mockProject)))
.thenThrow(new VcsException(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_ERROR_MSG, workspace1.getName())));
manageWorkspacesModel.deleteWorkspaceWithProgress(workspace1);
observer.assertAndClearLastUpdate(manageWorkspacesModel, ManageWorkspacesModel.REFRESH_WORKSPACE);
verifyStatic(times(1));
Messages.showErrorDialog(eq(mockProject), eq(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_ERROR_MSG, workspace1.getName())),
eq(TfPluginBundle.message(TfPluginBundle.KEY_TFVC_MANAGE_WORKSPACES_DELETE_ERROR_TITLE)));
}
内容来源于网络,如有侵权,请联系作者删除!