net.datacrow.console.views
Class View

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by net.datacrow.console.components.DcPanel
                      extended by net.datacrow.console.views.View
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.ListSelectionListener
Direct Known Subclasses:
CachedChildView, UserView

public class View
extends DcPanel
implements javax.swing.event.ListSelectionListener

The Swing presentation. A view uses a view component to render items. Any component implementing the IViewComponent interface can be used as a view component.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static int _TYPE_INSERT
           
static int _TYPE_SEARCH
           
protected  ViewActionPanel actionPanel
           
protected  javax.swing.JPanel panelResult
           
protected  QuickViewPanel quickView
           
protected  DataTask task
           
protected  boolean updateQuickView
           
protected  IViewComponent vc
           
protected  DcViewDivider vdGroupingPane
           
protected  DcViewDivider vdQuickPane
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
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
View(MasterView mv, int type, IViewComponent vc, java.lang.String title, javax.swing.ImageIcon icon, int index)
           
 
Method Summary
 void activate()
           
 void add(DcObject dco)
           
 void add(DcObject dco, boolean select)
           
 void add(java.util.List<DcObject> items)
          Adds the items to the view.
 void add(java.util.Map<java.lang.String,java.lang.Integer> keys)
          Adds the items to the view.
 void add(java.lang.String key)
           
 void add(java.lang.String key, boolean select)
           
 void afterSelect(int idx)
           
 void afterUpdate()
           
protected  boolean allowsHorizontalTraversel()
           
protected  boolean allowsVerticalTraversel()
           
 void applySettings()
           
 void applyViewDividerLocation()
           
 void cancelCurrentTask()
           
 void cancelEdit()
           
 void cancelTask()
           
 void checkForChanges(boolean b)
           
 void clear()
           
 void clear(boolean saveChanges)
           
 void createReport()
           
 void delete()
           
protected  java.util.Collection<java.awt.Component> getAdditionalActions()
           
protected  java.util.Collection<DcObject> getChangedItems()
           
 View getChildView()
           
 DataTask getCurrentTask()
           
 DcObject getDcObject(java.lang.String key)
           
 java.lang.String getHelpIndex()
           
 int getIndex()
           
 DcObject getItem(java.lang.String ID)
           
 DcObject getItemAt(int idx)
           
 int getItemCount()
           
 java.util.List<java.lang.String> getItemKeys()
           
 java.util.List<DcObject> getItems()
           
 DcModule getModule()
           
 java.lang.String getParentID()
           
 View getParentView()
           
 DcObject getSelectedItem()
           
 java.util.List<java.lang.String> getSelectedItemKeys()
           
 java.util.List<? extends DcObject> getSelectedItems()
           
 int[] getSelectedRows()
           
 int getType()
           
 IViewComponent getViewComponent()
           
 void groupBy()
           
 boolean isActionsAllowed()
           
 boolean isChangesSaved()
           
 boolean isChild()
           
 boolean isLoaded()
           
 boolean isParent()
           
protected  boolean isTaskRunning()
           
 void loadChildren()
           
 void open()
           
 void openFindReplaceDialog()
           
 void openUpdateAllDialog()
           
 void refreshQuickView()
           
 void remove(int[] indices)
           
 void remove(java.lang.String[] keys)
           
 void removeFromCache(java.lang.String key)
           
 void repaintQuickViewImage()
           
 void save(boolean threaded)
           
 void saveSelected()
           
 void saveSettings()
           
 void setActionsAllowed(boolean b)
           
 void setDefaultSelection()
           
 void setListSelectionListenersEnabled(boolean b)
           
 void setParentID(java.lang.String ID, boolean show)
          Note that the items only have to be shown after a select.
 void setParentView(View parentView)
           
protected  void setSelected()
           
 void setSelected(int index)
           
 void setVisible(boolean b)
           
 void showQuickView(boolean b)
           
 void sort()
           
 void undoChanges()
           
 int update(java.lang.String ID)
           
 int updateItem(java.lang.String ID, DcObject dco)
           
 void updateItemAt(int index, DcObject dco)
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
           
 
Methods inherited from class net.datacrow.console.components.DcPanel
getIcon, getStatusPanel, getTitle, initProgressBar, setFont, setHelpIndex, setIcon, setMaxForProgressBar, setStatus, setTitle, updateProgressBar, updateProgressBar
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_TYPE_SEARCH

public static final int _TYPE_SEARCH
See Also:
Constant Field Values

_TYPE_INSERT

public static final int _TYPE_INSERT
See Also:
Constant Field Values

vc

protected IViewComponent vc

task

protected DataTask task

vdQuickPane

protected DcViewDivider vdQuickPane

vdGroupingPane

