当前位置: 首页>>代码示例>>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;未经允许,请勿转载。