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 33271 Details for
Bug 119603
[api][content assist] allow contributions to filter and sort proposals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
119603.diff.txt
119603.diff.txt (text/plain), 12.53 KB, created by
Tom Hofmann
on 2006-01-19 11:25:21 EST
(
hide
)
Description:
119603.diff.txt
Filename:
MIME Type:
Creator:
Tom Hofmann
Created:
2006-01-19 11:25:21 EST
Size:
12.53 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/ui/text/java/AbstractProposalFilter.java >=================================================================== >RCS file: ui/org/eclipse/jdt/ui/text/java/AbstractProposalFilter.java >diff -N ui/org/eclipse/jdt/ui/text/java/AbstractProposalFilter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/ui/text/java/AbstractProposalFilter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,67 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.jdt.ui.text.java; >+ >+import org.eclipse.core.runtime.IConfigurationElement; >+ >+import org.eclipse.jface.text.contentassist.ICompletionProposal; >+ >+/** >+ * Abstract base class for filters contributed to the >+ * <code>org.eclipse.jdt.ui.javaCompletionProposalFilters</code> extension point. >+ * <p> >+ * Subclasses need to implement {@link #filter(ICompletionProposal)} and may override >+ * {@link #beginFiltering(ContentAssistInvocationContext) beginFiltering} and >+ * {@link #endFiltering() endFiltering}. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public abstract class AbstractProposalFilter { >+ >+ /** >+ * Creates a new filter. Note that subclasses must provide a zero-argument constructor to be >+ * instantiatable via {@link IConfigurationElement#createExecutableExtension(String)}. >+ */ >+ protected AbstractProposalFilter() { >+ } >+ >+ /** >+ * Called once before the content assist session. >+ * <p> >+ * Clients may override, the default implementation does nothing. >+ * </p> >+ * >+ * @param context the context of the content assist invocation >+ */ >+ public void beginFiltering(ContentAssistInvocationContext context) { >+ } >+ >+ /** >+ * Called once after the content assist session. >+ * <p> >+ * Clients may override, the default implementation does nothing. >+ * </p> >+ */ >+ public void endFiltering() { >+ } >+ >+ /** >+ * Returns <code>true</code> if a proposal is filtered, i.e. should not be displayed, >+ * <code>false</code> if it passes the filter. >+ * >+ * @param proposal the proposal to be filtered >+ * @return <code>true</code> to filter (remove) <code>proposal</code>, <code>false</code> >+ * to let it pass >+ */ >+ public abstract boolean filter(ICompletionProposal proposal); >+ >+} >Index: ui/org/eclipse/jdt/ui/text/java/AbstractProposalSorter.java >=================================================================== >RCS file: ui/org/eclipse/jdt/ui/text/java/AbstractProposalSorter.java >diff -N ui/org/eclipse/jdt/ui/text/java/AbstractProposalSorter.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ ui/org/eclipse/jdt/ui/text/java/AbstractProposalSorter.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,82 @@ >+/******************************************************************************* >+ * Copyright (c) 2006 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.jdt.ui.text.java; >+ >+import java.util.Comparator; >+ >+import org.eclipse.core.runtime.IConfigurationElement; >+ >+import org.eclipse.jface.text.contentassist.ICompletionProposal; >+ >+/** >+ * Abstract base class for sorters contributed to the >+ * <code>org.eclipse.jdt.ui.javaCompletionProposalFilters</code> extension point. >+ * <p> >+ * Subclasses need to implement {@link #compare(ICompletionProposal, ICompletionProposal)} and may >+ * override {@link #beginSorting(ContentAssistInvocationContext) beginSorting} and >+ * {@link #endSorting() endSorting}. >+ * </p> >+ * >+ * @since 3.2 >+ */ >+public abstract class AbstractProposalSorter implements Comparator { >+ >+ /** >+ * Creates a new sorter. Note that subclasses must provide a zero-argument constructor to be >+ * instantiatable via {@link IConfigurationElement#createExecutableExtension(String)}. >+ */ >+ protected AbstractProposalSorter() { >+ } >+ >+ /** >+ * This method may be removed if the class is ever converted to extend >+ * <code>Comparator<ICompletionProposal></code>. >+ * >+ * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object) >+ */ >+ public final int compare(Object o1, Object o2) { >+ ICompletionProposal p1= (ICompletionProposal) o1; >+ ICompletionProposal p2= (ICompletionProposal) o2; >+ >+ return compare(p1, p2); >+ } >+ >+ /** >+ * Called once before the content assist session. >+ * <p> >+ * Clients may override, the default implementation does nothing. >+ * </p> >+ * >+ * @param context the context of the content assist invocation >+ */ >+ public void beginSorting(ContentAssistInvocationContext context) { >+ } >+ >+ /** >+ * Called once after the content assist session. >+ * <p> >+ * Clients may override, the default implementation does nothing. >+ * </p> >+ */ >+ public void endSorting() { >+ } >+ >+ /** >+ * Implements the same contract as {@link Comparator#compare(Object, Object)} but with >+ * completion proposals as parameters. >+ * >+ * @param p1 the first proposal to be compared >+ * @param p2 the second proposal to be compared >+ * @return a negative integer, zero, or a positive integer as the first argument is less than, >+ * equal to, or greater than the second. >+ */ >+ public abstract int compare(ICompletionProposal p1, ICompletionProposal p2); >+} >Index: schema/javaCompletionProposalFilters.exsd >=================================================================== >RCS file: schema/javaCompletionProposalFilters.exsd >diff -N schema/javaCompletionProposalFilters.exsd >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ schema/javaCompletionProposalFilters.exsd 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,187 @@ >+<?xml version='1.0' encoding='UTF-8'?> >+<!-- Schema file written by PDE --> >+<schema targetNamespace="org.eclipse.jdt.ui"> >+<annotation> >+ <appInfo> >+ <meta.schema plugin="org.eclipse.jdt.ui" id="javaCompletionProposalFilters" name="Java Completion Proposal Filters and Sorters"/> >+ </appInfo> >+ <documentation> >+ This extension point allows to contribute sorters and filters that may modify the completion proposals displayed in the Java editor. >+<p>XXX this API is provisional and may change anytime during the course of 3.2</p> >+ </documentation> >+ </annotation> >+ >+ <element name="extension"> >+ <annotation> >+ <appInfo> >+ <meta.element labelAttribute="name"/> >+ </appInfo> >+ </annotation> >+ <complexType> >+ <choice> >+ <element ref="proposalSorter"/> >+ <element ref="proposalFilter"/> >+ </choice> >+ <attribute name="point" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The fully qualified identifier of the target extension point. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="id" type="string"> >+ <annotation> >+ <documentation> >+ The identifier of the extension instance, unique within the declaring plug-in (the plug-in's identifier will be prepended to form a platform-wide unique id). >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ The optional name of the extension instance. >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="proposalSorter"> >+ <annotation> >+ <appInfo> >+ <meta.element labelAttribute="name"/> >+ </appInfo> >+ <documentation> >+ A proposal sorter contribution. >+ </documentation> >+ </annotation> >+ <complexType> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The unique identifier of the sorter. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ The name of the sorter. >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The name of the class that implements the contributed sorter. The >+class must be a public implementation of >+<samp>java.util.Comparator</samp> >+and must have a public 0-argument constructor. >+<p> >+The sorter's <tt>compare(Object, Object)</tt> method will only be called with instances of <code>org.eclipse.jface.text.contentassist.ICompletionProposal</code>. >+</p> >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <element name="proposalFilter"> >+ <annotation> >+ <appInfo> >+ <meta.element labelAttribute="name"/> >+ </appInfo> >+ <documentation> >+ A proposal filter contribution. >+ </documentation> >+ </annotation> >+ <complexType> >+ <attribute name="id" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The unique identifier of the filter. >+ </documentation> >+ </annotation> >+ </attribute> >+ <attribute name="name" type="string"> >+ <annotation> >+ <documentation> >+ The name of the filter. >+ </documentation> >+ <appInfo> >+ <meta.attribute translatable="true"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ <attribute name="class" type="string" use="required"> >+ <annotation> >+ <documentation> >+ The name of the class that implements the contributed sorter. The >+class must be a public implementation of >+<samp>java.util.Comparator</samp> >+and must have a public 0-argument constructor. >+ </documentation> >+ <appInfo> >+ <meta.attribute kind="java"/> >+ </appInfo> >+ </annotation> >+ </attribute> >+ </complexType> >+ </element> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="since"/> >+ </appInfo> >+ <documentation> >+ 3.2 >+ </documentation> >+ </annotation> >+ >+ <annotation> >+ <appInfo> >+ <meta.section type="examples"/> >+ </appInfo> >+ <documentation> >+ >+ </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>
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 119603
: 33271