Skip to content

Commit ffb0cdc

Browse files
committed
SoftLimit: improve Preferences page text/tooltip/keywords
- Text: `Initial maximum number of elements shown in views:` - Tooltip: `Use 0 for no limit. If the number of elements exceeds given limit, user interaction is required to show more elements. This limit is a hint: not all views support support this limit or may use different one.` - Keywords: `view limit maximum elements items` Fixes #1026
1 parent fa99e88 commit ffb0cdc

File tree

5 files changed

+29
-2
lines changed

5 files changed

+29
-2
lines changed

bundles/org.eclipse.ui.ide/plugin.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ PreferenceKeywords.Editing = editing
231231
PreferenceKeywords.Appearance = appearance
232232
PreferenceKeywords.ColorLabels = color label
233233
PreferenceKeywords.General = click background heap
234+
PreferenceKeywords.ViewLimit = view limit maximum elements items
234235
PreferenceKeywords.Themes = themes
235236
PreferenceKeywords.AppearancePage = presentation MRU dark light tabs
236237
PreferenceKeywords.Tabs = tab

bundles/org.eclipse.ui.ide/plugin.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@
455455
<keyword
456456
id="org.eclipse.ui.ide.general"
457457
label="%PreferenceKeywords.General"/>
458+
<keyword
459+
id="org.eclipse.ui.ide.viewlimit"
460+
label="%PreferenceKeywords.ViewLimit"/>
458461
<keyword
459462
id="org.eclipse.ui.ide.themes"
460463
label="%PreferenceKeywords.Themes"/>
@@ -564,6 +567,7 @@
564567
class="org.eclipse.ui.internal.ide.dialogs.IDEWorkbenchPreferencePage"
565568
id="org.eclipse.ui.preferencePages.Workbench">
566569
<keywordReference id="org.eclipse.ui.ide.general"/>
570+
<keywordReference id="org.eclipse.ui.ide.viewlimit"/>
567571
</page>
568572
<page
569573
name="%PreferencePages.Globalization"

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchMessages.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ public class WorkbenchMessages extends NLS {
731731
public static String WorkbenchPreference_workbenchSaveInterval;
732732
public static String WorkbenchPreference_workbenchSaveIntervalError;
733733
public static String WorkbenchPreference_largeViewLimit;
734+
public static String WorkbenchPreference_largeViewLimitTooltip;
734735
public static String WorkbenchPreference_largeViewLimitError;
735736
public static String WorkbenchEditorsAction_label;
736737
public static String WorkbookEditorsAction_label;

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferencePage.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.eclipse.swt.widgets.Control;
3838
import org.eclipse.swt.widgets.Group;
3939
import org.eclipse.swt.widgets.Label;
40+
import org.eclipse.swt.widgets.Text;
4041
import org.eclipse.ui.IWorkbench;
4142
import org.eclipse.ui.IWorkbenchPreferenceConstants;
4243
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -158,7 +159,24 @@ protected void createLargeViewLimitPref(Composite composite) {
158159
groupComposite.setLayoutData(gd);
159160

160161
largeViewLimit = new IntegerFieldEditor(IWorkbenchPreferenceConstants.LARGE_VIEW_LIMIT,
161-
WorkbenchMessages.WorkbenchPreference_largeViewLimit, groupComposite);
162+
WorkbenchMessages.WorkbenchPreference_largeViewLimit, groupComposite) {
163+
164+
@Override
165+
protected Text createTextWidget(Composite parent) {
166+
Text w = super.createTextWidget(parent);
167+
w.setToolTipText(WorkbenchMessages.WorkbenchPreference_largeViewLimitTooltip);
168+
return w;
169+
}
170+
171+
@Override
172+
public Label getLabelControl(Composite parent) {
173+
Label label = super.getLabelControl(parent);
174+
if (label != null) {
175+
label.setToolTipText(WorkbenchMessages.WorkbenchPreference_largeViewLimitTooltip);
176+
}
177+
return label;
178+
}
179+
};
162180

163181
largeViewLimit.setPreferenceStore(getPreferenceStore());
164182
largeViewLimit.setPage(this);

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/messages.properties

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,10 @@ WorkbenchPreference_workbenchSaveIntervalError=The workbench save interval shoul
711711
WorkbenchEditorsAction_label=S&witch to Editor...
712712
WorkbookEditorsAction_label=&Quick Switch Editor
713713

714-
WorkbenchPreference_largeViewLimit=Default increment for displaying elements in UI:
714+
WorkbenchPreference_largeViewLimit=Initial maximum number of elements shown in views:
715+
WorkbenchPreference_largeViewLimitTooltip=Use 0 for no limit. \
716+
If the number of elements exceeds given limit, user interaction is required to show more elements. \
717+
This limit is a hint: not all views support this limit or may use different one.
715718
WorkbenchPreference_largeViewLimitError=The limit should be an integer between 0 and {0}.
716719

717720
WorkbenchEditorsDialog_title=Switch to Editor

0 commit comments

Comments
 (0)