當前位置: 首頁>>代碼示例>>Java>>正文


Java FormEditingUtil.selectSingleComponent方法代碼示例

本文整理匯總了Java中com.intellij.uiDesigner.FormEditingUtil.selectSingleComponent方法的典型用法代碼示例。如果您正苦於以下問題:Java FormEditingUtil.selectSingleComponent方法的具體用法?Java FormEditingUtil.selectSingleComponent怎麽用?Java FormEditingUtil.selectSingleComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.uiDesigner.FormEditingUtil的用法示例。


在下文中一共展示了FormEditingUtil.selectSingleComponent方法的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: processMousePressed

import com.intellij.uiDesigner.FormEditingUtil; //導入方法依賴的package包/類
private void processMousePressed(final MouseEvent e){
  if(myCurrentProcessor != null){
    if (myCurrentProcessor.needMousePressed()) {
      myCurrentProcessor.processMouseEvent(e);
      return;
    }
    // Sun sometimes skips mouse released events...
    myCurrentProcessor.cancelOperation();
    myCurrentProcessor = null;
  }

  RadComponent component = null;
  final RadComponent draggerHost = FormEditingUtil.getDraggerHost(myEditor);
  // Try to understand whether we pressed inside dragger area
  if(draggerHost != null){
    final JComponent delegee = draggerHost.getDelegee();
    final Point p = SwingUtilities.convertPoint(delegee, 0, 0, e.getComponent());
    if(
      p.x - MainProcessor.DRAGGER_SIZE <= e.getX() && e.getX() <= p.x &&
      p.y - MainProcessor.DRAGGER_SIZE <= e.getY() && e.getY() <= p.y
    ){
      component = draggerHost;
    }
  }

  // If user clicked not inside dragger then we have find RadComponent at the click point
  if(component == null){
    component = FormEditingUtil.getRadComponentAt(myEditor.getRootContainer(), e.getX(), e.getY());
  }

  if (component == null) {
    return;
  }

  final ComponentItem selectedItem = PaletteToolWindowManager.getInstance(myEditor).getActiveItem(ComponentItem.class);
  if (selectedItem != null) {
    myInsertComponentProcessor.setSticky(UIUtil.isControlKeyDown(e));
    myCurrentProcessor = myInsertComponentProcessor;
    return;
  }

  if (!UIUtil.isControlKeyDown(e) && !e.isShiftDown()) {
    if (!component.isSelected() || FormEditingUtil.getSelectedComponents(myEditor).size() != 1) {
      FormEditingUtil.selectSingleComponent(myEditor, component);
    }
  }

  final Point point = SwingUtilities.convertPoint(e.getComponent(), e.getPoint(), component.getDelegee());
  final int resizeMask = Painter.getResizeMask(component, point.x, point.y);
  LOG.debug("MainProcessor.processMousePressed: resizeMask at (" + point.x + "," + point.y + ") is " + resizeMask);

  if (resizeMask != 0) {
    if (component.getParent() != null) {
      component = component.getParent().getActionTargetComponent(component);
    }
    myCurrentProcessor = new ResizeProcessor(myEditor, component, resizeMask);
  }
  else if (component instanceof RadRootContainer || e.isShiftDown()) {
    myCurrentProcessor = new GroupSelectionProcessor(myEditor, component);
  }
  else if (!e.isShiftDown()) {
    myCurrentProcessor = new DragSelectionProcessor(myEditor);
  }

  updateDragger(e);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:67,代碼來源:MainProcessor.java

示例3: selectComponent

import com.intellij.uiDesigner.FormEditingUtil; //導入方法依賴的package包/類
public void selectComponent(@NotNull final String binding) {
  final RadComponent component = (RadComponent) FormEditingUtil.findComponentWithBinding(myEditor.getRootContainer(), binding);
  if (component != null) {
    FormEditingUtil.selectSingleComponent(getEditor(), component);
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:7,代碼來源:UIFormEditor.java

示例4: 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.selectSingleComponent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。