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


Java ConfigurationType.getIcon方法代碼示例

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


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

示例1: getIcon

import com.intellij.execution.configurations.ConfigurationType; //導入方法依賴的package包/類
public Icon getIcon(String file) {
  final ConfigurationBean bean = myState.getHistoryElements().get(file);
  if (bean != null) {
    ConfigurationType type = ConfigurationTypeUtil.findConfigurationType(bean.configurationId);
    if (type != null) return type.getIcon();
  }
  return null;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:TestHistoryConfiguration.java

示例2: buildNodes

import com.intellij.execution.configurations.ConfigurationType; //導入方法依賴的package包/類
private DefaultMutableTreeNode buildNodes() {
  DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Descriptor());
  RunManager runManager = RunManager.getInstance(myProject);
  final ConfigurationType[] configTypes = runManager.getConfigurationFactories();

  for (final ConfigurationType type : configTypes) {
    final Icon icon = type.getIcon();
    DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(new ConfigurationTypeDescriptor(type, icon, isConfigurationAssigned(type)));
    root.add(typeNode);
    final Set<String> addedNames = StringSetSpinAllocator.alloc();
    try {
      List<RunConfiguration> configurations = runManager.getConfigurationsList(type);
      for (final RunConfiguration configuration : configurations) {
        final String configurationName = configuration.getName();
        if (addedNames.contains(configurationName)) {
          // add only the first configuration if more than one has the same name
          continue;
        }
        addedNames.add(configurationName);
        typeNode.add(new DefaultMutableTreeNode(
          new ConfigurationDescriptor(configuration, isConfigurationAssigned(configuration))));
      }
    }
    finally {
      StringSetSpinAllocator.dispose(addedNames);
    }
  }

  return root;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:BaseExecuteBeforeRunDialog.java

示例3: getChildren

import com.intellij.execution.configurations.ConfigurationType; //導入方法依賴的package包/類
private AnAction[] getChildren(DataContext dataContext) {
  final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
  final RunnerAndConfigurationSettings existing = context.findExisting();
  if (existing == null) {
    final List<ConfigurationFromContext> producers = getConfigurationsFromContext(context);
    if (producers.size() > 1) {
      final AnAction[] children = new AnAction[producers.size()];
      int chldIdx = 0;
      for (final ConfigurationFromContext fromContext : producers) {
        final ConfigurationType configurationType = fromContext.getConfigurationType();
        final RunConfiguration configuration = fromContext.getConfiguration();
        final String actionName = configuration instanceof LocatableConfiguration
                                  ? StringUtil.unquoteString(suggestRunActionName((LocatableConfiguration)configuration))
                                  : configurationType.getDisplayName();
        final AnAction anAction = new AnAction(actionName, configurationType.getDisplayName(), configurationType.getIcon()) {
          @Override
          public void actionPerformed(AnActionEvent e) {
            perform(fromContext, context);
          }
        };
        anAction.getTemplatePresentation().setText(actionName, false);
        children[chldIdx++] = anAction;
      }
      return children;
    }
  }
  return EMPTY_ARRAY;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:29,代碼來源:BaseRunConfigurationAction.java

示例4: buildNodes

import com.intellij.execution.configurations.ConfigurationType; //導入方法依賴的package包/類
private DefaultMutableTreeNode buildNodes() {
  DefaultMutableTreeNode root = new DefaultMutableTreeNode(new Descriptor());
  RunManager runManager = RunManager.getInstance(myProject);
  final ConfigurationType[] configTypes = runManager.getConfigurationFactories();

  for (final ConfigurationType type : configTypes) {
    final Icon icon = type.getIcon();
    DefaultMutableTreeNode typeNode = new DefaultMutableTreeNode(new ConfigurationTypeDescriptor(type, icon, isConfigurationAssigned(type)));
    root.add(typeNode);
    final Set<String> addedNames = StringSetSpinAllocator.alloc();
    try {
      RunConfiguration[] configurations = runManager.getConfigurations(type);
      for (final RunConfiguration configuration : configurations) {
        final String configurationName = configuration.getName();
        if (addedNames.contains(configurationName)) {
          // add only the first configuration if more than one has the same name
          continue;
        }
        addedNames.add(configurationName);
        typeNode.add(new DefaultMutableTreeNode(
          new ConfigurationDescriptor(configuration, isConfigurationAssigned(configuration))));
      }
    }
    finally {
      StringSetSpinAllocator.dispose(addedNames);
    }
  }

  return root;
}
 
開發者ID:lshain-android-source,項目名稱:tools-idea,代碼行數:31,代碼來源:BaseExecuteBeforeRunDialog.java

示例5: getGroup

import com.intellij.execution.configurations.ConfigurationType; //導入方法依賴的package包/類
@Nullable
@Override
public DashboardGroup getGroup(AbstractTreeNode<?> node) {
  if (node instanceof DashboardRunConfigurationNode) {
    RunnerAndConfigurationSettings configurationSettings = ((DashboardRunConfigurationNode)node).getConfigurationSettings();
    ConfigurationType type = configurationSettings.getType();
    if (type != null) {
      return new DashboardGroupImpl<>(type, type.getDisplayName(), type.getIcon());
    }
  }
  return null;
}
 
開發者ID:consulo,項目名稱:consulo,代碼行數:13,代碼來源:ConfigurationTypeDashboardGroupingRule.java


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