Java Code Examples for com.intellij.execution.Executor#getIcon()

The following examples show how to use com.intellij.execution.Executor#getIcon() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RunConfigurationAction.java    From MavenHelper with Apache License 2.0 5 votes vote down vote up
public RunConfigurationAction(Executor executor,
							  boolean enabled,
							  Project project,
							  RunnerAndConfigurationSettings settings) {
	super(settings.getName(), null, executor.getIcon());
	myExecutor = executor;
	myEnabled = enabled;
	myProject = project;
	mySettings = settings;
}
 
Example 2
Source File: RunConfigurationNode.java    From consulo with Apache License 2.0 5 votes vote down vote up
@Nullable
private Image getExecutorIcon() {
  Content content = getContent();
  if (content != null) {
    if (!RunContentManagerImpl.isTerminated(content)) {
      Executor executor = RunContentManagerImpl.getExecutorByContent(content);
      if (executor != null) {
        return executor.getIcon();
      }
    }
  }
  return null;
}
 
Example 3
Source File: ExternalSystemRecentTasksList.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
  Component renderer = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
  if (value instanceof ExternalSystemRecentTaskListModel.MyEmptyDescriptor) {
    return EMPTY_RENDERER;
  }
  else if (value instanceof ExternalTaskExecutionInfo) {
    ExternalTaskExecutionInfo taskInfo = (ExternalTaskExecutionInfo)value;
    String text = null;
    if (myConfigurationType != null) {
      List<RunConfiguration> configurations = RunManager.getInstance(myProject).getConfigurationsList(myConfigurationType);
      for (RunConfiguration configuration : configurations) {
        if (!(configuration instanceof ExternalSystemRunConfiguration)) {
          continue;
        }
        ExternalSystemRunConfiguration c = (ExternalSystemRunConfiguration)configuration;
        if (c.getSettings().equals(taskInfo.getSettings())) {
          text = c.getName();
        }
      }
    }
    if (StringUtil.isEmpty(text)) {
      text = AbstractExternalSystemTaskConfigurationType.generateName(myProject, taskInfo.getSettings());
    }
    
    setText(text);
    Image icon = null;
    String executorId = taskInfo.getExecutorId();
    if (!StringUtil.isEmpty(executorId)) {
      Executor executor = ExecutorRegistry.getInstance().getExecutorById(executorId);
      if (executor != null) {
        icon = executor.getIcon();
      }
    }

    if (icon == null) {
      icon = myGenericTaskIcon;
    }
    setIcon(TargetAWT.to(icon));
  }

  return renderer;
}