Java Doc for CreatedModifiedFiles.java in  » IDE-Netbeans » api » org » netbeans » modules » apisupport » project » 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 Netbeans » api » org.netbeans.modules.apisupport.project 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.modules.apisupport.project.CreatedModifiedFiles

CreatedModifiedFiles
final public class CreatedModifiedFiles (Code)
Provide general infrastructure for performing miscellaneous operations upon NbModuleProject 's files, such as manifest.mf, bundle.properties, layer.xml, project.xml easily. See javadoc to individual methods below. After creating a CreatedModifiedFiles instance client may create CreatedModifiedFiles.Operation which then may be added to the CreatedModifiedFiles instance or just used itself. Both CreatedModifiedFiles and Operation provide methods to get sets of relative (to a project's base directory) paths which are going to be created and/or modified. These sets may be obtained before added operation are run so they can be e.g. shown by wizard before any files are actually created.
author:
   Martin Krauskopf

Inner Class :public interface Operation
Inner Class :public interface LayerOperation


Constructor Summary
public  CreatedModifiedFiles(Project project)
     Create instance for managing given NbModuleProject 's files.

Method Summary
public  voidadd(Operation operation)
     Adds given Operation to a list of operations that will be run after calling CreatedModifiedFiles.run() .
public  OperationaddLoaderSection(String dataLoaderClass, String installBefore)
     Provides Operation that will create a new section in the project's manifest registering a given dataLoaderClass.
 Name: org/netbeans/modules/myprops/MyPropsLoader.class
 OpenIDE-Module-Class: Loader
 

Parameters:
  dataLoaderClass - e.g.
public  OperationaddLookupRegistration(String interfaceClass, String implClass, boolean inTests)
     Provides Operation that will register an implClass implementation of interfaceClass interface in the lookup. If a file representing interfaceClass service already exists in META-INF/services directory implClass will be appended to the end of the list of implementations.
public  OperationaddModuleDependency(String codeNameBase, String releaseVersion, SpecificationVersion version, boolean useInCompiler)
     Add a dependency to a list of module dependencies of this project.
public  CreatedModifiedFiles.OperationaddModuleDependency(String codeNameBase)
     Delegates to CreatedModifiedFiles.addModuleDependency(String,String,SpecificationVersion,boolean) passing a given code name base, null as release version, null as version and true as useInCompiler arguments.
public  OperationbundleKey(String bundlePath, String key, String value)
     Provides Operation that will add given value under a specified key into the custom bundle which is specified by the bundlePath parameter.
public  OperationbundleKeyDefaultBundle(String key, String value)
     Provides Operation that will add given value under a specified key into the project's default localized bundle which is specified in the project's manifest.
public  OperationcreateFile(String path, FileObject content)
     Returns Operation for creating custom file in the project file hierarchy.
Parameters:
  path - relative to a project directory where a file to be created
Parameters:
  content - content for the file being created.
public  OperationcreateFileWithSubstitutions(String path, FileObject content, Map<String, String> tokens)
     Returns an Operation for creating custom file in the project file hierarchy with an option to replace tokens from a given content with custom string.
public  CreatedModifiedFiles.OperationcreateLayerAttribute(String parentPath, String attrName, Object attrValue)
     Creates a new arbitrary <attr> element.
Parameters:
  parentPath - path to a file or a folder in aproject's layer.
public  OperationcreateLayerEntry(String layerPath, FileObject content, Map<String, String> substitutionTokens, String localizedDisplayName, Map<String, Object> fileAttributes)
     Creates an entry (file element) in the project's layer.
public  String[]getCreatedPaths()
    
public  String[]getInvalidPaths()
    
 LayerUtils.LayerHandlegetLayerHandle()
    
public  String[]getModifiedPaths()
    
public static  FileObjectgetTemplate(String name)
     Convenience method to load a file template from the standard location.
public  OperationlayerModifications(LayerOperation op, Set<String> externalFiles)
     Make structural modifications to the project's XML layer. The operations may be expressed as filesystem calls.
Parameters:
  op - a callback for the actual changes to make
Parameters:
  externalFiles - a list of simple filenames of new data files whichare to be created in the layer and which will therefore appearon disk alongside the layer, usually with the same names (unlessthey conflict with existing files); you still need to create themyourself using e.g.
