Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javatools.applications.* (3)javatools.awt.* (9)javatools.db.* (56)
javatools.io.* (2)javatools.net.* (1)javatools.sql.* (2)
javatools.swing.* (45)javatools.text.* (7)javatools.util.* (43)
javatools.xml.* (2)

Package Samples:

javatools.util.test: Utility classes.  
javatools.util.plugin: Utility classes.  
javatools.applications.DBConstraints
javatools.applications.DBScriptExec
javatools.applications.DBScriptWizard
javatools.awt.event
javatools.sql
javatools.db
javatools.db.util
javatools.db.xml
javatools.io
javatools.net
javatools.swing.menu
javatools.swing.tree
javatools.swing
javatools.swing.dialog
javatools.swing.event
javatools.swing.frame
javatools.swing.internal
javatools.swing.panel

Classes:

DbSelector: A class used to select tabular data from an SQL database. The constructor is not public. To obtain a DbSelector call DbDatabase.selector(); Example: To select FRED's record from the people table... DbDatabase db = ...; DbTable people = db.getTable("PEOPLE"); DbSelector selector = db.selector(); selector.addColumn(people.getColumn("NAME")); selector.addColumn(people.getColumn("AGE")); selector.setWhere(people.getColumn("NAME").equal("FRED")); DbTable result = selector.execute(); DbIterator it = result.iterator(); while (it.hasNextRow()) { DbRow row = it.nextRow(); System.out.println(row.getValue("NAME") ...
DbInserter: A class used to insert records into SQL tables. The constructor is not public. To obtain a DbInserter call DbTable.inserter(); Example: To insert a record into the people table... DbDatabase db = ...; DbTable people = db.getTable("PEOPLE"); DbInserter inserter = people.inserter(); inserter.addColumn(people.getColumn("NAME"), "Fred")); inserter.addColumn(people.getColumn("FAVOURITE_TEAM"), "Raiders"); inserter.addColumn(people.getColumn("AGE"), new Integer(30)); int numberOfPeopleInserted = inserter.execute(); This is equivilent to... INSERT INTO PEOPLE(NAME, FAVOURITE_TEAM, AGE) VALUES('Fred', ...
DbUpdater: A class used to update records from SQL tables. The constructor is not public. To obtain a DbUpdater call DbTable.updater(); Example: To update all the people who are (younger than 18 or older than 80) and whose name is "Fred"... to have a favourite_team of "Raiders"; DbDatabase db = ...; DbTable people = db.getTable("PEOPLE"); DbUpdater updater = people.deleter(); updater.addColumn(people.getColumn("FAVOURITE_TEAM"), "Raiders"); updater.setWhere(people.getColumn("AGE").lessThan(new Integer(18)).or( people.getColumn("AGE").greaterThan(new Integer(80))).and( people.getColumn("NAME").equal("FRED")); ...
Props: An extended version of Properties class. It allows reading Properties files from the classpath or resource file. It uses ClassLoader.getResourceAsStream to find a properties file, so that means it either has to be on the classpath or bundled into the jar. It is intended that you only pass a single string to find the properties like "foo". That will cause Props to search for a file called foo.properties. The directory it searches in will be by default the "res/" directory. That means that it will search your classpath or jar file for a file res/foo.properties. If you run your software in different ...
VariablePaneDispatcher: It represents an "event dispatcher" to be used to manage a "variable pane" i.e. a pane that changes depending on a particular selection in another place of the application. You have to inherit only this method: initialize : to init the panels, if you need it. Set the panelName to your own name, to differentiate between different VariablePaneDispatcher 's. Create your panels, put them in type2panel HashMap, depending on the type of the ( Clippable ) object to be displayed. Put your messages in type2message HashMap (depending on ther type) and make all you need for your panels. The panels must be ...
SubPanelDispatcher: It represents an "event dispatcher" for sub-panels, i.e. panels into other panels. It is multi-panel, you can create only one for your application, if you want them to be processed in queue. It can manage fixed sub-panels (i.e. when you create a panel and its subpanels once and you have it until end of execution) or dynamic sub-panels (i.e. when you create a panel as you need it). Use this sequence of commands: Integer fillerID1; Long fillerID2; SubPanelDispatcher disp = new SubPanelDispatcher(); disp.setStatusLabelSync(myStatusLabelSync); -- repeat fillerID1 = disp.registerFiller(myFiller, myMessage); ...
JQueue: Implements a regular queue. The only unusual thing is you can delete things from the middle of the queue efficiently by supplying the QueueKey which is returned by put(). In terms of implementation we use a Dictionary Hashtable instead of a perhaps more traditional vector with round-robin pointers. The benefit here is efficient implementation of the remove functionality. It also happens to be a really easy way to implement queues in general. The way it works is that the dictionary is used as a sparse array. The upper and lower bounds of the sparse array keeping growing up and up towards infinity. ...
DbDeleter: A class used to delete records from SQL tables. The constructor is not public. To obtain a DbDeleter call DbTable.deleter(); Example: To delete all the people who are (younger than 18 or older than 80) and whose name is "Fred"... DbDatabase db = ...; DbTable people = db.getTable("PEOPLE"); DbDeleter deleter = people.deleter(); deleter.setWhere(people.getColumn("AGE").lessThan(new Integer(18)).or( people.getColumn("AGE").greaterThan(new Integer(80))).and( people.getColumn("NAME").equal("FRED")); int numberOfPeopleDeleted = deleter.execute(); This is equivilent to... DELETE FROM PEOPLE WHERE (AGE ...
DbTrueExpr: An expression that always evaluates to true. If not optimised away but DbAndExpr, this will probably result in "0 = 0" in the SQL. The use of true expressions makes it very convenient for dynamically generated queries... DbExpr e = db.trueExpr(); if (name != null) { e = e.and(table.getColumn("NAME")).equals(name)); } if (age != null) { e = e.and(table.getColumn("AGE")).equals(age)); } This gets converted to... (0 = 0) AND ( NAME = ? ) AND ( AGE = ? ) and then DbAndExpr optimises this to... ( NAME = ? ) AND ( AGE = ? )
DbFalseExpr: An expression that always evaluates to false. If not optimised away by DbTrueExpr, it will probably result in "0 = 1" in the SQL. The use of false expressions makes it very convenient for dynamically generated queries... DbExpr e = db.falseExpr(); if (name != null) { e = e.or(table.getColumn("NAME")).equals(name)); } if (age != null) { e = e.or(table.getColumn("AGE")).equals(age)); } This gets converted to... (0 = 1) OR ( NAME = ? ) OR ( AGE = ? ) and then DbOrExpr optimises this to... ( NAME = ? ) OR ( AGE = ? )
DbOrExpr: An expression of the form A OR B. The reason we have this class as well as DbCriterion, is that this class will optimise away unnecessary segments. i.e. A OR FALSE will be optimised to just A. The reason you may find a FALSE expression in your code is the use of DbDatabase.falseExpr(). This is a very convenient thing for dynamically generated queries. Of course we could just leave the dummy false expressions in the final SQL and presumably the dbms can optimise it away fine, but it looks a bit ugly and nasty to have these dummy expressions in the result.
DbAndExpr: An expression of the form A AND B. The reason we have this class as well as DbCriterion, is that this class will optimise away unnecessary segments. i.e. A AND TRUE will be optimised to just A. The reason you may find a TRUE expression in your code is the use of DbDatabase.trueExpr(). Of course we could just leave the dummy true expressions in the final SQL and presumably the dbms can optimise it away fine, but it looks a bit ugly and nasty to have these dummy expressions in the result.
AbstractTreeExpansionDispatcher: It is an "event dispatcher" for tree expansions, i.e. it manages in a separate thread tree expansions. You have only to inherit this method: doDispatchOne : what you have to do when you are expanding a node. Once created your own class, use this sequence of commands: AbstractTreeExpansioDispatcher disp = new YourClass(); disp.setStatusLabelSync(myStatusLabelSync); disp.start(); disp.expand(myTree, mySelectionPath); disp.stopAll();
FileLog: A class for logging context specific messages to a file. Logged messages include the context (typically a class or subsystem), a date-time stamp a severity and supplied text. Entries are of the form: yyyy.MM.dd HH:mm:ss : If the system property "debugOn" is set to TRUE the messages with a severity of DEBUG will be logged. If the property is missing or is FALSE then DEBUG messages will be ignored.
Cache: General purpose cache class. Acts basically like a weak reference dictionary except that it also returns null when asked to find an item whose use-by date has expired. It works with two main data structures: A Dictionary which provides fast access into the cache, and a Queue which keeps track of the least recently used items in the cache so that old items can be removed and limit the cache to a bounded size. Modified: 8th March 2003 11:41
DbParenthesis: This expression has the result of putting parenthesis around another expression. i.e. "expr" becomes "( expr )". It should be noted that you won't usually use this class in your application code. Normally the order of evaluation of the SQL is implied by the parethesis in your Java code. i.e. DbExpr x = a.and((b.or(c)).and(d)) This will automatically retain the Java evaluation order... A AND ( (B OR C) AND D)
StatusLabelSync: It is a thread to control messages displayed into a status label. Use this sequence of commands: StatusLabelSync sync = new StatusLabelSync(); sync.setStatusLabel(myOwnJLabel); sync.start(); -- repeat sync.setMessage(theMessageGroup, theMessageToBeDisplayed); // make what you need sync.removeMessage(theMessageGroup); -- return to repeat while you need it. sync.stopAll();
SwingWorker: This is the 3rd version of SwingWorker (also known as SwingWorker 3), an abstract class that you subclass to perform GUI-related work in a dedicated thread. For instructions on using this class, see: http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html Note that the API changed slightly in the 3rd version: You must now invoke start() on the SwingWorker after creating it.
SubstituteVariable: A utility class for substituting parts of Strings e.g. SubstituteVariable("${xx} brown fox jumped over ${xx} lazy dog", "${xx}", "the", 1); =>> "the quick brown fox jumped over ${xx} lazy dog" SubstituteVariable("${xx} brown fox jumped over ${xx} lazy dog", "${xx}", "the"); =>> "the quick brown fox jumped over the lazy dog"
DbRow: A row of tabular data. This class can return fields in different formats. Care should be taken not to ask for a field in an inappropriate format. e.g. don't ask for a field of letters as a number. TODO: More conversions can probably be done. e.g. convert varchar fields made of numbers into integers etc.
DbConstraint: This abstract class represents a generic set of constraints for a table. It contains a lot of code already written for generic purposes, i.e. it can be derived with few code. If you want to add additional checks, you can easily add your own code, rewriting check and update methods.
DbTableIterator: An iterator class for DbTables. There is no public constructor. Use DbTable.iterator(). While this class supports the java.util.Iterator interface, it is recommended not to use it because they do not throw the proper DbException on error. Instead use the similar hasNextRow() and nextRow().
OrdinalPostfix: This class returns the bit that you tag onto the end of number. e.g. if you pass in the number "1" it will return "st", as in 1st. If you pass in "2" it will return "nd", as in "2nd". etc. Yes, the name is pretty wierd, but what can you name something like this?
DbOrderBy: A class that represents an ORDER BY clause in a SELECT. An order by clause consists of a column and an optional DESC descending clause. Usually this class will not be referred to directly in an application. More usually you will use DbSelector.addOrderBy().
AbstractTable: A class representing tabular data. Could be a real database table or the result of a SELECT. Based upon class DbTable written by Chris Bitmead, of which it is an abstraction to differentiate between real tables and results of a SELECT command.

Home | Contact Us | Privacy Policy | Terms of Service