net.codescore.ui.components.windows
Class DnDWindow

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zk.ui.HtmlBasedComponent
          extended by org.zkoss.zul.impl.XulElement
              extended by org.zkoss.zul.Window
                  extended by net.codescore.ui.components.windows.AppWindow
                      extended by net.codescore.ui.components.windows.DnDWindow
All Implemented Interfaces:
Serializable, Cloneable, DnDContainer, PersistantDnDContainer, Component, IdSpace, ComponentCtrl
Direct Known Subclasses:
DnDContextWin

public class DnDWindow
extends AppWindow
implements PersistantDnDContainer

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.zkoss.zul.Window
Window.ExtraCtrl
 
Field Summary
private  List<DnDVbox> columns
           
private static long serialVersionUID
           
private  Hbox topHBox
           
 
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Constructor Summary
DnDWindow()
           
 
Method Summary
 void addColumn(DnDVbox newCol)
          Adds a column to this container
 void addWindow(int col, DnDObject win)
          Add A DnDObject to a column
 DnDColumn getCol(int col)
          
 boolean load()
          Load this DnD containers saved settings
 void rebuildCols()
          Re-builds each column and then re-parents each column, this will also fix any column number errors
 void save()
          Save the current layout
 void setColHeightPer(int percent)
          Sets the column height as a percentage
 void setColHeightPx(int pixels)
          Sets the column height in pixels
 void setColWidthPer(int percent)
          Sets the width of the columns as a percent
 void setColWidthPx(int pixels)
          Sets the width of the columns
 void setNumCols(int num_cols)
          Sets the number of columns in this container.
 void setTopHBoxParent(Component c)
          Sets the parent for the Hbox containing the columns
 
Methods inherited from class net.codescore.ui.components.windows.AppWindow
getRequest, getSession, getUserName, userHasRole
 
Methods inherited from class org.zkoss.zul.Window
clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getCtrlKeys, getDefaultActionOnShow, getMode, getOuterAttrs, getPosition, getRealStyle, getSclass, getTitle, getTitleSclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isSizable, newExtraCtrl, onChildRemoved, onClose, onModal, setBorder, setClosable, setContentSclass, setContentStyle, setCtrlKeys, setDefaultActionOnShow, setDraggable, setMode, setMode, setPage, setParent, setPosition, setSclass, setSizable, setTitle, setVisible
 
Methods inherited from class org.zkoss.zul.impl.XulElement
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getInnerAttrs, getPopup, getTooltip, setAction, setContext, setContext, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getRealSclass, getRealStyleFlags, getStyle, getTooltiptext, getTop, getWidth, getZIndex, setClass, setDroppable, setFocus, setHeight, setLeft, setStyle, setTooltiptext, setTop, setWidth, setZIndex
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getPropagatee, getRoot, getSpaceOwner, getUuid, getVariable, invalidate, isAsapRequired, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onDrawNewChild, onPageAttached, onPageDetached, onWrongValue, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPageBefore, setVariable, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdateDeferred, smartUpdateValues, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellowIfAny
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

columns

private final List<DnDVbox> columns

topHBox

private final Hbox topHBox
Constructor Detail

DnDWindow

public DnDWindow()
Method Detail

addColumn

public void addColumn(DnDVbox newCol)
Adds a column to this container

Specified by:
addColumn in interface DnDContainer
Parameters:
newCol - the new column to be added

addWindow

public void addWindow(int col,
                      DnDObject win)
Add A DnDObject to a column

Specified by:
addWindow in interface DnDContainer
Parameters:
col - The column number of the column to put the object in
win - the Object to be added
See Also:
DnDColumn.addWindow(DnDObject)

getCol

public DnDColumn getCol(int col)

Specified by:
getCol in interface DnDContainer
Returns:

load

public boolean load()
Load this DnD containers saved settings

Specified by:
load in interface PersistantDnDContainer
Returns:
true if the settings were sucessfully loaded from the database. false if the settings could not be loaded.

rebuildCols

public void rebuildCols()
Re-builds each column and then re-parents each column, this will also fix any column number errors

Specified by:
rebuildCols in interface DnDContainer
See Also:
DnDColumn.reBuildList()

save

public void save()
Save the current layout

Specified by:
save in interface PersistantDnDContainer

setColHeightPer

public void setColHeightPer(int percent)
Sets the column height as a percentage

Specified by:
setColHeightPer in interface DnDContainer
Parameters:
percent - a number between 1 and 100

setColHeightPx

public void setColHeightPx(int pixels)
Sets the column height in pixels

Specified by:
setColHeightPx in interface DnDContainer

setColWidthPer

public void setColWidthPer(int percent)
Sets the width of the columns as a percent

Specified by:
setColWidthPer in interface DnDContainer
Parameters:
percent - a value between 0 and 100/number of columns

setColWidthPx

public void setColWidthPx(int pixels)
Sets the width of the columns

Specified by:
setColWidthPx in interface DnDContainer
Parameters:
pixels - the width in pixels

setNumCols

public void setNumCols(int num_cols)
Sets the number of columns in this container. If num_cols is greater than the current number of columns, this method will add columns, if it is less than the current number of columns, it will throw and error, if it is equal to the current number of columns, the method will not make any changes.

Specified by:
setNumCols in interface DnDContainer
Parameters:
num_cols - A number greater than the current number of columns

setTopHBoxParent

public void setTopHBoxParent(Component c)
Sets the parent for the Hbox containing the columns

Parameters:
c - The component which will be the parent of the columns


Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.