本文整理匯總了Java中com.intellij.openapi.ui.Messages.showWarningDialog方法的典型用法代碼示例。如果您正苦於以下問題:Java Messages.showWarningDialog方法的具體用法?Java Messages.showWarningDialog怎麽用?Java Messages.showWarningDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.openapi.ui.Messages
的用法示例。
在下文中一共展示了Messages.showWarningDialog方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateProject
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public void generateProject(@NotNull final Project project, @NotNull final VirtualFile baseDir) {
final Course course = getCourse(project);
if (course == null) {
LOG.warn("Course is null");
Messages.showWarningDialog("Some problems occurred while creating the course", "Error in Course Creation");
return;
}
else if (course.isAdaptive() && !StudyUtils.isCourseValid(course)) {
Messages.showWarningDialog("There is no recommended tasks for this adaptive course", "Error in Course Creation");
return;
}
StudyTaskManager.getInstance(project).setCourse(course);
ApplicationManager.getApplication().runWriteAction(() -> {
StudyGenerator.createCourse(course, baseDir);
StudyUtils.registerStudyToolWindow(course, project);
StudyUtils.openFirstTask(course, project);
EduUsagesCollector.projectTypeCreated(course.isAdaptive() ? EduNames.ADAPTIVE : EduNames.STUDY);
});
}
示例2: findItemToAdd
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected Object findItemToAdd() {
String word = Messages.showInputDialog(SpellCheckerBundle.message("enter.simple.word"),
SpellCheckerBundle.message("add.new.word"), null);
if (word == null) {
return null;
}
else {
word = word.trim();
}
if (Strings.isMixedCase(word)) {
Messages.showWarningDialog(SpellCheckerBundle.message("entered.word.0.is.mixed.cased.you.must.enter.simple.word", word),
SpellCheckerBundle.message("add.new.word"));
return null;
}
if (!manager.hasProblem(word)) {
Messages.showWarningDialog(SpellCheckerBundle.message("entered.word.0.is.correct.you.no.need.to.add.this.in.list", word),
SpellCheckerBundle.message("add.new.word"));
return null;
}
return word;
}
示例3: showDiffImpl
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static void showDiffImpl(final Project project, @NotNull List<DiffRequestPresentable> changeList, int index,
@NotNull final ShowDiffUIContext context) {
final ChangeDiffRequest request = new ChangeDiffRequest(project, changeList, context.getActionsFactory(), context.isShowFrame());
final DiffTool tool = DiffManager.getInstance().getDiffTool();
final DiffRequest simpleRequest;
try {
request.quickCheckHaveStuff();
simpleRequest = request.init(index);
}
catch (VcsException e) {
Messages.showWarningDialog(e.getMessage(), "Show Diff");
LOG.info(e);
return;
}
if (simpleRequest != null) {
final DiffNavigationContext navigationContext = context.getDiffNavigationContext();
if (navigationContext != null) {
simpleRequest.passForDataContext(DiffTool.SCROLL_TO_LINE, navigationContext);
}
tool.show(simpleRequest);
}
}
示例4: rollbackChanges
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static void rollbackChanges(final Project project, final Collection<Change> changes, boolean refreshSynchronously,
final Runnable afterVcsRefreshInAwt) {
final ChangeListManagerEx manager = (ChangeListManagerEx) ChangeListManager.getInstance(project);
if (changes.isEmpty()) {
String operationName = UIUtil.removeMnemonic(RollbackUtil.getRollbackOperationName(project));
Messages.showWarningDialog(project, VcsBundle.message("commit.dialog.no.changes.detected.text"),
VcsBundle.message("changes.action.rollback.nothing", operationName));
return;
}
final ArrayList<Change> validChanges = new ArrayList<Change>();
final Set<LocalChangeList> lists = new THashSet<LocalChangeList>();
lists.addAll(manager.getInvolvedListsFilterChanges(changes, validChanges));
new RollbackChangesDialog(project, ContainerUtil.newArrayList(lists), validChanges, refreshSynchronously, afterVcsRefreshInAwt).show();
}
示例5: doAction
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
protected void doAction() {
if (myParametersTable != null) {
TableUtil.stopEditing(myParametersTable);
}
String message = validateAndCommitData();
if (message != null) {
if (message != EXIT_SILENTLY) {
CommonRefactoringUtil.showErrorMessage(getTitle(), message, getHelpId(), myProject);
}
return;
}
if (myMethodsToPropagateParameters != null && !mayPropagateParameters()) {
Messages.showWarningDialog(myProject, RefactoringBundle.message("changeSignature.parameters.wont.propagate"),
ChangeSignatureHandler.REFACTORING_NAME);
myMethodsToPropagateParameters = null;
}
myDisposed = true;
invokeRefactoring(createRefactoringProcessor());
}
示例6: consume
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void consume(@Nullable ProjectSettingsStepBase base) {
if (base == null) return;
final DirectoryProjectGenerator generator = base.getProjectGenerator();
final NullableConsumer<ProjectSettingsStepBase> callback = new GenerateProjectCallback();
if (generator instanceof PythonProjectGenerator && base instanceof ProjectSpecificSettingsStep) {
final BooleanFunction<PythonProjectGenerator> beforeProjectGenerated = ((PythonProjectGenerator)generator).
beforeProjectGenerated(((ProjectSpecificSettingsStep)base).getSdk());
if (beforeProjectGenerated != null) {
final boolean result = beforeProjectGenerated.fun((PythonProjectGenerator)generator);
if (result) {
callback.consume(base);
}
else {
Messages.showWarningDialog("Project can not be generated", "Error in Project Generation");
}
}
else {
callback.consume(base);
}
}
}
示例7: isCurrentSchemeValid
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static boolean isCurrentSchemeValid(Project project, FileTemplateSource fileTemplateSource) {
switch (fileTemplateSource) {
case PROJECT_ONLY:
case PROJECT_PRIORITY:
case DEFAULT_PRIORITY:
if (FileTemplateHelper.isDefaultScheme(project)) {
Messages.showWarningDialog(project, Localizer.get("warning.SwitchToProjectScheme"), "Warning Dialog");
return false;
}
}
return true;
}
示例8: addFavourite
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void addFavourite(String path) {
if(isDuplicateFavourite(path)){
Messages.showWarningDialog(Localizer.get("warning.FavouriteAlreadyExists"), "WarningDialog");
return;
}
SaveUtil.editor()
.addFavourite(new Favourite(path, SaveUtil.reader().getListFavourite().size()))
.save();
view.updateFavouritesUI();
}
示例9: invokeRefactoring
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
protected void invokeRefactoring(final BaseRefactoringProcessor processor) {
if (myMethodsToPropagateExceptions != null && !mayPropagateExceptions()) {
Messages.showWarningDialog(myProject, RefactoringBundle.message("changeSignature.exceptions.wont.propagate"), REFACTORING_NAME);
myMethodsToPropagateExceptions = null;
}
super.invokeRefactoring(processor);
}
示例10: showBinaryDiff
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private static void showBinaryDiff(Project project, Change change) {
try {
final SimpleDiffRequest request = createBinaryDiffRequest(project, change);
if (DiffManager.getInstance().getDiffTool().canShow(request)) {
DiffManager.getInstance().getDiffTool().show(request);
}
}
catch (VcsException e) {
Messages.showWarningDialog(e.getMessage(), "Show Diff");
LOG.info(e);
}
}
示例11: updateFields
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private void updateFields(boolean initial) {
if (!initial && myBranchFrom.getItemCount() == 0 && myCreateBranch.isSelected()) {
Messages.showWarningDialog(myPanel, "Can't create branch if no commit exists.\nCreate a commit first.", "Cannot Create Branch");
myCreateBranch.setSelected(false);
}
myBranchName.setEnabled(myCreateBranch.isSelected());
myFromLabel.setEnabled(myCreateBranch.isSelected());
myBranchFrom.setEnabled(myCreateBranch.isSelected());
myChangelistName.setEnabled(myCreateChangelist.isSelected());
myTaskStateCombo.setEnabled(myUpdateState.isSelected());
}
示例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: showWarningDialog
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static void showWarningDialog(@Nullable Component parent, String message, @NotNull String title) {
if (parent != null) Messages.showWarningDialog(parent, message, title);
else showWarningDialog(message, title);
}
示例14: showWarningDialog
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public static void showWarningDialog(@Nullable Project project, @NotNull String title, @NotNull String message) {
LOG.info(title + "; " + message);
Messages.showWarningDialog(project, message, title);
}
示例15: actionPerformed
import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public void actionPerformed(@NotNull AnActionEvent event) {
final DataContext dataContext = event.getDataContext();
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return;
}
final VirtualFile[] contextFiles = CommonDataKeys.VIRTUAL_FILE_ARRAY.getData(dataContext);
if (contextFiles == null || contextFiles.length == 0) {
return;
}
final AntConfiguration antConfiguration = AntConfiguration.getInstance(project);
final Set<VirtualFile> files = new HashSet<VirtualFile>();
files.addAll(Arrays.asList(contextFiles));
for (AntBuildFile buildFile : antConfiguration.getBuildFiles()) {
files.remove(buildFile.getVirtualFile());
}
int filesAdded = 0;
final StringBuilder errors = new StringBuilder();
for (VirtualFile file : files) {
try {
antConfiguration.addBuildFile(file);
filesAdded++;
}
catch (AntNoFileException e) {
String message = e.getMessage();
if (message == null || message.length() == 0) {
message = AntBundle.message("cannot.add.build.files.from.excluded.directories.error.message", e.getFile().getPresentableUrl());
}
if (errors.length() > 0) {
errors.append("\n");
}
errors.append(message);
}
}
if (errors.length() > 0) {
Messages.showWarningDialog(project, errors.toString(), AntBundle.message("cannot.add.build.file.dialog.title"));
}
if (filesAdded > 0) {
ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.ANT_BUILD).activate(null);
}
}