本文整理匯總了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);
}