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


Java Messages.showEditableChooseDialog方法代碼示例

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


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

示例1: actionPerformed

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

    List<String> channelsId = SlackStorage.getInstance().getChannelsId();

    if (channelsId.size() > 0) {
        String channelToRemove = Messages.showEditableChooseDialog(
                "Select the channel to remove",
                SlackChannel.getSettingsDescription(),
                SlackStorage.getSlackIcon(),
                channelsId.toArray(new String[channelsId.size()]),
                channelsId.get(0),
                null
        );

        if (channelsId.contains(channelToRemove)) {
            SlackStorage.getInstance().removeChannelByDescription(channelToRemove);
            Messages.showMessageDialog(project, "Channel \"" + channelToRemove + "\" removed.", "Information", Messages.getInformationIcon());
        }
    }
}
 
開發者ID:chakki-works,項目名稱:watchMe,代碼行數:23,代碼來源:SlackSettings.java

示例2: askForAttributeValue

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
@Nullable
private String askForAttributeValue(@NotNull PsiElement context) {
  final AndroidFacet facet = AndroidFacet.getInstance(context);
  final String message = "Specify value of attribute '" + myAttributeName + "'";
  final String title = "Set Attribute Value";

  if (facet != null) {
    final SystemResourceManager srm = facet.getSystemResourceManager();

    if (srm != null) {
      final AttributeDefinitions attrDefs = srm.getAttributeDefinitions();

      if (attrDefs != null) {
        final AttributeDefinition def = attrDefs.getAttrDefByName(myAttributeName);
        if (def != null) {
          final String[] variants = def.getValues();

          if (variants.length > 0) {
            return Messages.showEditableChooseDialog(message, title, Messages.getQuestionIcon(), variants, variants[0], null);
          }
        }
      }
    }
  }
  return Messages.showInputDialog(context.getProject(), message, title, Messages.getQuestionIcon());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:27,代碼來源:SetAttributeQuickFix.java

示例3: run

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public void run() {
  IProperty textProperty = FormInspectionUtil.findProperty(myComponent, SwingProperties.TEXT);
  StringDescriptor descriptor = (StringDescriptor) textProperty.getPropertyValue(myComponent);
  String value = StringDescriptorManager.getInstance(myComponent.getModule()).resolve(myComponent, descriptor);
  String[] variants = fillMnemonicVariants(SupportCode.parseText(value).myText);
  String result = Messages.showEditableChooseDialog(UIDesignerBundle.message("inspection.missing.mnemonics.quickfix.prompt"),
                                                    UIDesignerBundle.message("inspection.missing.mnemonics.quickfix.title"),
                                                    Messages.getQuestionIcon(), variants, variants [0], null);
  if (result != null) {
    if (!myEditor.ensureEditable()) {
      return;
    }
    FormInspectionUtil.updateStringPropertyValue(myEditor, myComponent, (IntroStringProperty)textProperty, descriptor, result);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:16,代碼來源:AssignMnemonicFix.java

示例4: actionPerformed

import com.intellij.openapi.ui.Messages; //導入方法依賴的package包/類
public final void actionPerformed(AnActionEvent e) {
  String[] strings = ArrayUtil.toStringArray(myPredefinedSeparators);
  String current = getCurrentSeparator();
  String separator = Messages.showEditableChooseDialog(PropertiesBundle.message("select.property.separator.dialog.text"),
                                                       PropertiesBundle.message("select.property.separator.dialog.title"),
                                                       Messages.getQuestionIcon(),
                                                       strings, current, null);
  if (separator == null) {
    return;
  }
  myPredefinedSeparators.add(separator);
  refillActionGroup();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:14,代碼來源:PropertiesGroupingStructureViewComponent.java


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