本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}