From c1a8bffddae3ab0e54c272ae0d5cb92ba71ac1a1 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 11 Nov 2025 15:21:51 +0100 Subject: [PATCH 1/4] Refactor: Replace magic strings with ICompareUIConstants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace hardcoded property key strings with constants from ICompareUIConstants interface for better maintainability and to avoid typos in property keys. Changes: - Add import for org.eclipse.compare.ICompareUIConstants - Use ICompareUIConstants.INCOMING_COLOR instead of string literal - Use ICompareUIConstants.OUTGOING_COLOR instead of string literal 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java index 19d7a65..c63f6db 100644 --- a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java +++ b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java @@ -1,6 +1,7 @@ package com.vogella.ide.editor.asciidoc; import org.eclipse.compare.CompareConfiguration; +import org.eclipse.compare.ICompareUIConstants; import org.eclipse.compare.contentmergeviewer.TextMergeViewer; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; @@ -9,7 +10,7 @@ public class AsciidocMergeViewer extends TextMergeViewer { public AsciidocMergeViewer(Composite parent, int style, CompareConfiguration configuration) { super(parent, style, configuration); - configuration.setProperty("org.eclipse.compare.INCOMING_COLOR", new RGB(0, 255, 0)); - configuration.setProperty("org.eclipse.compare.OUTGOING_COLOR", new RGB(255, 0, 0)); + configuration.setProperty(ICompareUIConstants.INCOMING_COLOR, new RGB(0, 255, 0)); + configuration.setProperty(ICompareUIConstants.OUTGOING_COLOR, new RGB(255, 0, 0)); } } From 38bc9c6cdf75c7194fde3e61b78cca519d4e777b Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Wed, 12 Nov 2025 10:50:17 +0100 Subject: [PATCH 2/4] Fix: Remove hardcoded color overrides in AsciidocMergeViewer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove hardcoded RGB color values for incoming/outgoing changes to respect user-configured color preferences and theme settings. This improves accessibility and maintains consistency with Eclipse platform conventions. Changes: - Remove setProperty calls for INCOMING_COLOR and OUTGOING_COLOR - Remove unused ICompareUIConstants and RGB imports - Let TextMergeViewer use default platform colors Addresses review feedback from gemini-code-assist regarding accessibility concerns and user preference overrides. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java index c63f6db..6826064 100644 --- a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java +++ b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java @@ -1,16 +1,12 @@ package com.vogella.ide.editor.asciidoc; import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.ICompareUIConstants; import org.eclipse.compare.contentmergeviewer.TextMergeViewer; -import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; public class AsciidocMergeViewer extends TextMergeViewer { public AsciidocMergeViewer(Composite parent, int style, CompareConfiguration configuration) { super(parent, style, configuration); - configuration.setProperty(ICompareUIConstants.INCOMING_COLOR, new RGB(0, 255, 0)); - configuration.setProperty(ICompareUIConstants.OUTGOING_COLOR, new RGB(255, 0, 0)); } } From 5c74d7413a4457ea058a82c4c8f226a092812b93 Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 18 Nov 2025 09:12:05 +0100 Subject: [PATCH 3/4] Fix: Restore custom colors in AsciidocMergeViewer This commit fixes a regression introduced in the previous commit. The functionality for setting custom colors in the AsciidocMergeViewer was incorrectly removed. This change restores the functionality by using the constants from ICompareUIConstants. --- .../com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java index 6826064..c63f6db 100644 --- a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java +++ b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java @@ -1,12 +1,16 @@ package com.vogella.ide.editor.asciidoc; import org.eclipse.compare.CompareConfiguration; +import org.eclipse.compare.ICompareUIConstants; import org.eclipse.compare.contentmergeviewer.TextMergeViewer; +import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; public class AsciidocMergeViewer extends TextMergeViewer { public AsciidocMergeViewer(Composite parent, int style, CompareConfiguration configuration) { super(parent, style, configuration); + configuration.setProperty(ICompareUIConstants.INCOMING_COLOR, new RGB(0, 255, 0)); + configuration.setProperty(ICompareUIConstants.OUTGOING_COLOR, new RGB(255, 0, 0)); } } From 04668b1c1811b398fed8ee126f9b473eee8a507e Mon Sep 17 00:00:00 2001 From: Lars Vogel Date: Tue, 18 Nov 2025 09:19:52 +0100 Subject: [PATCH 4/4] Fix: Revert usage of internal class ICompareUIConstants This commit reverts the usage of the internal class ICompareUIConstants and uses string literals instead. This fixes the build failure. --- .../com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java index c63f6db..19d7a65 100644 --- a/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java +++ b/com.vogella.ide.editor.asciidoc/src/com/vogella/ide/editor/asciidoc/AsciidocMergeViewer.java @@ -1,7 +1,6 @@ package com.vogella.ide.editor.asciidoc; import org.eclipse.compare.CompareConfiguration; -import org.eclipse.compare.ICompareUIConstants; import org.eclipse.compare.contentmergeviewer.TextMergeViewer; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.widgets.Composite; @@ -10,7 +9,7 @@ public class AsciidocMergeViewer extends TextMergeViewer { public AsciidocMergeViewer(Composite parent, int style, CompareConfiguration configuration) { super(parent, style, configuration); - configuration.setProperty(ICompareUIConstants.INCOMING_COLOR, new RGB(0, 255, 0)); - configuration.setProperty(ICompareUIConstants.OUTGOING_COLOR, new RGB(255, 0, 0)); + configuration.setProperty("org.eclipse.compare.INCOMING_COLOR", new RGB(0, 255, 0)); + configuration.setProperty("org.eclipse.compare.OUTGOING_COLOR", new RGB(255, 0, 0)); } }