input
stringlengths
10
828
output
stringlengths
5
107
public void close throws ioexception if debug system out println message writer close if the writer is still open we finish the element otherwise writer null we ve already closed it to create a data stream if writer null end element assert element stack size 0 start end element mismatch writing message for debug purpose prints the client side xml system out println xml output cache to string writer close debug only cache null debug only writer null
write message postamble and close the message substream
public void start element string element throws ioexception system out println inside message writer start element method element if debug system out println message writer start element element if is element open debug only cache append n debug only writer write n start line element is element open true is sub element seen false element stack add element
write element start tag
public void end element throws ioexception system out println inside message writer end element method if debug system out println message writer end element string element string element stack get element stack size 1 element stack remove element stack size 1 if is element open is element open false debug only cache append n debug only writer write n else if is sub element seen start line element debug only cache append n debug only writer write n else debug only cache append element n debug only writer write element n is sub element seen true
write the closing tag for the current element
private logged input stream input stream stream super stream
create a logged input stream backed by the given input stream
private void write try load project description if writer null writer end element catch sqlexception e log quit e catch ioexception e log quit e
write the xml description of project fields
private void flush string element name throws ioexception if there s something in buffer if buffer length 0 start the value list if it s not already started if writer null writer task get message writer writer start element t value list log print project writer flush field name buffer write the data from the buffer writer start element element name writer write attribute a name field name writer write content buffer writer end element empty the buffer buffer
write the value that has been constructed in buffer if any
public string edit project mapper map map value map boolean force boolean unitize int active group string treatment level return edit map null value map force unitize active group treatment level
do all edits required for the value map provided
private boolean required exists string value if value null value length 0 return false return true
check a single field for the edit parameters defined in project fields
public boolean check mandatory string str default list model model log print project editor check mandatory str model size string str array str split int size str array length for int i 0 i size i if model contains str array i trim log print project editor check mandatory return false str array i trim return false return true
see if the given string is listed in the model
public boolean check mandatory string str managed table model model log print project editor check mandatory str model size string str array str split int row count model get row count int size str array length for int i 0 i size i for int j 0 j row count j if str equals string model get value at j 0 break if j row count str not found in model return false if model contains str array i trim log print project editor check mandatory return false str array i trim return false return true
see if the given string is listed in the model
private void show error dialog string error string string error directive string error string1 toolkit get default toolkit beep log print beep project editor show error dialog object options ok int response joption pane show option dialog comp error string error directive validation field error error string1 joption pane ok option joption pane error message null options options 0
show the error dialog
public jcombo box get project combo return project combo
allows access by report programs subclasses of
public jcombo box get team combo return team combo
allows access by report programs subclasses of
private managed table filter get sorted list model string table name managed table filter filter new managed table filter tablevalue model public boolean accept table row the row if table name equals string the row get value 1 return true return false if filter get row count 0 return filter no tablevalue s could be a global table
filter the tablevalue model provided by split pane viewer by table name
public project mapper remove hash value hash value hv log print project mapper remove hash value hv sequence hv field name int index get field index hv field name if index 1 key remove index put hv field name null adjust sequences for int i hv sequence 1 i key size i hash value work hv get hash value i work hv sequence log print project mapper remove hash value seq work hv field name at work hv sequence put work hv field name work hv return this
replace this fields hash value with null in this hash map
public date selection field get date field return date selection field date field
allows access by report programs subclasses of
public date selection field get end date field return date selection field end date field
allows access by report programs subclasses of
public jtext field get days field return days field
allows access by report programs subclasses of
public jcheck box get order check box return order check box
allows access by report programs subclasses of
public jcheck box get order check box2 return order check box2
allows access by report programs subclasses of
public jcheck box get order check box3 return order check box3
allows access by report programs subclasses of
public jbutton get generate button return generate button
allows access by report programs subclasses of
private void validate column
todo needs to be implemented
protected void tab selected log print import page tab selected if project model null project model new sqlmanaged combo model get all projects project model register project combo set model project model query combo model combo new query combo model get all projects project combo set model combo
perform page initialization
public void run toy implementation system out println fetching mail
implements timer tasks abstract run method
private void button mouse clicked java awt event mouse event evt jbutton button jbutton evt get source string group button get name jpanel group border pane jpanel button get parent boolean visible group border pane get component 1 is visible group border pane get component 1 set visible visible if visible button set text group group else button set text group group
open and close the pane containing group projectfields as the user
private jbutton get button int group jbutton button new jbutton group group button set horizontal alignment swing constants left button set preferred size new dimension 240 18 button set background new color 57 70 125 button set foreground color white button set name integer to string group button set focusable false button add mouse listener new java awt event mouse adapter public void mouse clicked java awt event mouse event evt button mouse clicked evt return button
create a button with the properties required of the group separator and
private void exit application log print qaproof readingpage exit application try local properties store file catch exception e try synchronized image thread class if global the image connection null global the image connection shutdown catch exception e try client global the server connection shutdown final client task task task new task goodbye task enqueue this catch exception e try local properties store file catch exception e system exit 0
exit the application
protected boolean cross field edit return cross field edit false
do the cross field editing
private void exit application log print split pane viewer exit application try local properties store file catch exception e try synchronized image thread class if global the image connection null global the image connection shutdown catch exception e try client global the server connection shutdown final client task task task new task goodbye task enqueue this catch exception e try local properties store file catch exception e system exit 0
exit the application
public void save view if view prefix null log print save view skipping null else if get extended state 0 string position this get x this get y this get width this get height if current view coding undocked position undocked dialog get x undocked dialog get y undocked dialog get width undocked dialog get height else position splitpane get divider location log print saving view current view local properties get property view prefix current view view position local properties set property view prefix current view coordinates position
save location and size information for current view
private void get viewer data string bates try final client task task new task request image bates which status set viewer callback task catch throwable th log quit th
call client task to enqueue a task to get the requested data
private void get viewer data int page id int offset int boundary get viewer data page id offset boundary false
call client task to enqueue a task to get the requested data
protected void get coder data int page id int offset int boundary try log print spv get coder data page id offset page id offset bdry boundary final client task task new task request coding page id offset boundary coding set coder callback task catch throwable th log quit th
call client task to enqueue a task to get the requested data
private boolean do view from source image data data string filename if active group 1 for brs group one uses a different image log print spv do view from source data image path data group one path data group one filename filename data image path data group one path data group one filename else filename data image path data path data document number data filename image thread render image our viewer filename data offset resolution data server ip port set image path filename return true
call the viewer to render an image
private void copy all log print copy all copy all from previous record copy field null if saved page id 0 get page values saved page id actual
for the current page get the values from the previously saved page
private void copy field log print copy field copy one field from previous record copy field jcomponent keyboard focus manager get current keyboard focus manager get permanent focus owner log print spv copy field action fieldname copy field copy field get name if saved page id 0 if no previous save get the preceding page s values get page values the coding data page id minus one else get page values saved page id actual
for the current field get the value from the focused field in the
public int delete dialog try log write in delete dialog toolkit get default toolkit beep log print beep qaproof readingpage delete dialog object options yes no return joption pane show option dialog this do you want to delete this document delete verification joption pane yes no option joption pane question message null options options 1 catch throwable th log quit th return 0
user has pressed delete
private void hide current popup component current focus keyboard focus manager get current keyboard focus manager get focus owner log print spv hide current popup current focus get parent ibase text field get instance get text field get parent if current focus null current focus get parent instanceof ibase text field log print spv is instance true ibase text field current focus get parent hide popup
hide the popup if the currently focused component is an ibase text field
private void reset input verifier component current focus keyboard focus manager get current keyboard focus manager get focus owner if current focus null current focus get parent null current focus get parent instanceof ltext field current focus get parent instanceof beans ldate field if current focus instanceof jcomponent object obj jcomponent current focus get input verifier if obj null if obj instanceof min max verifier min max verifier obj set checked false else if obj instanceof mask field verifier mask field verifier obj set checked false
reset the input verifier if the currently focused component has one
protected void get coder data int page id int offset int boundary try log print spv get coder data page id offset page id offset bdry boundary final client task task new task request coding page id offset boundary which status set coder callback task catch throwable th log quit th
call client task to enqueue a task to get the requested data
public void set parent qagroup assign window parent parent parent
set frame to be made visible when this frame is closed
public int delete dialog try log write in delete dialog toolkit get default toolkit beep log print beep split pane viewer delete dialog object options yes no return joption pane show option dialog this do you want to delete this document delete verification joption pane yes no option joption pane question message null options options 1 catch throwable th log quit th return 0
user has pressed delete
public void set parent jframe new parent parent new parent
set frame to be made visible when this frame is closed
public void remove view panel bottom pane remove j panel1
remove the panel contains the view other fields save button
public int get int configuration key key int default value int result default value string value properties get property key get key default value try result integer parse int value catch number format exception e system out println configuration manager get int invalid int for key key e print stack trace return result
fetch an int from the properties file
public boolean equals object other if other null return false if other instanceof log view4 jevent id return log view4 jevent id other id id return false
checks ids for equality
public boolean get boolean configuration key key string value properties get property key get key false return boolean value of value boolean value
fetches a boolena value returning false by default
public boolean equals object other if other null return false if other instanceof log view4 jevent key return key equals log view4 jevent key other key return false
checks keys for equality
public void register log view4 jevent listener listener log view4 jevent id events listener get events of interest if events null return for int i 0 i events length i list list get listeners events i list add listener
registers an event listener to its events of interest
public long get long configuration key key long default value long result default value string value properties get property key get key default value try result long parse long value catch number format exception e system out println configuration manager get long invalid long for key key e print stack trace return result
fetch an long from the properties file
public log view4 jevent id get event id return event id
fetches the event id
public void fire event log view4 jevent event don t bother checking calling thread for these events if event contains log view4 jevent key just fire event fire event on awtthread event return if swing utilities is event dispatch thread fire event on awtthread event else log view4 jevent dispatcher dispatcher new log view4 jevent dispatcher event swing utilities invoke later dispatcher
fires an event to the registered listeners checking to see if the
public object get log view4 jevent key key return data get key
fetches data from this event
private properties load properties properties p new properties input stream in null file file new file config file try in new file input stream file p load in catch throwable t system out println configuration manager load properties failed to load properties from file file get absolute path t print stack trace finally if in null try in close catch ioexception e e print stack trace return p
loads the properties file
public void set log view4 jevent key key object value data put key value
stores data in this event
protected void fire event on awtthread log view4 jevent event list listeners list get listeners event get event id for int i 0 i listeners list size i log view4 jevent listener listener log view4 jevent listener listeners list get i listener event received event
fires the event on the awt event dispatcher thread
public boolean contains log view4 jevent key key return data contains key key
checks to see if this event contains the requested key
public string to string string buffer buffer new string buffer buffer append log view4 jevent id append get event id get id append return buffer to string
returns this as a string
private list get listeners log view4 jevent id id if listeners contains key id return list listeners get id list listener list new array list listeners put id listener list return listener list
get the listeners for the requested event id
public void event received log view4 jevent event switch event get event id get id case log view4 jevent id logging level filter changed id filter level changed integer event get log view4 jevent key level filter flags
fired when a requested event is received
public void run fire event on awtthread event
executed by the awt event dispatcher thread
protected void filter level changed integer flags this fire changed new logging level matcher flags int value
fired when the level filter has changed and tells the table to refilter
public boolean matches object o log view4 jlogging event event log view4 jlogging event o if level flags event get level flag event get level flag return true return false
fired to check if a logging event dto matches the requested levels
protected void init set opaque false set margin new insets 1 1 1 1
initializes the button
protected void init set opaque false set border border factory create empty border set floatable false set margin new insets 0 0 0 0 put client property jtool bar is rollover boolean true put client property plastic look and feel is 3 d key boolean false
initialize the toolbar
public void toggle on on on update toggle state
flips the toggle state
protected void init super init copy button new tool bar button copy copy event to clipboard images copy gif add copy button register listeners
initializes the toolbar buttons
private void update toggle state if on set icon on icon else set icon off icon
updates the toggle state
protected void update level filter simple toggle button button button toggle on log view4 jevent clear event new log view4 jevent log view4 jevent id clear event selection log view4 jevent manager get instance fire event clear event log view4 jevent event new log view4 jevent log view4 jevent id logging level filter changed event set log view4 jevent key level filter flags get level flags event set log view4 jevent key just fire event boolean true log view4 jevent manager get instance fire event event
toggles the button level state and notifies listeners of the change
private void register listeners throws log view4 jexception try socket listener new socket listener port catch log view4 jexception e e print stack trace error message log view4 j failed to listen on socket port caused by n e to string exit thread t new thread socket listener t set priority thread norm priority 1 t start
register event listeners
public void error message string message joption pane show message dialog this message log view4 j error joption pane error message
shows an error message
public void update ui super update ui remove divider border
updates the ui to remove the divider border if possible
protected void process window event window event e super process window event e if e get id window event window closing exit
handle close requests as exits
protected void toggle play pause play button toggle on if play button is on play button set tool tip text event receival is active click to pause else play button set tool tip text event receival is inactive click to start log view4 jevent event new log view4 jevent log view4 jevent id pause processing events event set log view4 jevent key paused new boolean play button is on log view4 jevent manager get instance fire event event
toggles the play button state and fires an event
private void remove divider border split pane ui split pane ui get ui if split pane ui instanceof basic split pane ui basic split pane ui basic ui basic split pane ui split pane ui basic ui get divider set border border factory create empty border
removes the divider border if this is a basic split pane ui
protected void create menu menu bar put client property options header style key header style both menu bar add file menu menu bar add help menu file menu add new exit action help menu add new about action set jmenu bar menu bar
creates the application menu
public comparator get column comparator int column if case insensitive columnn index column return glazed lists case insensitive comparator else return super get column comparator column
fetches the comparator for the requested column
protected void clear events log view4 jevent event new log view4 jevent log view4 jevent id remove all events event set log view4 jevent key just fire event boolean true log view4 jevent manager get instance fire event event
fired to clear events
public void add sort action listener final action listener sort action listener sort listener awtevent multicaster add sort listener sort action listener
registers the specified
public void remove sort action listener final action listener sort action listener sort listener awtevent multicaster remove sort listener sort action listener
deregisters the specified
protected integer get level flags int flags 0 if debug button is on flags flags log view4 jlogging event level debug flag if info button is on flags flags log view4 jlogging event level info flag if warn button is on flags flags log view4 jlogging event level warn flag if error button is on flags flags log view4 jlogging event level error flag if fatal button is on flags flags log view4 jlogging event level fatal flag return new integer flags
fecthes the level filter flags
protected void redetect comparator comparator current comparator super redetect comparator current comparator force the table header to redraw itself table get table header revalidate table get table header repaint
examines the current
protected boolean is sorting mouse event mouse event e return e get button mouse event button1
determines if the specified mouse event shall be handled by this
public void mouse clicked mouse event e if is sorting mouse event e return table column model column model table get column model int view column column model get column index at x e get x int column table convert column index to model view column int clicks e get click count if clicks 1 column 1 sorted columns column column clicked column clicks
when the mouse is clicked this selects the next comparator in
public void table changed table model event event if event get first row table model event header row event get column table model event all columns the table structure may have changed due to a change in the table format so we conservatively reset the table format set table format event table model table get model get table format if the comparator has changed comparator current comparator sorted list get comparator if current comparator sorted list comparator redetect comparator current comparator
when the number of columns changes in the table we need to
public void dispose super dispose if the default renderer within the table header is our sort arrow renderer uninstall it by restoring the table header s original default renderer if table get table header get default renderer sort arrow header renderer table get table header set default renderer sort arrow header renderer get delegate renderer remove our listeners from the table s header and model table get table header remove mouse listener listener table get model remove table model listener listener null out our table reference for safety s sake table null
releases the resources consumed by this
public table cell renderer get delegate renderer return this delegate renderer
returns the delegate renderer that is decorated with sort arrows
protected void init get viewport add text area set border border factory create empty border text area set border border factory create empty border 3 3 3 3 text area set line wrap false text area set tab size 4 text area set font new font courier new font plain 12 text area set editable false register listeners
initializes this component
protected void register listeners log view4 jevent manager get instance register this
registers for selection events
public void event received log view4 jevent event switch event get event id get id case log view4 jevent id logging event selected id log event selected event break case log view4 jevent id copy details id copy break
handles events from the event manager
protected void log event selected log view4 jevent event log view4 jlogging event logging events log view4 jlogging event event get log view4 jevent key logging event if logging events length 1 set logging event logging events 0 else set logging event null
fired when a log event is selected the log event itself might
public int compare object o1 object o2 log view4 jlogging event e1 log view4 jlogging event o1 log view4 jlogging event e2 log view4 jlogging event o2 long w1 e1 get when long w2 e2 get when if w1 w2 return 1 else if w1 w2 return 1 else return 0
compare event time stamps
public void set logging event log view4 jlogging event logging event if logging event null text area set text null else text area set text logging event get formatted string text area set caret position 0
sets the logging event to display
private void copy string selection st new string selection text area get text clipboard cp toolkit get default toolkit get system clipboard cp set contents st null
copies the details to the clipboard
public void mouse clicked mouse event e if get selected row 1 if swing utilities is right mouse button e log table popup menu popup new log table popup menu popup show menu this e get x e get y
fired when teh mouse is clicked on the table
public void action performed action event e joption pane show message dialog log view4 j get root frame get body message log view4 j joption pane information message image manager get instance get image images logview4j about gif
handles showing the about box
private string get body message string buffer buffer new string buffer buffer append html buffer append log view4 j version append version buffer append p buffer append listening on port append port buffer append p buffer append author josh passenger buffer append html return buffer to string
fetch the body message
public void action performed action event e log view4 jframe exit
handles exiting the system
public void action performed action event e log view4 jevent event new log view4 jevent log view4 jevent id delete events below log view4 jlogging event log event log table get instance get log event log table get instance get selected row event set log view4 jevent key logging event log event log view4 jevent manager get instance fire event event
fired whe this action is invoked