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


Java FormEditingUtil.deleteComponents方法代碼示例

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


在下文中一共展示了FormEditingUtil.deleteComponents方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: flattenSimple

import com.intellij.uiDesigner.FormEditingUtil; //導入方法依賴的package包/類
private static void flattenSimple(final RadContainer container) {
  RadContainer parent = container.getParent();
  RadComponent child = null;
  Object childLayoutConstraints = null;
  if (container.getComponentCount() == 1) {
    child = container.getComponent(0);
    childLayoutConstraints = container.getCustomLayoutConstraints();
    child.getConstraints().restore(container.getConstraints());
    container.removeComponent(child);
  }
  int childIndex = parent.indexOfComponent(container);
  FormEditingUtil.deleteComponents(Collections.singletonList(container), false);
  if (child != null) {
    if (childLayoutConstraints != null) {
      child.setCustomLayoutConstraints(childLayoutConstraints);
    }
    parent.addComponent(child, childIndex);
    child.revalidate();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:21,代碼來源:FlattenAction.java

示例2: flattenGrid

import com.intellij.uiDesigner.FormEditingUtil; //導入方法依賴的package包/類
private static void flattenGrid(final RadContainer container) {
  RadContainer parent = container.getParent();
  GridConstraints containerConstraints = (GridConstraints) container.getConstraints().clone();
  // ensure there will be enough rows and columns to fit the container contents
  for(int i=containerConstraints.getRowSpan(); i<container.getGridRowCount(); i++) {
    GridChangeUtil.splitRow(parent, containerConstraints.getRow());
  }
  for(int i=containerConstraints.getColSpan(); i<container.getGridColumnCount(); i++) {
    GridChangeUtil.splitColumn(parent, containerConstraints.getColumn());
  }

  ArrayList<RadComponent> contents = new ArrayList<RadComponent>();
  for(int i=container.getComponentCount()-1; i >= 0; i--) {
    contents.add(0, container.getComponent(i));
    container.removeComponent(container.getComponent(i));
  }

  if (contents.size() == 1) {
    contents.get(0).setCustomLayoutConstraints(container.getCustomLayoutConstraints());
  }
  
  FormEditingUtil.deleteComponents(Collections.singletonList(container), false);
  for(RadComponent child: contents) {
    final GridConstraints childConstraints = child.getConstraints();
    childConstraints.setRow(childConstraints.getRow() + containerConstraints.getRow());
    childConstraints.setColumn(childConstraints.getColumn() + containerConstraints.getColumn());
    parent.addComponent(child);
    child.revalidate();
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:FlattenAction.java

示例3: processDrop

import com.intellij.uiDesigner.FormEditingUtil; //導入方法依賴的package包/類
@Override
public void processDrop(final GuiEditor editor,
                        final RadComponent[] components,
                        final GridConstraints[] constraintsToAdjust,
                        final ComponentDragObject dragObject) {
  RadComponent c = myContainer.getComponentAtGrid(myRow, myColumn);
  if (c != null) {
    FormEditingUtil.deleteComponents(Collections.singletonList(c), false);
  }
  super.processDrop(editor, components, constraintsToAdjust, dragObject);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:12,代碼來源:GridReplaceDropLocation.java


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