input
stringlengths
10
828
output
stringlengths
5
107
public void set value string attribute name object value get table get volist table model set value at value row number get table get volist table model find column attribute name
method called by lookup controller to update parent v
public int get cell type int row num string attribute name grid control grid return column type text
define the cell type for the specified row
public input control get additional properties int row num string attribute name grid control grid return null
define additional properties for the specified cell
public void set focus lost behavior int behavior try if editor text box null editor text box set focus lost behavior behavior catch exception ex
sets the behavior when focus is lost
public void set export button export button export button if this export button null this export button remove data controller this this export button export button if export button null export button add data controller this binded buttons add export button export button set enabled true
set export button linked to grid
public void set domain domain domain this domain domain domain table cell renderer renderer null domain cell editor editor null iterator it renderers values iterator while it has next renderer domain table cell renderer it next renderer set domain domain it editors values iterator while it has next editor domain cell editor it next editor set domain domain
set the domain
public void set import button import button import button if this import button null this import button remove data controller this this import button import button if import button null import button add data controller this binded buttons add import button import button set enabled true
set import button linked to grid
public void set copy button copy button copy button if this copy button null this copy button remove data controller this this copy button copy button if copy button null copy button add data controller this binded buttons add copy button copy button set enabled true
set copy button linked to grid
public void delete user profile string function id object id throws throwable string user home system get property user home replace if user home ends with user home user home profiles file dir new file user home dir mkdirs file f new file user home id if f exists f delete else throw new ioexception file not found id
delete the specified grid profile
public void delete all grid profiles final string function id throws throwable string user home system get property user home replace if user home ends with user home user home profiles file dir new file user home file files dir list files new file filter public boolean accept file pathname return pathname get name index of function id replace 1 pathname get name ends with cfg if files null for int i 0 i files length i files i delete
delete all grid profiles independently from the current user
public void store grid digest string function id string grid digest throws throwable string user home system get property user home replace if user home ends with user home user home profiles file dir new file user home dir mkdirs file f new file user home function id replace dig if f exists f delete print writer pw null try pw new print writer new file output stream f pw println grid digest catch throwable ex throw new ioexception ex get message finally try pw close catch exception ex1
store the grid digest i
public void store grid profile id string function id object id throws throwable string user home system get property user home replace if user home ends with user home user home profiles file dir new file user home dir mkdirs file f new file user home function id replace get username replace ini if f exists f delete print writer pw null try pw new print writer new file output stream f pw println id catch throwable ex throw new ioexception ex get message finally try pw close catch exception ex1
store the current profile identifier in action
public void set reload button reload button reload button if this reload button null this reload button remove data controller this this reload button reload button if reload button null reload button add data controller this binded buttons add reload button reload button set enabled true
set reload button linked to grid
public void delete all grid profile ids string function id throws throwable string user home system get property user home replace if user home ends with user home user home profiles file dir new file user home dir mkdirs file f new file user home function id replace get username replace ini if f exists f delete
delete all grid profiles identifiers for the current user
protected void set value object value if value null set text null return date d null if value instanceof date d date value else if value instanceof calendar d calendar value get time string s value unknown if d null if dynamic settings null s new simple date format dynamic settings get data format row attribute name format d else s new simple date format date format format d set text s
set the value to be displayed by this cell renderer
private void after previous row grid ensure row is visible grid get selected row if locked grid null locked grid ensure row is visible locked grid get selected row if get nav bar null if grid get selected row 0 last index 1 model get row count get nav bar set first row true else get nav bar set first row false if grid get selected row model get row count 1 more rows get nav bar set last row false else get nav bar set last row true
method called from previous row method
public void focus gained focus event e scrolls horizontal scrollbar to the current filter field filter scroll pane get horizontal scroll bar set value field get location x
focus gained event in filter value field
private void update components switch filter type case filter type value label1 set text client settings get instance get resources get resource filter by label2 set visible false value2 set visible false break case filter type range label1 set text client settings get instance get resources get resource from value label2 set visible true value2 set visible true break
update filter icons
public void set generic buttons enabled boolean enabled for int i 0 i get generic buttons size i generic button get generic buttons get i set enabled enabled
set dis abilitation for whole generic buttons
public void set row selection interval int start row int end row if start row 1 end row 1 return if on loop return on loop true grid set row selection interval 0 0 grid set row selection interval start row end row grid ensure row is visible start row if locked grid null locked grid set row selection interval 0 0 locked grid set row selection interval start row end row locked grid ensure row is visible start row on loop false
set row selection interval
private void init dialog column col properties grids grid try panel new filter panel col properties grid consts filter panel on grid close on exit jb init set size 400 400 set default close operation jdialog hide on close client utils center dialog client utils get parent window grid this catch exception e e print stack trace
constructor called by a grid control to apply filtering sorting conditions
private void repaint additional column headers int index int width try jpanel hp jpanel header to additional header get new integer index if hp null array list list array list additional header to headers get hp int w 0 for int i 0 i list size i if i index w col props integer list get i int value get preferred width else w width hp set preferred size new dimension w hp get size height hp revalidate hp get parent validate catch exception ex
repaint additional column headers based in the specified column index
private void pack search window if search window null return search window pack
method used to pack the search window
public void hide search window if search window null search window set visible false search window dispose search window null text to search
hide the search window
private boolean is out of bounds int row int column if row 0 model get row count row column 0 model get column count column return true else return false
method invoked by merge cells to check cells merging consistency
public void process key event key event e search field process key event e if e is consumed if search field get text null search field get text trim length 0 return if e get key code key event vk enter e consume
listen window events and forward them to search field
private void select int index key event e string text to search if index 1 item found input control set selected index index last element found index search field set foreground default foreground not found label set text else item not found search field set foreground color red not found label set text client settings get instance get resources get resource not found
method invoked when an item does not match the search pattern
private boolean is out of bounds int rows int columns for int i 0 i rows length i if rows i 0 model get row count rows i return true for int i 0 i columns length i if columns i 0 model get column count columns i return true return false
method invoked by merge cells to check cells merging consistency
public response load data map params try method m class for name org openswing swing util client client utils get method get data new class string class object class return response m invoke null new object server method name params catch throwable ex return new error response error while loading data n ex to string
method invoked by the grid to load a block or rows
public void set current number of new rows int current number of new rows this current number of new rows current number of new rows
set the current number of new rows
public void set intercell spacing dimension spacing grid set intercell spacing spacing if locked grid null locked grid set intercell spacing spacing
sets the code row margin code and the code column margin code
private void init init new string 0
create the grid content with no grid on the left
public void set row margin int row margin grid set row margin row margin if locked grid null locked grid set row margin row margin
sets the amount of empty space between cells in adjacent rows
public void init string column names gantt rows clear boolean last enabled model1 is enabled model1 new table1 model model1 reset model column names model1 set enabled last enabled last enabled model2 is enabled model2 new table2 model model2 reset model model2 set enabled last enabled for int i 0 i table2 get column model get column count i table2 get column model get column i set preferred width column width table1 repaint table2 repaint if column names length 0 split pane set divider location 0 else if split pane get divider location 0 split pane set divider location 200
create the grid content
protected void fire new appointment event int row num appointment app for int i 0 i appointment change listeners size i appointment change listener appointment change listeners get i appointment change new appointment change event appointment change event new appointment row num app this
fire a new appointment event
protected void fire appointment changed event int row num appointment oldapp appointment newapp for int i 0 i appointment change listeners size i appointment change listener appointment change listeners get i appointment change new appointment change event appointment change event appointment changed row num oldapp newapp this
fire an appointment changed event
public void editing stopped change event e take in the new value table cell editor editor get cell editor if editor null object value editor get cell editor value boolean ok model set value value editing row convert column index to model editing column final int row editing row final int col editing column remove editor if ok swing utilities invoke later new runnable public void run edit cell at row col
invoked when editing is finished
protected void fire appointment deleted event int row num appointment app for int i 0 i appointment change listeners size i appointment change listener appointment change listeners get i appointment change new appointment change event appointment change event appointment deleted row num app this
fire an appointment deleted event
public boolean drop enabled default mutable tree node node string tree id return true
method called on firing a drop event onto the tree
public void drop action changed
this method is invoked when the user changes the drop action
public void drop enter
this method is invoked when you are dragging over the drop site
public void drop exit
this method is invoked when you are exit the drop site without dropping
public void drop over
this method is invoked when a drag operation is going on
public void set server method name string server method name this server method name server method name
set the method called on server side to retrieve the tree model
public response get tree model jtree tree response response client utils get data server method name super get tree node params if response is error option pane show message dialog tree response get error message client settings get instance get resources get resource error joption pane warning message return response
method called by the tree panel to fill the tree
public void set row height int row height if row height 0 super set row height row height if tree grid this null tree grid this get row height row height tree grid this set row height get row height
sets the row height of the tree and forwards the row height to
public void set bounds int x int y int w int h super set bounds x 0 w tree grid this get height
this is overridden to set the height to match that of the jtable
public void set tree node params map tree node params this tree node params tree node params
set the parameters used to retrieve children nodes
public void set node name attribute string node name attribute this node name attribute node name attribute
set the attribute name of the v
public void set checked nodes hash set checked nodes this checked nodes checked nodes
set current checked nodes i
private void create tree if icon attribute name null icon attribute name equals tree set icon attribute name icon attribute name response response tree data locator get tree model tree get tree if response is error tree root new open swing tree node else tree root default mutable tree node default tree model voresponse response get vo get root recreate tree tree data locator load data completed response is error
fill in the tree
public void set column formatter string attribute name format formatter int index grid columns index of attribute name if index 1 column formatters set index formatter
set the column format for the column identified by the specified attribute name
public boolean is leaf object node return tree node node get allows children
returns code true code if code node code is a leaf
public response validate code string code return client utils get data validation method name new lookup validation params code get lookup validation parameters
method called by lookup controller when validating code
public class get column class int column if column 0 return tree table model class else if getter methods null return super get column class column else return getter methods column get return type
returns the class for the particular column
private void init window frame grids grids hash set cols visible this frame frame this grids grids try control import type set selected index 0 jb init set size 260 300 init grids cols visible client utils center dialog frame this set visible true catch exception ex ex print stack trace
constructor called by grid
private boolean create lookup grid window parent frame lookup parent lookup parent return create lookup grid parent frame lookup parent new grid data locator public response load data int action int start index map filtered columns array list current sorted columns array list current sorted versus columns class value object type map other grid params return lookup data locator load data action start index filtered columns current sorted columns current sorted versus columns value object type
method called by open lookup grid methods to open lookup grid frame
public response get tree model jtree tree return lookup data locator get tree model tree
method called by the tree panel to fill the tree
public void set tree node params map tree node params lookup data locator set tree node params tree node params
set the parameters used to retrieve children nodes
public void set node name attribute string node name attribute lookup data locator set node name attribute node name attribute
set the attribute name of the v
public void load data completed boolean error lookup data locator load data completed error if tree panel get tree get row count 0 tree panel get tree set selection row 0 if tree panel get tree get selection path null tree container left click default mutable tree node tree panel get tree get selection path get last path component
callback method invoked when the data loading is completed
public void key typed key event e if grid this grids get current nested component null if grid this grids get current nested component instanceof grid e instanceof key event key event e get key code e vk tab return grid this grids get current nested component dispatch event e e consume repaint return
invoked when a key has been typed
private void fire force validate event for int i 0 i listeners size i lookup listener listeners get i force validate
method called by force validate method
private int update mnemonics int i 0 jmenu item item null string text null while i this get menu component count count menu component this get menu component i instanceof jseparator item jmenu item this get menu component i text item get text text i text substring text index of item set text text item set mnemonic text char at 0 if client settings icon disable frame null item set icon new image icon client utils get image client settings icon disable frame i return i
update mneonics for items
public void paint component graphics g if back image null int img width back image get width this int img height back image get height this for int i 0 i this get width i i img width for int j 0 j this get height j j img height g draw image back image i j this super paint component g
paint the background image
public string get description return image files gif jpg
the description of this filter
private void reset background background file name null background client utils get image client settings background repaint save config file save user profile
reset the image to use as mdi background and restore the default one
private boolean set background image from file buffered input stream in null try file file new file background file name in new buffered input stream new file input stream file byte bytes new byte int file length in read bytes background new image icon bytes get image repaint return true catch exception ex ex print stack trace return false finally try if in null in close catch exception ex1
set custom background image from file
private void save user profile try properties p new properties if background file name null background file name p set property background file name background file name string file system get property user home replace if file ends with file file profiles mdiframe get instance get title cfg p store new file output stream new file file user properties catch exception ex ex print stack trace
save user profile
public void internal frame deactivated internal frame event e if client settings mdi toolbar null client settings mdi toolbar disable all buttons
invoked when an internal frame is de activated
protected boolean before close frame return true
callback method invoked by close frame
private void init array list languages default list model model new default list model for int i 0 i languages size i model add element languages get i lang list set model model lang list revalidate lang list set selected index 0
initialize the list with the languages
public void menu selected menu event e if function get function id null execute function function
invoked when a menu is selected
private void set mem long total runtime get runtime total memory mem label set text client settings get instance get resources get resource java heap total runtime get runtime free memory 1024 1024 mb client settings get instance get resources get resource used total 1024 1024 mb client settings get instance get resources get resource allocated
set memory occupation
public void component resized component event e jinternal frame frames desktop pane get all frames for int i 0 i frames length i frames i set location last tree menu width tree menu get width frames i get x frames i get y last tree menu width tree menu get width
invoked when the components size changes
public void after mdicreation mdiframe frame generic status panel user panel new generic status panel user panel set columns 12 mdiframe add status component user panel user panel set text username mdiframe add status component new clock
method called after mdi creation
public void key pressed key event e int offset e get key code key event vk up 7 e get key code key event vk down 7 e get key code key event vk left 1 e get key code key event vk right 1 0 int new day get day offset if new day 1 new day calendar get maximum calendar day of month update date true for int i 7 i 49 i if days i get text equals integer to string new day days i request focus break set day new day update date false
jday chooser is the key listener for all day buttons
public void stop application system exit 0
method used to destroy application
public void row changed int row number if frame get users grid get mode consts readonly return if row number 1 frame get user roles grid clear data else user vo vo user vo frame get users grid get volist table model get object for row frame get users grid get selected row frame get user roles grid get other grid params put username vo get username frame get user roles grid reload data
callback method invoked when the user has selected another row
public void mode changed int current mode if current mode consts readonly frame set buttons enabled true else frame get user roles grid set mode consts readonly frame set buttons enabled false
callback method invoked each time the grid mode is changed
public void create value object value object value object throws exception user role vo vo user role vo value object vo set username string frame get user roles grid get other grid params get username
callback method invoked when the user has clicked on the insert button
public boolean authenticate user map login info throws exception prepared statement pstmt null result set rset null try pstmt conn prepare statement select from users where username and password pstmt set string 1 login info get username to string to upper case pstmt set string 2 string login info get password rset pstmt execute query if rset next return true else return false catch exception ex ex print stack trace return false finally try rset close catch exception ex1 try pstmt close catch exception ex1
method called by mdi frame to authenticate the user
public response get tree model jtree tree return new voresponse new default tree model new open swing tree node
method called by the tree panel to fill the tree
public void load data completed boolean error frame get control currency set currency symbol frame get control currency set decimals 2 frame get control currency set decimal symbol frame get control currency set grouping symbol emp vo vo emp vo frame get main panel get vomodel get value object frame get grid get other grid params put emp code vo get emp code frame get grid reload data
callback method called when the data loading is completed
public void mode changed int current mode if current mode consts insert frame get grid clear data frame set enable grid buttons false else frame set enable grid buttons true
callback method called when the form mode is changed
public void create value object value object value object throws exception task vo vo task vo value object vo set status e
callback method invoked when the user has clicked on the insert button
public void after mdicreation mdiframe frame mdiframe add status component new clock
method called after mdi creation
public color get background color int row string attributed name object value if attributed name equals dept code if value equals sf return new color 255 100 100 else if value equals s return new color 210 100 100 else if value equals p return new color 170 100 100 return super get background color row attributed name value
method used to define the background color for each cell of the grid
public void create value object value object value object throws exception dept vo vo dept vo value object vo set status e
callback method invoked when the user has clicked on the insert button
public boolean authenticate user map login info throws exception return true
method called by mdi frame to authenticate the user
public void login successful map login info
method called by login dialog to notify the sucessful login
public void load data completed boolean error panel get control currency set currency symbol panel get control currency set decimals 2 panel get control currency set decimal symbol panel get control currency set grouping symbol emp vo vo emp vo panel get main panel get vomodel get value object panel get grid get other grid params put emp code vo get emp code panel get grid reload data
callback method called when the data loading is completed
public void mode changed int current mode if current mode consts insert panel get grid clear data panel set enable grid buttons false else panel set enable grid buttons true
callback method called when the form mode is changed
protected boolean before close frame grid null return true
callback method invoked by close frame
public color get background color int row string attribute name object value dept vo vo dept vo model get object for row row if vo get dept code equals s return color orange return super get background color row attribute name value
method used to define the background color for each cell of the grid
public string get image name return setup gif
this method could be overrided
public string get image name return setup3 gif
this method could be overrided
public string get first panel id wizard panel wizard return intro
method called by wizard panel when showing the panel the first time
public string get last panel id wizard panel wizard if first panel wizard get panel first get radio button zip is selected return second else return third
method called by wizard panel to check which panel is the last one
private void add files array list files file dir file newfiles dir list files for int i 0 i newfiles length i if newfiles i is directory add files files newfiles i else files add newfiles i
add recursiverly a list of files for the specified directory