當前位置: 首頁>>代碼示例>>Java>>正文


Java Messages.showInputDialog方法代碼示例

本文整理匯總了Java中com.intellij.openapi.ui.Messages.showInputDialog方法的典型用法代碼示例。如果您正苦於以下問題:Java Messages.showInputDialog方法的具體用法?Java Messages.showInputDialog怎麽用?Java Messages.showInputDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.ui.Messages的用法示例。


在下文中一共展示了Messages.showInputDialog方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    Project project = anActionEvent.getProject();

    if (project != null) {

        String packageName = Messages.showInputDialog(
                Strings.MESSAGE_ASK_PACKAGE_NAME_TO_FILTER,
                Strings.TITLE_ASK_PACKAGE_NAME_TO_FILTER,
                Messages.getQuestionIcon(),
                PropertiesManager.getData(project, PropertyKeys.PACKAGE_NAME),
                new NonEmptyInputValidator());

        if (!TextUtils.isEmpty(packageName)) {
            PropertiesManager.putData(project, PropertyKeys.PACKAGE_NAME, packageName);
        }
    }
}
 
開發者ID:kaygisiz,項目名稱:Dependency-Injection-Graph,代碼行數:19,代碼來源:SetPackageFilter.java

示例2: invokeDialog

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@NotNull
@Override
protected PsiElement[] invokeDialog(Project project, PsiDirectory psiDirectory) {
    PsiElement[] result = new PsiElement[0];
    String initialValue = StringUtils.EMPTY;
    String folderName = Messages.showInputDialog(project,
            DIALOG_TEXT,
            DIALOG_TITLE,
            Messages.getQuestionIcon(),
            initialValue,
            new NewItemNameValidator(psiDirectory));
    if (StringUtils.isNotEmpty(folderName)) {
        result = create(folderName, psiDirectory);
    }
    return result;
}
 
開發者ID:Cognifide,項目名稱:IntelliJ-Shortcuts-For-AEM,代碼行數:17,代碼來源:NewSlingFolder.java

示例3: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void actionPerformed(@NotNull AnActionEvent event) {

    final Project project = getEventProject(event);
    if (project == null) {
        this.setStatus(event, false);
        return;
    }

    PsiDirectory bundleDirContext = ExtensionUtility.getExtensionDirectory(event);
    if (bundleDirContext == null) {
        return;
    }

    String className = Messages.showInputDialog(project, "New class name:", "New File", TYPO3CMSIcons.TYPO3_ICON);
    if (StringUtils.isBlank(className)) {
        return;
    }

    if (!PhpNameUtil.isValidClassName(className)) {
        JOptionPane.showMessageDialog(null, "Invalid class name");
        return;
    }

    write(project, bundleDirContext, className);
}
 
開發者ID:cedricziel,項目名稱:idea-php-typo3-plugin,代碼行數:27,代碼來源:NewExtensionFileAction.java

