Java Doc for JavaProjectHelper.java in  » IDE-Eclipse » jdt » org » eclipse » jdt » testplugin » 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.testplugin 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.jdt.testplugin.JavaProjectHelper

JavaProjectHelper
public class JavaProjectHelper (Code)
Helper methods to set up a IJavaProject.


Field Summary
final public static  intCOUNT_CLASSES_JUNIT_SRC_381
    
final public static  intCOUNT_CLASSES_MYLIB
    
final public static  intCOUNT_CLASSES_RT_STUBS_15
    
final public static  intCOUNT_INTERFACES_JUNIT_SRC_381
    
final public static  intCOUNT_INTERFACES_RT_STUBS_15
    
final public static  IPathJUNIT_SRC
    
final public static  IPathJUNIT_SRC_381
    
final public static  StringJUNIT_SRC_ENCODING
    
final public static  IPathMYLIB
    
final public static  IPathNLS_LIB
    
final public static  IPathRT_STUBS_13
    
final public static  IPathRT_STUBS_15
    


Method Summary
public static  IPackageFragmentRootaddClassFolder(IJavaProject jproject, String containerName, IPath sourceAttachPath, IPath sourceAttachRoot)
     Creates and adds a class folder to the class path.
public static  IPackageFragmentRootaddClassFolderWithImport(IJavaProject jproject, String containerName, IPath sourceAttachPath, IPath sourceAttachRoot, File zipFile)
     Creates and adds a class folder to the class path and imports all files contained in the given ZIP file.
public static  IPackageFragmentRootaddLibrary(IJavaProject jproject, IPath path)
     Adds a library entry to a IJavaProject.
public static  IPackageFragmentRootaddLibrary(IJavaProject jproject, IPath path, IPath sourceAttachPath, IPath sourceAttachRoot)
     Adds a library entry with source attachment to a IJavaProject.
public static  IPackageFragmentRootaddLibraryWithImport(IJavaProject jproject, IPath jarPath, IPath sourceAttachPath, IPath sourceAttachRoot)
     Copies the library into the project and adds it as library entry.
public static  IPackageFragmentRootaddRTJar(IJavaProject jproject)
     Adds a library entry pointing to a JRE (stubs only) and sets the right compiler options.
public static  IPackageFragmentRootaddRTJar13(IJavaProject jproject)
    
public static  voidaddRequiredProject(IJavaProject jproject, IJavaProject required)
     Adds a required project entry.
public static  IPackageFragmentRootaddSourceContainer(IJavaProject jproject, String containerName)
     Adds a source container to a IJavaProject.
public static  IPackageFragmentRootaddSourceContainer(IJavaProject jproject, String containerName, IPath[] exclusionFilters)
     Adds a source container to a IJavaProject.
public static  IPackageFragmentRootaddSourceContainer(IJavaProject jproject, String containerName, IPath[] inclusionFilters, IPath[] exclusionFilters)
     Adds a source container to a IJavaProject.
public static  IPackageFragmentRootaddSourceContainerWithImport(IJavaProject jproject, String containerName, File zipFile, String containerEncoding)
     Adds a source container to a IJavaProject and imports all files contained in the given ZIP file.
public static  IPackageFragmentRootaddSourceContainerWithImport(IJavaProject jproject, String containerName, File zipFile, String containerEncoding, IPath[] exclusionFilters)
     Adds a source container to a IJavaProject and imports all files contained in the given ZIP file.
public static  voidaddToClasspath(IJavaProject jproject, IClasspathEntry cpe)
    
public static  IPackageFragmentRootaddVariableEntry(IJavaProject jproject, IPath path, IPath sourceAttachPath, IPath sourceAttachRoot)
     Adds a variable entry with source attachment to a IJavaProject.
public static  IPackageFragmentRootaddVariableRTJar(IJavaProject jproject, String libVarName, String srcVarName, String srcrootVarName)
     Adds a variable entry pointing to a current JRE (stubs only) and sets the compiler compliance level on the project accordingly. The arguments specify the names of the variables to be used. Currently, the compiler compliance level is set to 1.5.
Parameters:
  jproject - the project to add the variable RT JAR
Parameters:
  libVarName - Name of the variable for the library
Parameters:
  srcVarName - Name of the variable for the source attachment.
public static  IPackageFragmentRootaddVariableRTJar13(IJavaProject jproject, String libVarName, String srcVarName, String srcrootVarName)
    
public static  voidclear(IJavaProject jproject, IClasspathEntry[] entries)
    
