|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecte4s.util.E4Object
e4s.html.E4HtmlObject
e4s.html.E4HtmlElementGeneral
e4s.html.input.grid.E4Grid
public abstract class E4Grid
This is an abstract elements that enables editing of larger portions of data
where vertical and horizontal paging is required. Compared to other elements of E4S (e.g. Tree-Elements)
the grid is not a complete implementation, as this is an abstract class, a class extending this grid must
implement the missing methods to support data handling, createing input fields and storing values into
the database. The function #processParams(e4s.html.E4CgiParams) is required to set all the navigation
values of this grid (e.g. the user has branched one page to the right).
| Example_Grid.java |
| Field Summary | |
|---|---|
static java.lang.String |
JS_NAME_SETMAP
|
static java.lang.String |
MAP_PLACEHOLDER
|
static E4InputFieldName |
PARAM_COL
|
static E4InputFieldName |
PARAM_GRID_SIZE
|
static java.lang.String |
PARAM_IS_PRINTING
|
static E4InputFieldName |
PARAM_ROW
|
static E4InputFieldName |
PARAM_SESS_OBJ
|
| Fields inherited from class e4s.html.E4HtmlElementGeneral |
|---|
m_elements, m_needed_scripts |
| Fields inherited from class e4s.html.E4HtmlObject |
|---|
m_parent_e4sID |
| Fields inherited from class e4s.util.E4Object |
|---|
CRLF, E4S_CORE_SYSTEM_LANGUAGE, NBSP, NULLSTR, URL_ENCODING_CHARSET |
| Constructor Summary | |
|---|---|
E4Grid(E4Method mref)
Construct a E4Grid object with 1 header cell, each vertically and horizontally. |
|
E4Grid(E4Method mref,
int numHeaderCols,
int numHeaderRows)
Construct a E4Grid object. |
|
E4Grid(int numHeaderCols,
int numHeaderRows)
Construct a E4Grid object. |
|
| Method Summary | |
|---|---|
static java.lang.String |
_getSVNVersionString()
Get version info string from subversion. |
void |
add2body(BODY body,
E4ServletImplementation_Intf servlet)
This function adds the grid element to the body and (if printing is active) calls the printer dialog. |
void |
addDisplaySize(E4GridSize gs)
Add a new display layout (size) component the user can select from. |
void |
addDisplaySize(int width,
int height)
Add a new display layout (size) component the user can select from. |
void |
addDisplaySizeDefault()
Add some default sizes. |
void |
collectScripts(E4ScriptsVec vec,
E4ServletImplementation_Intf servlet)
Collect the scripts required. |
void |
collectStylesForEditing(E4StylesHash v,
E4ServletImplementation_Intf servlet)
Build a list (Vector) with style definitions used so far during display of this page. |
void |
collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
Collect the scripts required. |
void |
createdForm(FORM form)
A good place to add hidden fields to the form just beeing created |
static int[] |
createScaleGaps(int maxIdx,
int treshhold,
int actualIdx)
If an interval 0..maxIdx is greater than a specified treshold, then use only the first elements, the last elements, the elements around actualIdx and every 10th element. |
java.lang.String |
drawCell_Csv(int row,
int col)
Draw a black/white representation of the value (typically, this will be NOT an input field). |
abstract void |
drawCell_Printer(TD td,
int row,
int col)
Draw a black/white representation of the value (typically, this will be NOT an input field). |
abstract void |
drawCell_Screen(TD td,
E4InputFieldName fieldname,
int row,
int col)
Draw a cell (typically, this will be an imput field) and set the value of that cell. |
java.lang.String |
drawFirstGrid_Csv()
|
void |
drawFirstGrid_Printer(TD tdDummy)
Here, output to the first column/row is possible when printing. |
void |
drawFirstGrid_Screen(TD tdDummy)
Here, output to the first column/row is possible. |
java.lang.String[] |
drawHorizontalHeader_Csv(int row)
|
void |
drawHorizontalHeader_Printer(TD[] td,
int row)
Draw a header (one or more columns) for the horizontal rows when printing. |
abstract void |
drawHorizontalHeader_Screen(TD[] td,
int row)
Draw a header (one or more columns) for the horizontal rows. |
java.lang.String[][] |
drawVerticalHeaders_Csv(int firstCol,
int lastCol)
|
void |
drawVerticalHeaders_Printer(TR[] tr,
int firstCol,
int lastCol)
Draw a header (one or more rows) for the vertical columns when printing. |
abstract void |
drawVerticalHeaders_Screen(TR[] tr,
int firstCol,
int lastCol)
Draw a header (one or more rows) for the vertical columns. |
boolean |
enableNewWindow()
Is opening of new windows enabled? |
void |
enableNewWindow(boolean mode)
Enable to open a new window printing. |
E4Label_Intf |
getCaption_horizontal()
Get the caption for the horizontal data components. |
E4Label_Intf |
getCaption_vertical()
Get the caption for the vertical data components. |
int |
getDisplayCols()
Get the current display size (number of columns). |
int |
getDisplayRows()
Get the current display size (number of rows). |
static E4InputFieldName |
getE4InputFieldName(int row,
int col)
Get an input field name for the cell at specified row/column. |
boolean |
getEnableExcel()
Is xcel export enabled? |
boolean |
getEnablePrinting()
Is printing enabled? |
int |
getFirstCol()
Get the index of the first column (including) currently displayed. |
int |
getFirstRow()
Get the index of the first row (including) currently displayed. |
E4Color |
getLabelColor()
Get the color for displaying the labels. |
int |
getLastCol()
Get the index of the last column (including) currently displayed. |
int |
getLastRow()
Get the index of the last row (including) currently displayed. |
E4Color |
getNavigationColor()
Get the color for displaying the navigation items. |
int |
getNumHeaderCols()
Get the number of header rows. |
int |
getNumHeaderRows()
Get the number of header rows. |
java.lang.String |
getObjectID()
Get the ID of the Object. |
abstract int |
horizontalSize()
Get the horizontal size for this E4Grid. |
boolean |
isPrinting()
Get the current display mode. |
boolean |
isSaving()
Check, if the saving process with subsequent calls to saveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int) is in progress. |
boolean |
isWindow()
Get the current window mode. |
boolean |
openingWindow()
Get the current window mode. |
void |
processParams(E4CgiParams params,
E4ServletImplementation_Intf servlet)
Process the parameters to the internal navigation functions. |
void |
processParams(E4ServletImplementation_Intf servlet)
Deprecated. |
void |
saveFinished(E4ServletImplementation_Intf servlet)
|
abstract boolean |
saveValue(E4InputFieldName fieldname,
E4CgiParams params,
int row,
int col)
Save the value into the database. |
void |
setActualSizeIndex(int grid_size_index)
Set the grid size. |
void |
setCaption_horizontal(E4Label_Intf caption_horizontal)
Set the caption for the horizontal data components. |
void |
setCaption_horizontal(java.lang.String caption_horizontal)
Set the caption for the horizontal data components. |
void |
setCaption_vertical(E4Label_Intf caption_vertical)
Set the caption for the vertical data components. |
void |
setCaption_vertical(java.lang.String caption_vertical)
Set the caption for the vertical data components. |
void |
setEnableExcel(boolean mode)
Enable excel export. |
void |
setEnablePrinting(boolean mode)
Enable printing. |
void |
setFirstColumn(int col)
Set the first display column. |
void |
setFirstRow(int row)
Set the first display row. |
void |
setLabelColor(E4Color color)
Set the color for displaying the labels. |
void |
setNavigationColor(E4Color color)
Set the color for displaying the navigation items. |
void |
setNumHeaderCols(int cols)
Set the number of header columns for the horizontal headers. |
void |
setNumHeaderRows(int rows)
Set the number of header rows for the vertical headers. |
boolean |
showNumbers()
Get the row/column-number display mode. |
void |
showNumbers(boolean mode)
Set the row/column-number display mode. |
java.lang.StringBuffer |
toExcel()
|
void |
toHtml(E4StringBufferHtml buf,
E4ServletImplementation_Intf servlet)
Render this object. |
java.lang.String |
toString()
|
abstract int |
verticalSize()
Get the vertical size for this E4Grid. |
| Methods inherited from class e4s.html.E4HtmlObject |
|---|
E4ID, E4ID, set_e4sID |
| Methods inherited from class e4s.util.E4Object |
|---|
Calendar, CName, CName, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelApp, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelNone, E4LabelSys, E4LabelSys, e4sCopyright, e4sVersion, encode, encode, encode, encodeHtml, encodeHtml, encodeHtml, encodeURL, encodeURL, encodeURL, finalize, getLINE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTRACE, getTraceMemory, HtmlEncode, HtmlEncode, HtmlEncode, isdecimal, isdigit, isnotok, isnotok, isnumeric, isok, isok, isok, isok, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingFunction, lastCallingStack, mkdirs, null2nbsp, null2nbsp, null2nbsp, ok, ok, ok, ok, outPrintln, setLogFile4Trace, setTraceMemory, STACKTRACE, toDebug, toDouble, toFloat, toFloat, TRACE_CALLS, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, TRACE, wait |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface e4s.html.E4HtmlElement_Intf |
|---|
addScript, addScript, addScript, debugToString, findElement, findElement, getElements, getElementsVec, getField, getId, getStringContent, isContentClass, removeAll, removeElementById, removeElements, set_e4sID, setId, setReadOnly, setValue, toHtml_hidden, validate |
| Field Detail |
|---|
public static final E4InputFieldName PARAM_COL
public static final E4InputFieldName PARAM_ROW
public static final java.lang.String PARAM_IS_PRINTING
public static final E4InputFieldName PARAM_GRID_SIZE
public static final E4InputFieldName PARAM_SESS_OBJ
public static final java.lang.String JS_NAME_SETMAP
public static final java.lang.String MAP_PLACEHOLDER
| Constructor Detail |
|---|
public E4Grid(E4Method mref,
int numHeaderCols,
int numHeaderRows)
mref - the Method-Reflection that is called, when this E4Grid
requires repaint. This method shall call #add2body(e4s.html.BODY)
and #processParams(e4s.html.E4CgiParams).numHeaderCols - the number of rows for the matrix top-headernumHeaderRows - the number of columns for the matrix left-headerE4Grid(e4s.html.E4Method)
public E4Grid(int numHeaderCols,
int numHeaderRows)
mref - the Method-Reflection that is called, when this E4Grid
requires repaint. This method shall call #add2body(e4s.html.BODY)
and #processParams(e4s.html.E4CgiParams).numHeaderCols - the number of rows for the matrix top-headernumHeaderRows - the number of columns for the matrix left-headerE4Grid(e4s.html.E4Method)public E4Grid(E4Method mref)
mref - the Method-Reflection that is called, when this E4Grid
requires repaint. This method shall call #add2body(e4s.html.BODY)
and #processParams(e4s.html.E4CgiParams).E4Grid(e4s.html.E4Method,int,int)| Method Detail |
|---|
public boolean isPrinting()
drawCell_Printer(e4s.html.TD, int, int),
setEnablePrinting(boolean),
getEnablePrinting()public void setEnablePrinting(boolean mode)
mode - true, if printing is enabledgetEnablePrinting(),
isPrinting()public boolean getEnablePrinting()
setEnablePrinting(boolean),
isPrinting()public void setEnableExcel(boolean mode)
mode - true, if printing is enabledgetEnableExcel()public boolean getEnableExcel()
setEnableExcel(boolean)public boolean isWindow()
enableNewWindow(boolean)public boolean openingWindow()
enableNewWindow(boolean)public void enableNewWindow(boolean mode)
mode - true, if opening a new window is enabledenableNewWindow(),
isPrinting()public boolean enableNewWindow()
enableNewWindow(boolean),
isWindow()public boolean showNumbers()
showNumbers(boolean)public void showNumbers(boolean mode)
mode - true, if row and column numbering is enabled.showNumbers()public void setNumHeaderRows(int rows)
rows - the number of header rows.getNumHeaderRows(),
drawVerticalHeaders_Screen(e4s.html.TR[], int, int),
drawVerticalHeaders_Printer(e4s.html.TR[], int, int)public int getNumHeaderRows()
setNumHeaderRows(int)public void setNumHeaderCols(int cols)
cols - the number of header columns.getNumHeaderCols(),
#drawHorizontalHeaders_Screen,
#drawHorizontalHeaders_Printerpublic int getNumHeaderCols()
setNumHeaderCols(int)public void addDisplaySize(E4GridSize gs)
gs - the grid-size element to be added.addDisplaySize(int,int)
public void addDisplaySize(int width,
int height)
width - the grid-size width.height - the grid-size width.#addDisplaySize(e4s.html.grid.E4GridSize)public void addDisplaySizeDefault()
addDisplaySize(e4s.html.input.grid.E4GridSize)public int getDisplayRows()
#setDisplaySize,
getDisplayCols()public int getDisplayCols()
#setDisplaySize,
getDisplayRows()public int getFirstRow()
verticalSize().getLastRow(),
verticalSize()public int getLastRow()
verticalSize().getFirstRow(),
verticalSize()public int getFirstCol()
horizontalSize().getLastCol(),
horizontalSize()public int getLastCol()
horizontalSize().getFirstCol(),
horizontalSize()
public void toHtml(E4StringBufferHtml buf,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
toHtml in interface E4HtmlElement_IntftoHtml in class E4HtmlElementGeneralservlet - the servlet context.
java.lang.Exception
public void collectScripts(E4ScriptsVec vec,
E4ServletImplementation_Intf servlet)
collectScripts in interface E4HtmlElement_IntfcollectScripts in class E4HtmlElementGeneralvec - collect the names of all scriptsservlet - the servlet contextE4JavaScript
public void collectTranslationsForEditing(E4TranslationsVec v,
E4ServletImplementation_Intf servlet)
collectTranslationsForEditing in interface E4HtmlElement_IntfcollectTranslationsForEditing in class E4HtmlElementGeneralv - the Vector where the styles will be collected, may not be nullservlet - the current servlet instanceE4Label_Intf
public void collectStylesForEditing(E4StylesHash v,
E4ServletImplementation_Intf servlet)
E4HtmlElementGeneralE4StyleUsage.
collectStylesForEditing in interface E4HtmlElement_IntfcollectStylesForEditing in class E4HtmlElementGeneralv - the Vector where the styles will be collected, may not be nullservlet - the servlet contextE4ServletImplementation_Intf.sessionCanEditStyles(),
#collectStylesForEditing(e4s.html.style.E4StylesHash, STYLE_Name, boolean)
public static E4InputFieldName getE4InputFieldName(int row,
int col)
row - the rowcol - the column
public void processParams(E4ServletImplementation_Intf servlet)
throws java.lang.Exception
java.lang.ExceptionprocessParams(e4s.html.E4CgiParams, e4s.servlet.E4ServletImplementation_Intf)
public void processParams(E4CgiParams params,
E4ServletImplementation_Intf servlet)
throws java.lang.Exception
params - the CGI parameters, containing some values also to layout and branch this grid object
java.lang.Exceptionadd2body(e4s.html.BODY,e4s.servlet.E4ServletImplementation_Intf)public void setActualSizeIndex(int grid_size_index)
grid_size_index - The index representing the size#addDisplaySize(e4s.html.grid.E4GridSize),
addDisplaySize(int,int)public void setFirstRow(int row)
getFirstRow() and getLastRow().
row - the current row to be displayed.getFirstRow(),
getLastRow(),
#vertivalSize()public void setFirstColumn(int col)
getFirstCol() and getLastCol().
col - the current column to be displayed.getFirstCol(),
getLastCol(),
horizontalSize()public E4Label_Intf getCaption_horizontal()
setCaption_horizontal(String),
setCaption_horizontal(e4s.translate.E4Label_Intf)public void setCaption_horizontal(E4Label_Intf caption_horizontal)
caption_horizontal - the caption_horizontal to setgetCaption_horizontal(),
setCaption_horizontal(String),
setCaption_vertical(e4s.translate.E4Label_Intf)public void setCaption_horizontal(java.lang.String caption_horizontal)
caption_horizontal - the caption_horizontal to setgetCaption_horizontal(),
setCaption_horizontal(e4s.translate.E4Label_Intf),
setCaption_vertical(String)public E4Label_Intf getCaption_vertical()
setCaption_vertical(String),
setCaption_vertical(e4s.translate.E4Label_Intf)public void setCaption_vertical(E4Label_Intf caption_vertical)
caption_vertical - the caption_vertical to setgetCaption_vertical(),
setCaption_vertical(String),
setCaption_vertical(e4s.translate.E4Label_Intf)public void setCaption_vertical(java.lang.String caption_vertical)
caption_vertical - the caption_vertical to setgetCaption_vertical(),
setCaption_vertical(e4s.translate.E4Label_Intf),
setCaption_vertical(String)
public static int[] createScaleGaps(int maxIdx,
int treshhold,
int actualIdx)
maxIdx - the maximal indextreshhold - if maxIdx is less than treshhold every index is usedactualIdx - the actualIdx (or -1 if none)
public E4Color getNavigationColor()
setNavigationColor(e4s.html.E4Color),
getLabelColor()public void setNavigationColor(E4Color color)
color - the label colorgetNavigationColor(),
getLabelColor()public E4Color getLabelColor()
setLabelColor(e4s.html.E4Color),
getNavigationColor()public void setLabelColor(E4Color color)
color - the label colorgetLabelColor(),
setNavigationColor(e4s.html.E4Color)
public void add2body(BODY body,
E4ServletImplementation_Intf servlet)
body - the above body element where this grid shall be added.#processParams(e4s.html.E4CgiParams)
public void drawFirstGrid_Screen(TD tdDummy)
throws java.lang.Exception
java.lang.ExceptiondrawFirstGrid_Printer(e4s.html.TD)
public void drawFirstGrid_Printer(TD tdDummy)
throws java.lang.Exception
java.lang.ExceptiondrawFirstGrid_Screen(e4s.html.TD),
isPrinting()
public abstract void drawVerticalHeaders_Screen(TR[] tr,
int firstCol,
int lastCol)
throws java.lang.Exception
drawHorizontalHeader_Screen(e4s.html.TD[], int) this covers more than one cell, so table-cells
could be joined.
tr - one or more TR elements (number depending on the value specified on setNumHeaderRows(int))firstCol - start from this column (including)lastCol - end at this column (including)
java.lang.ExceptiondrawVerticalHeaders_Printer(e4s.html.TR[], int, int),
getNumHeaderRows()
public void drawVerticalHeaders_Printer(TR[] tr,
int firstCol,
int lastCol)
throws java.lang.Exception
drawVerticalHeaders_Printer(e4s.html.TR[], int, int) so there is no implementation required.
tr - one or more TR elements (number depending on the value specified on setNumHeaderRows(int))firstCol - start from this column (including)lastCol - end at this column (including)
java.lang.ExceptiondrawVerticalHeaders_Screen(e4s.html.TR[], int, int),
isPrinting(),
getNumHeaderRows()
public abstract void drawHorizontalHeader_Screen(TD[] td,
int row)
throws java.lang.Exception
drawVerticalHeaders_Screen(e4s.html.TR[], int, int) this covers exactly one cell.
td - one or more TD elements (number depending on the value specified on setNumHeaderCols(int))row - draw header for this row
java.lang.ExceptiondrawHorizontalHeader_Printer(e4s.html.TD[], int),
getNumHeaderCols()
public void drawHorizontalHeader_Printer(TD[] td,
int row)
throws java.lang.Exception
td - one or more TD elements (number depending on the value specified on setNumHeaderCols(int))row - draw header for this row
java.lang.ExceptiondrawHorizontalHeader_Screen(e4s.html.TD[], int),
getNumHeaderCols(),
isPrinting()
public abstract void drawCell_Screen(TD td,
E4InputFieldName fieldname,
int row,
int col)
throws java.lang.Exception
td - the place to draw this input fieldfieldname - the fieldname of that valuerow - the current row greater or equals 0 and less than verticalSize()col - the current column greater or equals 0 and less than horizontalSize()
java.lang.ExceptionsaveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int),
drawCell_Printer(e4s.html.TD, int, int)
public abstract void drawCell_Printer(TD td,
int row,
int col)
throws java.lang.Exception
td - the place to draw this input fieldrow - the current row greater or equals 0 and less than verticalSize()col - the current column greater or equals 0 and less than horizontalSize()
java.lang.ExceptiondrawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int),
isPrinting()public abstract int verticalSize()
horizontalSize()public abstract int horizontalSize()
verticalSize()
public abstract boolean saveValue(E4InputFieldName fieldname,
E4CgiParams params,
int row,
int col)
throws java.lang.Exception
fieldname - the fieldname of that valueparams - all CGI parameters, including the value associated with fieldname.row - the current row greater or equals 0 and less than verticalSize()col - the current column greater or equals 0 and less than horizontalSize()
java.lang.ExceptiondrawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int)public java.lang.String getObjectID()
getObjectID in interface E4ClientObject_IntfgetObjectID in interface E4SessionObject_Intf
public java.lang.String drawCell_Csv(int row,
int col)
throws java.lang.Exception
row - the current row greater or equals 0 and less than verticalSize()col - the current column greater or equals 0 and less than horizontalSize()
java.lang.ExceptiondrawCell_Screen(e4s.html.TD, e4s.html.input.extended.E4InputFieldName, int, int),
drawCell_Printer(e4s.html.TD, int, int)
public java.lang.String drawFirstGrid_Csv()
throws java.lang.Exception
java.lang.Exception
public java.lang.String[] drawHorizontalHeader_Csv(int row)
throws java.lang.Exception
java.lang.Exception
public java.lang.String[][] drawVerticalHeaders_Csv(int firstCol,
int lastCol)
throws java.lang.Exception
java.lang.Exception
public java.lang.StringBuffer toExcel()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.String toString()
toString in class E4Object
public void saveFinished(E4ServletImplementation_Intf servlet)
throws java.lang.Exception
java.lang.Exceptionpublic void createdForm(FORM form)
form - the current formpublic boolean isSaving()
saveValue(e4s.html.input.extended.E4InputFieldName, e4s.html.E4CgiParams, int, int) is in progress.
public static java.lang.String _getSVNVersionString()
E4Util.getRevisionCodeFromSVN(Class)
|
www.element4solution.com | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||