Skip to content

Commit 5b82a4c

Browse files
Thomas Wolfakurtakov
authored andcommitted
Bug 575393 - Normalize line endings to LF
Some files in SWT were checked-in with CR-LF line endings; one even had mixed line endings (Test_org_eclipse_swt_browser_Browser.java). Normalize them all to use LF as line endings like all the other source files. Change-Id: I45cbfc332d1fd9a2192b7733b86c7ce79c732285 Signed-off-by: Thomas Wolf <[email protected]> Reviewed-on: https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/186410 Reviewed-by: Jörg Kubitz <[email protected]> Reviewed-by: Lars Vogel <[email protected]> Reviewed-by: Alexander Kurtakov <[email protected]> Tested-by: Platform Bot <[email protected]>
1 parent 84293c1 commit 5b82a4c

File tree

6 files changed

+347
-347
lines changed

6 files changed

+347
-347
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,60 @@
1-
/*******************************************************************************
2-
* Copyright (c) 2021 Syntevo and others.
3-
*
4-
* This program and the accompanying materials
5-
* are made available under the terms of the Eclipse Public License 2.0
6-
* which accompanies this distribution, and is available at
7-
* https://www.eclipse.org/legal/epl-2.0/
8-
*
9-
* SPDX-License-Identifier: EPL-2.0
10-
*
11-
* Contributors:
12-
* Syntevo - initial API and implementation
13-
*******************************************************************************/
14-
package org.eclipse.swt.tests.gtk.snippets;
15-
16-
import org.eclipse.swt.*;
17-
import org.eclipse.swt.custom.StyledText;
18-
import org.eclipse.swt.layout.*;
19-
import org.eclipse.swt.widgets.*;
20-
21-
public class Bug568501_JniWarningDisposingAccessible {
22-
public static void main(String[] args) {
23-
// The parent Shell has to be modal to reproduce
24-
final Display display = new Display();
25-
final Shell shell = new Shell(display);
26-
shell.setLayout(new GridLayout());
27-
28-
final Label hint = new Label(shell, 0);
29-
hint.setText(
30-
"1) Run this snippet on Linux with -Xcheck:jni\n" +
31-
"2) Click button below\n" +
32-
"3) Observe JNI warnings on console"
33-
);
34-
35-
final Button btnTest = new Button(shell, SWT.PUSH);
36-
btnTest.setText("Show me the bug");
37-
btnTest.addListener(SWT.Selection, event1 -> {
38-
Shell shell2 = new Shell(shell, SWT.SHELL_TRIM);
39-
40-
// Somehow 2 is not enough, let's have more to be sure.
41-
for (int i = 0; i < 16; i++) {
42-
StyledText styledText = new StyledText(shell2, 0);
43-
styledText.setText("I'm a StyledText");
44-
}
45-
46-
shell2.dispose();
47-
});
48-
49-
shell.pack();
50-
shell.open();
51-
52-
while (!shell.isDisposed()) {
53-
if (display.readAndDispatch()) {
54-
display.sleep();
55-
}
56-
}
57-
58-
display.dispose();
59-
}
60-
}
1+
/*******************************************************************************
2+
* Copyright (c) 2021 Syntevo and others.
3+
*
4+
* This program and the accompanying materials
5+
* are made available under the terms of the Eclipse Public License 2.0
6+
* which accompanies this distribution, and is available at
7+
* https://www.eclipse.org/legal/epl-2.0/
8+
*
9+
* SPDX-License-Identifier: EPL-2.0
10+
*
11+
* Contributors:
12+
* Syntevo - initial API and implementation
13+
*******************************************************************************/
14+
package org.eclipse.swt.tests.gtk.snippets;
15+
16+
import org.eclipse.swt.*;
17+
import org.eclipse.swt.custom.StyledText;
18+
import org.eclipse.swt.layout.*;
19+
import org.eclipse.swt.widgets.*;
20+
21+
public class Bug568501_JniWarningDisposingAccessible {
22+
public static void main(String[] args) {
23+
// The parent Shell has to be modal to reproduce
24+
final Display display = new Display();
25+
final Shell shell = new Shell(display);
26+
shell.setLayout(new GridLayout());
27+
28+
final Label hint = new Label(shell, 0);
29+
hint.setText(
30+
"1) Run this snippet on Linux with -Xcheck:jni\n" +
31+
"2) Click button below\n" +
32+
"3) Observe JNI warnings on console"
33+
);
34+
35+
final Button btnTest = new Button(shell, SWT.PUSH);
36+
btnTest.setText("Show me the bug");
37+
btnTest.addListener(SWT.Selection, event1 -> {
38+
Shell shell2 = new Shell(shell, SWT.SHELL_TRIM);
39+
40+
// Somehow 2 is not enough, let's have more to be sure.
41+
for (int i = 0; i < 16; i++) {
42+
StyledText styledText = new StyledText(shell2, 0);
43+
styledText.setText("I'm a StyledText");
44+
}
45+
46+
shell2.dispose();
47+
});
48+
49+
shell.pack();
50+
shell.open();
51+
52+
while (!shell.isDisposed()) {
53+
if (display.readAndDispatch()) {
54+
display.sleep();
55+
}
56+
}
57+
58+
display.dispose();
59+
}
60+
}
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
package org.eclipse.swt.tests.win32.snippets;
2-
3-
import org.eclipse.swt.SWT;
4-
import org.eclipse.swt.graphics.Color;
5-
import org.eclipse.swt.graphics.GC;
6-
import org.eclipse.swt.graphics.Image;
7-
import org.eclipse.swt.graphics.Pattern;
8-
import org.eclipse.swt.widgets.Display;
9-
import org.eclipse.swt.widgets.Shell;
10-
11-
public class Bug121220_AlphaTransparencyWithPatterns {
12-
13-
public static void main(String[] args) {
14-
15-
Display disp = new Display();
16-
Shell shell = new Shell(disp);
17-
shell.setSize(400, 300);
18-
shell.setText("Pattern with alpha");
19-
Image image = new Image(disp, 50, 50);
20-
{
21-
GC gc = new GC(image);
22-
gc.setForeground(new Color(null, 255, 0, 0));
23-
gc.drawLine(0, 0, 49, 49);
24-
gc.drawLine(0, 49, 49, 0);
25-
gc.setForeground(new Color(null, 0, 0, 200));
26-
gc.drawString("Pat", 5, 5);
27-
gc.dispose();
28-
}
29-
final Pattern pat = new Pattern(disp, image);
30-
shell.addPaintListener(e -> {
31-
32-
e.gc.setBackground(new Color(null, 200, 200, 200));
33-
e.gc.fillRectangle(0, 0, shell.getBounds().width, shell.getBounds().height);
34-
e.gc.setBackground(new Color(null, 255, 0, 0));
35-
e.gc.fillRectangle(0, 0, 100, 100);
36-
e.gc.fillRectangle(100, 100, 100, 100);
37-
e.gc.setAlpha(100);
38-
e.gc.setBackgroundPattern(pat);
39-
e.gc.fillRectangle(50, 10, 100, 100);
40-
e.gc.setLineWidth(16);
41-
e.gc.setAlpha(150);
42-
e.gc.setLineCap(SWT.CAP_ROUND);
43-
e.gc.setForegroundPattern(pat);
44-
e.gc.drawLine(10, 170, 170, 170);
45-
e.gc.setAlpha(50);
46-
e.gc.setLineCap(SWT.CAP_FLAT);
47-
e.gc.setForegroundPattern(pat);
48-
e.gc.drawLine(10, 120, 170, 120);
49-
e.gc.setAlpha(255);
50-
e.gc.setLineCap(SWT.CAP_FLAT);
51-
e.gc.setForegroundPattern(pat);
52-
e.gc.drawLine(150, 120, 170, 20);
53-
});
54-
55-
shell.open();
56-
while (!shell.isDisposed()) {
57-
if (!disp.readAndDispatch())
58-
disp.sleep();
59-
}
60-
image.dispose();
61-
pat.dispose();
62-
disp.dispose();
63-
}
64-
}
1+
package org.eclipse.swt.tests.win32.snippets;
2+
3+
import org.eclipse.swt.SWT;
4+
import org.eclipse.swt.graphics.Color;
5+
import org.eclipse.swt.graphics.GC;
6+
import org.eclipse.swt.graphics.Image;
7+
import org.eclipse.swt.graphics.Pattern;
8+
import org.eclipse.swt.widgets.Display;
9+
import org.eclipse.swt.widgets.Shell;
10+
11+
public class Bug121220_AlphaTransparencyWithPatterns {
12+
13+
public static void main(String[] args) {
14+
15+
Display disp = new Display();
16+
Shell shell = new Shell(disp);
17+
shell.setSize(400, 300);
18+
shell.setText("Pattern with alpha");
19+
Image image = new Image(disp, 50, 50);
20+
{
21+
GC gc = new GC(image);
22+
gc.setForeground(new Color(null, 255, 0, 0));
23+
gc.drawLine(0, 0, 49, 49);
24+
gc.drawLine(0, 49, 49, 0);
25+
gc.setForeground(new Color(null, 0, 0, 200));
26+
gc.drawString("Pat", 5, 5);
27+
gc.dispose();
28+
}
29+
final Pattern pat = new Pattern(disp, image);
30+
shell.addPaintListener(e -> {
31+
32+
e.gc.setBackground(new Color(null, 200, 200, 200));
33+
e.gc.fillRectangle(0, 0, shell.getBounds().width, shell.getBounds().height);
34+
e.gc.setBackground(new Color(null, 255, 0, 0));
35+
e.gc.fillRectangle(0, 0, 100, 100);
36+
e.gc.fillRectangle(100, 100, 100, 100);
37+
e.gc.setAlpha(100);
38+
e.gc.setBackgroundPattern(pat);
39+
e.gc.fillRectangle(50, 10, 100, 100);
40+
e.gc.setLineWidth(16);
41+
e.gc.setAlpha(150);
42+
e.gc.setLineCap(SWT.CAP_ROUND);
43+
e.gc.setForegroundPattern(pat);
44+
e.gc.drawLine(10, 170, 170, 170);
45+
e.gc.setAlpha(50);
46+
e.gc.setLineCap(SWT.CAP_FLAT);
47+
e.gc.setForegroundPattern(pat);
48+
e.gc.drawLine(10, 120, 170, 120);
49+
e.gc.setAlpha(255);
50+
e.gc.setLineCap(SWT.CAP_FLAT);
51+
e.gc.setForegroundPattern(pat);
52+
e.gc.drawLine(150, 120, 170, 20);
53+
});
54+
55+
shell.open();
56+
while (!shell.isDisposed()) {
57+
if (!disp.readAndDispatch())
58+
disp.sleep();
59+
}
60+
image.dispose();
61+
pat.dispose();
62+
disp.dispose();
63+
}
64+
}
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
package org.eclipse.swt.tests.win32.snippets;
2-
3-
import org.eclipse.swt.SWT;
4-
import org.eclipse.swt.layout.FillLayout;
5-
import org.eclipse.swt.widgets.Display;
6-
import org.eclipse.swt.widgets.Shell;
7-
import org.eclipse.swt.widgets.Table;
8-
import org.eclipse.swt.widgets.TableColumn;
9-
import org.eclipse.swt.widgets.TableItem;
10-
11-
/**
12-
* @author Thomas Singer
13-
*/
14-
public class Bug536020_TableColorTest {
15-
16-
public static void main(String[] args) {
17-
final Display display = new Display();
18-
19-
final Shell shell = new Shell(display);
20-
shell.setLayout(new FillLayout());
21-
22-
final Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
23-
createColumn(table, "Column 1");
24-
final TableColumn column = createColumn(table, "Column 2");
25-
table.setHeaderVisible(true);
26-
27-
table.setSortColumn(column);
28-
table.setSortDirection(SWT.UP);
29-
30-
table.setHeaderBackground(display.getSystemColor(SWT.COLOR_WHITE));
31-
32-
for (int i = 0; i < 10; i++) {
33-
final TableItem item = new TableItem(table, 0);
34-
item.setText(0, "Item 1+" + i);
35-
item.setText(1, "Item 2+" + i);
36-
}
37-
38-
table.setSelection(0);
39-
40-
shell.setSize(400, 200);
41-
shell.open();
42-
43-
while (!shell.isDisposed()) {
44-
if (!display.readAndDispatch()) {
45-
display.sleep();
46-
}
47-
}
48-
49-
display.dispose();
50-
}
51-
52-
private static TableColumn createColumn(Table table, String text) {
53-
final TableColumn column = new TableColumn(table, SWT.LEFT);
54-
column.setText(text);
55-
column.setWidth(100);
56-
return column;
57-
}
58-
}
1+
package org.eclipse.swt.tests.win32.snippets;
2+
3+
import org.eclipse.swt.SWT;
4+
import org.eclipse.swt.layout.FillLayout;
5+
import org.eclipse.swt.widgets.Display;
6+
import org.eclipse.swt.widgets.Shell;
7+
import org.eclipse.swt.widgets.Table;
8+
import org.eclipse.swt.widgets.TableColumn;
9+
import org.eclipse.swt.widgets.TableItem;
10+
11+
/**
12+
* @author Thomas Singer
13+
*/
14+
public class Bug536020_TableColorTest {
15+
16+
public static void main(String[] args) {
17+
final Display display = new Display();
18+
19+
final Shell shell = new Shell(display);
20+
shell.setLayout(new FillLayout());
21+
22+
final Table table = new Table(shell, SWT.MULTI | SWT.FULL_SELECTION);
23+
createColumn(table, "Column 1");
24+
final TableColumn column = createColumn(table, "Column 2");
25+
table.setHeaderVisible(true);
26+
27+
table.setSortColumn(column);
28+
table.setSortDirection(SWT.UP);
29+
30+
table.setHeaderBackground(display.getSystemColor(SWT.COLOR_WHITE));
31+
32+
for (int i = 0; i < 10; i++) {
33+
final TableItem item = new TableItem(table, 0);
34+
item.setText(0, "Item 1+" + i);
35+
item.setText(1, "Item 2+" + i);
36+
}
37+
38+
table.setSelection(0);
39+
40+
shell.setSize(400, 200);
41+
shell.open();
42+
43+
while (!shell.isDisposed()) {
44+
if (!display.readAndDispatch()) {
45+
display.sleep();
46+
}
47+
}
48+
49+
display.dispose();
50+
}
51+
52+
private static TableColumn createColumn(Table table, String text) {
53+
final TableColumn column = new TableColumn(table, SWT.LEFT);
54+
column.setText(text);
55+
column.setWidth(100);
56+
return column;
57+
}
58+
}

0 commit comments

Comments
 (0)