input
stringlengths
10
828
output
stringlengths
5
107
public int get row id int row return model get row id row
get the id of this row
public void register managed table model get model register
register the underlying managed table model
public table row get row at int index return model get row at index
return the row at the given index
public int get id at int index if get first value null if index 0 first element there is no id return 0 else skip the first element index return managed table model get model get row id index
get the id corresponding to the given index
public field mapper the list new array list
create an instance of field mapper and initialize code the list code
public int contains ignore case object element string element string string element find position for comparison int new position this size while new position 0 element string trim compare to ignore case string this get new position 1 trim 0 new position system out println new position new position if new position this size element string trim equals ignore case string this get new position trim element matches existing item do not replace existing item return new position return 1
searches for the specified element in this list ignoring case
public void add string fieldname lfield field int position boolean checkbox the list add new field item fieldname field position checkbox
add a new screen field
public void create temporary table prepared statement ps throws sqlexception log print create temporary table ps set bin log enabled false if temp table has been created log print dropping temporary table before create st execute update drop temporary table if exists temp temp table has been created true ps execute update
create a temporary table using a prepared statement
public int get column max count return column max count
return the number of values in a row
public int get row id int row assert row 0 return row data get id
get the id of this row
public void clear screen string treatment level project mapper hash value hv for int i 0 i the list size i field item item field item the list get i hv proj mapper get hash value item fieldname if hv field level 1 treatment level equals l1 hv field level 0 treatment level equals l2 hv field name equals general document type item field clear field item field set changed false jcheck box check box item field get check box if check box null check box set enabled false check box set selected false
clear all screen fields
public int get column count return column max count
table model interface method to return the number of
public object get value at int row int column assert row 0 assert column 0 return row data get value 0
table model interface method to return the number of
public table row get row at int index assert index 0 return row data
return the row at the given index
public boolean get permission team leader return permission team leader
obtain permission team leader
public void clear screen changed for int i 0 i the list size i field item item field item the list get i item field set changed false
clear change flags on all screen fields
public void set checkbox unselected enabled boolean flag for int i 0 i the list size i field item item field item the list get i jcheck box check box item field get check box if check box null break else check box set enabled flag check box set selected false
if the screen fields have checkboxes unselect them
public managed table group object user object managed table model child model this child model child model if user object instanceof table row row data table row user object else row data new table row 0 new object user object initialize child model add table model listener this
create a table model with the given parameters
public void finished writing temporary table throws sqlexception log print finished writing temporary table assert temp table has been created set bin log enabled true
indicate that writing to a temporary table is complete
public int get row id int row table row row data get row at row return row data get id
get the id of this row
public int get row count return child model get row count 0 0 1
table model interface method to return the number of
public string to string table row row table row get user object string first bates string row get value 0 string last bates string row get value 1 string boundary flag string row get value 2 string buffer buffer new string buffer first bates if first bates equals last bates buffer append buffer append last bates if c equals boundary flag buffer append buffer append boundary flag buffer append return buffer to string
override to return first bates last bates boundary flag
public object get value at int row int column table row row data get row at row return row data get value 0
table model interface method to return the value at
public lfield first changed for int i 0 i the list size i field item item field item the list get i log print first changed i if item field is changed return item field return null
return the first screen field with the change flag
public void set table model table model model string column names new string model get column count for int i column names length 1 i 0 i column names i model get column name i this column names column names
set the table model to provide column names
public table row get row at int index assert get row count 0 index 0 return row data
return the row at the given index
public void set column class int column class type assert type integer class expand column types column 1 column types column type
set the column class to other than the default string
public boolean get permission admin users return permission admin users
obtain permission admin users
public class get column class int column if column types null column types column null return super get column class column else return column types column
get the column class for a column
public boolean get permission admin project return permission admin project
obtain permission admin project
public void populate screen field string fieldname map map if map null for int i 0 i the list size i field item item field item the list get i if item fieldname equals fieldname item field set text string map get item fieldname set screen changed true wbe 2004 08 31 only the one field item field set changed true change set by set text
fill in a single screen field with coding data from the database
public boolean get permission admin batch return permission admin batch
obtain permission admin batch
public prepared statement prepare statement string sql throws sqlexception return new managed prepared statement this sql
prepare a managed prepared statement
public void add int gridx int gridy string label component comp string clist label constraints gridx gridx label constraints gridy gridy add new jlabel label label constraints add comp gbc gridx 1 gridy clist
add a code component code with a label to the pane with
public int get row id int row table row row data table row data get row return row data id
get the id of this row
public int execute update string sql throws sqlexception prepared statement ps prepare statement sql int count ps execute update ps close return count
execute given sql as a managed prepared statement
public void add int gridx int gridy javax swing jlabel label component comp string clist label constraints gridx gridx label constraints gridy gridy add label label constraints add comp gbc gridx 1 gridy clist
add a code component code with a label to the pane with
public void add int gridx int gridy string label component comp add gridx gridy label comp null
add a code component code with a label to the pane with
public map populate error row hash map the map the map new hash map for int i 0 i the list size i field item item field item the list get i jcheck box check box item field get check box if check box is enabled if the map null the map the map new hash map the map put item fieldname check box is selected boolean true boolean false return the map
populate a table with error indications
public void add int gridx int gridy javax swing jlabel label component comp add gridx gridy label comp null
add a code component code with a label to the pane with
public string to string table row row data table row get user object string leader name string row data get value 1 if leader name null leader name length 0 return super to string else return super to string leader name
overridden to append the team leader name if any to the team name
public boolean get permission admin profit return permission admin profit
obtain permission admin profit
public void populate error screen map the map if the map null the map collections empty map for int i 0 i the list size i field item item field item the list get i jcheck box check box item field get check box object value the map get item fieldname if value null check box set enabled false check box set selected false else check box set enabled true check box set selected yes equals value
enable and select error checkboxes
public table row get row at int index return table row data get index
return the row at the given index
public boolean is level indicator return field level check box is selected
used by project admin page to enable delete button if this is not
public void set model tree model model tree set model model
sets the tree model that will provide the data
public string to string table row row data table row get user object string team name string row data get value 1 if team name null team name length 0 return super to string else return super to string team name
overridden to append the team name if any to the user name
public default mutable tree node get child default mutable tree node parent int index if parent is leaf return default mutable tree node tree model get child parent index return null
returns the child of parent at index index in the parents child array
public void add mouse listener mouse adapter ma tree add mouse listener ma
adds the specified mouse listener to receive mouse events from
public void set root user object string name root node set user object name
sets the user object for this node to code name code
public void set user object tree path path string name node set user object name tree model value for path changed path name tree model node changed default mutable tree node path get last path component
change the text that is viewable by the user for this node
public int get selection count return tree get selection count
returns the number of nodes selected
public tree path get path for location int x int y return tree get path for location x y
returns the path for the node at the specified location
public void add table model listener table model listener listener if listener instanceof weak table model listener already wrapped don t wrap it twice and don t add it if the referent has been garbage collected object reference weak table model listener listener get if reference null super add table model listener listener else log print null referent when adding listener else super add table model listener new weak table model listener listener this
wrap listener in weak table model listener and add it
public tree path get selection path return tree get selection path
returns the path to the first selected node
public void remove table model listener table model listener listener assert listener instanceof weak table model listener super remove table model listener listener
remove a table model listener
public void set tree selection model int tsm tree get selection model set selection mode tsm
sets the selection model which must be one of single tree selection
protected string check text string str int offs parse position pos new parse position 0 string text super get text string new text text substring 0 offs str text substring offs number value nf parse new text pos check that parsing accepted the entire new text return value null pos get index new text length str null
limit insertions so that field always contains a valid integer
public string to string return sqlmanaged table model name with id
return a string identifying this model
public string get text return integer to string get value
get the textual value
public int get value string text super get text if text length 0 return 0 try return nf parse super get text int value catch parse exception e log quit e return 0
get the integer value
public void set drag enabled boolean flag tree set drag enabled flag
sets the drag enabled property which must be true to enable automatic drag
private void get coder data string parameters new string 2 parameters 0 integer to string child id parameters 1 field name final client task task task new task execute query get coded data parameters task set callback new runnable public void run ge checked value result set task get result boolean ok task enqueue this add controls
get the coder data for a field
public void set text string text if text null text length 0 super set text else set value integer parse int text
set this field from a text value
public void show node default mutable tree node node if node null return log print dynamic tree show node node tree path path new tree path node get path tree scroll path to visible path tree set selection path path
makes sure all the path components in path are expanded except for the
public void set value int value string text if value 0 text nf format value super set text text
set this field from an integer value
public dimension get preferred size int columns get columns if columns 0 return super get preferred size else use size calculation with extra columns for commas return get preferred size columns 4 1 3
returns the preferred size dimensions needed for this
protected int get column width if l column width 0 font metrics metrics get font metrics get font l column width metrics char width n return l column width
gets the column width
public dimension get preferred size dimension size super get preferred size int columns get columns if columns 0 todo get rid of magic number in calculation size width 32 columns get column width return size
returns the preferred size dimensions needed for this
public void set document document doc super set document doc
call to set document not valid
private void tool tip text
this class cannot be instantiated
public void set selection paths tree path path tree set selection paths path
selects the nodes identified by the specified array of paths
public int render graphics2 d g2 int page this g2 g2 return render page false
call render to format a single page of the report
public string to string table row row data table row get user object int priority integer row data get value 3 int value string group integer parse int string row data get value 6 0 group integer parse int string row data get value 6 return row data get value 0 project name batch row data get value 1 group batch number tbd should be queue type batch or unit priority priority negative is returned
overridden to return project batch priority
public void remove node from parent default mutable tree node node remove node from parent node true
call code remove node from parent code defaulting to
public string to string table row row data table row get user object int priority integer row data get value 3 int value return row data get value 0 project name batch row data get value 1 batch number tbd should be queue type batch or unit priority priority negative is returned
overridden to return project batch priority
public void remove node from parent default mutable tree node node boolean remove childless parent default mutable tree node parent default mutable tree node node get parent tree model remove node from parent node if remove childless parent parent get child count 1 tree model remove node from parent parent
message this to remove node from its parent
protected string check text string str return str
this method may be overridden to provide checking and modification
public int get number of pages if initialize return pageable unknown number of pages else return page start row size
return the number of pages which is the size of
private void check ok set enabled if field name get text equals type combo get text equals ok button set enabled true else ok button set enabled false
check if ok should be enabled
public void remove current node tree path current selection tree get selection path if current selection null default mutable tree node current node default mutable tree node current selection get last path component mutable tree node parent mutable tree node current node get parent if parent null tree model remove node from parent current node return either there was no selection or the root was selected toolkit beep log print beep dynamic tree either there was no selection or the root was selected
remove the currently selected node from the model
public void focus gained focus event e try abstract page get status string set text log print is focused get selected icon set focus painted true set selected true set border painted true catch throwable t log quit t
invoked when a component gains the keyboard focus
public void focus lost focus event e try log print not focused get selected icon set focus painted false set selected false set border painted false catch throwable t log quit t
invoked when a component loses the keyboard focus
public default mutable tree node add object object child default mutable tree node parent node null tree path parent path tree get selection path if parent path null parent node root node else parent node default mutable tree node parent path get last path component return add object parent node child true 1
add child to the currently selected node
public void action performed action event e if e get source ok ok clicked true else if e get source clear clear clicked true clear hide
called when the ok button is pressed
public void drop drop target drop event e
drop must be overridden in code batching page
public string get value int index object obj super get user object if obj instanceof table row table row tr table row obj return string tr get value index return
return the value at the given index
public void drag gesture recognized drag gesture event e get the first selected node tree path drag path get selection path if drag path null users tree node drag node users tree node drag path get last path component if drag node null drag node is transferable begin the drag try get the transferable object transferable transferable transferable drag node drag source start drag e drag source default copy drop transferable this super start drag e drag source default copy drop drag node catch invalid dn doperation exception idoe log print users dynamic tree idoe
override code dynamic tree code s method to start a
public string get selection if new value equals new value trim equals old value trim toolkit get default toolkit beep object options yes no int ok joption pane show option dialog this do you want to change all occurrences of old value to new value in project text get text normalize verification joption pane yes no option joption pane question message null options options 1 if ok joption pane ok option log print normalize values dialog get selection from old value to new value in project text get text return new value return
after verifying that the user wants to normalize the value by
public int get id return super get row id
return the value in the id data item
public void drag over drop target drag event e point pt e get location int action e get drop action tree path destination path get path for location pt x pt y if destination path null users tree node node users tree node destination path get last path component if node instanceof users tree node log print batching page drag over drop target destination path node if drag and drop paths are ok accept drop if node is droppable e accept drag action else e reject drag
override code dynamic tree code s method to determine
public boolean verify jcomponent input lfield field lfield input if checked return true checked true string value field get text if value null value length 0 return true if min null min equals value null value equals if value compare to ignore case min 0 value is less than the min value return false if max null max equals value null value equals if value compare to ignore case max 0 value is greater than the max value return false return true
check the value of code input code to see if it is within
public boolean is team return get type equals team
is the currently selected node a team name
public void set checked boolean checked min max verifier checked checked
if this field has already been checked dont check again but allow
public boolean is volume return get type equals volume
is the currently selected node a volume name
public void scroll path to visible default mutable tree node node tree path path new tree path node get path tree collapse path path tree scroll path to visible path
makes sure all the path components in path are expanded except for
public boolean is user return get type equals user
is the currently selected node a users name
public boolean is assigned return get type equals coding assigned get type equals unitize assigned get type equals uqc assigned get type equals qc assigned get type equals qa assigned get type equals masking assigned get type equals modifyerrors assigned get type equals listing assigned get type equals tally assigned
is the currently selected node assigned
public boolean is queued return get type equals coding queued get type equals unitize queued get type equals uqc queued get type equals qc queued get type equals qa queued get type equals masking queued get type equals modifyerrors queued get type equals listing queued get type equals tally queued
is the currently selected node queued
public void insert update document event e check ok enabled
gives notification that there was an insert into the document