Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion org.eclipse.wb.swing/wbp-meta/.wbp-cache-presentations
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7879b7f1b9d6189960c278dcdaddeeae
25ac5b3b39f8d6f8c3db96a940f0b80b
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
<description>The GridBagLayout class is a flexible layout manager that aligns components vertically and
horizontally, without requiring that the components be of the same size. Each GridBagLayout object
maintains a dynamic, rectangular grid of cells, with each component occupying, one or more cells.</description>
<!-- METHODS -->
<methods>
<method name="setConstraints">
<parameter type="java.awt.Component"/>
<parameter type="java.awt.GridBagConstraints"/>
</method>
</methods>
<!-- PROPERTIES -->
<property-tag name="columnWidths" tag="noClipboard" value="true"/>
<property-tag name="rowHeights" tag="noClipboard" value="true"/>
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wb.tests/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: WindowBuilder Tests
Bundle-SymbolicName: org.eclipse.wb.tests;singleton:=true
Bundle-Version: 1.7.300.qualifier
Bundle-Version: 1.8.0.qualifier
Bundle-Activator: org.eclipse.wb.tests.designer.tests.Activator
Bundle-Vendor: Google
Bundle-RequiredExecutionEnvironment: JavaSE-21
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.wb.tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.wb</groupId>
<artifactId>org.eclipse.wb.tests</artifactId>
<version>1.7.300-SNAPSHOT</version>
<version>1.8.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,39 @@ public Test() {
assertSame(layout.getRows().get(0), constraints.getRow());
}

@Test
public void test_access1() throws Exception {
test_access("\t\tlayout.setConstraints(label, new GridBagConstraints(0, 0, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10, 10, 0, 0), 5, 5));");
}

@Test
public void test_access2() throws Exception {
test_access("""
\t\tGridBagConstraints constraints = new GridBagConstraints(0, 0, 1, 1, 100, 100, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(10, 10, 0, 0), 5, 5);
\t\tlayout.setConstraints(label, constraints);
""");
}

private void test_access(String code) throws Exception {
ContainerInfo panel = parseContainer("""
public class Test extends JPanel {
public Test() {
GridBagLayout layout = new GridBagLayout();
setLayout(layout);

JLabel label = new JLabel("New label");
add(label);

%s
}
}""".formatted(code));
ContainerInfo label = panel.getChildren(ContainerInfo.class).getFirst();
GridBagConstraintsInfo constraints = GridBagLayoutInfo.getConstraintsFor(label);

assertEquals(constraints.getInsets("left"), 10);
assertEquals(constraints.getInsets("top"), 10);
}

@Test
public void test_properties() throws Exception {
ContainerInfo panel = parseContainer("""
Expand Down
Loading