Java Doc for Misc.java in  » Report » iReport-2.0.5 » it » businesslogic » ireport » util » 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 » Report » iReport 2.0.5 » it.businesslogic.ireport.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   it.businesslogic.ireport.util.Misc

Misc
public class Misc (Code)

author:
   Administrator


Field Summary
final public static  KeyListenerARABIC_KEY_LISTENER
    
public static  HashMapopTimes
    
final public static  String[]special_chars
    

Constructor Summary
public  Misc()
    

Method Summary
public static  voidaddProperties(String resourceUri, java.util.Properties props)
     Add the properties in resourceUri to props.
public static  voidcenterFrame(java.awt.Component c)
    
public static  StringchangeFileExtension(String filename, String newExtension)
    
public static  booleandockAt(Dockable toDock, String side, int index)
     side can be: DockingConstants.NOTRH_REGION DockingConstants.EAST_REGION DockingConstants.SOUTH_REGION DockingConstants.WEST_REGION index is the position into a side i.e.
public static  voidensurePathIsSelected(TreePath treePath, JTree jTree)
     If treePath is not in the current jTree selection, set it as selected.
public static  DefaultMutableTreeNodefindNodeWithUserObject(Object userObject, javax.swing.tree.TreeNode node)
    
public static  java.awt.FrameframeFromComponent(java.awt.Component parent)
     Method used to grab the Frame which is above this component in the hierarchy.
public static  java.util.ListgetAvailablePLAF()
    
public static  StringgetClassPath()
    
public static  ObjectgetComboboxSelectedValue(JComboBox combo)
     If the selected value is a Tag, tag.getValue is returned, otherwise the selected item itself is returned.
public static  java.sql.ConnectiongetConnection(String name)
    
public static  net.sf.jasperreports.engine.JRDataSourcegetJRDataSource(String name)
    
public static  StringgetJRFieldType(String type)
     Return the correct field type...
public static  StringgetJdbcTypeClass(java.sql.ResultSetMetaData rsmd, int t)
    
public static  longgetLastWriteTime(String filename)
    
public static  java.util.LocalegetLocaleFromString(String localeName)
    
public static  java.util.LocalegetLocaleFromString(String localeName, Locale defaultLocale)
    
public static  intgetMaxBandHeight(Report report, Band band)
    
public static  SubDatasetgetObjectSubDataset(SubDataset report, Object object)
     Look for the SubDataset of an Object in the given report / subDataset.
public static  SetgetResoucesInPackage(String packageName)
     Enumerates the resouces in a give package name.
public static  StringgetResourceContent(String resourceUri)
     Get the content of a text resource file...
public static  StringgetShortFileName(String filename)
    
public static  booleanisValidUrl(String url)
    
public static  java.awt.image.BufferedImageloadBufferedImageFromResources(Component c, String filename)
    
public static  StringloadExpression()
    
public static  StringloadExpression(Component c)
     Load the query asking for a file.
public static  VectorloadExpressionsList(String xmlFile)
     Read the expressions list from the specified file...
public static  java.awt.ImageloadImageFromFile(String path)
    
public static  java.awt.ImageloadImageFromResources(String filename)
    
public static  StringloadSQLQuery()
    
public static  StringloadSQLQuery(Component c)
     Load the query asking for a file.
public static  VectorloadStyleLibrary(String fileName)
    
public static  VectorloadStyleLibrary(InputStream is, String filename)
    
public static  Stringnvl(Object obj, String def)
    
public static  voidopenURL(String url)
    
public static  voidoptime(String opName)
     This function is used for debug porpuses.
public static  it.businesslogic.ireport.StylereadStyle(Node styleNode, ConditionedStyle cStyle)
    
public static  StringreplaceTabWithBlank(String source)
    
public static  booleansaveExpression(String expression)
     Save the expression asking for a file.
public static  booleansaveExpression(String expression, Component c)
     Save the query asking for a file.
public static  booleansaveExpressionsList(Vector v, String xmlFile)
     Save the expressions list to the specified file...
public static  booleansaveSQLQuery(String query)
     Save the query asking for a file.
public static  booleansaveSQLQuery(String query, Component c)
     Save the query asking for a file.
public static  voidsaveStyleLibrary(String filename, Vector styles)
    
public static  voidsaveTemporaryLocale(java.util.Properties properties, String fileName)
    
public static  voidselectTextAndFocusArea(JComponent expArea)
     This method select the whole text inside a textarea and set there the focus.
public static  voidsetComboboxSelectedTagValue(javax.swing.JComboBox comboBox, String itemValue)
    
public static  voidsetPLAF(String s)
    
public static  Stringstring_replace(String s1, String s2, String s3)
    
public static  StringtoHTML(String s)
    
public static  StringtreatNewLineChars(String source)
     This method inserts a blank character between to consecutive newline characters if encoutered.
