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 181990 Details for
Bug 328366
Need way for completionProposal extensions to supply autoactivation character preferences
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
328366.patch (text/plain), 9.28 KB, created by
Nick Sandonato
on 2010-10-28 15:58:27 EDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Nick Sandonato
Created:
2010-10-28 15:58:27 EDT
Size:
9.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.wst.sse.ui >Index: schema/completionProposal.exsd >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.ui/schema/completionProposal.exsd,v >retrieving revision 1.2 >diff -u -r1.2 completionProposal.exsd >--- schema/completionProposal.exsd 2 Jun 2010 03:00:37 -0000 1.2 >+++ schema/completionProposal.exsd 28 Oct 2010 19:58:07 -0000 >@@ -195,6 +195,16 @@ > </documentation> > </annotation> > </attribute> >+ <attribute name="autoActivationDelegate" type="string"> >+ <annotation> >+ <documentation> >+ Identifies a class that is responsible for identifying auto-activation characters for the associated content and partition type. >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java" basedOn="org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate:"/> >+ </appInfo> >+ </annotation> >+ </attribute> > </complexType> > </element> > >Index: src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java >=================================================================== >RCS file: src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java >diff -N src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/wst/sse/ui/contentassist/AutoActivationDelegate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+/******************************************************************************* >+ * Copyright (c) 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 >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * IBM Corporation - initial API and implementation >+ *******************************************************************************/ >+package org.eclipse.wst.sse.ui.contentassist; >+ >+public abstract class AutoActivationDelegate { >+ >+ public char[] getCompletionProposalAutoActivationCharacters() { >+ return null; >+ } >+ >+ public char[] getContextInformationAutoActivationCharacters() { >+ return null; >+ } >+ >+ public abstract void dispose(); >+} >Index: src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java,v >retrieving revision 1.7.2.3 >diff -u -r1.7.2.3 StructuredContentAssistProcessor.java >--- src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java 25 Aug 2010 23:55:41 -0000 1.7.2.3 >+++ src/org/eclipse/wst/sse/ui/contentassist/StructuredContentAssistProcessor.java 28 Oct 2010 19:58:07 -0000 >@@ -176,6 +176,8 @@ > /** the context information validator for this processor */ > private IContextInformationValidator fContextInformationValidator; > >+ private AutoActivationDelegate fAutoActivation; >+ > /** > * <p>Create a new content assist processor for a specific partition type. > * The content type will be determined when a document is set on the viewer</p> >@@ -291,7 +293,7 @@ > * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getCompletionProposalAutoActivationCharacters() > */ > public char[] getCompletionProposalAutoActivationCharacters() { >- return null; >+ return (fAutoActivation != null) ? fAutoActivation.getCompletionProposalAutoActivationCharacters() : null; > } > > /** >@@ -301,7 +303,7 @@ > * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationAutoActivationCharacters() > */ > public char[] getContextInformationAutoActivationCharacters() { >- return null; >+ return (fAutoActivation != null) ? fAutoActivation.getContextInformationAutoActivationCharacters() : null; > } > > /** >@@ -333,6 +335,10 @@ > * @see org.eclipse.wst.sse.ui.internal.IReleasable#release() > */ > public void release() { >+ if (fAutoActivation != null) { >+ fAutoActivation.dispose(); >+ fAutoActivation = null; >+ } > if(this.fPreferenceStore != null) { > this.fPreferenceStore.removePropertyChangeListener(this); > this.fPreferenceStore = null; >@@ -891,6 +897,10 @@ > model = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)newInput); > if(model != null) { > fContentTypeID = model.getContentTypeIdentifier(); >+ if (fAutoActivation != null) { >+ fAutoActivation.dispose(); >+ } >+ fAutoActivation = CompletionProposalComputerRegistry.getDefault().getActivator(fContentTypeID, fPartitionTypeID); > } > } finally { > if(model != null) { >Index: src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java,v >retrieving revision 1.1 >diff -u -r1.1 CompletionProposalComputerDescriptor.java >--- src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java 26 Feb 2010 20:59:19 -0000 1.1 >+++ src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerDescriptor.java 28 Oct 2010 19:58:07 -0000 >@@ -470,6 +470,7 @@ > ContentAssistUtils.checkExtensionAttributeNotNull(partitionTypeID, ATTR_ID, partitionTypes[partitionTypeIndex]); > > CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, partitionTypeID, desc); >+ CompletionProposalComputerRegistry.getDefault().putAutoActivator(contentTypeID, partitionTypeID, partitionTypes[partitionTypeIndex]); > } > } else { > CompletionProposalComputerRegistry.getDefault().putDescription(contentTypeID, null, desc); >Index: src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java >=================================================================== >RCS file: /cvsroot/webtools/sourceediting/plugins/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java,v >retrieving revision 1.2 >diff -u -r1.2 CompletionProposalComputerRegistry.java >--- src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java 28 Apr 2010 17:32:22 -0000 1.2 >+++ src/org/eclipse/wst/sse/ui/internal/contentassist/CompletionProposalComputerRegistry.java 28 Oct 2010 19:58:07 -0000 >@@ -30,6 +30,7 @@ > import org.eclipse.core.runtime.Status; > import org.eclipse.core.runtime.content.IContentType; > import org.eclipse.jface.preference.IPreferenceStore; >+import org.eclipse.wst.sse.ui.contentassist.AutoActivationDelegate; > import org.eclipse.wst.sse.ui.internal.Logger; > import org.eclipse.wst.sse.ui.internal.SSEUIPlugin; > >@@ -55,6 +56,9 @@ > > /** The extension schema name for element ID attributes */ > private static final String ATTR_ID= "id"; //$NON-NLS-1$ >+ >+ /** The extension schema name for the partition's auto-activation class */ >+ private static final String ATTR_AUTO_ACTIVATION_CLASS = "autoActivationClass"; //$NON-NLS-1$ > > /** preference key to keep track of the last known number of content assist computers */ > private static final String NUM_COMPUTERS_PREF_KEY = "content_assist_number_of_computers"; //$NON-NLS-1$ >@@ -235,6 +239,52 @@ > context.putDescriptor(partitionTypeID, descriptor); > } > >+ private Map fAutoActivators = new HashMap(); >+ >+ static class Activator { >+ IConfigurationElement fElement; >+ >+ public Activator(IConfigurationElement element) { >+ fElement = element; >+ } >+ >+ AutoActivationDelegate createAutoActivation() { >+ AutoActivationDelegate activation = null; >+ if (fElement != null) { >+ try { >+ activation = (AutoActivationDelegate) fElement.createExecutableExtension(ATTR_AUTO_ACTIVATION_CLASS); >+ } catch (CoreException e) { >+ } >+ } >+ return activation; >+ } >+ >+ } >+ >+ void putAutoActivator(String contentTypeID, String partitionTypeID, IConfigurationElement element) { >+ String autoActivationClass = element.getAttribute(ATTR_AUTO_ACTIVATION_CLASS); >+ if (autoActivationClass == null) >+ return; >+ >+ Map partitionMap = (Map) fAutoActivators.get(contentTypeID); >+ if (partitionMap == null) { >+ partitionMap = new HashMap(); >+ fAutoActivators.put(contentTypeID, partitionMap); >+ } >+ partitionMap.put(partitionTypeID, new Activator(element)); >+ } >+ >+ public AutoActivationDelegate getActivator(String contentTypeID, String partitionTypeID) { >+ Map partitionMap = (Map) fAutoActivators.get(contentTypeID); >+ if (partitionMap != null) { >+ Activator activator = (Activator) partitionMap.get(partitionTypeID); >+ if (activator != null) { >+ return activator.createAutoActivation(); >+ } >+ } >+ return null; >+ } >+ > /** > * @param contentTypeID get only descriptors associated with this content type > * @param partitionTypeID get only descriptors associated with this partition type as well
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 328366
:
181990
|
181991