Skip to content

Commit

Permalink
feat: externalize label text for "Show TextMate Token Hover" checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
sebthom committed May 16, 2024
1 parent 19990e7 commit d7b9ba2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public final class TMUIMessages extends NLS {
public static String TextMatePreferencePage_LanguageConfigurationRelatedLink;
public static String TextMatePreferencePage_TaskTagsRelatedLink;
public static String TextMatePreferencePage_ThemeRelatedLink;
public static String TextMatePreferencePage_ShowTextMateTokenInfoHover;

// Grammar preferences page
public static String GrammarPreferencePage_title;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ TextMatePreferencePage_GrammarRelatedLink=See <a>''{0}''</a> for associating edi
TextMatePreferencePage_LanguageConfigurationRelatedLink=See <a>''{0}''</a> for associating editors with language configurations.
TextMatePreferencePage_TaskTagsRelatedLink=See <a>''{0}''</a> for task tags configuration.
TextMatePreferencePage_ThemeRelatedLink=See <a>''{0}''</a> for associating editors with themes.
TextMatePreferencePage_ShowTextMateTokenInfoHover=Show TextMate token info in hovers.

GrammarPreferencePage_title=TextMate grammars
GrammarPreferencePage_description=Register, configure or remove TextMate grammars:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
public final class TextMatePreferencePage extends AbstractPreferencePage {

private Button enableTMScopeHover = lazyNonNull();
private Button enableTMScopeHoverButton = lazyNonNull();

public TextMatePreferencePage() {
super(null, null);
Expand All @@ -50,9 +50,9 @@ protected Control createContents(final @NonNullByDefault({}) Composite parent) {
new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL)
.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

enableTMScopeHover = new Button(composite, SWT.CHECK);
enableTMScopeHover.setText("Show TextMate scope name in hovers.");
enableTMScopeHover.setSelection(PreferenceHelper.isTMScopeHoverEnabled());
enableTMScopeHoverButton = new Button(composite, SWT.CHECK);
enableTMScopeHoverButton.setText(TMUIMessages.TextMatePreferencePage_ShowTextMateTokenInfoHover);
enableTMScopeHoverButton.setSelection(PreferenceHelper.isTMScopeHoverEnabled());

applyDialogFont(composite);
return composite;
Expand Down Expand Up @@ -90,13 +90,13 @@ public void init(final @NonNullByDefault({}) IWorkbench workbench) {

@Override
protected void performDefaults() {
enableTMScopeHover.setSelection(PreferenceHelper.isTMScopeHoverEnabled());
enableTMScopeHoverButton.setSelection(PreferenceHelper.isTMScopeHoverEnabled());
}

@Override
public boolean performOk() {
try {
PreferenceHelper.saveTMScopeHoverEnabled(enableTMScopeHover.getSelection());
PreferenceHelper.saveTMScopeHoverEnabled(enableTMScopeHoverButton.getSelection());
} catch (final BackingStoreException ex) {
TMUIPlugin.logError(ex);
return false;
Expand Down

0 comments on commit d7b9ba2

Please sign in to comment.