public  OperationmanifestModification(String section, Map<String, String> attributes)
     Adds new attributes into manifest file.
Parameters:
  section - the name of the section or null for the main section.
Parameters:
  attributes - <String,String> map mapping attributes names and values.
public  OperationorderLayerEntry(String layerPath, String precedingItemName, String newItemName, String followingItemName)
     Order a new entry in a project layer between two others.
Parameters:
  layerPath - folder path in a project's layer.
public  OperationpropertiesModification(String propertyPath, Map<String, String> properties)
     Adds new properties into property file.
Parameters:
  propertyPath - path representing properties file relative to a project directory where allproperties will be put in.
public  voidrun()
     Performs in turn Operation.run on all operations added to this instance in order in which operations have been added.


Constructor Detail
CreatedModifiedFiles
public CreatedModifiedFiles(Project project)(Code)
Create instance for managing given NbModuleProject 's files.
Parameters:
  project - project this instance will operate upon




Method Detail
add
public void add(Operation operation)(Code)
Adds given Operation to a list of operations that will be run after calling CreatedModifiedFiles.run() . Operations are run in the order in which they have been added. Also files which would be created by a given operation are added to lists of paths returned by CreatedModifiedFiles.getModifiedPaths() or CreatedModifiedFiles.getCreatedPaths() immediately. @param operation operation to be added



addLoaderSection
public Operation addLoaderSection(String dataLoaderClass, String installBefore)(Code)
Provides Operation that will create a new section in the project's manifest registering a given dataLoaderClass.
 Name: org/netbeans/modules/myprops/MyPropsLoader.class
 OpenIDE-Module-Class: Loader
 

Parameters:
  dataLoaderClass - e.g. org/netbeans/modules/myprops/MyPropsLoader(without .class extension)
Parameters:
  installBefore - content of Install-Before attribute, or null if notspecified



addLookupRegistration
public Operation addLookupRegistration(String interfaceClass, String implClass, boolean inTests)(Code)
Provides Operation that will register an implClass implementation of interfaceClass interface in the lookup. If a file representing interfaceClass service already exists in META-INF/services directory implClass will be appended to the end of the list of implementations. If it doesn't exist a new file will be created.
Parameters:
  interfaceClass - e.g. org.example.spi.somemodule.ProvideMe
Parameters:
  implClass - e.g. org.example.module1.ProvideMeImpl
Parameters:
  inTests - if true, add to test/unit/src/META-INF/services/, else to src/META-INF/services/



addModuleDependency
public Operation addModuleDependency(String codeNameBase, String releaseVersion, SpecificationVersion version, boolean useInCompiler)(Code)
Add a dependency to a list of module dependencies of this project. This means editing of project's nbproject/project.xml. All parameters refers to a module this module will depend on. If a project already has a given dependency it will not be added.
Parameters:
  codeNameBase - codename base
Parameters:
  releaseVersion - release version, if null will be taken from theentry found in platform
Parameters:
  version - specification version (see SpecificationVersion),if null will be taken from the entry found in platform
Parameters:
  useInCompiler - do this module needs a module beeing added at acompile time?



addModuleDependency
public CreatedModifiedFiles.Operation addModuleDependency(String codeNameBase)(Code)
Delegates to CreatedModifiedFiles.addModuleDependency(String,String,SpecificationVersion,boolean) passing a given code name base, null as release version, null as version and true as useInCompiler arguments.



bundleKey
public Operation bundleKey(String bundlePath, String key, String value)(Code)
Provides Operation that will add given value under a specified key into the custom bundle which is specified by the bundlePath parameter.



bundleKeyDefaultBundle
public Operation bundleKeyDefaultBundle(String key, String value)(Code)
Provides Operation that will add given value under a specified key into the project's default localized bundle which is specified in the project's manifest.



createFile
public Operation createFile(String path, FileObject content)(Code)
Returns Operation for creating custom file in the project file hierarchy.
Parameters:
  path - relative to a project directory where a file to be created
Parameters:
  content - content for the file being created. Content may addresseither text or binary data.



