Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 34884 Details for
Bug 116197
[Help] Help window for dialogs is very small
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
patch
org.eclipse.help.ui_116197.txt (text/plain), 5.94 KB, created by
Curtis d'Entremont
on 2006-02-16 18:04:40 EST
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Curtis d'Entremont
Created:
2006-02-16 18:04:40 EST
Size:
5.94 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.help.ui >Index: src/org/eclipse/help/ui/internal/ContextHelpDialog.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/ContextHelpDialog.java,v >retrieving revision 1.42 >diff -u -r1.42 ContextHelpDialog.java >--- src/org/eclipse/help/ui/internal/ContextHelpDialog.java 9 Feb 2006 23:19:41 -0000 1.42 >+++ src/org/eclipse/help/ui/internal/ContextHelpDialog.java 16 Feb 2006 23:03:47 -0000 >@@ -13,6 +13,7 @@ > > import org.eclipse.help.*; > import org.eclipse.help.internal.base.BaseHelpSystem; >+import org.eclipse.help.ui.internal.views.HelpTray; > import org.eclipse.jface.dialogs.TrayDialog; > import org.eclipse.swt.SWT; > import org.eclipse.swt.accessibility.*; >@@ -309,9 +310,8 @@ > } > > // create dynamic help link if current context allows dynamic help >- Object shellData = parentShell.getData(); > IWorkbenchWindow wbWindow = HelpUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); >- if (DefaultHelpUI.isActiveShell(parentShell, wbWindow) || shellData instanceof TrayDialog) { >+ if (DefaultHelpUI.isActiveShell(parentShell, wbWindow) || HelpTray.isAppropriateFor(parentShell)) { > // Create separator. > label = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL); > label.setBackground(backgroundColour); >Index: src/org/eclipse/help/ui/internal/DefaultHelpUI.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/DefaultHelpUI.java,v >retrieving revision 1.37 >diff -u -r1.37 DefaultHelpUI.java >--- src/org/eclipse/help/ui/internal/DefaultHelpUI.java 21 Dec 2005 21:53:13 -0000 1.37 >+++ src/org/eclipse/help/ui/internal/DefaultHelpUI.java 16 Feb 2006 23:03:47 -0000 >@@ -276,12 +276,9 @@ > } > } > // check the dialog >- if (activeShell != null) { >- Object data = activeShell.getData(); >- if (data instanceof TrayDialog && (!dinfopop || noInfopop)) { >- displayContextAsHelpTray(activeShell, context); >- return; >- } >+ if (HelpTray.isAppropriateFor(activeShell) && (!dinfopop || noInfopop)) { >+ displayContextAsHelpTray(activeShell, context); >+ return; > } > // we are here either as a fallback or because of the user preferences > displayContextAsInfopop(context, x, y); >Index: src/org/eclipse/help/ui/internal/views/HelpTray.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.help.ui/src/org/eclipse/help/ui/internal/views/HelpTray.java,v >retrieving revision 1.4 >diff -u -r1.4 HelpTray.java >--- src/org/eclipse/help/ui/internal/views/HelpTray.java 21 Dec 2005 21:53:13 -0000 1.4 >+++ src/org/eclipse/help/ui/internal/views/HelpTray.java 16 Feb 2006 23:03:47 -0000 >@@ -26,6 +26,7 @@ > import org.eclipse.swt.graphics.Image; > import org.eclipse.swt.graphics.ImageData; > import org.eclipse.swt.graphics.PaletteData; >+import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.RGB; > import org.eclipse.swt.layout.GridData; > import org.eclipse.swt.layout.GridLayout; >@@ -50,7 +51,12 @@ > */ > public class HelpTray extends DialogTray implements IPageChangedListener { > >+ public static final int MINIMUM_HEIGHT = 450; > private static final int DEFAULT_WIDTH = 210; >+ >+ private int originalHeight; >+ private int heightAdded; >+ > private FormToolkit toolkit; > private ReusableHelpPart helpPart; > private Shell shell; >@@ -89,6 +95,9 @@ > * @param parent the parent composite that will contain the tray > */ > protected Control createContents(Composite parent) { >+ // if the dialog is too short, make it taller >+ ensureMinimumHeight(parent.getShell()); >+ > toolkit = new FormToolkit(parent.getDisplay()); > toolkit.getHyperlinkGroup().setHyperlinkUnderlineMode(HyperlinkGroup.UNDERLINE_HOVER); > toolkit.getColors().initializeSectionToolBarColors(); >@@ -187,9 +196,44 @@ > hover.dispose(); > toolkit.dispose(); > helpPart.dispose(); >+ >+ /* >+ * Shell is about to be closed. Add a one-time-only listener >+ * that will return the dialog height back to original. >+ */ >+ shell.addListener(SWT.Resize, new Listener() { >+ public void handleEvent(Event event) { >+ shell.removeListener(SWT.Resize, this); >+ Point p = shell.getSize(); >+ if (heightAdded > 0 && p.y > originalHeight) { >+ p.y = Math.max(p.y - heightAdded, originalHeight); >+ shell.setSize(p); >+ } >+ } >+ }); > } > > /** >+ * Ensures that the dialog's height is sufficient to contain the help tray. >+ * If the dialog is too short, its height is increased. When closing the tray, >+ * the height is returned to original (see dispose()). >+ * >+ * @param shell the dialog's shell >+ */ >+ private void ensureMinimumHeight(Shell shell) { >+ Point p = shell.getSize(); >+ originalHeight = p.y; >+ if (p.y < MINIMUM_HEIGHT) { >+ heightAdded = MINIMUM_HEIGHT - p.y; >+ p.y = MINIMUM_HEIGHT; >+ shell.setSize(p); >+ } >+ else { >+ heightAdded = 0; >+ } >+ } >+ >+ /** > * Returns the ReusableHelpPart contained in the tray. > * > * @return the tray's ReusableHelpPart >@@ -212,6 +256,22 @@ > } > > /** >+ * Returns whether or not the help tray can handle the given shell. In some >+ * cases the help tray is not appropriate for shells that are too short and >+ * not resizable. In these cases infopops are used. >+ * >+ * @param shell the shell to check >+ * @return whether or not the help tray is appropriate for the hsell >+ */ >+ public static boolean isAppropriateFor(Shell shell) { >+ if (shell != null && !shell.isDisposed() && shell.isVisible()) { >+ Object data = shell.getData(); >+ return (data instanceof TrayDialog && (shell.getSize().y >= MINIMUM_HEIGHT || (shell.getStyle() & SWT.RESIZE) != 0)); >+ } >+ return false; >+ } >+ >+ /** > * Called whenever the dialog we're inside has changed pages. This updates > * the context help page if it is visible. > *
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 116197
: 34884