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


java.lang.Object
   org.netbeans.modules.visualweb.insync.Util

Util
final public class Util (Code)
Common utility methods for helping with NB, Swing and DOM objects.
author:
   Carl Quinn
author:
   Tor Norbye

Inner Class :public interface BufferResult

Field Summary
final public static  StringJAVA_EXT
    
final public static  StringJSPF_EXT
    
final public static  StringJSP_EXT
    
final public static  StringXML_EXT
    


Method Summary
public static  voidaddLocalStyleValueForElement(Element element, int style, String value)
    
public static  voidclearErrors(boolean delayed)
    
public static  StringcomputeFileName(Object location)
    
public static  intcomputeLine(Document doc, Element element)
    
public static  intcomputeLineNumber(Object location, int lineno)
    
public static  voidcustomizeCreation(DesignBean[] beans, FacesModel facesModel)
    
public static  voiddisplayErrorForFileObject(String message, FileObject fileObject, int line, int column)
    
public static  voiddisplayErrorForLocation(String message, Object location, int line, int column)
    
public static  ElementfindChild(String tag, Node parent, boolean create)
     Locate an element of the given tag name as a direct child of the given parent.
public static  DataObjectfindDataObject(FileObject file)
     Get/find the NB DataObject for a given FileObject
Parameters:
  file - The given FileObject.
public static  ElementfindDescendant(String tag, Node node)
     Find the given tag anywhere in the subtree of the given node (possibly including the node itself).
public static  DesignBeanfindHtmlContainer(DesignBean parent)
     Find the nearest DesignBean container that allows html children.
public static  DesignBeanfindParent(String className, DesignBean droppee, Node parentNode, boolean searchUp, FacesModel facesModel)
    
public static  DesignBeanfindParentBean(Node node)
    
public static  StringfromURL(String url)
    
public static  org.openide.nodes.Node.CookiegetCookie(FileObject file, Class type)
     Get the NB (data) cookie of a specified type for a given FileObject.
Parameters:
  file - The given FileObject.
Parameters:
  type - The cookie type to get.
public static  URLgetDocumentUrl(Document doc)
    
public static  ElementgetElement(DesignBean lb)
     Return the element for the live bean.
public static  FacesBeangetFacesBean(DesignBean lb)
     Return the FacesBean for the live bean.
public static  FileObjectgetFileObject(Document doc)
    
public static  ElementgetHtmlBodyForDocument(Document document)
    
public static  ElementgetHtmlBodyForMarkupFile(FileObject markupFile)
    
public static  DocumentFragmentgetHtmlDomFragmentForDocument(Document document)
    
public static  StringgetHtmlStream(org.w3c.dom.Node node)
     Generate the html string from the given node.
public static  StringgetHtmlStream(Element element)
    
public static  StringgetHtmlStream(org.w3c.dom.Document document)
     Generate the html string from the given element.
public static  StringgetHtmlStream(DocumentFragment df)
    
public static  MarkupBeangetMarkupBean(DesignBean lb)
     Return the MarkupBean for the live bean.
public static  String[]getMimeTypes()
    
public static  ListgetWebPages(Project project, boolean includePages, boolean includeFragments)
    
public static  booleanisBraveheartPage(Document dom)
    
public static  booleanisFormBean(FacesModel facesModel, DesignBean bean)
    
