Example usage for com.intellij.openapi.ui MessageDialogBuilder.YesNo noText

List of usage examples for com.intellij.openapi.ui MessageDialogBuilder.YesNo noText

Introduction

In this page you can find the example usage for com.intellij.openapi.ui MessageDialogBuilder.YesNo noText.

Prototype

public T noText(@NotNull String noText) 

Source Link

Usage

From source file:org.mustbe.consulo.csharp.ide.refactoring.rename.CSharpOverrideElementProcessor.java

License:Apache License

@Override
public void prepareRenaming(PsiElement element, String newName, Map<PsiElement, String> allRenames,
        SearchScope scope) {//  ww  w.ja v a 2s  .c o  m

    // if name is empty that mean start rename
    if (StringUtil.isEmpty(newName)) {
        myLastResult = -1;
    }

    if (myLastResult == -1) {
        Set<DotNetVirtualImplementOwner> allElements = getAllElements(element);
        if (!allElements.isEmpty()) {
            MessageDialogBuilder.YesNo builder = MessageDialogBuilder.yesNo("Rename",
                    "Rename all override/implement methods or this method?");
            builder = builder.yesText("All Methods");
            builder = builder.noText("This Method");

            if ((myLastResult = builder.show()) == Messages.YES) {
                for (DotNetVirtualImplementOwner tempElement : allElements) {
                    allRenames.put(tempElement, newName);
                }
            }
        }
    } else if (myLastResult == Messages.YES) {
        Set<DotNetVirtualImplementOwner> allElements = getAllElements(element);
        for (DotNetVirtualImplementOwner tempElement : allElements) {
            allRenames.put(tempElement, newName);
        }
    }
}