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

Quick Search    Search Deep

org.hsqldb.util
Class ZaurusEditor  view ZaurusEditor download ZaurusEditor.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Panel
              extended byorg.hsqldb.util.ZaurusEditor
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class ZaurusEditor
extends java.awt.Panel
implements java.awt.event.ActionListener

ZaurusEditor implements an search/input/edit form to search/view/update/insert table records.

Version:
1.0

Starting on a search panel, one can choose a table from the actual database. The list contains only tables which have a primary key defined. One may provide one or more words which are to be contained in the rows of the table.

There are three options in searching these words:

  • Use search words: all or any
    Only rows which contain all words in any column will be found. Alternatively, it is sufficient when any of the words is contained in one of the columns.
  • Ignore case :
    While searching, there is no difference between lower or upper case letters, if this optioned is set to 'yes',
  • Match whole column:
    It is sufficient that the given word is just a part of any column. For instance, the word 'ring' will be found as part of 'Stringer'. Alternatively, the column content must match the search word completely.

After choosing a table, typing one or more search words and choosing some search options, the button Search Rows initiates the search through the table.
Alternatively, the button New Row will open an empty input panel for inserting a new row for the choosen table.
In both cases, a table specific panel with an entry field per column is shown.


Nested Class Summary
 
Nested classes inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
(package private)  int aktHoldNr
           
(package private)  java.awt.Button bCancel1
           
(package private)  java.awt.Button bCancel2
           
(package private)  java.awt.Button bDelete
           
(package private)  java.awt.Button bNewInsert
           
(package private)  java.awt.Button bNewRow
           
(package private)  java.awt.Button bNewSearch
           
(package private)  java.awt.Button bNewSearch1
           
(package private)  java.awt.Button bNext
           
(package private)  java.awt.Button bPrev
           
(package private)  java.awt.Button bSearchRow
           
(package private)  java.sql.Connection cConn
           
(package private)  java.awt.Choice cTables
           
(package private)  java.sql.DatabaseMetaData dbmeta
           
(package private)  java.awt.TextField fSearchWords
           
(package private)  java.awt.CheckboxGroup gAllWords
           
(package private)  java.awt.CheckboxGroup gIgnoreCase
           
(package private)  java.awt.CheckboxGroup gNoMatchWhole
           
(package private)  boolean lastButtonDelete
           
(package private)  java.awt.CardLayout lButton
           
(package private)  java.awt.CardLayout lForm
           
(package private)  java.awt.Panel pButton
           
(package private)  java.awt.Panel pEditButs
           
(package private)  java.awt.Panel pForm
           
(package private)  java.awt.Panel pInsertButs
           
(package private)  java.awt.Panel pSearchButs
           
(package private) static java.awt.TextField tStatus
           
(package private)  java.util.Vector vHoldForms
           
(package private)  java.util.Vector vHoldTableNames
           
 
Fields inherited from class java.awt.Panel
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
ZaurusEditor()
          Constructor declaration
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          actionPerformed method is the main entry point which interprets the buttons and initiates the actions.
static void clearStatus()
          The class method clearStatus deletes the status line.
private  java.util.Vector getAllTables()
           
private  int getChoosenTableIndex()
           
private  int getTableIndex(java.lang.String tableName)
           
private  java.lang.String[] getWords()
           
private  void initButtons()
           
private  void initGUI()
           
static void printStatus(java.lang.String text)
          printStatus prints a text into the status line below the panel.
 void refresh(java.sql.Connection c)
          refresh will read again the meta data of the actual database.
private  void resetLastButtonDelete()
           
private  void resetTableForms()
           
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tStatus

static java.awt.TextField tStatus

cConn

java.sql.Connection cConn

dbmeta

java.sql.DatabaseMetaData dbmeta

bSearchRow

java.awt.Button bSearchRow

bNewRow

java.awt.Button bNewRow

bCancel1

java.awt.Button bCancel1

bPrev

java.awt.Button bPrev

bNext

java.awt.Button bNext

bDelete

java.awt.Button bDelete

bNewSearch

java.awt.Button bNewSearch

bCancel2

java.awt.Button bCancel2

bNewInsert

java.awt.Button bNewInsert

bNewSearch1

java.awt.Button bNewSearch1

pSearchButs

java.awt.Panel pSearchButs

pEditButs

java.awt.Panel pEditButs

pInsertButs

java.awt.Panel pInsertButs

vHoldTableNames

java.util.Vector vHoldTableNames

vHoldForms

java.util.Vector vHoldForms

aktHoldNr

int aktHoldNr

pForm

java.awt.Panel pForm

pButton

java.awt.Panel pButton

lForm

java.awt.CardLayout lForm

lButton

java.awt.CardLayout lButton

fSearchWords

java.awt.TextField fSearchWords

cTables

java.awt.Choice cTables

gAllWords

java.awt.CheckboxGroup gAllWords

gIgnoreCase

java.awt.CheckboxGroup gIgnoreCase

gNoMatchWhole

java.awt.CheckboxGroup gNoMatchWhole

lastButtonDelete

boolean lastButtonDelete
Constructor Detail

ZaurusEditor

public ZaurusEditor()
Constructor declaration

Method Detail

printStatus

public static void printStatus(java.lang.String text)
printStatus prints a text into the status line below the panel.


clearStatus

public static void clearStatus()
The class method clearStatus deletes the status line.


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed method is the main entry point which interprets the buttons and initiates the actions.

Specified by:
actionPerformed in interface java.awt.event.ActionListener

refresh

public void refresh(java.sql.Connection c)
refresh will read again the meta data of the actual database. This is useful after changes of the table structures for instance creating or dropping tables, or altering tabel. The method will be called if one asks to refresh the tree or if the connection to the database is changed.


initGUI

private void initGUI()

getAllTables

private java.util.Vector getAllTables()

getChoosenTableIndex

private int getChoosenTableIndex()

getTableIndex

private int getTableIndex(java.lang.String tableName)

getWords

private java.lang.String[] getWords()

initButtons

private void initButtons()

resetLastButtonDelete

private void resetLastButtonDelete()

resetTableForms

private void resetTableForms()