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