示例4: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  final IdeView view = e.getData(LangDataKeys.IDE_VIEW);
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (view == null || project == null) {
    return;
  }
  final String courseId = Messages.showInputDialog("Please, enter course id", "Get Course From Stepik", null);
  if (StringUtil.isNotEmpty(courseId)) {
    ProgressManager.getInstance().run(new Task.Modal(project, "Creating Course", true) {
      @Override
      public void run(@NotNull final ProgressIndicator indicator) {
        createCourse(project, courseId);
      }
    });
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:18,代碼來源:CCGetCourseFromStepic.java

示例5: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Override
public void actionPerformed(AnActionEvent e) {
    project = e.getProject();
    selectGroup = DataKeys.VIRTUAL_FILE.getData(e.getDataContext());
    String className = Messages.showInputDialog(project, "請輸入類名稱", "NewMvpGroup", Messages.getQuestionIcon());
    if (className == null || className.equals("")) {
        System.out.print("沒有輸入類名");
        return;
    }
    if (className.equals("base") || className.equals("BASE") || className.equals("Base")) {
        createMvpBase();
    } else {
        createClassMvp(className);
    }
    project.getBaseDir().refresh(false, true);
}
 
開發者ID:y1xian,項目名稱:KotlinMvp,代碼行數:17,代碼來源:AndroidMvpAction.java

示例6: exportProjectScheme

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public int exportProjectScheme() {
  String name = Messages.showInputDialog("Enter new scheme name:", "Copy Project Scheme to Global List", Messages.getQuestionIcon());
  if (name != null && !CodeStyleSchemesModel.PROJECT_SCHEME_NAME.equals(name)) {
    CodeStyleScheme newScheme = mySchemesModel.exportProjectScheme(name);
    updateSchemes();
    int switchToGlobal = Messages
      .showYesNoDialog("Project scheme was copied to global scheme list as '" + newScheme.getName() + "'.\n" +
                       "Switch to this created scheme?",
                       "Copy Project Scheme to Global List", Messages.getQuestionIcon());
    if (switchToGlobal == Messages.YES) {
      mySchemesModel.setUsePerProjectSettings(false);
      mySchemesModel.selectScheme(newScheme, null);
    }
    int row = 0;
    for (CodeStyleScheme scheme : mySchemes) {
      if (scheme == newScheme) {
        fireTableRowsInserted(row, row);
        return switchToGlobal == 0 ? row : -1;
      }
      row++;
    }
  }
  return -1;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:ManageCodeStyleSchemesDialog.java

示例7: invokeDialog

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@NotNull
@Override
protected PsiElement[] invokeDialog(Project project, PsiDirectory psiDirectory) {
    HashMap<String,String> classConfig = new HashMap<>();

    String controllerName = Messages.showInputDialog(
            "Set Plugin Name",
            "Input Plugin Name",
            Messages.getQuestionIcon(),
            "",
            new NonEmptyInputValidator()
    );

    if (StringUtils.isBlank(controllerName)) {
        PsiElement[] psiElements = new PsiElement[1];

        return psiElements;
    }

    classConfig.put(SprykerConstants.CLASS_NAME, controllerName);

    return this.createClassType(project, psiDirectory, classConfig);
}
 
開發者ID:project-a,項目名稱:idea-php-spryker-plugin,代碼行數:24,代碼來源:ClientPluginAction.java

示例8: invokeDialog

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@NotNull
@Override
protected PsiElement[] invokeDialog(Project project, PsiDirectory psiDirectory) {
    HashMap<String,String> classConfig = new HashMap<>();

    String controllerName = Messages.showInputDialog(
            "Set Controller Name",
            "Input Controller Name",
            Messages.getQuestionIcon(),
            "",
            new NonEmptyInputValidator()
    );

    if (StringUtils.isBlank(controllerName)) {
        PsiElement[] psiElements = new PsiElement[1];

        return psiElements;
    }

    classConfig.put(SprykerConstants.CLASS_NAME, controllerName);

    return this.createClassType(project, psiDirectory, classConfig);
}
 
開發者ID:project-a,項目名稱:idea-php-spryker-plugin,代碼行數:24,代碼來源:ZedControllerAction.java

示例9: applyNewSetterPrefix

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private void applyNewSetterPrefix() {
  final String setterPrefix = Messages.showInputDialog(myTable, "New setter prefix:", "Rename Setters Prefix", null,
                                                       mySetterPrefix, new MySetterPrefixInputValidator());
  if (setterPrefix != null) {
    mySetterPrefix = setterPrefix;
    PropertiesComponent.getInstance(myProject).setValue(SETTER_PREFIX_KEY, setterPrefix);
    final JavaCodeStyleManager javaCodeStyleManager = JavaCodeStyleManager.getInstance(myProject);
    for (String paramName : myParametersMap.keySet()) {
      final ParameterData data = myParametersMap.get(paramName);
      paramName = data.getParamName();
      final String propertyName = javaCodeStyleManager.variableNameToPropertyName(paramName, VariableKind.PARAMETER);
      data.setSetterName(PropertyUtil.suggestSetterName(propertyName, setterPrefix));
    }
    myTable.revalidate();
    myTable.repaint();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:ReplaceConstructorWithBuilderDialog.java

示例10: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
/**
 * @param event Carries information on the invocation place
 */
@Override
public void actionPerformed(AnActionEvent event) {
    final Project project = getEventProject(event);
    if (project == null) {
        this.setStatus(event, false);
        return;
    }

    DataContext dataContext = event.getDataContext();

    final Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
    final PsiFile file = CommonDataKeys.PSI_FILE.getData(dataContext);
    final PhpClass targetClass = editor == null || file == null ? null : PhpCodeEditUtil.findClassAtCaret(editor, file);

    if (targetClass == null) {
        JOptionPane.showMessageDialog(null, "Could not find containing class");
        return;
    }

    String actionName = Messages.showInputDialog(project, "New action name:", "New Extbase ActionController Action", TYPO3CMSIcons.TYPO3_ICON);

    if (StringUtils.isBlank(actionName)) {
        return;
    }

    actionName = Character.toLowerCase(actionName.charAt(0)) + actionName.substring(1);

    if (!actionName.endsWith("Action")) {
        actionName += "Action";
    }

    if (!PhpNameUtil.isValidMethodName(actionName)) {
        JOptionPane.showMessageDialog(null, "Invalid method name");
        return;
    }

    write(project, targetClass, actionName);
}
 
開發者ID:cedricziel,項目名稱:idea-php-typo3-plugin,代碼行數:42,代碼來源:ExtbaseControllerActionAction.java

示例11: showInputDialog

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected String showInputDialog(String keyDescription, String keyDefaultValue) {
    return Messages.showInputDialog(
            this.project,
            keyDescription,
            SlackChannel.getSettingsDescription(),
            SlackStorage.getSlackIcon(),
            keyDefaultValue,
            null
    );
}
 
開發者ID:chakki-works,項目名稱:watchMe,代碼行數:11,代碼來源:SlackSettings.java

示例12: getItem

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Nullable
protected StudyItem getItem(@NotNull final PsiDirectory sourceDirectory,
                            @NotNull final Project project,
                            @NotNull final Course course,
                            @Nullable IdeView view,
                            @Nullable StudyItem parentItem) {

  String itemName;
  int itemIndex;
  if (isAddedAsLast(sourceDirectory, project, course)) {
    itemIndex = getSiblingsSize(course, parentItem) + 1;
    String suggestedName = getItemName() + itemIndex;
    itemName = view == null ? suggestedName : Messages.showInputDialog("Name:", getTitle(),
                                                                       null, suggestedName, null);
  }
  else {
    StudyItem thresholdItem = getThresholdItem(course, sourceDirectory);
    if (thresholdItem == null) {
      return null;
    }
    final int index = thresholdItem.getIndex();
    CCCreateStudyItemDialog dialog = new CCCreateStudyItemDialog(project, getItemName(), thresholdItem.getName(), index);
    dialog.show();
    if (dialog.getExitCode() != DialogWrapper.OK_EXIT_CODE) {
      return null;
    }
    itemName = dialog.getName();
    itemIndex = index + dialog.getIndexDelta();
  }
  if (itemName == null) {
    return null;
  }
  return createAndInitItem(course, parentItem, itemName, itemIndex);
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:35,代碼來源:CCCreateStudyItemActionBase.java

示例13: processRename

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
protected static void processRename(@NotNull final StudyItem item, String namePrefix, @NotNull final Project project) {
  String name = item.getName();
  String text = "Rename " + StringUtil.toTitleCase(namePrefix);
  String newName = Messages.showInputDialog(project, text + " '" + name + "' to", text, null, name, null);
  if (newName != null) {
    item.setName(newName);
  }
}
 
開發者ID:medvector,項目名稱:educational-plugin,代碼行數:9,代碼來源:CCRenameHandler.java

示例14: setPackageName

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
private void setPackageName(Project project) {
    String packageName = Messages.showInputDialog(
            Strings.MESSAGE_ASK_PACKAGE_NAME_TO_FILTER,
            Strings.TITLE_ASK_PACKAGE_NAME_TO_FILTER,
            Messages.getQuestionIcon(),
            PropertiesManager.getData(project, PropertyKeys.PACKAGE_NAME),
            new NonEmptyInputValidator());

    if (!TextUtils.isEmpty(packageName)) {
        this.packageName = packageName;
        PropertiesManager.putData(project, PropertyKeys.PACKAGE_NAME, packageName);
    }
}
 
開發者ID:kaygisiz,項目名稱:Dependency-Injection-Graph,代碼行數:14,代碼來源:GenerateDependencyInjectionGraph.java

示例15: invokeDialog

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@NotNull
protected final PsiElement[] invokeDialog(final Project project, final PsiDirectory directory) {
    log.debug("invokeDialog");
    final MyInputValidator validator = new MyInputValidator(project, directory);
    Messages.showInputDialog(project, getDialogPrompt(), getDialogTitle(), Messages.getQuestionIcon(), "", validator);

    final PsiElement[] elements = validator.getCreatedElements();
    log.debug("Result: " + Arrays.toString(elements));
    return elements;
}
 
開發者ID:internetisalie,項目名稱:lua-for-idea,代碼行數:11,代碼來源:NewLuaActionBase.java


注:本文中的com.intellij.openapi.ui.Messages.showInputDialog方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。