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 184247 Details for
Bug 331524
WorkbenchPreferenceDialog overrides client focus (was: [preferences] Configuring problem severity via hover broken)
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]
Fix
patch.txt (text/plain), 6.33 KB, created by
Dani Megert
on 2010-12-01 07:15:00 EST
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Dani Megert
Created:
2010-12-01 07:15:00 EST
Size:
6.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceDialog.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceDialog.java,v >retrieving revision 1.72 >diff -u -r1.72 WorkbenchPreferenceDialog.java >--- Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceDialog.java 23 Apr 2009 18:55:01 -0000 1.72 >+++ Eclipse UI/org/eclipse/ui/internal/dialogs/WorkbenchPreferenceDialog.java 1 Dec 2010 12:14:31 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2009 IBM Corporation and others. >+ * Copyright (c) 2000, 2010 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 >@@ -15,6 +15,7 @@ > import org.eclipse.jface.preference.IPreferenceNode; > import org.eclipse.jface.preference.IPreferencePage; > import org.eclipse.jface.preference.PreferenceManager; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IWorkbench; > import org.eclipse.ui.IWorkbenchWindow; >@@ -22,6 +23,7 @@ > import org.eclipse.ui.activities.WorkbenchActivityHelper; > import org.eclipse.ui.internal.IWorkbenchHelpContextIds; > import org.eclipse.ui.internal.WorkbenchPlugin; >+import org.eclipse.ui.internal.dnd.SwtUtil; > > /** > * Prefence dialog for the workbench including the ability to load/save >@@ -205,7 +207,9 @@ > Shell shell = getShell(); > if ((shell != null) && (!shell.isDisposed())) { > shell.open(); // make the dialog visible to properly set the focus >- selectedPage.getControl().setFocus(); >+ Control control = selectedPage.getControl(); >+ if (!SwtUtil.isFocusAncestor(control)) >+ control.setFocus(); > } > } > return super.open(); >Index: Eclipse UI/org/eclipse/ui/internal/dnd/SwtUtil.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/dnd/SwtUtil.java,v >retrieving revision 1.15 >diff -u -r1.15 SwtUtil.java >--- Eclipse UI/org/eclipse/ui/internal/dnd/SwtUtil.java 8 May 2006 20:55:51 -0000 1.15 >+++ Eclipse UI/org/eclipse/ui/internal/dnd/SwtUtil.java 1 Dec 2010 12:14:31 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2004, 2006 IBM Corporation and others. >+ * Copyright (c) 2004, 2010 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 >@@ -10,7 +10,6 @@ > *******************************************************************************/ > package org.eclipse.ui.internal.dnd; > >-import org.eclipse.core.runtime.Assert; > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.graphics.Rectangle; > import org.eclipse.swt.widgets.Composite; >@@ -80,13 +79,13 @@ > } > > /** >- * Determines if one control is a child of another. Returns true iff the second >- * argument is a child of the first (or the same object). >- * >- * @param potentialParent >- * @param childToTest >- * @return >- */ >+ * Determines if one control is a child of another. >+ * >+ * @param potentialParent >+ * @param childToTest >+ * @return <code>true</code> if the second argument is a child of the first >+ * or the same object, <code>false</code> otherwise >+ */ > public static boolean isChild(Control potentialParent, Control childToTest) { > if (childToTest == null) { > return false; >@@ -100,7 +99,8 @@ > } > > public static boolean isFocusAncestor(Control potentialParent) { >- Assert.isNotNull(potentialParent); >+ if (potentialParent == null) >+ return false; > Control focusControl = Display.getCurrent().getFocusControl(); > if (focusControl == null) { > return false; >@@ -109,13 +109,13 @@ > } > > /** >- * Finds and returns the most specific SWT control at the given location. >- * (Note: this does a DFS on the SWT widget hierarchy, which is slow). >- * >- * @param displayToSearch >- * @param locationToFind >- * @return >- */ >+ * Finds and returns the most specific SWT control at the given location. >+ * (Note: this does a DFS on the SWT widget hierarchy, which is slow). >+ * >+ * @param displayToSearch >+ * @param locationToFind >+ * @return the most specific SWT control at the given location >+ */ > public static Control findControl(Display displayToSearch, > Point locationToFind) { > Shell[] shells = displayToSearch.getShells(); >@@ -195,12 +195,13 @@ > } > > /** >- * Finds the control in the given location >- * >- * @param toSearch >- * @param locationToFind location (in display coordinates) >- * @return >- */ >+ * Finds the control at the given location. >+ * >+ * @param toSearch >+ * @param locationToFind >+ * location (in display coordinates) >+ * @return the control at the given location >+ */ > public static Control findControl(Composite toSearch, Point locationToFind) { > Control[] children = toSearch.getChildren(); > >@@ -208,13 +209,16 @@ > } > > /** >- * >- * Returns true iff the given rectangle is located in the client area of any >- * monitor. >- * >- * @param someRectangle a rectangle in display coordinates (not null) >- * @return true iff the given point can be seen on any monitor >- */ >+ * >+ * Returns true iff the given rectangle is located in the client area of any >+ * monitor. >+ * >+ * @param display >+ * the display >+ * @param someRectangle >+ * a rectangle in display coordinates (not null) >+ * @return true iff the given point can be seen on any monitor >+ */ > public static boolean intersectsAnyMonitor(Display display, > Rectangle someRectangle) { > Monitor[] monitors = display.getMonitors();
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 331524
:
184245
| 184247