Java PropertiesComponent.setValues方法代码示例(javapropertiescomponent.setvalues方法代码示例汇总)

本文整理汇总了Java中com.intellij.ide.util.PropertiesComponent.setValues方法的典型用法代码示例。如果您正苦于以下问题:Java PropertiesComponent.setValues方法的具体用法?Java PropertiesComponent.setValues怎么用?Java PropertiesComponent.setValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ide.util.PropertiesComponent的用法示例。


Java PropertiesComponent.setValues方法代码示例(javapropertiescomponent.setvalues方法代码示例汇总)

在下文中一共展示了PropertiesComponent.setValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: commitForNext

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
@Override
protected void commitForNext() throws CommitStepException {
  if (myIdeaAndroidProject == null) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.no.model"));
  }

  final String apkFolder = myApkPathField.getText().trim();
  if (apkFolder.isEmpty()) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.destination"));
  }

  File f = new File(apkFolder);
  if (!f.isDirectory() || !f.canWrite()) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.invalid.destination"));
  }

  int[] selectedFlavorIndices = myFlavorsList.getSelectedIndices();
  if (!myFlavorsListModel.isEmpty() && selectedFlavorIndices.length == 0) {
    throw new CommitStepException(AndroidBundle.message("android.apk.sign.gradle.missing.flavors"));
  }

  Object[] selectedFlavors = myFlavorsList.getSelectedValues();
  List<String> flavors = new ArrayList<String>(selectedFlavors.length);
  for (int i = 0; i < selectedFlavors.length; i++) {
    flavors.add((String)selectedFlavors[i]);
  }

  myWizard.setApkPath(apkFolder);
  myWizard.setGradleOptions((String)myBuildTypeCombo.getSelectedItem(), flavors);

  PropertiesComponent properties = PropertiesComponent.getInstance(myWizard.getProject());
  properties.setValue(PROPERTY_APK_PATH, apkFolder);
  properties.setValues(PROPERTY_FLAVORS, ArrayUtil.toStringArray(flavors));
  properties.setValue(PROPERTY_BUILD_TYPE, (String)myBuildTypeCombo.getSelectedItem());
} 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:36,代码来源:GradleSignStep.java

示例2: saveHistory

import com.intellij.ide.util.PropertiesComponent; //导入方法依赖的package包/类
private static void saveHistory(Project project, String text, Object value) {
  if (project == null || project.isDisposed() || !project.isInitialized()) {
    return;
  }
  HistoryType type = null;
  String fqn = null;
  if (isActionValue(value)) {
    type = HistoryType.ACTION;
    AnAction action = (AnAction)(value instanceof GotoActionModel.ActionWrapper ? ((GotoActionModel.ActionWrapper)value).getAction() : value);
    fqn = ActionManager.getInstance().getId(action);
  } else if (value instanceof VirtualFile) {
    type = HistoryType.FILE;
    fqn = ((VirtualFile)value).getUrl();
  } else if (value instanceof ChooseRunConfigurationPopup.ItemWrapper) {
    type = HistoryType.RUN_CONFIGURATION;
    fqn = ((ChooseRunConfigurationPopup.ItemWrapper)value).getText();
  } else if (value instanceof PsiElement) {
    final PsiElement psiElement = (PsiElement)value;
    final Language language = psiElement.getLanguage();
    final String name = LanguagePsiElementExternalizer.INSTANCE.forLanguage(language).getQualifiedName(psiElement);
    if (name != null) {
      type = HistoryType.PSI;
      fqn = language.getID() + "://" + name;
    }
  }

  final PropertiesComponent storage = PropertiesComponent.getInstance(project);
  final String[] values = storage.getValues(SE_HISTORY_KEY);
  List<HistoryItem> history = new ArrayList<HistoryItem>();
  if (values != null) {
    for (String s : values) {
      final String[] split = s.split("\t");
      if (split.length != 3 || text.equals(split[0])) {
        continue;
      }
      if (!StringUtil.isEmpty(split[0])) {
        history.add(new HistoryItem(split[0], split[1], split[2]));
      }
    }
  }
  history.add(0, new HistoryItem(text, type == null ? null : type.name(), fqn));

  if (history.size() > MAX_SEARCH_EVERYWHERE_HISTORY) {
    history = history.subList(0, MAX_SEARCH_EVERYWHERE_HISTORY);
  }
  final String[] newValues = new String[history.size()];
  for (int i = 0; i < newValues.length; i++) {
    newValues[i] = history.get(i).toString();
  }
  storage.setValues(SE_HISTORY_KEY, newValues);
} 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:SearchEverywhereAction.java

本文标签属性:

示例:示例英语

代码:代码转换器

java:javascript什么意思

PropertiesComponent:PropertiesComponent

setValues:setvalue是什么意思

上一篇:林志颖妈妈的老公是谁(婆婆妈妈林志颖妈妈是后妈吗?)
下一篇:IT圈说的白帽子,红帽子,黑帽子都是指什么(“黑帽子”长什么样?黑帽子为什么会成为官员的象征?)

为您推荐