public static  IJavaProjectcreateJavaProject(String projectName, String binFolderName)
     Creates a IJavaProject.
public static  IJavaProjectcreateJavaProjectWithJUnitSource(String projectName, String srcContainerName, String outputFolderName)
     Creates a Java project with JUnit source and rt.jar from JavaProjectHelper.addVariableRTJar(IJavaProject,String,String,String) .
public static  voiddelete(IJavaElement elem)
    
public static  IPath[]findRtJar(IPath rtStubsPath)
    
public static  voidimportResources(IContainer importTarget, String bundleSourcePath)
     Imports resources from bundleSourcePath to importTarget.
public static  voidperformDummySearch()
    
public static  voidremoveFromClasspath(IJavaProject jproject, IPath path)
    
public static  voidremoveSourceContainer(IJavaProject jproject, String containerName)
     Removes a source folder from a IJavaProject.
public static  voidset13CompilerOptions(Map options)
    
public static  voidset14CompilerOptions(IJavaProject project)
     Sets the compiler options to 1.4 for the given project.
public static  voidset14CompilerOptions(Map options)
    
public static  voidset15CompilerOptions(IJavaProject project)
     Sets the compiler options to 1.5 for the given project.
public static  voidset15CompilerOptions(Map options)
    
public static  booleansetAutoBuilding(boolean state)
     Sets auto-building state for the test workspace.

Field Detail
COUNT_CLASSES_JUNIT_SRC_381
final public static int COUNT_CLASSES_JUNIT_SRC_381(Code)



COUNT_CLASSES_MYLIB
final public static int COUNT_CLASSES_MYLIB(Code)



COUNT_CLASSES_RT_STUBS_15
final public static int COUNT_CLASSES_RT_STUBS_15(Code)



COUNT_INTERFACES_JUNIT_SRC_381
final public static int COUNT_INTERFACES_JUNIT_SRC_381(Code)



COUNT_INTERFACES_RT_STUBS_15
final public static int COUNT_INTERFACES_RT_STUBS_15(Code)



JUNIT_SRC
final public static IPath JUNIT_SRC(Code)

See Also:   JavaProjectHelper.JUNIT_SRC_381



JUNIT_SRC_381
final public static IPath JUNIT_SRC_381(Code)



JUNIT_SRC_ENCODING
final public static String JUNIT_SRC_ENCODING(Code)



MYLIB
final public static IPath MYLIB(Code)



NLS_LIB
final public static IPath NLS_LIB(Code)



RT_STUBS_13
final public static IPath RT_STUBS_13(Code)

See Also:   JavaProjectHelper.RT_STUBS_15



RT_STUBS_15
final public static IPath RT_STUBS_15(Code)





Method Detail
addClassFolder
public static IPackageFragmentRoot addClassFolder(IJavaProject jproject, String containerName, IPath sourceAttachPath, IPath sourceAttachRoot) throws CoreException(Code)
Creates and adds a class folder to the class path.
Parameters:
  jproject - The parent project
Parameters:
  containerName -
Parameters:
  sourceAttachPath - The source attachment path
Parameters:
  sourceAttachRoot - The source attachment root path The handle of the created root
throws:
  CoreException -



addClassFolderWithImport
public static IPackageFragmentRoot addClassFolderWithImport(IJavaProject jproject, String containerName, IPath sourceAttachPath, IPath sourceAttachRoot, File zipFile) throws IOException, CoreException, InvocationTargetException(Code)
Creates and adds a class folder to the class path and imports all files contained in the given ZIP file.
Parameters:
  jproject - The parent project
Parameters:
  containerName -
Parameters:
  sourceAttachPath - The source attachment path
Parameters:
  sourceAttachRoot - The source attachment root path
Parameters:
  zipFile - The handle of the created root
throws:
  IOException -
throws:
  CoreException -
throws:
  InvocationTargetException -



addLibrary
public static IPackageFragmentRoot addLibrary(IJavaProject jproject, IPath path) throws JavaModelException(Code)
Adds a library entry to a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  path - The path of the library to add The handle of the created root
throws:
  JavaModelException -



addLibrary
public static IPackageFragmentRoot addLibrary(IJavaProject jproject, IPath path, IPath sourceAttachPath, IPath sourceAttachRoot) throws JavaModelException(Code)
Adds a library entry with source attachment to a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  path - The path of the library to add
Parameters:
  sourceAttachPath - The source attachment path
Parameters:
  sourceAttachRoot - The source attachment root path The handle of the created root