protected DcViewDivider vdGroupingPane

actionPanel

protected ViewActionPanel actionPanel

quickView

protected QuickViewPanel quickView

updateQuickView

protected boolean updateQuickView

panelResult

protected javax.swing.JPanel panelResult
Constructor Detail

View

public View(MasterView mv,
            int type,
            IViewComponent vc,
            java.lang.String title,
            javax.swing.ImageIcon icon,
            int index)
Method Detail

getHelpIndex

public java.lang.String getHelpIndex()
Overrides:
getHelpIndex in class DcPanel

setListSelectionListenersEnabled

public void setListSelectionListenersEnabled(boolean b)

allowsHorizontalTraversel

protected boolean allowsHorizontalTraversel()

refreshQuickView

public void refreshQuickView()

allowsVerticalTraversel

protected boolean allowsVerticalTraversel()

isParent

public boolean isParent()

isChild

public boolean isChild()

getParentView

public View getParentView()

getChildView

public View getChildView()

setParentView

public void setParentView(View parentView)

getViewComponent

public IViewComponent getViewComponent()

getIndex

public int getIndex()

getType

public int getType()

isTaskRunning

protected boolean isTaskRunning()

applyViewDividerLocation

public void applyViewDividerLocation()

getCurrentTask

public DataTask getCurrentTask()

undoChanges

public void undoChanges()

afterUpdate

public void afterUpdate()

setDefaultSelection

public void setDefaultSelection()

sort

public void sort()

openUpdateAllDialog

public void openUpdateAllDialog()

openFindReplaceDialog

public void openFindReplaceDialog()

getModule

public DcModule getModule()

add

public void add(DcObject dco)

add

public void add(java.lang.String key)

add

public void add(java.lang.String key,
                boolean select)

add

public void add(DcObject dco,
                boolean select)

cancelCurrentTask

public void cancelCurrentTask()

add

public void add(java.util.Map<java.lang.String,java.lang.Integer> keys)
Adds the items to the view. Note: children for the insert view are added by the view component.

Parameters:
items -
See Also:
DcTable#add(DcObject).

add

public void add(java.util.List<DcObject> items)
Adds the items to the view. Note: children for the insert view are added by the view component.

Parameters:
items -
See Also:
DcTable#add(DcObject).

setSelected

protected void setSelected()

setVisible

public void setVisible(boolean b)
Overrides:
setVisible in class javax.swing.JComponent

checkForChanges

public void checkForChanges(boolean b)

clear

public void clear(boolean saveChanges)

cancelTask

public void cancelTask()

activate

public void activate()

groupBy

public void groupBy()

delete

public void delete()

isChangesSaved

public boolean isChangesSaved()

open

public void open()

update

public int update(java.lang.String ID)

updateItem

public int updateItem(java.lang.String ID,
                      DcObject dco)

repaintQuickViewImage

public void repaintQuickViewImage()

save

public void save(boolean threaded)

saveSelected

public void saveSelected()

clear

public void clear()
Overrides:
clear in class DcPanel

saveSettings

public void saveSettings()

applySettings

public void applySettings()

getItemCount

public int getItemCount()

isLoaded

public boolean isLoaded()

isActionsAllowed

public boolean isActionsAllowed()

setActionsAllowed

public void setActionsAllowed(boolean b)

getItems

public java.util.List<DcObject> getItems()

getItemAt

public DcObject getItemAt(int idx)

getItem

public DcObject getItem(java.lang.String ID)

setSelected

public void setSelected(int index)

getSelectedItems

public java.util.List<? extends DcObject> getSelectedItems()

getSelectedItemKeys

public java.util.List<java.lang.String> getSelectedItemKeys()

getItemKeys

public java.util.List<java.lang.String> getItemKeys()

getSelectedItem

public DcObject getSelectedItem()

createReport

public void createReport()

remove

public void remove(java.lang.String[] keys)

remove

public void remove(int[] indices)

showQuickView

public void showQuickView(boolean b)

getSelectedRows

public int[] getSelectedRows()

updateItemAt

public void updateItemAt(int index,
                         DcObject dco)

getChangedItems

protected java.util.Collection<DcObject> getChangedItems()

removeFromCache

public void removeFromCache(java.lang.String key)

getDcObject

public DcObject getDcObject(java.lang.String key)

cancelEdit

public void cancelEdit()

loadChildren

public void loadChildren()

setParentID

public void setParentID(java.lang.String ID,
                        boolean show)
Note that the items only have to be shown after a select.


getParentID

public java.lang.String getParentID()

afterSelect

public void afterSelect(int idx)

getAdditionalActions

protected java.util.Collection<java.awt.Component> getAdditionalActions()

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener