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


Java FormEditingUtil.findComponent方法代码示例

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


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

示例1: updateLabelForBinding

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
void updateLabelForBinding(final RadComponent component) {
  String value = getValue(component);
  String text = FormInspectionUtil.getText(component.getModule(), component);
  if (text != null && value != null) {
    RadRootContainer root = (RadRootContainer) FormEditingUtil.getRoot(component);
    if (root != null) {
      RadComponent valueComponent = (RadComponent)FormEditingUtil.findComponent(root, value);
      if (valueComponent != null) {
        if (valueComponent instanceof RadScrollPane && ((RadScrollPane) valueComponent).getComponentCount() == 1) {
          valueComponent = ((RadScrollPane) valueComponent).getComponent(0);
        }
        BindingProperty.checkCreateBindingFromText(valueComponent, text);
      }
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:IntroComponentProperty.java

示例2: getComponent

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public JComponent getComponent(final RadRootContainer rootContainer, String value, boolean selected, boolean hasFocus) {
  clear();
  setBackground(selected ? UIUtil.getTableSelectionBackground() : UIUtil.getTableBackground());
  if (value != null && value.length() > 0) {
    RadComponent target = (RadComponent)FormEditingUtil.findComponent(rootContainer, value);
    if (target != null) {
      renderComponent(target, selected);
    }
    else {
      append(UIDesignerBundle.message("component.not.found"), SimpleTextAttributes.ERROR_ATTRIBUTES);
    }
  }

  return this;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:ComponentRenderer.java

示例3: checkComponentProperties

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的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

示例4: getGroupContents

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public List<RadComponent> getGroupContents(final RadButtonGroup group) {
  ArrayList<RadComponent> result = new ArrayList<RadComponent>();
  for(String id: group.getComponentIds()) {
    RadComponent component = (RadComponent) FormEditingUtil.findComponent(this, id);
    if (component != null) {
      result.add(component);
    }
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:RadRootContainer.java

示例5: createDescriptor

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
@NotNull
public NodeDescriptor createDescriptor(final Object element,final NodeDescriptor parentDescriptor){
  if(element==myRootElement){
    return new RootDescriptor(parentDescriptor,myRootElement);
  }
  else if(element instanceof ComponentPtr){
    return new ComponentPtrDescriptor(parentDescriptor,(ComponentPtr)element);
  }
  else if (element instanceof LwInspectionSuppression[]) {
    return new SuppressionGroupDescriptor(parentDescriptor, (LwInspectionSuppression[]) element);
  }
  else if (element instanceof LwInspectionSuppression) {
    final LwInspectionSuppression suppression = (LwInspectionSuppression)element;
    RadComponent target = (RadComponent)(suppression.getComponentId() == null
                                         ? null
                                         : FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()));
    return new SuppressionDescriptor(parentDescriptor, target, suppression);
  }
  else if (element instanceof RadButtonGroup[]) {
    return new ButtonGroupListDescriptor(parentDescriptor, (RadButtonGroup[]) element);
  }
  else if (element instanceof RadButtonGroup) {
    return new ButtonGroupDescriptor(parentDescriptor, (RadButtonGroup) element);
  }
  else{
    throw new IllegalArgumentException("unknown element: "+element);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ComponentTreeStructure.java

示例6: setState

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public void setState(@NotNull final FileEditorState state){
  FormEditingUtil.clearSelection(myEditor.getRootContainer());
  final String[] ids = ((MyEditorState)state).getSelectedComponentIds();
  for (final String id : ids) {
    final RadComponent component = (RadComponent)FormEditingUtil.findComponent(myEditor.getRootContainer(), id);
    if (component != null) {
      component.setSelected(true);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:UIFormEditor.java

示例7: getChildElements

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public Object[] getChildElements(final Object element){
  if(element==myRootElement){
    ArrayList<Object> elements = new ArrayList<Object>();
    final RadRootContainer rootContainer=myEditor.getRootContainer();
    elements.add(new ComponentPtr(myEditor, rootContainer));
    final LwInspectionSuppression[] suppressions = rootContainer.getInspectionSuppressions();
    if (suppressions.length > 0) {
      elements.add(suppressions);
    }
    RadButtonGroup[] buttonGroups = rootContainer.getButtonGroups();
    if (buttonGroups.length > 0) {
      elements.add(buttonGroups);
    }
    return elements.toArray();
  }
  else if(element instanceof ComponentPtr){
    final ComponentPtr ptr=(ComponentPtr)element;
    LOG.assertTrue(ptr.isValid()); // pointer must be valid
    final RadComponent component=ptr.getComponent();
    if(component instanceof RadContainer){
      final RadContainer container=(RadContainer)component;
      final ComponentPtr[] ptrs=new ComponentPtr[container.getComponentCount()];
      for(int i=0;i<ptrs.length;i++){
        ptrs[i]=new ComponentPtr(myEditor,container.getComponent(i));
      }
      return ptrs;
    }else{
      return ourEmptyObjectArray;
    }
  }
  else if (element instanceof LwInspectionSuppression[]) {
    ArrayList<LwInspectionSuppression> result = new ArrayList<LwInspectionSuppression>();
    for(LwInspectionSuppression suppression: (LwInspectionSuppression[]) element) {
      if (suppression.getComponentId() == null ||
        FormEditingUtil.findComponent(myEditor.getRootContainer(), suppression.getComponentId()) != null) {
        result.add(suppression);
      }
    }
    return ArrayUtil.toObjectArray(result);
  }
  else if (element instanceof RadButtonGroup[]) {
    return (RadButtonGroup[]) element;
  }
  else if (element instanceof LwInspectionSuppression || element instanceof RadButtonGroup) {
    return ArrayUtil.EMPTY_OBJECT_ARRAY;
  }
  else{
    throw new IllegalArgumentException("unknown element: "+element);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:51,代码来源:ComponentTreeStructure.java

示例8: validate

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
/**
 * Validates (updates) the state of the pointer
 */
public void validate(){
  // Try to find component with myId starting from root container
  final RadContainer container=myEditor.getRootContainer();
  myComponent= (RadComponent)FormEditingUtil.findComponent(container,myId);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:ComponentPtr.java

示例9: selectComponentById

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public void selectComponentById(@NotNull final String id) {
  final RadComponent component = (RadComponent)FormEditingUtil.findComponent(myEditor.getRootContainer(), id);
  if (component != null) {
    FormEditingUtil.selectSingleComponent(getEditor(), component);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:UIFormEditor.java


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