• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java InputComponent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.forge.addon.ui.input.InputComponent的典型用法代码示例。如果您正苦于以下问题:Java InputComponent类的具体用法?Java InputComponent怎么用?Java InputComponent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



InputComponent类属于org.jboss.forge.addon.ui.input包,在下文中一共展示了InputComponent类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: EditConnectorOptionsStep

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public EditConnectorOptionsStep(ProjectFactory projectFactory,
                                CamelCatalog camelCatalog,
                                String connectorName, String camelComponentName, String group,
                                List<InputComponent> allInputs,
                                List<InputComponent> inputs,
                                boolean last, int index, int total) {
    this.projectFactory = projectFactory;
    this.camelCatalog = camelCatalog;
    this.connectorName = connectorName;
    this.camelComponentName = camelComponentName;
    this.group = group;
    this.allInputs = allInputs;
    this.inputs = inputs;
    this.last = last;
    // we want to 1-based
    this.index = index + 1;
    this.total = total;
}
 
开发者ID:fabric8io,项目名称:django,代码行数:19,代码来源:EditConnectorOptionsStep.java


示例2: initializeUI

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
    super.initializeUI(builder);

    // populate autocompletion options
    serviceId.setCompleter(new UICompleter<String>() {
        @Override
        public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) {
            List<String> list = new ArrayList<String>();
            ServiceList services = getKubernetes().services().inNamespace(getNamespace()).list();
            if (services != null) {
                List<Service> items = services.getItems();
                if (items != null) {
                    for (Service item : items) {
                        String id = KubernetesHelper.getName(item);
                        list.add(id);
                    }
                }
            }
            Collections.sort(list);
            return list;
        }
    });

    builder.add(serviceId);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:ServiceDelete.java


示例3: initializeUI

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public void initializeUI(UIBuilder builder) throws Exception {
    super.initializeUI(builder);

    // populate autocompletion options
    replicationControllerId.setCompleter(new UICompleter<String>() {
        @Override
        public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) {
            List<String> list = new ArrayList<String>();
            ReplicationControllerList replicationControllers = getKubernetes().replicationControllers().inNamespace(getNamespace()).list();
            if (replicationControllers != null) {
                List<ReplicationController> items = replicationControllers.getItems();
                if (items != null) {
                    for (ReplicationController item : items) {
                        String id = KubernetesHelper.getName(item);
                        list.add(id);
                    }
                }
            }
            Collections.sort(list);
            return list;
        }
    });

    builder.add(replicationControllerId);
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:27,代码来源:ReplicationControllerDelete.java


