From b3be9b32054582d561be8fd7c1c72ee63053a0e0 Mon Sep 17 00:00:00 2001 From: Chris Goldthorpe Date: Thu, 3 Dec 2009 19:15:19 +0000 Subject: Bug 287859 – [CheatSheet] description text in cheat sheet selection dialog needs vertical scrollbar --- .../CheatSheetCategoryBasedSelectionDialog.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'org.eclipse.ui.cheatsheets/src/org') diff --git a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java index 1e9c3184b..2e971cd62 100644 --- a/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java +++ b/org.eclipse.ui.cheatsheets/src/org/eclipse/ui/internal/cheatsheets/dialogs/CheatSheetCategoryBasedSelectionDialog.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2002, 2008 IBM Corporation and others. + * Copyright (c) 2002, 2009 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -54,12 +54,12 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; import org.eclipse.ui.ISharedImages; import org.eclipse.ui.PlatformUI; import org.eclipse.ui.activities.ITriggerPoint; import org.eclipse.ui.activities.WorkbenchActivityHelper; import org.eclipse.ui.cheatsheets.OpenCheatSheetAction; +import org.eclipse.ui.forms.widgets.ScrolledFormText; import org.eclipse.ui.internal.cheatsheets.CheatSheetPlugin; import org.eclipse.ui.internal.cheatsheets.ICheatSheetResource; import org.eclipse.ui.internal.cheatsheets.Messages; @@ -88,7 +88,7 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends private TreeViewer treeViewer; - private Text desc; + private ScrolledFormText desc; private Button showAllButton; @@ -284,8 +284,7 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends treeViewer.addSelectionChangedListener(this); treeViewer.setInput(cheatsheetCategories); - desc = new Text(sform, SWT.MULTI | SWT.WRAP); - desc.setEditable(false); + desc = new ScrolledFormText(sform, true); sform.setWeights(new int[] {10, 2}); @@ -531,11 +530,14 @@ public class CheatSheetCategoryBasedSelectionDialog extends TrayDialog //extends currentSelection = (CheatSheetElement) obj; } + String description; if (currentSelection != null) { - desc.setText(currentSelection.getDescription()); - } else { - desc.setText(""); //$NON-NLS-1$ + description = currentSelection.getDescription(); + } else { + description = ""; //$NON-NLS-1$ } + desc.getFormText().setText(description, false, false); + desc.reflow(true); setOkButton(); } -- cgit v1.2.3