throws:
  JavaModelException -



addLibraryWithImport
public static IPackageFragmentRoot addLibraryWithImport(IJavaProject jproject, IPath jarPath, IPath sourceAttachPath, IPath sourceAttachRoot) throws IOException, CoreException(Code)
Copies the library into the project and adds it as library entry.
Parameters:
  jproject - The parent project
Parameters:
  jarPath -
Parameters:
  sourceAttachPath - The source attachment path
Parameters:
  sourceAttachRoot - The source attachment root path The handle of the created root
throws:
  IOException -
throws:
  CoreException -



addRTJar
public static IPackageFragmentRoot addRTJar(IJavaProject jproject) throws CoreException(Code)
Adds a library entry pointing to a JRE (stubs only) and sets the right compiler options.

Currently, the compiler compliance level is 1.5.
Parameters:
  jproject - target the new package fragment root
throws:
  CoreException -




addRTJar13
public static IPackageFragmentRoot addRTJar13(IJavaProject jproject) throws CoreException(Code)



addRequiredProject
public static void addRequiredProject(IJavaProject jproject, IJavaProject required) throws JavaModelException(Code)
Adds a required project entry.
Parameters:
  jproject - Parent project
Parameters:
  required - Project to add to the build path
throws:
  JavaModelException - Creation failed



addSourceContainer
public static IPackageFragmentRoot addSourceContainer(IJavaProject jproject, String containerName) throws CoreException(Code)
Adds a source container to a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  containerName - The name of the new source container The handle to the new source container
throws:
  CoreException - Creation failed



addSourceContainer
public static IPackageFragmentRoot addSourceContainer(IJavaProject jproject, String containerName, IPath[] exclusionFilters) throws CoreException(Code)
Adds a source container to a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  containerName - The name of the new source container
Parameters:
  exclusionFilters - Exclusion filters to set The handle to the new source container
throws:
  CoreException - Creation failed



addSourceContainer
public static IPackageFragmentRoot addSourceContainer(IJavaProject jproject, String containerName, IPath[] inclusionFilters, IPath[] exclusionFilters) throws CoreException(Code)
Adds a source container to a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  containerName - The name of the new source container
Parameters:
  inclusionFilters - Inclusion filters to set
Parameters:
  exclusionFilters - Exclusion filters to set The handle to the new source container
throws:
  CoreException - Creation failed



addSourceContainerWithImport
public static IPackageFragmentRoot addSourceContainerWithImport(IJavaProject jproject, String containerName, File zipFile, String containerEncoding) throws InvocationTargetException, CoreException, IOException(Code)
Adds a source container to a IJavaProject and imports all files contained in the given ZIP file.
Parameters:
  jproject - The parent project
Parameters:
  containerName - Name of the source container
Parameters:
  zipFile - Archive to import
Parameters:
  containerEncoding - encoding for the generated source container The handle to the new source container
throws:
  InvocationTargetException - Creation failed
throws:
  CoreException - Creation failed
throws:
  IOException - Creation failed



addSourceContainerWithImport
public static IPackageFragmentRoot addSourceContainerWithImport(IJavaProject jproject, String containerName, File zipFile, String containerEncoding, IPath[] exclusionFilters) throws InvocationTargetException, CoreException, IOException(Code)
Adds a source container to a IJavaProject and imports all files contained in the given ZIP file.
Parameters:
  jproject - The parent project
Parameters:
  containerName - Name of the source container
Parameters:
  zipFile - Archive to import
Parameters:
  containerEncoding - encoding for the generated source container
Parameters:
  exclusionFilters - Exclusion filters to set The handle to the new source container
throws:
  InvocationTargetException - Creation failed
throws:
  CoreException - Creation failed
throws:
  IOException - Creation failed



addToClasspath
public static void addToClasspath(IJavaProject jproject, IClasspathEntry cpe) throws JavaModelException(Code)



addVariableEntry
public static IPackageFragmentRoot addVariableEntry(IJavaProject jproject, IPath path, IPath sourceAttachPath, IPath sourceAttachRoot) throws JavaModelException(Code)
Adds a variable entry with source attachment to a IJavaProject. Can return null if variable can not be resolved.
Parameters:
  jproject - The parent project
Parameters:
  path - The variable path
Parameters:
  sourceAttachPath - The source attachment path (variable path)
Parameters:
  sourceAttachRoot - The source attachment root path (variable path) The added package fragment root
throws:
  JavaModelException -