public static  voidupdateComboBox(javax.swing.JComboBox comboBox, Vector newItems)
    
public static  voidupdateComboBox(javax.swing.JComboBox comboBox, Vector newItems, boolean addNullEntry)
    
public static  voidupdateStringComboBox(javax.swing.JComboBox comboBox, Vector newItems, boolean addNullEntry)
    
public static  StringxmlEscape(String text)
    

Field Detail
ARABIC_KEY_LISTENER
final public static KeyListener ARABIC_KEY_LISTENER(Code)



opTimes
public static HashMap opTimes(Code)



special_chars
final public static String[] special_chars(Code)




Constructor Detail
Misc
public Misc()(Code)
Creates a new instance of Misc




Method Detail
addProperties
public static void addProperties(String resourceUri, java.util.Properties props)(Code)
Add the properties in resourceUri to props. If resourceUri does not exists, nothing happen.



centerFrame
public static void centerFrame(java.awt.Component c)(Code)



changeFileExtension
public static String changeFileExtension(String filename, String newExtension)(Code)
Take a filename, strip out the extension and append the new extension newExtension = ".xyz" or "xyz" If filename is null, ".xyz" is returned



dockAt
public static boolean dockAt(Dockable toDock, String side, int index)(Code)
side can be: DockingConstants.NOTRH_REGION DockingConstants.EAST_REGION DockingConstants.SOUTH_REGION DockingConstants.WEST_REGION index is the position into a side i.e. dockAt( dockable, DockingConstants.WEST_REGION, 0) means the top left position



ensurePathIsSelected
public static void ensurePathIsSelected(TreePath treePath, JTree jTree)(Code)
If treePath is not in the current jTree selection, set it as selected.



findNodeWithUserObject
public static DefaultMutableTreeNode findNodeWithUserObject(Object userObject, javax.swing.tree.TreeNode node)(Code)
Find the DefaultMutableTreeNode containing the userObject as UserObject Returns null if node == null or userObject == null



frameFromComponent
public static java.awt.Frame frameFromComponent(java.awt.Component parent)(Code)
Method used to grab the Frame which is above this component in the hierarchy. This allows programmers to make any component the parent of any window or dialog easier.
Parameters:
  comp - the component to get the Frame for the Frame above this component in the hierarchy



getAvailablePLAF
public static java.util.List getAvailablePLAF()(Code)



getClassPath
public static String getClassPath()(Code)



getComboboxSelectedValue
public static Object getComboboxSelectedValue(JComboBox combo)(Code)
If the selected value is a Tag, tag.getValue is returned, otherwise the selected item itself is returned. If not item is selected, the method return null.



getConnection
public static java.sql.Connection getConnection(String name)(Code)
Return the named connection configured in iReport Return a java.sql.Connection;



getJRDataSource
public static net.sf.jasperreports.engine.JRDataSource getJRDataSource(String name)(Code)
Return the named connection configured in iReport Return a net.sf.jasperreports.engine.getJRDataSource



getJRFieldType
public static String getJRFieldType(String type)(Code)
Return the correct field type...



getJdbcTypeClass
public static String getJdbcTypeClass(java.sql.ResultSetMetaData rsmd, int t)(Code)
Thanx to Jackie Manning j.m@programmer.net for this method!!



getLastWriteTime
public static long getLastWriteTime(String filename)(Code)



getLocaleFromString
public static java.util.Locale getLocaleFromString(String localeName)(Code)
Take a string like _it_IT or it_IT or it and return the right locale Default return value is Locale.getDefault()



getLocaleFromString
public static java.util.Locale getLocaleFromString(String localeName, Locale defaultLocale)(Code)
Take a string like _it_IT or it_IT or it and return the right locale



getMaxBandHeight
public static int getMaxBandHeight(Report report, Band band)(Code)



getObjectSubDataset
public static SubDataset getObjectSubDataset(SubDataset report, Object object)(Code)
Look for the SubDataset of an Object in the given report / subDataset. If the subDataset is a report, it looks recursively in each subdataset...
Parameters:
  report - Report or SubDataset to look in
Parameters:
  object - Object to search for (Parameter, Field, Variable) a subdataset or null if the object is not found



getResoucesInPackage
public static Set getResoucesInPackage(String packageName) throws IOException(Code)
Enumerates the resouces in a give package name. This works even if the resources are loaded from a jar file! Adapted from code by mikewse on the java.sun.com message boards. http://forum.java.sun.com/thread.jsp?forum=22&thread=30984
Parameters:
  packageName - The package to enumerate A Set of Strings for each resouce in the package.



getResourceContent
public static String getResourceContent(String resourceUri)(Code)
Get the content of a text resource file...



getShortFileName
public static String getShortFileName(String filename)(Code)



isValidUrl
public static boolean isValidUrl(String url)(Code)
This method validates URL like: 123.123.123[:port] domain.domain.dom[:port]



