EGit UI DebugOptionsListener as a OSGi declarative service
commit6c9309466b6f220fd777c0605f2a49caabf66310
authorThomas Wolf <thomas.wolf@paranor.ch>
Sun, 7 Feb 2021 15:30:02 +0000 (7 16:30 +0100)
committerThomas Wolf <thomas.wolf@paranor.ch>
Thu, 11 Feb 2021 14:18:29 +0000 (11 15:18 +0100)
tree7875457cb14d7bc81de7927c3b8660d4cb5b6ebc
parentdfd0958aa593fda3c7a930f600aaf3c46e4f350c
EGit UI DebugOptionsListener as a OSGi declarative service

Remove the DebugOptionsListener from the Activator and make it a
separate OSGi declarative service. Let the framework handle subscribing
and unsubscribing this service.

Adapt the GitTraceConfigurationDialog, and fix two bugs:

* If the trace location is set to stdout in the PDE trace preferences,
  the trace file may be null. Disable the field and the "Open in Editor"
  button in that case.
* Make the dialog contents always fill the whole available space.

Three notes:

1. The EGit GitTraceConfigurationDialog does not interact well with
   the PDE trace preference page. While EGit picks up changes done
   via the PDE preference page, that preference page does _not_ pick
   up changes done via the EGit dialog.
2. Using a static inner class GitTraceLocation$DebugOptionsHandler did
   not work in Eclipse Neon.3. With the DebugOptionsHandler as a
   separate top-level class it works.
3. The command to open the EGit trace dialog is a bit hidden; it does
   not appear in any menu, and has no key binding. A user can define a
   key binding for it in the Eclipse preferences, though. The command
   is named "Configure Git Debug Trace".

Change-Id: Icfcee3eeb27fe98a92566656c4b7b0c19cf088af
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/test/trace/TraceConfigurationDialogTest.java
org.eclipse.egit.ui/META-INF/MANIFEST.MF
org.eclipse.egit.ui/OSGI-INF/org.eclipse.egit.ui.internal.trace.DebugOptionsHandler.xml [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/Activator.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/dialogs/GitTraceConfigurationDialog.java
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/trace/DebugOptionsHandler.java [new file with mode: 0644]
org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/trace/GitTraceLocation.java