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