示例4: ConfigureComponentPropertiesStep

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public ConfigureComponentPropertiesStep(ProjectFactory projectFactory,
                                        DependencyInstaller dependencyInstaller,
                                        CamelCatalog camelCatalog,
                                        String componentName, String group,
                                        List<InputComponent> allInputs,
                                        List<InputComponent> inputs,
                                        boolean last, int index, int total) {
    this.projectFactory = projectFactory;
    this.dependencyInstaller = dependencyInstaller;
    this.camelCatalog = camelCatalog;
    this.componentName = componentName;
    this.group = group;
    this.allInputs = allInputs;
    this.inputs = inputs;
    this.last = last;
    // we want to 1-based
    this.index = index + 1;
    this.total = total;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:ConfigureComponentPropertiesStep.java


示例5: ConfigureEndpointPropertiesStep

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public ConfigureEndpointPropertiesStep(ProjectFactory projectFactory,
                                       DependencyInstaller dependencyInstaller,
                                       CamelCatalog camelCatalog,
                                       String componentName, String group,
                                       List<InputComponent> allInputs,
                                       List<InputComponent> inputs,
                                       boolean last, int index, int total) {
    this.projectFactory = projectFactory;
    this.dependencyInstaller = dependencyInstaller;
    this.camelCatalog = camelCatalog;
    this.componentName = componentName;
    this.group = group;
    this.allInputs = allInputs;
    this.inputs = inputs;
    this.last = last;
    // we want to 1-based
    this.index = index + 1;
    this.total = total;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:20,代码来源:ConfigureEndpointPropertiesStep.java


示例6: getCompletionProposals

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public Iterable<String> getCompletionProposals(UIContext context, InputComponent input, String value) {
    if (core == null) {
        return null;
    }

    // find all available component labels
    Iterable<String> names = getValueChoices();

    List<String> filtered = new ArrayList<String>();
    for (String name : names) {
        if (value == null || name.startsWith(value)) {
            filtered.add(name);
        }
    }

    return filtered;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:19,代码来源:CamelComponentsLabelCompleter.java


示例7: ConfigureEipPropertiesStep

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public ConfigureEipPropertiesStep(ProjectFactory projectFactory,
                                  CamelCatalog camelCatalog,
                                  String eipName, String group,
                                  List<InputComponent> allInputs,
                                  List<InputComponent> inputs,
                                  boolean last, int index, int total) {
    this.projectFactory = projectFactory;
    this.camelCatalog = camelCatalog;
    this.eipName = eipName;
    this.group = group;
    this.allInputs = allInputs;
    this.inputs = inputs;
    this.last = last;
    // we want to 1-based
    this.index = index + 1;
    this.total = total;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:18,代码来源:ConfigureEipPropertiesStep.java


示例8: getCompletionProposals

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public Iterable<String> getCompletionProposals(UIContext context, InputComponent<?, String> input, String value) {
    List<String> answer = new ArrayList<>();
    try {
        List<Map<String, String>> contexts = controller.getCamelContexts();
        for (Map<String, String> row : contexts) {
            final String name = row.get("name");
            if (value == null || name.startsWith(value)) {
                answer.add(name);
            }
        }
    } catch (Exception e) {
        // ignore
    }

    Collections.sort(answer);
    return answer;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:19,代码来源:CamelContextCompleter.java


示例9: EditComponentOptionsStep

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public EditComponentOptionsStep(ProjectFactory projectFactory,
                                CamelCatalog camelCatalog,
                                String connectorName, String camelComponentName, String group,
                                List<InputComponent> allInputs,
                                List<InputComponent> inputs,
                                boolean last, int index, int total) {
    this.projectFactory = projectFactory;
    this.camelCatalog = camelCatalog;
    this.connectorName = connectorName;
    this.camelComponentName = camelComponentName;
    this.group = group;
    this.allInputs = allInputs;
    this.inputs = inputs;
    this.last = last;
    // we want to 1-based
    this.index = index + 1;
    this.total = total;
}
 
开发者ID:fabric8io,项目名称:django,代码行数:19,代码来源:EditComponentOptionsStep.java


示例10: prepare

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public JComponent prepare(WizardNavigationState state)
{
   JPanel container = new JPanel(new MigLayout("fillx,wrap 2",
            "[left]rel[grow,fill]"));

   Map<String, ForgeComponent> components = new HashMap<>();
   UIContext context = navigationState.getController().getContext();
   ValueChangeListener listener = new ValueChangeListener(model, components, navigationState);

   for (InputComponent input : navigationState.getController().getInputs().values())
   {
      ComponentBuilder builder = ComponentBuilderRegistry.INSTANCE.getBuilderFor(input);
      ForgeComponent component = builder.build(context, input);
      component.buildUI(container);
      component.setValueChangeListener(listener);

      components.put(input.getName(), component);
   }

   navigationState.refreshNavigationState();
   listener.updateComponentsState();

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


示例11: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, final InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return showEditDialog("Edit item", item);
      }

      @Override
      protected String findItemToAdd()
      {
         return showEditDialog("Add item", "");
      }

      private String showEditDialog(String title, final String initialValue)
      {
         return Messages.showInputDialog(IDEUtil.projectFromContext(context),
                  "", title, Messages.getQuestionIcon(), initialValue, null);
      }
   };
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:25,代码来源:TextBoxMultipleComponentBuilder.java


示例12: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleFolderDescriptor(), item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleFolderDescriptor(), "");
      }
   };
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:19,代码来源:DirectoryChooserMultipleComponentBuilder.java


示例13: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseClass(context, item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseClass(context, "");
      }
   };
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:19,代码来源:JavaClassChooserMultipleComponentBuilder.java


示例14: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new ListComponent((UIInputMany<Object>) input)
   {
      @Override
      protected String editSelectedItem(String item)
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), item);
      }

      @Override
      protected String findItemToAdd()
      {
         return IDEUtil.chooseFile(context, FileChooserDescriptorFactory.createSingleLocalFileDescriptor(), "");
      }
   };
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:19,代码来源:FileChooserMultipleComponentBuilder.java


示例15: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new LabeledComponent(input, new ChooserComponent(context, input)
   {
      @Override
      public ActionListener createBrowseButtonActionListener(final TextFieldWithAutoCompletion<String> textField)
      {
         return e -> {
            String initialValue = textField.getText();
            String value = IDEUtil.choosePackage(context, initialValue);
            if (value != null)
            {
               textField.setText(value);
            }
         };
      }
   });
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:20,代码来源:JavaPackageChooserComponentBuilder.java


