|
1 | | -/* |
| 1 | +/** |
2 | 2 | * Copyright 2019 Philipp Salvisberg <philipp.salvisberg@trivadis.com> |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
13 | 13 | * See the License for the specific language governing permissions and |
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | | -package org.utplsql.sqldev.ui.runner |
| 16 | +package org.utplsql.sqldev.ui.runner; |
17 | 17 |
|
18 | | -import java.awt.Rectangle |
19 | | -import javax.swing.JPanel |
20 | | -import javax.swing.Scrollable |
| 18 | +import java.awt.Dimension; |
| 19 | +import java.awt.Rectangle; |
| 20 | +import javax.swing.JPanel; |
| 21 | +import javax.swing.Scrollable; |
21 | 22 |
|
22 | | -/* |
23 | | - * Fixes resizing issues of JTextArea when put into JPanel and JPanel into JScrollPane |
| 23 | +/** |
| 24 | + * Fixes resizing issues of JTextArea when put into JPanel and JPanel into JScrollPane |
24 | 25 | * Solution is based on https://stackoverflow.com/questions/15783014/jtextarea-on-jpanel-inside-jscrollpane-does-not-resize-properly/15786939 |
25 | | - */ |
26 | | -class ScrollablePanel extends JPanel implements Scrollable { |
27 | | - |
28 | | - override getPreferredScrollableViewportSize() { |
29 | | - return super.getPreferredSize() |
30 | | - } |
31 | | - |
32 | | - override getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction) { |
33 | | - return 0 |
34 | | - } |
35 | | - |
36 | | - override getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction) { |
37 | | - return 0 |
38 | | - } |
39 | | - |
40 | | - override getScrollableTracksViewportWidth() { |
41 | | - return true |
42 | | - } |
43 | | - |
44 | | - override getScrollableTracksViewportHeight() { |
45 | | - return false |
46 | | - } |
| 26 | + */ |
| 27 | +@SuppressWarnings("all") |
| 28 | +public class ScrollablePanel extends JPanel implements Scrollable { |
| 29 | + @Override |
| 30 | + public Dimension getPreferredScrollableViewportSize() { |
| 31 | + return super.getPreferredSize(); |
| 32 | + } |
| 33 | + |
| 34 | + @Override |
| 35 | + public int getScrollableUnitIncrement(final Rectangle visibleRect, final int orientation, final int direction) { |
| 36 | + return 0; |
| 37 | + } |
| 38 | + |
| 39 | + @Override |
| 40 | + public int getScrollableBlockIncrement(final Rectangle visibleRect, final int orientation, final int direction) { |
| 41 | + return 0; |
| 42 | + } |
| 43 | + |
| 44 | + @Override |
| 45 | + public boolean getScrollableTracksViewportWidth() { |
| 46 | + return true; |
| 47 | + } |
| 48 | + |
| 49 | + @Override |
| 50 | + public boolean getScrollableTracksViewportHeight() { |
| 51 | + return false; |
| 52 | + } |
47 | 53 | } |
0 commit comments