loadBufferedImageFromResources
public static java.awt.image.BufferedImage loadBufferedImageFromResources(Component c, String filename)(Code)



loadExpression
public static String loadExpression()(Code)
See loadSQLQuery(Component c)



loadExpression
public static String loadExpression(Component c)(Code)
Load the query asking for a file. The optional component is used as parent for the file selection dialog Default is the MainFrame



loadExpressionsList
public static Vector loadExpressionsList(String xmlFile)(Code)
Read the expressions list from the specified file...



loadImageFromFile
public static java.awt.Image loadImageFromFile(String path)(Code)



loadImageFromResources
public static java.awt.Image loadImageFromResources(String filename)(Code)
New version by Umberto Uderzo



loadSQLQuery
public static String loadSQLQuery()(Code)
See loadSQLQuery(Component c)



loadSQLQuery
public static String loadSQLQuery(Component c)(Code)
Load the query asking for a file. The optional component is used as parent for the file selection dialog Default is the MainFrame



loadStyleLibrary
public static Vector loadStyleLibrary(String fileName)(Code)



loadStyleLibrary
public static Vector loadStyleLibrary(InputStream is, String filename)(Code)



nvl
public static String nvl(Object obj, String def)(Code)



openURL
public static void openURL(String url)(Code)
This method uses the code from: http://www.centerkey.com/java/browser/ Bare Bones Browser Launch Version 1.5 December 10, 2005 Supports: Mac OS X, GNU/Linux, Unix, Windows XP Example Usage: String url = "http://www.centerkey.com/"; BareBonesBrowserLaunch.openURL(url); Public Domain Software -- Free to Use as You Like



optime
public static void optime(String opName)(Code)
This function is used for debug porpuses. It is used to misure the time of an operation. Sample usage:

 ....some code
 Misc.optime("My operation");  // Start the timer
 ....block to measure....
 Misc.optime("My operation");  // Stop the timer
 
Result on video:

 My operation START (1)
 My operation END (1)	20ms
 



readStyle
public static it.businesslogic.ireport.Style readStyle(Node styleNode, ConditionedStyle cStyle)(Code)
If a ConditionedStyle, the style is interpreted like part of the tag conditionalStyle



replaceTabWithBlank
public static String replaceTabWithBlank(String source)(Code)
Thanks to Teodor Danciu for this method (c) 2003 Teodor Danciu



saveExpression
public static boolean saveExpression(String expression)(Code)
Save the expression asking for a file. see saveSQLQuery(String query, Component c)



saveExpression
public static boolean saveExpression(String expression, Component c)(Code)
Save the query asking for a file. The optional component is used as parent for the file selection dialog Default is the MainFrame



saveExpressionsList
public static boolean saveExpressionsList(Vector v, String xmlFile)(Code)
Save the expressions list to the specified file...



saveSQLQuery
public static boolean saveSQLQuery(String query)(Code)
Save the query asking for a file. see saveSQLQuery(String query, Component c)



saveSQLQuery
public static boolean saveSQLQuery(String query, Component c)(Code)
Save the query asking for a file. The optional component is used as parent for the file selection dialog Default is the MainFrame



saveStyleLibrary
public static void saveStyleLibrary(String filename, Vector styles)(Code)



saveTemporaryLocale
public static void saveTemporaryLocale(java.util.Properties properties, String fileName)(Code)
Creates fileName inside /classes/it/businesslogic/ireport/locale and stores there the properties keys



selectTextAndFocusArea
public static void selectTextAndFocusArea(JComponent expArea)(Code)
This method select the whole text inside a textarea and set there the focus. It should be used to select a component that contains a wrong expression. In the future other properties of the componenct can be modified



setComboboxSelectedTagValue
public static void setComboboxSelectedTagValue(javax.swing.JComboBox comboBox, String itemValue)(Code)



setPLAF
public static void setPLAF(String s)(Code)



string_replace
public static String string_replace(String s1, String s2, String s3)(Code)
Replace s2 with s1 in s3



toHTML
public static String toHTML(String s)(Code)



treatNewLineChars
public static String treatNewLineChars(String source)(Code)
This method inserts a blank character between to consecutive newline characters if encoutered. Also appends a blank character at the beginning of the text, if the first character is a newline character and at the end of the text, if the last character is also a newline. This is useful when trying to layout the paragraphs. Thanks to Teodor Danciu for this this method (c) 2003 Teodor Danciu



updateComboBox
public static void updateComboBox(javax.swing.JComboBox comboBox, Vector newItems)(Code)



updateComboBox
public static void updateComboBox(javax.swing.JComboBox comboBox, Vector newItems, boolean addNullEntry)(Code)



updateStringComboBox
public static void updateStringComboBox(javax.swing.JComboBox comboBox, Vector newItems, boolean addNullEntry)(Code)
Mthis method perform equals based on string rapresentation of objects



xmlEscape
public static String xmlEscape(String text)(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.