|
From: <caw...@us...> - 2007-08-07 17:27:44
|
Revision: 2934
http://rubyeclipse.svn.sourceforge.net/rubyeclipse/?rev=2934&view=rev
Author: cawilliams
Date: 2007-08-07 10:27:41 -0700 (Tue, 07 Aug 2007)
Log Message:
-----------
fix #5315 - Add preference for disabling hovers
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyEditorAppearanceConfigurationBlock.java
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-08-07 16:06:18 UTC (rev 2933)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/RubyPlugin.java 2007-08-07 17:27:41 UTC (rev 2934)
@@ -22,6 +22,7 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Preferences;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.internal.ui.ImageDescriptorRegistry;
@@ -594,6 +595,10 @@
* @since 1.0
*/
public RubyEditorTextHoverDescriptor[] getRubyEditorTextHoverDescriptors() {
+ Preferences prefs = getPluginPreferences();
+ if (prefs != null && !prefs.getBoolean(PreferenceConstants.HOVERS_ENABLED)) {
+ return new RubyEditorTextHoverDescriptor[0];
+ }
if (fRubyEditorTextHoverDescriptors == null) {
fRubyEditorTextHoverDescriptors= RubyEditorTextHoverDescriptor.getContributedHovers();
ConfigurationElementSorter sorter= new ConfigurationElementSorter() {
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java 2007-08-07 16:06:18 UTC (rev 2933)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.java 2007-08-07 17:27:41 UTC (rev 2934)
@@ -191,6 +191,7 @@
public static String KeywordInputDialog_error_comma;
public static String KeywordInputDialog_error_entryExists;
public static String KeywordInputDialog_error_noSpace;
+ public static String RubyEditorPreferencePage_enableHovers;
static {
NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-08-07 16:06:18 UTC (rev 2933)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/PreferencesMessages.properties 2007-08-07 17:27:41 UTC (rev 2934)
@@ -95,6 +95,8 @@
RubyEditorPreferencePage_enable= Enab&le
RubyEditorPreferencePage_folding_title= &Folding
+RubyEditorPreferencePage_enableHovers= Enable ruby code hovers
+
# coloring
RubyEditorPreferencePage_coloring_category_ruby=Ruby
RubyEditorColoringConfigurationBlock_link= Default colors and font can be configured on the <a href=\"org.eclipse.ui.preferencePages.GeneralTextEditor\">Text Editors</a> and on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">Colors and Fonts</a> preference page.
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyEditorAppearanceConfigurationBlock.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyEditorAppearanceConfigurationBlock.java 2007-08-07 16:06:18 UTC (rev 2933)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/preferences/RubyEditorAppearanceConfigurationBlock.java 2007-08-07 17:27:41 UTC (rev 2934)
@@ -70,8 +70,9 @@
private OverlayPreferenceStore.OverlayKey[] createOverlayStoreKeys() {
ArrayList overlayKeys= new ArrayList();
-
+
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR));
+ overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.HOVERS_ENABLED));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_MATCHING_BRACKETS));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_EVALUTE_TEMPORARY_PROBLEMS));
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SMART_HOME_END));
@@ -208,6 +209,9 @@
label= PreferencesMessages.RubyEditorPreferencePage_highlightMatchingBrackets;
addCheckBox(appearanceComposite, label, PreferenceConstants.EDITOR_MATCHING_BRACKETS, 0);
+ label= PreferencesMessages.RubyEditorPreferencePage_enableHovers;
+ addCheckBox(appearanceComposite, label, PreferenceConstants.HOVERS_ENABLED, 0);
+
Label l= new Label(appearanceComposite, SWT.LEFT );
gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 2;
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-08-07 16:06:18 UTC (rev 2933)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/ui/PreferenceConstants.java 2007-08-07 17:27:41 UTC (rev 2934)
@@ -388,6 +388,14 @@
* @see org.eclipse.jface.preference.PreferenceConverter
*/
public final static String EDITOR_MATCHING_BRACKETS_COLOR = "matchingBracketsColor"; //$NON-NLS-1$
+
+ /**
+ * A named preference that controls if the Ruby hovers get created.
+ * <p>
+ * Value is of type <code>Boolean</code>.
+ * </p>
+ */
+ public final static String HOVERS_ENABLED = "hovers_enabled"; //$NON-NLS-1$
/**
* A named preference that controls if the Ruby code assist gets auto
@@ -870,6 +878,7 @@
store.setDefault(PreferenceConstants.EDITOR_MATCHING_BRACKETS, true);
PreferenceConverter.setDefault(store, PreferenceConstants.EDITOR_MATCHING_BRACKETS_COLOR, new RGB(192, 192, 192));
+ store.setDefault(PreferenceConstants.HOVERS_ENABLED, true);
store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION, true);
store.setDefault(PreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY, 200);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|