input
stringlengths
10
828
output
stringlengths
5
107
public void prepare if get request get method equals ignore case post ext update equals get request get parameter from prevent failures on new ext update equals get request get parameter from is prevent ext update if equals get request get parameter user id jron ext equals get request get parameter from user user manager get user get request get parameter user id
grab the entity from the database before populating with request parameters
public object clone try return super clone catch clone not supported exception e shouldn t happen throw new internal error e to string
copies the cookie
public void test text pane throws interrupted exception action action new action adapter nm new abstract action public void action performed action event e trigger true system out println fired better text pane pane new better text pane action pane add modifier key event shift down mask pane add modifier key event ctrl down mask add pane window set visible true wait for me 50 system out println trigger
didnt feel like working the robot
public void test text pane throws interrupted exception final jlabel label new clock label action action new action adapter nm new abstract action public void action performed action event e label set visible false system out println fired label set text blah add label jbutton button new jbutton action button set tool tip text blah add button window set visible true wait for me 50 system out println trigger
didnt feel like working the robot
public void test offset label throws interrupted exception final jlabel plain label new jlabel blah final int width inc 3 final jlabel offset label new jlabel blah this removes the need for a whole panel up the width return new width public dimension get preferred size dimension dim super get preferred size dim width width inc return dim protected void paint component graphics g g translate width inc 0 super paint component g window set layout new flow layout add plain label add offset label window set visible true wait for me 50 system out println trigger
didnt feel like working the robot
public dimension get preferred size dimension dim super get preferred size dim width width inc return dim
up the width
public void add servlet string url pat servlet servlet try servlet init new serve config this registry put url pat servlet servlets put servlet get class get name servlet catch servlet exception e log problem initializing servlet e
register a servlet
public void add default servlets boolean cgi add servlet new acme serve file servlet
register a standard set of servlets
public void add default servlets boolean cgi string throttles throws ioexception add servlet new acme serve file servlet throttles
register a standard set of servlets with throttles
protected void process message message message throws ioexception return a message back message set outgoing false
overide this message with code that sends the message out
protected void process secure message message message throws ioexception
overide this message with code that sends the message out
public boolean is system message nameable contact return false
true if this is a system message
public void accept file transfer file transfer listener ftl object connection info todo change
sets up file for receival
public void reject file transfer object object todo change
request to cancel the file transfer in progress
public void set up throws exception super set up save file load properties jlabel label new jlabel label set text mo label set text html bo u b u html add label
sets up the fixture for example open a network connection
public servlet get servlet string name return servlets get name
gets a servlet by name
public void action performed action event e jtext component target get text component e if target null target cut if target get caret get dot target get caret get mark toolkit get default toolkit get system clipboard set contents new string selection target get selected text null target replace selection
the operation to perform when this action is triggered
public void action performed action event e jtext component target get text component e if target null target copy if target get caret get dot target get caret get mark toolkit get default toolkit get system clipboard set contents new string selection target get selected text null
the operation to perform when this action is triggered
public void action performed action event e jtext component target get text component e if target null try target replace selection toolkit get default toolkit get system clipboard get contents null get transfer data data flavor string flavor catch unsupported flavor exception e1 e1 print stack trace catch ioexception e1 e1 print stack trace
the operation to perform when this action is triggered
public void state changed change event e if e get source instanceof abstract button for jcomponent dependent dependents dependent set enabled abstract button e get source is selected
change listener call
public void action performed action event e if e get source instanceof abstract button for jcomponent dependent dependents dependent set enabled abstract button e get source is selected
action listener call
public void window iconified window event e if last state tray icon null frame set visible false
invoked when a window is iconified
public enumeration get servlets return servlets elements
enumerates the servlets in this context server
public enumeration get servlet names return servlets keys
enumerates the names of the servlets in this context server
public void setup keys root pane container comp guiutils add action comp key event vk page up key event ctrl down mask act tab up guiutils add action comp key event vk page down key event ctrl down mask act tab down guiutils add action comp key event vk f4 key event ctrl down mask act tab close guiutils add action comp key event vk escape 0 act log if you want to add more mappings to same buttons just use text constants
use to provide key mapping to other components
public int index of component component component lock try find index finder new find index component synchronized get tree lock guiutils run on awtand wait finder so that we know that swing didn t mess with it finder run return finder index finally unlock
returns the index of the tab for the specified component
public component get tab component at reflect int index return super get tab component at index if old vm try class types new class int class method method get class get method get tab component at types return component method invoke this index catch exception e jdk 1 5 compatibility this is 1 5 lets do smth else old vm true return null
returns the tab component at code index code
public void set tab component at reflect int index component component super set tab component at index component if old vm try class types new class int class component class method method get class get method set tab component at types method invoke this index component catch exception e jdk 1 5 compatibility this is 1 5 lets do smth else old vm true
here b c mac is 1
public void log exception exception string message log log level severe message exception
write a stack trace to the servlet log
public void set snap distance int distance if distance 0 enabled false if distance 0 distance toolkit get default toolkit get screen size height 2 snap distance distance enabled true
sets the distance
public int get snap distance return snap distance
distance from which to snap
public insets get insets if insets null return super get insets return insets
if a border has been set on this component returns the
public string get server info return serve utils server name serve utils server version serve utils server url
returns the name and version of the web server under which the servlet
public void set editable boolean enabled super set editable enabled if enabled remove caret listener auto copy else add caret listener auto copy
sets whether or not this component is enabled
protected void process key event key event e if e get key code key event vk enter e get id key event key pressed if e get modifiers ex key event shift down mask 0 transfer focus else transfer focus backward else super process key event e
makes the enter move to next item
public void set max length string char count int count integer parse int char count set document new length document count
sets the max number of chars allowed
public void set max length int char count set document new length document char count
sets the max number of chars allowed
public void set folder selector boolean select folders chooser set file filter select folders filter folder filter file chooser set file selection mode select folders jfile chooser directories only jfile chooser files only
allows folder selection
public string load log message support connection string buddy throws ioexception holding handle holding handle open file connection buddy byte text synchronized holding handle holding handle verify date long read from holding handle raf length client properties instance get display buffer 1024 read from read from 0 0 read from holding handle raf seek read from text new byte int holding handle raf length read from holding handle raf read fully text holding handle raf seek holding handle raf length todo see if we still need this return new string text
returns last portion of the log
public boolean message received message support connection message message throws ioexception return message received connection connection message
recevied a message
public void file receive requested file transfer support connection contact contact string filename string description object connection info string text n contact get name is trying to send you a file filename description null description trim length 0 n description description message message new message impl contact false text try message received connection message catch ioexception e log log level severe failed to log incoming file info e
other side requested a file transfer
public nameable get user return user
username for this connection
public string get service name return medium
returns a short display name for the service
public void action performed action event e do the do for object selected items if selected instanceof contact wrapper contact wrapper selected get preferences set hide from list hide contact wrapper selected update display component list repaint
invoked when an action occurs
public void picture received icon support connection contact contact todo change
a previously requested icon has arrived
public void error occured string message exception exception don t care
gets called when an assynchronous error occurs
public void file receive requested file transfer support connection contact contact string filename string description object connection info
other side requested a file transfer
public dimension get preferred size dimension dim super get preferred size dim width contact label size width inc dim height contact label size height inc 2 return dim
up the width
public dimension get preferred size dimension dim super get preferred size dim width size width inc dim height size height inc return dim
up the width
public void connection initiated connection connection set controls enabled false
sent before connection is attempted
public void show frame if frame null frame is displayable frame guiutils create frame title frame set bounds bounds guiutils add cancel by escape frame frame get content pane set layout new border layout frame get content pane add get spread sheet frame get content pane add get buttons border layout south frame add component listener new component adapter public void component resized component event e save position public void component moved component event e save position reload data frame set visible true
shows the frame
private void setup check box editor table column tc jcheck box jcb new jcheck box remove the last choice it s only there for some db rows created outside of this tool tc set cell editor new default cell editor jcb tc set cell renderer new default table cell renderer public component get table cell renderer component jtable table object value boolean is selected boolean has focus int row int column boolean bvalue boolean value jcheck box jcb new jcheck box jcb set selected bvalue system out println cell renderer new date return jcb
sticks a checkbox to every cell in a column
public object get attribute string name this server does not implement attributes return null
returns the value of the named attribute of the request or null if
public string get method return req method
returns the method with which the request was made
public void window closing window event e on window close
invoked when a window is in the process of being closed
public void action performed action event e if cancel equals e get action command try look and feel manager set look and feel client properties instance get look and feel index catch exception e1 error dialog display error this failed to skin settings e1 dispose return set controls enabled false new thread pd action public void run do action start set visible false
invoked when an action occurs
protected jcomponent get text components jsplit pane split pane new jsplit pane jsplit pane vertical split get history get message split pane set divider location int frame get height default separation return split pane
adds history pane and typing space
private void work extra panel jpanel extra panel frame set size extra panel get preferred size width frame get size width extra panel is visible frame get size width extra panel get preferred size width 3 frame get size height extra panel get preferred size height extra panel is visible 1 1 extra panel set visible extra panel is visible frame validate
shows and hides the extra panel
public void feed for buddy message message try add text to history panel message false catch ioexception e error dialog display error frame error processing command try again n e get message e
sends a message to buddy as long as this is the right window
public void connection lost connection connection guiutils run on awt new runnable public void run for int i 0 i enabled when on size i enabled when on get i set enabled enabled flag get i
connection with server was interrupted
public void connection failed connection connection string message guiutils run on awt new runnable public void run for int i 0 i enabled when on size i enabled when on get i set enabled enabled flag get i
connection with server has failed
public void connection established connection connection guiutils run on awt new runnable public void run for int i 0 i enabled when on size i jcomponent comp enabled when on get i comp set enabled enabled flag get i if comp instanceof jcheck box jcheck box comp set selected false
indicates we are now logged in and can start using the connection
protected jcomponent get text components split pane new jsplit pane jsplit pane vertical split get history get message split pane set one touch expandable true split pane set resize weight 1 add dndsupport split pane if contact wrapper get preferences get vertical separation 1 split pane set divider location int frame get height default separation else split pane set divider location contact wrapper get preferences get vertical separation split pane set visible false return split pane
adds history pane and typing space
public http session get session boolean create http session session serve session map get get remote addr if create session null session new http session impl get remote addr serve session map put get remote addr session log info new session with get remote addr return session
gets the current valid session associated with this request if
protected jcomponent get personal info list new check box jlist list set cell renderer new contact label list cell renderer return get surround list
provides a list of contacts with checkboxes
protected void set file transfer handler do nothing
this version does nothing
public void connection established connection connection notify all users connection established to connection get service name connection
indicates we are now logged in and can start using the connection
public void notify all users string text connection connection for message window message window message windows if message window contact wrapper get connection equals connection message window append history text n text att error
messages all users for this connection
public void window closing window event e tabbed pane remove all default list model check box pane get model remove all elements off uiexecutor execute new runnable public void run save file save properties system gc frame set visible false
invoked when a window is in the process of being closed
public void status changed connection connection contact contact status old status if contact get status is online old status is online notify user n contact contact get status is online is now online has disconnected contact
nameables status changed
public void window opened window event e delayed show start
do window init stuff here
public void picture received icon support connection contact contact set the icon for the user for message window message window message windows if message window contact wrapper equals contact message window user icon set icon contact get picture
a previously requested icon has arrived
public string get requested session id return null
gets the session id specified with this request
public void file receive requested file transfer support connection contact contact string filename string description object connection info message window window find window contact if window null return description description null general utils strip html description description description trim length 0 n description description string message n contact get name is trying to send you a file filename description window append history text message att error
other side requested a file transfer
public void component removed container event e if e get child equals tab itself this e get container remove container listener this yeah can you believe we have to do this on close
invoked when a component has been removed from the container
public boolean is hide from list return hide from list
determines if this contact will be displayed in the list
public void set hide from list boolean hide from list this hide from list hide from list
determines if this contact will be displayed in the list
public boolean is show in list return show in list
show in the list even if contact list doesnt show offline
public void set show in list boolean show in list this show in list show in list
show in the list even if contact list doesnt show offline
public boolean is requested session id from url return false
checks whether the session id specified by this request came in as
public boolean is notify on connect return notify on connect
if true notify the user when a contact comes online
public void set notify on connect boolean notify on connect this notify on connect notify on connect
if true notify the user when a contact comes online
public void component added container event e do stuff here that needs to be done to tab components even if it s invisible setup tab action send set enabled true action send all set enabled true
invoked when a component has been added to the container
public boolean is show icon return show icon
display the buddy icon for the user
public boolean equals object obj return obj hash code hash code
indicates whether some other object is equal to this one
private string get preset or default string prop name string default value if system get property prop name null return default value return system get property prop name
gets the looked up value or the defaults
protected void un setup tab tab itself tab if tab null old tab log info un setup tab for tab get contact char count set text try jazzy interface create remove spell check component tab text pane document listener jazzy catch ioexception e no care tab split history text pane remove property change listener jsplit pane divider location property split matcher set tab null tab text pane get document remove document listener document listener for counter tab text pane set action null if
remove all attached events and button listeners since they no longer apply
public file get log path return new file instance log path
path describing superfolder of where the logs are stored
public void set status int res code string res message this res code res code this res message res message
sets the status code and message for this response
private tab itself get current tab component tab tabbed pane get selected component if tab null tab instanceof tab itself return null return tab itself tab
returns current tab properly cast
public void close tab contact buddy wrapper tabbed pane lock try close tab tab itself tab find tab buddy wrapper if tab null tabbed pane remove tab tab exists finally tabbed pane unlock
does not automatically get called
public boolean is force front return force front
sends window to front
public string get sound receive return sound receive
sound when receiving a message
public void set sound receive string sound receive this sound receive sound receive
sound when receiving a message
public string get sound send return sound send
sound when sending a message
public void set sound send string sound send this sound send sound send
sound when sending a message
public boolean is sound idle return sound idle
allow sound when connection is away
public string encode url string url try return urlencoder encode url utf 8 catch unsupported encoding exception e return url
encodes the specified url by including the session id in it or if
public string get database store return database store
prepared statement string for storing the db data
public void feed for buddy contact contact message message guiutils run on awt new runnable and wait was there before but why wait if it already exists public void run if frame is visible frame set visible true add text to history panel contact message false
sends a message to buddy as long as this is the right window