Skip to content

Reduce code duplication in LayoutNameSupport#1464

Merged
ptziegler merged 1 commit into
eclipse-windowbuilder:masterfrom
ptziegler:cleanup-layout-name-support
Apr 26, 2026
Merged

Reduce code duplication in LayoutNameSupport#1464
ptziegler merged 1 commit into
eclipse-windowbuilder:masterfrom
ptziegler:cleanup-layout-name-support

Conversation

@ptziegler
Copy link
Copy Markdown
Contributor

The templateLayoutName preference is the same between Swing and SWT, so the preference constants can be moved to the Core plugin. Due to split packages, this then means that the IPreferenceConstants in the Java plugin has to be removed, as it conflicts with the class in the Core plugin. But which doesn't matter, as they are otherwise identical.

This then means that the getTemplate() can be moved up to the parent class. Only the list of available templates needs to be known, which is declared via the new, abstract getTemplates() method.

Additionally, the getValueMap() method can be partially moved to the base class, because the layoutAcronym and layoutClassName styles are shared. The method is overridden to add Swing and SWT-specific layouts.

The `templateLayoutName` preference is the same between Swing and SWT,
so the preference constants can be moved to the Core plugin. Due to
split packages, this then means that the `IPreferenceConstants` in the
Java plugin has to be removed, as it conflicts with the class in the
Core plugin. But which doesn't matter, as they are otherwise identical.

This then means that the `getTemplate()` can be moved up to the parent
class. Only the list of available templates needs to be known, which is
declared via the new, abstract `getTemplates()` method.

Additionally, the `getValueMap()` method can be partially moved to the
base class, because the `layoutAcronym` and `layoutClassName` styles are
shared. The method is overridden to add Swing and SWT-specific layouts.
@ptziegler ptziegler added this to the 1.24.0 milestone Apr 24, 2026
@github-actions
Copy link
Copy Markdown

Test Results

 2 720 files  ±0   2 720 suites  ±0   11h 22m 7s ⏱️ + 59m 4s
 7 018 tests ±0   6 972 ✅ ±0   45 💤 ±0  0 ❌ ±0  1 🔥 ±0 
28 072 runs  ±0  27 881 ✅ ±0  190 💤 ±0  0 ❌ ±0  1 🔥 ±0 

For more details on these errors, see this check.

Results for commit 08d0910. ± Comparison against base commit 9e303e6.

@ptziegler ptziegler merged commit def68fe into eclipse-windowbuilder:master Apr 26, 2026
6 of 8 checks passed
@ptziegler ptziegler deleted the cleanup-layout-name-support branch April 26, 2026 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant