input
stringlengths
10
828
output
stringlengths
5
107
public boolean exists in memory db string database name return in memory databases created contains key database name in memory databases in creation contains key database name
whether an in memory database with the given database name is already
protected void setup database logger info setting up database database name builds and opens the database session session factory session factory build session factory session session session factory open session sets up the initial database session get transaction begin execute statements session manager get db setup statements session get transaction commit logger info database set up database name session close builds the entity manager factory responsible for this database entity manager factory build entity manager factory synchronized creation completed database created true creation completed notify all
sets up an associated derby in memory database instance and executes the sql
public ejb3 configuration get configuration return configuration
gets the ejb3 configuration used by this in memory manager to
protected void wait for timeout while time to timeout 0 try thread sleep timeout check interval catch interrupted exception e throw new runtime exception e time to timeout timeout check interval destroy database
waits for the timeout to be reaches by frequently
protected void destroy database logger info destroying database database name try driver manager get connection jdbc derby memory database name drop true catch sqlexception e sqlexception next exception e boolean is expected exception false while next exception null is expected exception is expected exception e get message contains dropped next exception e get next exception if is expected exception throw new runtime exception failed to destroy database e logger info database destroyed database name manager remove in memory db database name
destroys an associated derby in memory database instance
protected void remove in memory db string database name in memory databases created remove database name
removes the in memory database with the given database name
protected entity manager factory build entity manager factory ejb3 configuration cfg manager get configuration cfg set property hibernate connection url jdbc derby memory database name create true return cfg build entity manager factory
builds an entity manager factory associated to this in memory database using
protected session factory build session factory configuration cfg new configuration cfg set property hibernate connection url jdbc derby memory database name create true return cfg build session factory
builds a hibernate session factory associated to this in memory database
protected void execute statements session session string statements for string statement statements if statement is empty continue session create sqlquery statement execute update
executes all given sql statements using the given hibernate session
public void drop action changed drag source drag event e drag source context context e get drag source context system out println drop action changed e get drag source context context set cursor drag source default copy drop
for example press shift during drag to change to
private boolean is drag flavor supported drop target drag event e boolean ok false if e is data flavor supported mail local flavor ok true else if e is data flavor supported directory local flavor ok true else if e is data flavor supported dn ditem collection local flavor ok true else if e is data flavor supported data flavor java file list flavor ok true else system out println is drag flavor supported no return ok
called by is drag ok
public void drag enter drop target drag event e system out println dtlistener drag enter if is drag ok e false system out println enter not ok dn dtree this set background color red e reject drag return dn dtree this set background color green system out println dt enter accepting e get drop action e accept drag e get drop action
start drag under feedback on component
private boolean is drag flavor supported drop target drag event e boolean ok false if e is data flavor supported mail local flavor ok true return ok
called by is drag ok
private data flavor choose drop flavor drop target drop event e if e is local transfer true e is data flavor supported mail local flavor return mail local flavor return null
called by drop
private boolean is drag ok drop target drag event e if is drag flavor supported e false system out println is drag ok no flavors chosen return false the actions specified when the source created the drag gesture recognizer int sa e get source actions the docs on drop target drag event reject drag says that the drop action should be examined int da e get drop action we re saying that these actions are necessary if da dn dlist this acceptable actions 0 return false return true
called by drag enter and drag over
public void drag enter drop target drag event e system out println dtlistener drag enter if is drag ok e false system out println enter not ok dn dlist this set background color red e reject drag return dn dlist this set background color green system out println dt enter accepting e get drop action e accept drag e get drop action
start drag under feedback on component
public void drag over drop target drag event e if is drag ok e false system out println dtlistener drag over not ok dn dlist this set background color red e reject drag return system out println dt over accepting e accept drag e get drop action
continue drag under feedback on component
private boolean is drag flavor supported drop target drag event e boolean ok false return ok return true
called by is drag ok
private data flavor choose drop flavor drop target drop event e if e is local transfer true e is data flavor supported ding schema local flavor return ding schema local flavor if e is local transfer true e is data flavor supported handlung schema local flavor return handlung schema local flavor if e is local transfer true e is data flavor supported funktion schema local flavor return funktion schema local flavor return null
called by drop
private boolean is drag ok drop target drag event e if is drag flavor supported e false system out println is drag ok no flavors chosen return false the actions specified when the source created the drag gesture recognizer int sa e get source actions the docs on drop target drag event reject drag says that the drop action should be examined int da e get drop action we re saying that these actions are necessary if da begriffs textfield this acceptable actions 0 return false return true
called by drag enter and drag over
private popup authenticator exists authenticator account account for iterator iter authenticator items iterator iter has next authenticator item item authenticator item iter next if item account equals account return item popup return null return popup authenticator authenticator items get account
ermittelt ob zu dem account bereits ein popup authenticator objekt
public void disconnect transport transport account account for enumeration enum1 transport items elements enum1 has more elements transport item item transport item enum1 next element if item account equals account transport items remove item account try transport close catch messaging exception e e print stack trace
trennt die verbindung vom transport
public void drop action changed drag source drag event e drag source context context e get drag source context system out println drop action changed e get drag source context if e get drop action dn dconstants action copy context set cursor drag source default copy drop else if e get drop action dn dconstants action move context set cursor drag source default move drop
for example press shift during drag to change to a link action
private boolean is drag ok drop target drag event e if is drag flavor supported e false return false the actions specified when the source created the drag gesture recognizer int sa e get source actions the docs on drop target drag event reject drag says that the drop action should be examined int da e get drop action we re saying that these actions are necessary if da dn dtable this acceptable actions 0 return false return true
called by drag enter and drag over checks the flavors and operations
public void drag enter drop target drag event e system out println dtlistener drag enter if is drag ok e false system out println enter not ok dn dtable this set background color red e reject drag return dn dtable this set background color green system out println dt enter accepting e get drop action e accept drag e get drop action
start drag under feedback on component invoke accept drag or
public void drag over drop target drag event e if is drag ok e false system out println dtlistener drag over not ok dn dtable this set background color red e reject drag return system out println dt over accepting e accept drag e get drop action
continue drag under feedback on component invoke accept drag or
protected void set view bview view this view view
set the view for the highlight
public string get value return word
get the value of the widget a string representing
protected int get dx return dx
get the highlight x coordinate offset
public void set value string new word if new word null new word if undo value null set undo state false this word new word notify listeners
set the value of the widget all clients will be
protected int get dy return dy
get the highlight y coordinate offset
public void link keyboard to state int state keyboard keyboard if state lowercase state symbol todo should throw illegal arg exception return keyboard states state keyboard if we re replacing the curerent state then replace the keyboard if keyboard state state set keyboard state
set a keyboard to a keyboard state
static public point get keyboard size int keyboard type boolean tips return get keyboard size get standard keyboard keyboard type tips input width same as widget
helper method to return the size size of the keyboard
static public point get keyboard size keyboard keyboard boolean tips int text entry width if keyboard null keyboard get standard keyboard standard keyboard lowercase int kbwidth keyboard image width if tips true kbwidth 150 if text entry width input width same as widget text entry width kbwidth kbwidth text entry width height id keyboard image text entry height space between them int kbheight keyboard image height 40 5 return new point kbwidth kbheight
helper method to return the size size of the keyboard
public boolean handle focus boolean got focus bview gained bview lost if got focus gained this get screen set focus focused highlight vis true refresh highlights animation else if got focus false lost this highlight vis false refresh highlights animation else highlight vis gained instanceof letter view refresh highlights animation return super handle focus got focus gained lost
upon gaining the focus we want to make sure the highlight is visible
public boolean handle action bview view object action if push equals action int idx list get focus switch idx case 0 if kbts null kbts new plain keyboard screen get bapp get bapp push kbts transition left break case 1 if kbes null kbes new keyboard email screen get bapp get bapp push kbes transition left email break case 2 if kbls null kbls new keyboard list screen get bapp get bapp push kbls transition left break return true return super handle action view action
push the selected screen
protected void notify listeners if get value null keyboard event kbe new keyboard event evt kbd value this get id get value bevent action action new bevent action this get value post event kbe
tell all the clients that the text associated with the keyboard has changed
public boolean handle event hme event event if event instanceof keyboard event update keyboard event event get value return super handle event event
handle a change in the value of the bkeyboard by
public boolean handle key press int code long rawcode if code key left code key select get bapp pop return true return super handle key press code rawcode
pop on left or select
public boolean handle event hme event event if event instanceof keyboard event text field update string keyboard event event get value return super handle event event
handle a change in the value of the bkeyboard by
public boolean handle action bview view object action if action equals push go to the screen currently selected in the list bscreen screen bscreen list get list get focus get bapp push screen transition left return true return super handle action view action
hand an action
protected void create row bview parent int index the row is a simple text item aligned left and is the name of the screen btext text new btext parent 10 4 parent get width 40 parent get height 4 text set shadow true text set flags rsrc halign left text set value get index to string
create a row that displays text
public string to string string buffer buffer new string buffer synchronized buffer buffer append name tivoconnect m tivo connect n if m method null buffer append name method m method n if m platform null buffer append name platform m platform n buffer append name machine m machine n buffer append name identify m identity n if m services null buffer append name services m services n if m swversion null buffer append name swversion m swversion n return buffer to string
tivoconnect number method method platform type sub type machine string identity string
public string get swversion return m swversion
this value describes the primary software running on the tcm
public integer start string args try if m server null m server new server m server start catch exception ex ex print stack trace return new integer 1 return null
the start method is called when the wrapper manager is signaled by the
public int stop int exit code try m server stop m server null catch exception ex ex print stack trace return exit code
called when the application is shutting down
public void control event int event if wrapper manager is controlled by native wrapper the wrapper will take care of this event else we are not being controlled by the wrapper so handle the event ourselves if event wrapper manager wrapper ctrl c event event wrapper manager wrapper ctrl close event event wrapper manager wrapper ctrl shutdown event wrapper manager stop 0
called whenever the native wrapper code traps a system control signal
protected void create row bview parent int index final int padding 3 for int i 0 i m column count i bview view new bview parent i parent get width m column count padding 0 parent get width m column count 2 padding get row height 2 padding create cell view index i index get focus
create a row for the given element
public void start document
method used by sax at the start of the xml document parsing
public void warning saxparse exception e throws saxexception throw e
receive notification of a parser warning
public void error saxparse exception e throws saxexception throw e
receive notification of a recoverable parser error
public int get cancellato return cancellato
getter and setters
public int compare to bus stop other if other instanceof bus stop int result double compare f stop number bus stop other get stop number if result 0 return this get source range get offset bus stop other get source range get offset return result return 0
compare to makes individual bus stops comparable using the value of their
public void input changed viewer v object old input final object new input if new input instanceof ijava project return f viewer v f project ijava project new input irunnable with progress op new tour create runnable this try platform ui get workbench get progress service busy cursor while op catch invocation target exception e f tour plan null catch interrupted exception e f tour plan null
input changed is responsible to updating the internal data model by
public resource bundle get resource bundle try if resource bundle null resource bundle resource bundle get bundle tree view plugin tree view plugin plugin resources catch missing resource exception x resource bundle null return resource bundle
returns the plugins resource bundle
private void hook actions icontribution manager manager manager add f action set from editor manager add new separator manager add f action insert bus stop manager add new separator manager add f action next stop manager add f action previous stop manager add new separator iworkbench action constants mb additions
add actions to the toolbar
private void initialize this set size 300 200 this add tab neuer verkauf null verkauf neu null this add tab verkaufs liste null verkauf liste null
this method initializes this
private void initialize j label1 new jlabel j label new jlabel this set layout null this set size 300 200 j label set text menge j label set bounds 24 25 76 20 j label1 set bounds 26 61 72 19 j label1 set text preis this add j label null this add get jtext field null this add j label1 null this add get jtext field1 null this add get jbutton null
this method initializes this
private void initialize this set size 300 200 this add tab neuer einkauf null einkauf neu null this add tab einkauf liste null einkauf liste null
this method initializes this
private jtext field get jtext field if j text field null j text field new jtext field j text field set bounds 114 26 105 21 return j text field
this method initializes j text field
private jtext field get jtext field1 if j text field1 null j text field1 new jtext field j text field1 set bounds 115 57 103 23 return j text field1
this method initializes j text field1
private void initialize this set size 488 183 this add get jscroll pane null this add get jbutton null datenbank get kunden
this method initializes this
private jbutton get jbutton if j button null j button new jbutton j button set bounds 42 92 125 21 j button set text eintragen return j button
this method initializes j button
private void initialize this set size 316 186 this add tab verkauf null verkauf null this add tab einkauf null einkauf null this add tab kunden null kunden null this add tab kurs rechner null rechner null
this method initializes this
private jtext field get jtext field if j text field null j text field new jtext field j text field set bounds 150 13 110 23 return j text field
this method initializes j text field
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set viewport view get jtable j scroll pane set preferred size new java awt dimension 453 140 j scroll pane set horizontal scroll bar policy javax swing jscroll pane horizontal scrollbar as needed j scroll pane set vertical scroll bar policy javax swing jscroll pane vertical scrollbar always return j scroll pane
this method initializes j scroll pane
private void initialize this set size 300 200 this add tab neuer kunde null kunde neu null this add tab kunden liste null kunden liste null
this method initializes this
private jbutton get jbutton if j button null j button new jbutton j button set text update j button add action listener new java awt event action listener public void action performed java awt event action event e j scroll pane repaint j table repaint return j button
this method initializes j button
private void initialize this set default close operation javax swing jframe exit on close this set jmenu bar get jjmenu bar this set resizable false tab pane set bounds 3 1 512 293 this set size 520 342 this set content pane get jcontent pane this set title jframe
this method initializes this
private jmenu item get jmenu item if j menu item null j menu item new jmenu item j menu item set text datei ffnen return j menu item
this method initializes j menu item
private jtext field get jtext field1 if j text field1 null j text field1 new jtext field j text field1 set bounds 150 46 110 23 return j text field1
this method initializes j text field1
private jtext field get jtext field2 if j text field2 null j text field2 new jtext field j text field2 set bounds 150 78 110 23 return j text field2
this method initializes j text field2
public void set number to print int number to print this number to print number to print
set how many copies of this label to print
private void check defaults if properties contains key key papersize paper size for printing e g a4 or letter properties set property key papersize letter if properties contains key key fieldmapping xml file containing field mappings properties set property key fieldmapping resources nevp tcn precapture fields xml if properties contains key key editable authority file is the taxon name authority file editable properties set property key editable authority file false if properties contains key key show inventory is the taxon name authority file editable properties set property key show inventory true
set default property values for each key
public string get properties source return properties file path to string
get persistence file location
public void reset values int field count pre capture singleton get instance get mapping list get field in list size int field count container label get fields size for int i 0 i field count i container label get fields get i get text field set text
reset all of the text field values to empty strings
protected void load properties throws exception properties new properties file input stream properties stream null try properties stream new file input stream properties file path to string properties load properties stream catch file not found exception e log error error properties file not found log error e get message throw e catch exception ex log error error loading properties log error ex get message throw ex finally if properties stream null properties stream close
load the properties from the properties file
public void add label to list container label label this get labels add label this fire table data changed
adds a a container label to the list and fires table data changed
public void save properties throws exception file output stream properties stream null try properties stream new file output stream properties file path to string properties store properties stream pre capture app name pre capture app version user properties properties stream close catch exception e log error error saving properties log error e get message e print stack trace throw e finally if properties stream null properties stream close
persist the current property values to the property file
public void clear list labels new array list container label this fire table data changed
removes all labels currently on list and fires table data changed
private void initialize this set layout new border layout this set size new dimension 444 290 this add get jscroll pane border layout center this add get jpanel border layout north
this method initializes this
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set viewport view get jtable j scroll pane set preferred size new dimension 444 290 return j scroll pane
this method initializes j scroll pane
private void initialize this set size 414 144 this set title change password this set content pane get jcontent pane
this method initializes this
private jtext field get jtext field if j text field null j text field new jtext field j text field add key listener new java awt event key adapter public void key typed java awt event key event e new filter return j text field
this method initializes j text field
private jcombo box get jcombo box if j combo box null j combo box new jcombo box work flow status get work flow status values j combo box add item j combo box set selected item j combo box add action listener new java awt event action listener public void action performed java awt event action event e j text field set text new filter return j combo box
this method initializes j combo box
private jbutton get jbutton1 if j button1 null j button1 new jbutton j button1 set text cancel j button1 add action listener new java awt event action listener public void action performed java awt event action event e string a message password change canceled singleton get singleton instance get main frame set status message a message set visible false return j button1
this method initializes j button1
private jpassword field get jpassword field old if j password field old null j password field old new jpassword field return j password field old
this method initializes j password field old
private jtext field get jtext field family if j text field family null j text field family new jtext field j text field family add key listener new java awt event key adapter public void key typed java awt event key event e new filter return j text field family
this method initializes j text field family
private void initialize this set size 709 340 this set content pane get jcontent pane this set title event log dimension screen size toolkit get default toolkit get screen size this set location screen size width this get width 2 screen size height this get height 2
this method initializes this
private jbutton get jbutton if j button null j button new jbutton j button set text close j button add action listener new java awt event action listener public void action performed java awt event action event e event log set visible false event log dispose return j button
this method initializes j button
private jpassword field get jpassword field2 if j password field2 null j password field2 new jpassword field return j password field2
this method initializes j password field2
private jtext field get jtext field drawer number if j text field drawer number null j text field drawer number new jtext field j text field drawer number add key listener new java awt event key adapter public void key typed java awt event key event e new filter return j text field drawer number
this method initializes j text field drawer number
private jscroll pane get jscroll pane if j scroll pane null j scroll pane new jscroll pane j scroll pane set viewport view get jtable j scroll pane set preferred size new dimension 700 300 return j scroll pane
this method initializes j scroll pane
private jtable get jtable if j table null j table new jtable new tracking table model events j table set auto create row sorter true return j table
this method initializes j table
private jpanel get jpanel if j panel null j panel new jpanel j panel set layout new grid bag layout j panel add get jbutton new grid bag constraints return j panel
this method initializes j panel
public void set main frame main frame a main frame main frame a main frame
store a single instance of a main frame to be referenced from
private void initialize this set size 342 200 this set title edit a template component this set content pane get jcontent pane
this method initializes this
public dimension get ul return ul
get the upper left coordinate of the box in pixels on the
private jtext field get jtext field if j text field filename null j text field filename new jtext field j text field filename add key listener new java awt event key adapter public void key typed java awt event key event e new filter return j text field filename
this method initializes j text field
private void initialize this set preferred size new dimension 965 300 this set title preprocessing results this set content pane get jcontent pane this pack dimension screen size toolkit get default toolkit get screen size this set location screen size width this get width 2 screen size height this get height 2
this method initializes this