示例16: build

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public ForgeComponent build(final UIContext context, InputComponent<?, Object> input)
{
   return new LabeledComponent(input, new ChooserComponent(context, input)
   {
      @Override
      public ActionListener createBrowseButtonActionListener(final TextFieldWithAutoCompletion<String> textField)
      {
         return e -> {
            String initialValue = textField.getText();
            String value = IDEUtil.chooseClass(context, initialValue);
            if (value != null)
            {
               textField.setText(value);
            }
         };
      }
   });
}
 
开发者ID:forge,项目名称:intellij-idea-plugin,代码行数:20,代码来源:JavaClassChooserComponentBuilder.java


示例17: getCompletions

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public static List<String> getCompletions(ConverterFactory converterFactory, UIContext context,
         InputComponent<?, Object> input, String text)
{
   List<String> result = new ArrayList<>();
   UICompleter<Object> completer = ((HasCompleter<?, Object>) input).getCompleter();
   Converter<Object, String> converter = converterFactory.getConverter(input.getValueType(), String.class);

   Iterable<Object> proposals = completer.getCompletionProposals(context, input, text);

   if (proposals != null)
   {
      for (Object object : proposals)
      {
         if (object != null)
         {
            result.add(converter.convert(object));
         }
      }
   }

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


示例18: populateMetadata

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
@Override
public void populateMetadata(InputComponent component, ControlMetadata meta) {
   super.populateMetadata(component, meta);

   if (component instanceof UISelectOne) {
      UISelectOne selectOne = (UISelectOne) component;
      List<String> values = new ArrayList<String>();

      Converter<Object, String> converter = getConverter(selectOne);
      if (selectOne.getValueChoices() != null) {
         for (Object choice : selectOne.getValueChoices()) {
            String itemLabel = converter.convert(choice);
            values.add(itemLabel);
         }
      }

      meta.setValueChoices(values.toArray(new String[values.size()]));
   }
}
 
开发者ID:forgeide,项目名称:forgeide,代码行数:20,代码来源:ComboControl.java


示例19: useCommand

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
protected void useCommand(RestUIContext context, String commandName, boolean shouldExecute) {
    try {
        UICommand command = commandFactory.getCommandByName(context, commandName);
        if (command == null) {
            LOG.warn("No such command! '" + commandName + "'");
            return;
        }
        CommandController controller = commandControllerFactory.createController(context, runtime, command);
        if (controller == null) {
            LOG.warn("No such controller! '" + commandName + "'");
            return;
        }
        controller.initialize();
        WizardCommandController wizardCommandController = assertWizardController(controller);

        Map<String, InputComponent<?, ?>> inputs = controller.getInputs();
        Set<Map.Entry<String, InputComponent<?, ?>>> entries = inputs.entrySet();
        for (Map.Entry<String, InputComponent<?, ?>> entry : entries) {
            String key = entry.getKey();
            InputComponent component = entry.getValue();
            Object value = InputComponents.getValueFor(component);
            Object completions = null;
            UICompleter<?> completer = InputComponents.getCompleterFor(component);
            if (completer != null) {
                completions = completer.getCompletionProposals(context, component, "");
            }
            LOG.info(key + " = " + component + " value: " + value + " completions: " + completions);
        }
        validate(controller);
        wizardCommandController = wizardCommandController.next();

        if (shouldExecute) {
            Result result = controller.execute();
            printResult(result);
        }
    } catch (Exception e) {
        LOG.error("Failed to create the " + commandName + " controller! " + e, e);
    }
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:40,代码来源:ProjectGenerator.java


示例20: createCommandInputDTO

import org.jboss.forge.addon.ui.input.InputComponent; //导入依赖的package包/类
public static CommandInputDTO createCommandInputDTO(RestUIContext context, UICommand command, CommandController controller) throws Exception {
    CommandInfoDTO info = createCommandInfoDTO(context, command);
    CommandInputDTO inputInfo = new CommandInputDTO(info);
    Map<String, InputComponent<?, ?>> inputs = controller.getInputs();
    if (inputs != null) {
        Set<Map.Entry<String, InputComponent<?, ?>>> entries = inputs.entrySet();
        for (Map.Entry<String, InputComponent<?, ?>> entry : entries) {
            String key = entry.getKey();
            InputComponent<?, ?> input = entry.getValue();
            PropertyDTO dto = UICommands.createInputDTO(context, input);
            inputInfo.addProperty(key, dto);
        }
    }
    return inputInfo;
}
 
开发者ID:fabric8io,项目名称:fabric8-forge,代码行数:16,代码来源:UICommands.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Checkout类代码示例发布时间:2022-05-23
下一篇:
Java KafkaMetricsConfig类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap