echebbi / eclipse-discord-integration

Discord's Rich Presence Integration within Eclipse IDE
https://discord-rich-presence-for-eclipse-ide.readthedocs.io/en/latest/
Other
45 stars 5 forks source link

Deactivate Preferences fields when the plug-in is disabled #67

Closed echebbi closed 4 years ago

echebbi commented 5 years ago

Currently, even when the plug-in has been disabled in the Preferences page, all the fields remain activated:

image

Disabling them would make clear that the plug-in do is disabled and would thus improve UX.

I think that this can be done entirely in DiscordIntegrationPreferencesPage and that the code should not be very complicated. Likely something like that:

showRichPresence.getPreferenceStore()
                .addPropertyChangeListener(event -> {
                    boolean presenceIsActivated = (boolean) event.getNewValue();
                    showFileName.setEnabled(presenceIsActivated, null);
                    // more code
                });