本文整理汇总了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);
}
}
}
示例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"));
}
}