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 55173 Details for
Bug 167010
[QuickAccess] Resources in Ctrl-E?
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]
experimental stuff
patch-167010.txt (text/plain), 15.50 KB, created by
Boris Bokowski
on 2006-12-06 18:27:44 EST
(
hide
)
Description:
experimental stuff
Filename:
MIME Type:
Creator:
Boris Bokowski
Created:
2006-12-06 18:27:44 EST
Size:
15.50 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui.ide >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.ide/plugin.xml,v >retrieving revision 1.163 >diff -u -r1.163 plugin.xml >--- plugin.xml 12 Sep 2006 20:09:45 -0000 1.163 >+++ plugin.xml 6 Dec 2006 23:25:04 -0000 >@@ -1019,5 +1019,11 @@ > value="0"/> > </markerAttributeGrouping> > </extension> >+ <extension >+ point="org.eclipse.ui.internalQuickAccessProvider"> >+ <provider >+ class="org.eclipse.ui.internal.ide.ResourceProvider"> >+ </provider> >+ </extension> > > </plugin> >Index: src/org/eclipse/ui/internal/ide/ResourceProvider.java >=================================================================== >RCS file: src/org/eclipse/ui/internal/ide/ResourceProvider.java >diff -N src/org/eclipse/ui/internal/ide/ResourceProvider.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/ui/internal/ide/ResourceProvider.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,133 @@ >+package org.eclipse.ui.internal.ide; >+ >+import java.util.ArrayList; >+import java.util.List; >+ >+import org.eclipse.core.resources.IFile; >+import org.eclipse.core.resources.IResource; >+import org.eclipse.core.resources.IResourceProxy; >+import org.eclipse.core.resources.IResourceProxyVisitor; >+import org.eclipse.core.resources.IWorkspace; >+import org.eclipse.core.resources.ResourcesPlugin; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IPath; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Path; >+import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.ui.IWorkbenchPage; >+import org.eclipse.ui.IWorkbenchWindow; >+import org.eclipse.ui.PartInitException; >+import org.eclipse.ui.PlatformUI; >+import org.eclipse.ui.ide.IDE; >+import org.eclipse.ui.internal.incubator.AbstractElement; >+import org.eclipse.ui.internal.incubator.AbstractProvider; >+import org.eclipse.ui.statushandling.StatusManager; >+ >+/** >+ * Provides the resources in the workspace >+ * >+ * @since 3.3 >+ * >+ */ >+public class ResourceProvider extends AbstractProvider { >+ >+ static IWorkspace workspace; >+ >+ /** >+ * >+ */ >+ public ResourceProvider() { >+ workspace = ResourcesPlugin.getWorkspace(); >+ } >+ >+ public AbstractElement getElementForId(String id) { >+ IResource resource = workspace.getRoot().findMember( >+ Path.fromPortableString(id)); >+ return resource == null ? null : new ResourceElement(this, resource >+ .getFullPath()); >+ } >+ >+ public AbstractElement[] getElements() { >+ final List result = new ArrayList(); >+ try { >+ workspace.getRoot().accept(new IResourceProxyVisitor() { >+ >+ public boolean visit(IResourceProxy proxy) { >+ if (proxy.getType() == IResource.FILE && !proxy.isDerived()) { >+ result.add(new ResourceElement(ResourceProvider.this, >+ proxy.requestFullPath())); >+ } >+ return true; >+ } >+ }, 0); >+ } catch (CoreException e) { >+ StatusManager >+ .getManager() >+ .handle( >+ StatusUtil >+ .newStatus( >+ IStatus.ERROR, >+ "NON-NLSed: Error while retrieving workspace resources", e), //$NON-NLS-1$ >+ StatusManager.LOG); >+ } >+ return (AbstractElement[]) result.toArray(new AbstractElement[result >+ .size()]); >+ } >+ >+ public String getId() { >+ return "org.eclipse.ui.ide.ResourceProvider"; //$NON-NLS-1$ >+ } >+ >+ public ImageDescriptor getImageDescriptor() { >+ return null; >+ } >+ >+ public String getName() { >+ return "NON-NLSed: Resources"; //$NON-NLS-1$ >+ } >+ >+ private static class ResourceElement extends AbstractElement { >+ >+ private final IPath path; >+ >+ ResourceElement(ResourceProvider provider, IPath path) { >+ super(provider); >+ this.path = path; >+ } >+ >+ public void execute() { >+ IResource resource = workspace.getRoot().findMember(path); >+ if (!resource.exists() || resource.getType() != IResource.FILE) >+ return; >+ IWorkbenchWindow window = PlatformUI.getWorkbench() >+ .getActiveWorkbenchWindow(); >+ if (window == null) >+ return; >+ IWorkbenchPage activePage = window.getActivePage(); >+ if (activePage == null) >+ return; >+ try { >+ IDE.openEditor(activePage, (IFile) resource); >+ } catch (PartInitException e) { >+ StatusManager.getManager().handle( >+ StatusUtil.newStatus(IStatus.ERROR, >+ "NON-NLSed: Error while opening editor", e), //$NON-NLS-1$ >+ StatusManager.SHOWANDLOG); >+ } >+ } >+ >+ public String getId() { >+ return path.toPortableString(); >+ } >+ >+ public ImageDescriptor getImageDescriptor() { >+ return null; >+ } >+ >+ public String getLabel() { >+ return path.lastSegment() + " - " + path.toString(); //$NON-NLS-1$ >+ } >+ >+ } >+ >+} >#P org.eclipse.ui >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.xml,v >retrieving revision 1.364 >diff -u -r1.364 plugin.xml >--- plugin.xml 6 Dec 2006 19:59:46 -0000 1.364 >+++ plugin.xml 6 Dec 2006 23:25:09 -0000 >@@ -46,6 +46,7 @@ > <extension-point id="views" name="%ExtPoint.views" schema="schema/views.exsd"/> > <extension-point id="workingSets" name="%ExtPoint.workingSets" schema="schema/workingSets.exsd"/> > <extension-point id="browserSupport" name="%ExtPoint.browserSupport" schema="schema/browserSupport.exsd"/> >+ <extension-point id="internalQuickAccessProvider" name="%ExtPoint.internalQuickAccessProvider" schema="schema/internalQuickAccessProvider.exsd"/> > > <extension > point="org.eclipse.ui.contexts"> >Index: plugin.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/plugin.properties,v >retrieving revision 1.180 >diff -u -r1.180 plugin.properties >--- plugin.properties 24 Nov 2006 16:41:36 -0000 1.180 >+++ plugin.properties 6 Dec 2006 23:25:09 -0000 >@@ -54,6 +54,7 @@ > ExtPoint.browserSupport = Browser Support > ExtPoint.StatusHandler = Status Handler > ExtPoint.menus2 = Menus2 >+ExtPoint.internalQuickAccessProvider = (INTERNAL/EXPERIMENTAL) Quick Access Provider > > Views.Category.Basic = General > Views.IntroAdapter = Welcome >Index: schema/internalQuickAccessProvider.exsd >=================================================================== >RCS file: schema/internalQuickAccessProvider.exsd >diff -N schema/internalQuickAccessProvider.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/internalQuickAccessProvider.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,109 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.ui"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.ui" id="internalQuickAccessProvider" name="%ExtPoint.internalQuickAccessProvider"/> >+ </appInfo> >+ <documentation> >+ INTERNAL/EXPERIMENTAL - This extension point is used to add element providers to the "Quick Access" action. >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <complexType> >+ <sequence> >+ <element ref="provider"/> >+ </sequence> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="provider"> >+ <complexType> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.ui.internal.incubator.AbstractProvider"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ 3.3 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ [Enter extension point usage example here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="apiInfo"/> >+ </appInfo> >+ <documentation> >+ [Enter API information here.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="implementation"/> >+ </appInfo> >+ <documentation> >+ [Enter information about supplied implementation of this extension point.] >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="copyright"/> >+ </appInfo> >+ <documentation> >+ Copyright (c) 2006 IBM Corporation and others.<br> >+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 <a >+href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a> >+ </documentation> >+ </annotation> >+ >+</schema> >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/internal/incubator/CtrlEAction.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/incubator/CtrlEAction.java,v >retrieving revision 1.15 >diff -u -r1.15 CtrlEAction.java >--- Eclipse UI/org/eclipse/ui/internal/incubator/CtrlEAction.java 4 Dec 2006 20:49:53 -0000 1.15 >+++ Eclipse UI/org/eclipse/ui/internal/incubator/CtrlEAction.java 6 Dec 2006 23:25:10 -0000 >@@ -3,12 +3,17 @@ > import java.util.ArrayList; > import java.util.HashMap; > import java.util.LinkedList; >+import java.util.List; > import java.util.Map; > import java.util.StringTokenizer; > > import org.eclipse.core.commands.AbstractHandler; > import org.eclipse.core.commands.ExecutionEvent; > import org.eclipse.core.runtime.Assert; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IConfigurationElement; >+import org.eclipse.core.runtime.IStatus; >+import org.eclipse.core.runtime.Platform; > import org.eclipse.jface.dialogs.IDialogSettings; > import org.eclipse.jface.resource.DeviceResourceException; > import org.eclipse.jface.resource.ImageDescriptor; >@@ -35,7 +40,9 @@ > import org.eclipse.ui.internal.IWorkbenchGraphicConstants; > import org.eclipse.ui.internal.WorkbenchImages; > import org.eclipse.ui.internal.WorkbenchPlugin; >+import org.eclipse.ui.internal.misc.StatusUtil; > import org.eclipse.ui.internal.progress.ProgressManagerUtil; >+import org.eclipse.ui.statushandling.StatusManager; > > /** > * Experimental Action for search-based navigation to UI elements such as >@@ -71,11 +78,39 @@ > } > > if (providers == null) { >- providers = new AbstractProvider[] { new PreviousPicksProvider(), >- new EditorProvider(), new ViewProvider(), >- new PerspectiveProvider(), new CommandProvider(), >- new ActionProvider(), new WizardProvider(), >- new PreferenceProvider() }; >+ List providerList = new ArrayList(); >+ providerList.add(new PreviousPicksProvider()); >+ providerList.add(new EditorProvider()); >+ providerList.add(new ViewProvider()); >+ providerList.add(new PerspectiveProvider()); >+ // add contributed providers >+ IConfigurationElement[] elements = Platform.getExtensionRegistry() >+ .getConfigurationElementsFor( >+ "org.eclipse.ui.internalQuickAccessProvider"); //$NON-NLS-1$ >+ for (int i = 0; i < elements.length; i++) { >+ AbstractProvider provider; >+ try { >+ provider = (AbstractProvider) elements[i] >+ .createExecutableExtension("class"); //$NON-NLS-1$ >+ providerList.add(provider); >+ } catch (CoreException e) { >+ StatusManager >+ .getManager() >+ .handle( >+ StatusUtil >+ .newStatus( >+ IStatus.ERROR, >+ "NON-NLSed: Error with extension " + elements[i], e), //$NON-NLS-1$ >+ StatusManager.LOG); >+ } >+ } >+ >+ providerList.add(new CommandProvider()); >+ providerList.add(new ActionProvider()); >+ providerList.add(new WizardProvider()); >+ providerList.add(new PreferenceProvider()); >+ providers = (AbstractProvider[]) providerList >+ .toArray(new AbstractProvider[providerList.size()]); > > providerMap = new HashMap(); > for (int i = 0; i < providers.length; i++) { >@@ -171,7 +206,7 @@ > public String[] getMatchNames(Object element, Object parentElementOrNull) { > if (element instanceof AbstractProvider) { > AbstractProvider provider = (AbstractProvider) element; >- return (new String[]{provider.getName()}); >+ return (new String[] { provider.getName() }); > } else if (element instanceof AbstractElement) { > AbstractElement abstractElement = (AbstractElement) element; > String sortLabel = abstractElement.getSortLabel(); >@@ -181,21 +216,22 @@ > String combinedLabel = abstractProvider.getName() > + " " + abstractElement.getLabel(); //$NON-NLS-1$ > String combinedCamelCase = getCamelCase(combinedLabel); >- return (new String[] { sortLabel, camelCase, combinedLabel, combinedCamelCase }); >+ return (new String[] { sortLabel, camelCase, combinedLabel, >+ combinedCamelCase }); > } > return (new String[] { sortLabel, camelCase }); > } >- return (new String[]{""}); //$NON-NLS-1$ >+ return (new String[] { "" }); //$NON-NLS-1$ > } >- >+ > /** > * @return a string containing the first character of every word for >- * camel case checking. >+ * camel case checking. > */ > private String getCamelCase(String label) { > StringTokenizer tokenizer = new StringTokenizer(label); > StringBuffer camelCase = new StringBuffer(); >- while(tokenizer.hasMoreTokens()) { >+ while (tokenizer.hasMoreTokens()) { > String word = tokenizer.nextToken(); > camelCase.append(word.charAt(0)); > } >Index: META-INF/MANIFEST.MF >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/META-INF/MANIFEST.MF,v >retrieving revision 1.40 >diff -u -r1.40 MANIFEST.MF >--- META-INF/MANIFEST.MF 8 Nov 2006 22:06:59 -0000 1.40 >+++ META-INF/MANIFEST.MF 6 Dec 2006 23:25:10 -0000 >@@ -38,7 +38,7 @@ > org.eclipse.ui.internal.expressions;x-internal:=true, > org.eclipse.ui.internal.handlers;x-internal:=true, > org.eclipse.ui.internal.help;x-internal:=true, >- org.eclipse.ui.internal.incubator;x-friends:="org.eclipse.ui", >+ org.eclipse.ui.internal.incubator;x-friends:="org.eclipse.ui,org.eclipse.ui.ide", > org.eclipse.ui.internal.intro;x-internal:=true, > org.eclipse.ui.internal.keys;x-internal:=true, > org.eclipse.ui.internal.layout;x-friends:="org.eclipse.ui.presentations.r21,org.eclipse.ui.intro",
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 167010
:
55173
|
55377