Source Code Cross Referenced for JavaCompletionProcessor.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » internal » ui » text » java » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jdt » org.eclipse.jdt.internal.ui.text.java 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*******************************************************************************
002:         * Copyright (c) 2000, 2006 IBM Corporation and others.
003:         * All rights reserved. This program and the accompanying materials
004:         * are made available under the terms of the Eclipse Public License v1.0
005:         * which accompanies this distribution, and is available at
006:         * http://www.eclipse.org/legal/epl-v10.html
007:         *
008:         * Contributors:
009:         *     IBM Corporation - initial API and implementation
010:         *******************************************************************************/package org.eclipse.jdt.internal.ui.text.java;
011:
012:        import java.util.Hashtable;
013:        import java.util.List;
014:
015:        import org.eclipse.core.runtime.IProgressMonitor;
016:
017:        import org.eclipse.jface.text.ITextViewer;
018:        import org.eclipse.jface.text.contentassist.ContentAssistant;
019:        import org.eclipse.jface.text.contentassist.IContextInformationValidator;
020:
021:        import org.eclipse.ui.IEditorPart;
022:
023:        import org.eclipse.jdt.core.JavaCore;
024:
025:        import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
026:        import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
027:
028:        /**
029:         * Java completion processor.
030:         */
031:        public class JavaCompletionProcessor extends ContentAssistProcessor {
032:
033:            private final static String VISIBILITY = JavaCore.CODEASSIST_VISIBILITY_CHECK;
034:            private final static String ENABLED = "enabled"; //$NON-NLS-1$
035:            private final static String DISABLED = "disabled"; //$NON-NLS-1$
036:
037:            private IContextInformationValidator fValidator;
038:            protected final IEditorPart fEditor;
039:
040:            public JavaCompletionProcessor(IEditorPart editor,
041:                    ContentAssistant assistant, String partition) {
042:                super (assistant, partition);
043:                fEditor = editor;
044:            }
045:
046:            /**
047:             * Tells this processor to restrict its proposal to those element
048:             * visible in the actual invocation context.
049:             *
050:             * @param restrict <code>true</code> if proposals should be restricted
051:             */
052:            public void restrictProposalsToVisibility(boolean restrict) {
053:                Hashtable options = JavaCore.getOptions();
054:                Object value = options.get(VISIBILITY);
055:                if (value instanceof  String) {
056:                    String newValue = restrict ? ENABLED : DISABLED;
057:                    if (!newValue.equals(value)) {
058:                        options.put(VISIBILITY, newValue);
059:                        JavaCore.setOptions(options);
060:                    }
061:                }
062:            }
063:
064:            /**
065:             * Tells this processor to restrict is proposals to those
066:             * starting with matching cases.
067:             *
068:             * @param restrict <code>true</code> if proposals should be restricted
069:             */
070:            public void restrictProposalsToMatchingCases(boolean restrict) {
071:                // not yet supported
072:            }
073:
074:            /*
075:             * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#getContextInformationValidator()
076:             */
077:            public IContextInformationValidator getContextInformationValidator() {
078:                if (fValidator == null)
079:                    fValidator = new JavaParameterListValidator();
080:                return fValidator;
081:            }
082:
083:            /*
084:             * @see org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor#filterAndSort(java.util.List, org.eclipse.core.runtime.IProgressMonitor)
085:             */
086:            protected List filterAndSortProposals(List proposals,
087:                    IProgressMonitor monitor,
088:                    ContentAssistInvocationContext context) {
089:                ProposalSorterRegistry.getDefault().getCurrentSorter()
090:                        .sortProposals(context, proposals);
091:                return proposals;
092:            }
093:
094:            /*
095:             * @see org.eclipse.jdt.internal.ui.text.java.ContentAssistProcessor#createContext(org.eclipse.jface.text.ITextViewer, int)
096:             */
097:            protected ContentAssistInvocationContext createContext(
098:                    ITextViewer viewer, int offset) {
099:                return new JavaContentAssistInvocationContext(viewer, offset,
100:                        fEditor);
101:            }
102:        }
www_.__jav___a__2_s__.c__om_ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.