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


Java FormEditingUtil.selectComponent方法代码示例

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


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

示例1: selectOrExtend

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
private void selectOrExtend(final RadComponent component) {
  if (myExtend) {
    FormEditingUtil.selectComponent(myEditor, component);
  }
  else {
    FormEditingUtil.selectSingleComponent(myEditor, component);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:AbstractMoveSelectionAction.java

示例2: moveToFirstComponent

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
private void moveToFirstComponent(final JComponent rootContainerDelegee) {
  final int[] minX = new int[]{Integer.MAX_VALUE};
  final int[] minY = new int[]{Integer.MAX_VALUE};
  final Ref<RadComponent> componentToBeSelected = new Ref<RadComponent>();
  FormEditingUtil.iterate(
    myEditor.getRootContainer(),
    new FormEditingUtil.ComponentVisitor<RadComponent>() {
      public boolean visit(final RadComponent component) {
        if (component instanceof RadAtomicComponent) {
          final JComponent _delegee = component.getDelegee();
          final Point p = SwingUtilities.convertPoint(
            _delegee,
            new Point(0, 0),
            rootContainerDelegee
          );
          if(minX[0] > p.x || minY[0] > p.y){
            minX[0] = p.x;
            minY[0] = p.y;
            componentToBeSelected.set(component);
          }
        }
        return true;
      }
    }
  );
  if(!componentToBeSelected.isNull()){
    FormEditingUtil.selectComponent(myEditor, componentToBeSelected.get());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:AbstractMoveSelectionAction.java

示例3: valueChanged

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
public void valueChanged(final TreeSelectionEvent e) {
  if (myInsideChange>0) {
    return;
  }

  final Set<ComponentPtr> selectedElements = getSelectedElements(ComponentPtr.class);
  myInsideChange++;
  try{
    FormEditingUtil.clearSelection(myEditor.getRootContainer());
    boolean hasComponentInTab = false;
    int count = 0;
    for(ComponentPtr ptr: selectedElements) {
      ptr.validate();
      if(ptr.isValid()) {
        final RadComponent component=ptr.getComponent();
        LOG.assertTrue(component!=null);
        if (!hasComponentInTab) {
          hasComponentInTab = FormEditingUtil.selectComponent(myEditor, component);
        }
        else {
          component.setSelected(true);
        }
        if (++count == selectedElements.size()) {
          myEditor.scrollComponentInView(component);
        }
      }
    }

    // Notify ComponentTree that selected component changed
    myEditor.fireSelectedComponentChanged();
  }finally{
    myInsideChange--;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ComponentTreeBuilder.java

示例4: moveSelectionByGrid

import com.intellij.uiDesigner.FormEditingUtil; //导入方法依赖的package包/类
private boolean moveSelectionByGrid(final RadComponent selectedComponent) {
  final RadContainer parent = selectedComponent.getParent();
  if (parent == null || !parent.getLayoutManager().isGrid()) {
    return false;
  }

  int row = selectedComponent.getConstraints().getRow();
  int column = selectedComponent.getConstraints().getColumn();

  RadComponent lastComponent = null;
  do {
    row += getRowMoveDelta();
    column += getColumnMoveDelta();
    if (row < 0 || row >= parent.getGridRowCount() || column < 0 || column >= parent.getGridColumnCount()) {
      if (myMoveToLast) {
        break;
      }
      return false;
    }

    final RadComponent component = parent.getComponentAtGrid(row, column);
    if (component != null && component != selectedComponent) {
      if (myMoveToLast) {
        if (myExtend) {
          FormEditingUtil.selectComponent(myEditor, component);
        }
        lastComponent = component;
      }
      else {
        selectOrExtend(component);
        return true;
      }
    }
  } while(true);

  if (lastComponent != null) {
    selectOrExtend(lastComponent);
    return true;
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:42,代码来源:AbstractMoveSelectionAction.java


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