Skip to content

Commit feb329e

Browse files
add ScrollablePanel.java generated by Xtend 2.20.0
1 parent e2e11cd commit feb329e

File tree

1 file changed

+35
-29
lines changed

1 file changed

+35
-29
lines changed
Lines changed: 35 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/**
22
* Copyright 2019 Philipp Salvisberg <philipp.salvisberg@trivadis.com>
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -13,35 +13,41 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16-
package org.utplsql.sqldev.ui.runner
16+
package org.utplsql.sqldev.ui.runner;
1717

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;
2122

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
2425
* 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+
}
4753
}

0 commit comments

Comments
 (0)