当前位置: 首页>>代码示例>>Java>>正文


Java UICommand.getMetadata方法代码示例

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


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

示例1: getRecentCommands

import org.jboss.forge.addon.ui.command.UICommand; //导入方法依赖的package包/类
public synchronized List<UICommand> getRecentCommands(List<UICommand> commands, UIContext context)
{
   List<UICommand> enabledList = new ArrayList<>();

   for (UICommand command : commands)
   {
      UICommandMetadata metadata = command.getMetadata(context);

      // It's necessary to check if the command is still apparent on the list
      if (recentCommands.contains(metadata.getName()) && Commands.isEnabled(command, context))
      {
         enabledList.add(command);
      }
   }

   return enabledList;
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:18,代码来源:PluginService.java

示例2: createCommandInfoDTO

import org.jboss.forge.addon.ui.command.UICommand; //导入方法依赖的package包/类
public static CommandInfoDTO createCommandInfoDTO(RestUIContext context, UICommand command) {
    CommandInfoDTO answer;
    UICommandMetadata metadata = command.getMetadata(context);
    String metadataName = unshellifyName(metadata.getName());
    String id = shellifyName(metadataName);
    String description = metadata.getDescription();
    String category = toStringOrNull(metadata.getCategory());
    String docLocation = toStringOrNull(metadata.getDocLocation());
    boolean enabled = command.isEnabled(context);
    answer = new CommandInfoDTO(id, metadataName, description, category, docLocation, enabled);
    return answer;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:13,代码来源:UICommands.java

示例3: addRecentCommand

import org.jboss.forge.addon.ui.command.UICommand; //导入方法依赖的package包/类
public synchronized void addRecentCommand(UICommand command, UIContext context)
{
   UICommandMetadata metadata = command.getMetadata(context);

   // To make sure it will be the last element on the list
   recentCommands.remove(metadata.getName());
   recentCommands.add(metadata.getName());

   if (recentCommands.size() > RECENT_COMMANDS_LIMIT)
   {
      recentCommands.remove(0);
   }
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:14,代码来源:PluginService.java

示例4: indexMetadata

import org.jboss.forge.addon.ui.command.UICommand; //导入方法依赖的package包/类
public static Map<UICommand, UICommandMetadata> indexMetadata(List<UICommand> commands, UIContext context)
{
    Map<UICommand, UICommandMetadata> index = new HashMap<>();

    for (UICommand command : commands)
    {
        UICommandMetadata metadata = command.getMetadata(context);
        index.put(command, metadata);
    }

    return index;
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:13,代码来源:CommandUtil.java

示例5: setup

import org.jboss.forge.addon.ui.command.UICommand; //导入方法依赖的package包/类
public void setup(File repoDir)
{
   furnace = FurnaceFactory.getInstance(Thread.currentThread().getContextClassLoader(), Thread.currentThread().getContextClassLoader());
   furnace.addRepository(AddonRepositoryMode.IMMUTABLE, repoDir);
   Future<Furnace> future = furnace.startAsync();

   try
   {
      future.get();
   }
   catch (InterruptedException | ExecutionException e)
   {
      throw new RuntimeException("Furnace failed to start.", e);
   }

   availableCommands = new HashMap<>();

   AddonRegistry addonRegistry = furnace.getAddonRegistry();
   commandFactory = addonRegistry.getServices(CommandFactory.class).get();
   IDEUIContext context = new IDEUIContext();
   for (UICommand cmd : commandFactory.getCommands())
   {
      UICommandMetadata metadata = cmd.getMetadata(context);
      if (!availableCommands.containsKey(metadata.getCategory().getName()))
      {
         availableCommands.put(metadata.getCategory().getName(), new ArrayList<String>());
      }
      availableCommands.get(metadata.getCategory().getName()).add(metadata.getName());
   }

   controllerFactory = (CommandControllerFactory) addonRegistry
            .getServices(CommandControllerFactory.class.getName()).get();
}
 
开发者ID:forgeide,项目名称:forgeide,代码行数:34,代码来源:FurnaceProducer.java


注:本文中的org.jboss.forge.addon.ui.command.UICommand.getMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。