mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-94953 Code Style | Arrangement: settings could be scrolled to the bottom on adding a rule
This commit is contained in:
+10
@@ -27,6 +27,8 @@ import com.intellij.openapi.util.SystemInfoRt;
|
||||
import gnu.trove.TIntArrayList;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author Denis Zhdanov
|
||||
* @since 8/24/12 1:54 PM
|
||||
@@ -64,6 +66,14 @@ public class AddArrangementRuleAction extends AnAction implements DumbAware {
|
||||
}
|
||||
showEditor(control, rowToEdit);
|
||||
control.getSelectionModel().setSelectionInterval(rowToEdit, rowToEdit);
|
||||
|
||||
final Rectangle rect = control.getCellRect(rowToEdit, 0, false);
|
||||
final Rectangle editorRect = control.getCellRect(rowToEdit + 1, 0, false);
|
||||
if(!rect.isEmpty() && !editorRect.isEmpty()) {
|
||||
final int height = (int)(rect.getHeight() + editorRect.getHeight());
|
||||
final Rectangle visibleRect = new Rectangle((int)rect.getX(), (int)rect.getY(), (int)rect.getWidth(), height);
|
||||
control.scrollRectToVisible(visibleRect);
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
||||
Reference in New Issue
Block a user