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