addVariableRTJar
public static IPackageFragmentRoot addVariableRTJar(IJavaProject jproject, String libVarName, String srcVarName, String srcrootVarName) throws CoreException(Code)
Adds a variable entry pointing to a current JRE (stubs only) and sets the compiler compliance level on the project accordingly. The arguments specify the names of the variables to be used. Currently, the compiler compliance level is set to 1.5.
Parameters:
  jproject - the project to add the variable RT JAR
Parameters:
  libVarName - Name of the variable for the library
Parameters:
  srcVarName - Name of the variable for the source attachment. Can be null.
Parameters:
  srcrootVarName - name of the variable for the source attachment root. Can be null. the new package fragment root
throws:
  CoreException - Creation failed



addVariableRTJar13
public static IPackageFragmentRoot addVariableRTJar13(IJavaProject jproject, String libVarName, String srcVarName, String srcrootVarName) throws CoreException(Code)



clear
public static void clear(IJavaProject jproject, IClasspathEntry[] entries) throws CoreException(Code)
Removes all files in the project and sets the given classpath
Parameters:
  jproject - The project to clear
Parameters:
  entries - The default class path to set
throws:
  CoreException - Clearing the project failed



createJavaProject
public static IJavaProject createJavaProject(String projectName, String binFolderName) throws CoreException(Code)
Creates a IJavaProject.
Parameters:
  projectName - The name of the project
Parameters:
  binFolderName - Name of the output folder Returns the Java project handle
throws:
  CoreException - Project creation failed



createJavaProjectWithJUnitSource
public static IJavaProject createJavaProjectWithJUnitSource(String projectName, String srcContainerName, String outputFolderName) throws CoreException, IOException, InvocationTargetException(Code)
Creates a Java project with JUnit source and rt.jar from JavaProjectHelper.addVariableRTJar(IJavaProject,String,String,String) .
Parameters:
  projectName - the project name
Parameters:
  srcContainerName - the source container name
Parameters:
  outputFolderName - the output folder name the IJavaProject
throws:
  CoreException -
throws:
  IOException -
throws:
  InvocationTargetException -
since:
   3.1



delete
public static void delete(IJavaElement elem) throws CoreException(Code)
Removes a IJavaElement
Parameters:
  elem - The element to remove
throws:
  CoreException - Removing failed
See Also:   JavaProjectHelper.ASSERT_NO_MIXED_LINE_DELIMIERS



findRtJar
public static IPath[] findRtJar(IPath rtStubsPath) throws CoreException(Code)

Parameters:
  rtStubsPath - the path to the RT stubs a rt.jar (stubs only)
throws:
  CoreException -



importResources
public static void importResources(IContainer importTarget, String bundleSourcePath) throws CoreException, IOException(Code)
Imports resources from bundleSourcePath to importTarget.
Parameters:
  importTarget - the parent container
Parameters:
  bundleSourcePath - the path to a folder containing resources
throws:
  CoreException - import failed
throws:
  IOException - import failed



performDummySearch
public static void performDummySearch() throws JavaModelException(Code)



removeFromClasspath
public static void removeFromClasspath(IJavaProject jproject, IPath path) throws JavaModelException(Code)



removeSourceContainer
public static void removeSourceContainer(IJavaProject jproject, String containerName) throws CoreException(Code)
Removes a source folder from a IJavaProject.
Parameters:
  jproject - The parent project
Parameters:
  containerName - Name of the source folder to remove
throws:
  CoreException - Remove failed



set13CompilerOptions
public static void set13CompilerOptions(Map options)(Code)
Sets the compiler options to 1.3
Parameters:
  options - The compiler options to configure



set14CompilerOptions
public static void set14CompilerOptions(IJavaProject project)(Code)
Sets the compiler options to 1.4 for the given project.
Parameters:
  project - the java project



set14CompilerOptions
public static void set14CompilerOptions(Map options)(Code)
Sets the compiler options to 1.4
Parameters:
  options - The compiler options to configure



set15CompilerOptions
public static void set15CompilerOptions(IJavaProject project)(Code)
Sets the compiler options to 1.5 for the given project.
Parameters:
  project - the java project



set15CompilerOptions
public static void set15CompilerOptions(Map options)(Code)
Sets the compiler options to 1.5
Parameters:
  options - The compiler options to configure



setAutoBuilding
public static boolean setAutoBuilding(boolean state) throws CoreException(Code)
Sets auto-building state for the test workspace.
Parameters:
  state - The new auto building state The previous state
throws:
  CoreException - Change failed



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.