createFileWithSubstitutions
public Operation createFileWithSubstitutions(String path, FileObject content, Map<String, String> tokens)(Code)
Returns an Operation for creating custom file in the project file hierarchy with an option to replace tokens from a given content with custom string. The result will be stored into a file representing by a given path.
Parameters:
  path - relative to a project directory where a file to be created
Parameters:
  content - content for the file being created
Parameters:
  tokens - properties with values to be passed to FreeMarker(in addition to: name, nameAndExt, user, date, time, and project.license)



createLayerAttribute
public CreatedModifiedFiles.Operation createLayerAttribute(String parentPath, String attrName, Object attrValue)(Code)
Creates a new arbitrary <attr> element.
Parameters:
  parentPath - path to a file or a folder in aproject's layer. It must exist.
Parameters:
  attrName - value of the name attribute of the <attr>element.
Parameters:
  attrValue - value of the attribute (may specially be a string prefixed with "newvalue:" or "methodvalue:") see Operation



createLayerEntry
public Operation createLayerEntry(String layerPath, FileObject content, Map<String, String> substitutionTokens, String localizedDisplayName, Map<String, Object> fileAttributes)(Code)
Creates an entry (file element) in the project's layer. Also may create and/or modify other files as it is needed.
Parameters:
  layerPath - path in a project's layer. Folders which don't existyet will be created. (e.g.Menu/Tools/org-example-module1-BeepAction.instance).
Parameters:
  content - became content of a file, or null
Parameters:
  substitutionTokens - see CreatedModifiedFiles.createFileWithSubstitutions for details;may be null to not use FreeMarker
Parameters:
  localizedDisplayName - if it is not a nullSystemFileSystem.localizingBundle attribute will becreated with the stringvalue to a default bundle (from manifest).Also an appropriate entry will be added into the bundle.
Parameters:
  fileAttributes - <String,Object> map. key in the map is thename of the file attribute value is the actual value, currentlysupported types are Boolean and String Generates
<attr name="KEY" stringvalue="VALUE"/> or <attr name="KEY" booleanvalue="VALUE"/>
see Operation



getCreatedPaths
public String[] getCreatedPaths()(Code)



getInvalidPaths
public String[] getInvalidPaths()(Code)



getLayerHandle
LayerUtils.LayerHandle getLayerHandle()(Code)



getModifiedPaths
public String[] getModifiedPaths()(Code)



getTemplate
public static FileObject getTemplate(String name)(Code)
Convenience method to load a file template from the standard location.
Parameters:
  name - a simple filename that file from the Templates/NetBeansModuleDevelopment-files layer folder



layerModifications
public Operation layerModifications(LayerOperation op, Set<String> externalFiles)(Code)
Make structural modifications to the project's XML layer. The operations may be expressed as filesystem calls.
Parameters:
  op - a callback for the actual changes to make
Parameters:
  externalFiles - a list of simple filenames of new data files whichare to be created in the layer and which will therefore appearon disk alongside the layer, usually with the same names (unlessthey conflict with existing files); you still need to create themyourself using e.g. FileObject.createData and FileObject.getOutputStream the operation handle



manifestModification
public Operation manifestModification(String section, Map<String, String> attributes)(Code)
Adds new attributes into manifest file.
Parameters:
  section - the name of the section or null for the main section.
Parameters:
  attributes - <String,String> map mapping attributes names and values. see Operation



orderLayerEntry
public Operation orderLayerEntry(String layerPath, String precedingItemName, String newItemName, String followingItemName)(Code)
Order a new entry in a project layer between two others.
Parameters:
  layerPath - folder path in a project's layer. (e.g. Loaders/text/x-java/Actions).
Parameters:
  precedingItemName - item to be before newItemName (may be null)
Parameters:
  newItemName - the new item (must already exist!)
Parameters:
  followingItemName - item to be after newItemName (may be null)



propertiesModification
public Operation propertiesModification(String propertyPath, Map<String, String> properties)(Code)
Adds new properties into property file.
Parameters:
  propertyPath - path representing properties file relative to a project directory where allproperties will be put in. If such a file does not exist it is created.
Parameters:
  properties - <String,String> map mapping properties names and values. see Operation



run
public void run() throws IOException(Code)
Performs in turn Operation.run on all operations added to this instance in order in which operations have been added.



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.