public static  booleanisGridMode(FacesModel facesModel)
     Return true if this document is in "grid mode" (objects should be positioned by absolute coordinates instead of in "flow" order.
public static  booleanisPageRootContainerDesignBean(DesignBean designBean)
    
public static  booleanisSpecialBean(DesignBean bean)
     Return true iff the given DesignBean is the body bean, or the form bean, OR THE LIVE BEAN CONTAINER.
public static  booleanisWebPage(FileObject fo)
    
public static  booleanisWoodstockPage(Document dom)
    
public static  BufferResultloadDocumentBuffer(StyledDocument doc)
     Load a swing abstract document into a buffer.
public static  BufferResultloadDocumentOrFileObjectBuffer(FileObject fileObject)
    
public static  BufferResultloadFileObjectBuffer(FileObject fileObject)
    
public static  voidremoveLocalStyleValueForElement(Element element, int style)
    
public static  URLresolveUrl(URL base, Document document, String src)
    
public static  StyledDocumentretrieveDocument(FileObject file, boolean open)
     Retrieve the swing Abstract Document from a given data object.
Parameters:
  file - The file object to retrieve the document from
Parameters:
  open - If true, open the document if it's not already open.
public static  voidselectErrors()
    
public static  booleansetDesignProperty(DesignBean bean, String attribute, int length)
     Attempt to set the given attribute on the bean to the given length and return true iff it succeeds.
public static  StringtruncateString(String s, int maxLength)
     Strip the given string to the given maximum length of characters.
public static  voidupdateItemProperty(FileObject file, String name, String newval)
     Update a Project GenericItem's property to a given value, removing the property if the value is null or blank, and not touching the property if the new value is not a change.
public static  voidupdateLocalStyleValuesForElement(Element element, StyleData[] stylesToSet, StyleData[] stylesToRemove)
    

Field Detail
JAVA_EXT
final public static String JAVA_EXT(Code)



JSPF_EXT
final public static String JSPF_EXT(Code)



JSP_EXT
final public static String JSP_EXT(Code)



XML_EXT
final public static String XML_EXT(Code)





Method Detail
addLocalStyleValueForElement
public static void addLocalStyleValueForElement(Element element, int style, String value)(Code)



clearErrors
public static void clearErrors(boolean delayed)(Code)



computeFileName
public static String computeFileName(Object location)(Code)



computeLine
public static int computeLine(Document doc, Element element)(Code)



computeLineNumber
public static int computeLineNumber(Object location, int lineno)(Code)



customizeCreation
public static void customizeCreation(DesignBean[] beans, FacesModel facesModel)(Code)



displayErrorForFileObject
public static void displayErrorForFileObject(String message, FileObject fileObject, int line, int column)(Code)



displayErrorForLocation
public static void displayErrorForLocation(String message, Object location, int line, int column)(Code)



findChild
public static Element findChild(String tag, Node parent, boolean create)(Code)
Locate an element of the given tag name as a direct child of the given parent. If no element of that tag name is found it will either return null if the create flag is false, or if the create flag is true, the element will be created and inserted before it is returned.


Parameters:
  tag - The tag name of the tag to be found or created
Parameters:
  parent - The element parent under which we want to search
Parameters:
  create - If true, create the element if it doesn't exist, otherwise return null if thetag is not found.




findDataObject
public static DataObject findDataObject(FileObject file)(Code)
Get/find the NB DataObject for a given FileObject
Parameters:
  file - The given FileObject. The corresponding DataObject.



findDescendant
public static Element findDescendant(String tag, Node node)(Code)
Find the given tag anywhere in the subtree of the given node (possibly including the node itself).
Parameters:
  tag - The name of the tag element to be found
Parameters:
  node - The root node to begin the search The first element in the node tree with the given tag name



findHtmlContainer
public static DesignBean findHtmlContainer(DesignBean parent)(Code)
Find the nearest DesignBean container that allows html children. This will typically be the parent you pass in, but if there are any beans up in the hierarchy that renders their own children, then the outermost such parent's parent will be used, since "renders children" jsf components cannot contain markup.



findParent
public static DesignBean findParent(String className, DesignBean droppee, Node parentNode, boolean searchUp, FacesModel facesModel)(Code)



findParentBean
public static DesignBean findParentBean(Node node)(Code)
Given a node, return the nearest DesignBean that "contains" it



fromURL
public static String fromURL(String url)(Code)



getCookie
public static org.openide.nodes.Node.Cookie getCookie(FileObject file, Class type)(Code)
Get the NB (data) cookie of a specified type for a given FileObject.
Parameters:
  file - The given FileObject.
Parameters:
  type - The cookie type to get. The cookie.



getDocumentUrl
public static URL getDocumentUrl(Document doc)(Code)



getElement
public static Element getElement(DesignBean lb)(Code)
Return the element for the live bean. May be null, for non faces beans for example.



getFacesBean
public static FacesBean getFacesBean(DesignBean lb)(Code)
Return the FacesBean for the live bean. May be null, for non faces live beans.
Parameters:
  lb - The live bean to get the faces bean for. May be null. the FacesBean corresponding to the live bean, or null.



getFileObject
public static FileObject getFileObject(Document doc)(Code)



getHtmlBodyForDocument
public static Element getHtmlBodyForDocument(Document document)(Code)



getHtmlBodyForMarkupFile
public static Element getHtmlBodyForMarkupFile(FileObject markupFile)(Code)



getHtmlDomFragmentForDocument
public static DocumentFragment getHtmlDomFragmentForDocument(Document document)(Code)



getHtmlStream
public static String getHtmlStream(org.w3c.dom.Node node)(Code)
Generate the html string from the given node. This will return an empty string unless the Node is an Element or a DocumentFragment or a Document.



getHtmlStream
public static String getHtmlStream(Element element)(Code)
Generate the html string from the given element



getHtmlStream
public static String getHtmlStream(org.w3c.dom.Document document)(Code)
Generate the html string from the given element. Does formatting.



getHtmlStream
public static String getHtmlStream(DocumentFragment df)(Code)
Generate the html string from the given document fragment



getMarkupBean
public static MarkupBean getMarkupBean(DesignBean lb)(Code)
Return the MarkupBean for the live bean. May be null, for non markup live beans.
Parameters:
  lb - The live bean to get the faces bean for. May be null. the MarkupBean corresponding to the live bean, or null.



getMimeTypes
public static String[] getMimeTypes()(Code)



getWebPages
public static List getWebPages(Project project, boolean includePages, boolean includeFragments)(Code)



isBraveheartPage
public static boolean isBraveheartPage(Document dom)(Code)



isFormBean
public static boolean isFormBean(FacesModel facesModel, DesignBean bean)(Code)
Return true iff the given DesignBean is the form bean for this form OR THE LIVE BEAN CONTAINER, since it acts like the form bean in many ways (not draggable, not deletable, etc.)



isGridMode
public static boolean isGridMode(FacesModel facesModel)(Code)
Return true if this document is in "grid mode" (objects should be positioned by absolute coordinates instead of in "flow" order. true iff the document should be in grid mode



isPageRootContainerDesignBean
public static boolean isPageRootContainerDesignBean(DesignBean designBean)(Code)



isSpecialBean
public static boolean isSpecialBean(DesignBean bean)(Code)
Return true iff the given DesignBean is the body bean, or the form bean, OR THE LIVE BEAN CONTAINER. These beans have special behavior since they are not draggable, not deletable, etc. TODO Move this into insync.



isWebPage
public static boolean isWebPage(FileObject fo)(Code)



isWoodstockPage
public static boolean isWoodstockPage(Document dom)(Code)



loadDocumentBuffer
public static BufferResult loadDocumentBuffer(StyledDocument doc)(Code)
Load a swing abstract document into a buffer. Use doc.getLength() to get the length in chars.
Parameters:
  doc - BufferResult with the allocated char[] buffer and size or null and 0.



loadDocumentOrFileObjectBuffer
public static BufferResult loadDocumentOrFileObjectBuffer(FileObject fileObject)(Code)



loadFileObjectBuffer
public static BufferResult loadFileObjectBuffer(FileObject fileObject)(Code)



removeLocalStyleValueForElement
public static void removeLocalStyleValueForElement(Element element, int style)(Code)



resolveUrl
public static URL resolveUrl(URL base, Document document, String src)(Code)



retrieveDocument
public static StyledDocument retrieveDocument(FileObject file, boolean open)(Code)
Retrieve the swing Abstract Document from a given data object.
Parameters:
  file - The file object to retrieve the document from
Parameters:
  open - If true, open the document if it's not already open. If false, this method willreturn null for data object whose document is not already open. The document, or null if the data object is not openable (or if the document is notopen and you did not set the open parameter to true.)



selectErrors
public static void selectErrors()(Code)



setDesignProperty
public static boolean setDesignProperty(DesignBean bean, String attribute, int length)(Code)
Attempt to set the given attribute on the bean to the given length and return true iff it succeeds.



truncateString
public static String truncateString(String s, int maxLength)(Code)
Strip the given string to the given maximum length of characters. If the string is not that long, just return it. If it needs to be truncated, truncate it and append "...". maxLength must be at least 4.



updateItemProperty
public static void updateItemProperty(FileObject file, String name, String newval)(Code)
Update a Project GenericItem's property to a given value, removing the property if the value is null or blank, and not touching the property if the new value is not a change.
Parameters:
  item - The item whose property is to be set.
Parameters:
  name - The property name to set.
Parameters:
  newval - The new property value.



updateLocalStyleValuesForElement
public static void updateLocalStyleValuesForElement(Element element, StyleData[] stylesToSet, StyleData[] stylesToRemove)(Code)



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.