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 61721 Details for
Bug 85608
[ViewMgmt] [EditorMgmt] Create option to disable views that open automatically
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]
Grab Focus Hooks v01
tweak-v01.txt (text/plain), 6.47 KB, created by
Paul Webster
on 2007-03-22 14:19:53 EDT
(
hide
)
Description:
Grab Focus Hooks v01
Filename:
MIME Type:
Creator:
Paul Webster
Created:
2007-03-22 14:19:53 EDT
Size:
6.47 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/Workbench.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Workbench.java,v >retrieving revision 1.435 >diff -u -r1.435 Workbench.java >--- Eclipse UI/org/eclipse/ui/internal/Workbench.java 22 Mar 2007 14:01:16 -0000 1.435 >+++ Eclipse UI/org/eclipse/ui/internal/Workbench.java 22 Mar 2007 18:18:29 -0000 >@@ -166,6 +166,8 @@ > import org.eclipse.ui.internal.themes.FontDefinition; > import org.eclipse.ui.internal.themes.ThemeElementHelper; > import org.eclipse.ui.internal.themes.WorkbenchThemeManager; >+import org.eclipse.ui.internal.tweaklets.GrabFocus; >+import org.eclipse.ui.internal.tweaklets.Tweaklets; > import org.eclipse.ui.internal.util.PrefUtil; > import org.eclipse.ui.internal.util.Util; > import org.eclipse.ui.intro.IIntroManager; >@@ -1304,6 +1306,15 @@ > > // initialize workbench single-click vs double-click behavior > initializeSingleClickOption(); >+ >+ StartupThreading.runWithoutExceptions(new StartupRunnable() { >+ >+ public void runWithException() { >+ ((GrabFocus) Tweaklets.get(GrabFocus.class)) >+ .init(getDisplay()); >+ } >+ }); >+ > > // attempt to restore a previous workbench state > try { >@@ -2662,6 +2673,8 @@ > Platform.getExtensionRegistry().removeRegistryChangeListener( > startupRegistryListener); > >+ ((GrabFocus) Tweaklets.get(GrabFocus.class)).dispose(); >+ > // Bring down all of the services. > serviceLocator.dispose(); > >Index: Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java,v >retrieving revision 1.286 >diff -u -r1.286 WorkbenchPage.java >--- Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 19 Mar 2007 20:58:52 -0000 1.286 >+++ Eclipse UI/org/eclipse/ui/internal/WorkbenchPage.java 22 Mar 2007 18:18:29 -0000 >@@ -100,6 +100,7 @@ > import org.eclipse.ui.internal.registry.IWorkbenchRegistryConstants; > import org.eclipse.ui.internal.registry.PerspectiveDescriptor; > import org.eclipse.ui.internal.registry.UIExtensionTracker; >+import org.eclipse.ui.internal.tweaklets.GrabFocus; > import org.eclipse.ui.internal.tweaklets.TabBehaviour; > import org.eclipse.ui.internal.tweaklets.Tweaklets; > import org.eclipse.ui.internal.util.PrefUtil; >@@ -571,6 +572,11 @@ > return; > } > >+ if (composite!=null && composite.isVisible() >+ && !((GrabFocus)Tweaklets.get(GrabFocus.class)).grabFocusAllowed(part)) { >+ return; >+ } >+ > // If zoomed, unzoom. > zoomOutIfNecessary(part); > >@@ -789,6 +795,10 @@ > if (persp == null || !certifyPart(part)) { > return; > } >+ >+ if (!((GrabFocus)Tweaklets.get(GrabFocus.class)).grabFocusAllowed(part)) { >+ return; >+ } > > String label = null; // debugging only > if (UIStats.isDebugging(UIStats.BRING_PART_TO_TOP)) { >@@ -1013,6 +1023,9 @@ > * Performs showing of the view in the given mode. > */ > private void busyShowView(IViewPart part, int mode) { >+ if (!((GrabFocus)Tweaklets.get(GrabFocus.class)).grabFocusAllowed(part)) { >+ return; >+ } > if (mode == VIEW_ACTIVATE) { > activate(part); > } else if (mode == VIEW_VISIBLE) { >Index: Eclipse UI/org/eclipse/ui/internal/tweaklets/GrabFocus.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/tweaklets/GrabFocus.java >diff -N Eclipse UI/org/eclipse/ui/internal/tweaklets/GrabFocus.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/tweaklets/GrabFocus.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,32 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ui.internal.tweaklets; >+ >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IWorkbenchPart; >+ >+/** >+ * The tweaklet provider can prevent the workbench page from grabbing focus. >+ * >+ * @since 3.3 >+ */ >+public abstract class GrabFocus { >+ static { >+ Tweaklets.setDefault(GrabFocus.class, new AllowGrabFocus()); >+ } >+ >+ public abstract boolean grabFocusAllowed(IWorkbenchPart part); >+ >+ public abstract void init(Display display); >+ >+ public abstract void dispose(); >+} >Index: Eclipse UI/org/eclipse/ui/internal/tweaklets/AllowGrabFocus.java >=================================================================== >RCS file: Eclipse UI/org/eclipse/ui/internal/tweaklets/AllowGrabFocus.java >diff -N Eclipse UI/org/eclipse/ui/internal/tweaklets/AllowGrabFocus.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ Eclipse UI/org/eclipse/ui/internal/tweaklets/AllowGrabFocus.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,45 @@ >+/******************************************************************************* >+ * Copyright (c) 2007 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ ******************************************************************************/ >+ >+package org.eclipse.ui.internal.tweaklets; >+ >+import org.eclipse.swt.widgets.Display; >+import org.eclipse.ui.IWorkbenchPart; >+ >+/** >+ * @since 3.3 >+ * >+ */ >+public class AllowGrabFocus extends GrabFocus { >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ui.internal.tweaklets.GrabFocusManager#allowGrabFocus(org.eclipse.ui.IWorkbenchPart) >+ */ >+ public boolean grabFocusAllowed(IWorkbenchPart part) { >+ return true; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.ui.internal.tweaklets.GrabFocusManager#init(Display) >+ */ >+ public void init(Display display) { >+ } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.internal.tweaklets.GrabFocusManager#dispose() >+ */ >+ public void dispose() { >+ } >+}
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 85608
:
28240
|
28241
|
59186
| 61721 |
61929