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


Java IRootContainer.getButtonGroupName方法代码示例

本文整理汇总了Java中com.intellij.uiDesigner.lw.IRootContainer.getButtonGroupName方法的典型用法代码示例。如果您正苦于以下问题:Java IRootContainer.getButtonGroupName方法的具体用法?Java IRootContainer.getButtonGroupName怎么用?Java IRootContainer.getButtonGroupName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.uiDesigner.lw.IRootContainer的用法示例。


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

示例1: checkComponentProperties

import com.intellij.uiDesigner.lw.IRootContainer; //导入方法依赖的package包/类
protected void checkComponentProperties(Module module, IComponent component, FormErrorCollector collector) {
  if (FormInspectionUtil.isComponentClass(module, component, JRadioButton.class)) {
    final IRootContainer root = FormEditingUtil.getRoot(component);
    if (root == null) return;
    if (root.getButtonGroupName(component) == null) {
      EditorQuickFixProvider quickFixProvider = null;
      IContainer parent = component.getParentContainer();
      for(int i=0; i<parent.getComponentCount(); i++) {
        IComponent child = parent.getComponent(i);
        if (child != component &&
            FormInspectionUtil.isComponentClass(module, child, JRadioButton.class)) {
          final GridConstraints c1 = component.getConstraints();
          final GridConstraints c2 = child.getConstraints();
          if (areCellsAdjacent(parent, c1, c2)) {
            final String groupName = root.getButtonGroupName(child);
            if (groupName == null) {
              quickFixProvider = new EditorQuickFixProvider() {
                 public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
                   return new CreateGroupQuickFix(editor, component, c1.getColumn() == c2.getColumn());
                 }
               };
              break;
            }
            else {
              quickFixProvider = new EditorQuickFixProvider() {
                public QuickFix createQuickFix(GuiEditor editor, RadComponent component) {
                  return new AddToGroupQuickFix(editor, component, groupName);
                }
              };
            }
          }
        }
      }
      collector.addError(getID(), component, null, UIDesignerBundle.message("inspection.no.button.group.error"), quickFixProvider);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:NoButtonGroupInspection.java

示例2: checkComponentProperties

import com.intellij.uiDesigner.lw.IRootContainer; //导入方法依赖的package包/类
protected void checkComponentProperties(Module module, IComponent component, FormErrorCollector collector) {
  final IRootContainer root = FormEditingUtil.getRoot(component);
  if (root == null) return;
  String groupName = root.getButtonGroupName(component);
  if (groupName != null) {
    final String[] sameGroupComponents = root.getButtonGroupComponentIds(groupName);
    for(String id: sameGroupComponents) {
      final IComponent otherComponent = FormEditingUtil.findComponent(root, id);
      if (otherComponent != null && otherComponent != component) {
        return;
      }
    }
    collector.addError(getID(), component, null, UIDesignerBundle.message("inspection.one.button.group.error"));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:OneButtonGroupInspection.java


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