input
stringlengths
10
828
output
stringlengths
5
107
public void reset throws sqlexception
reset the jdbc provider
public void set driver string val props put driver val
set the driver name
public void set properties properties props throws sqlexception synchronized props for enumeration e props keys e has more elements object o e next element this props put o props get o driver false
set or change the properties used for the connections
public void set user string val props put user val
set the user name
public void set pass string val props put pass val
set the user password
public void reset throws sqlexception close all connections synchronized props try driver drv driver class for name props get property driver new instance driver manager register driver drv driver true catch class not found exception e throw new sqlexception driver not found props get property driver catch illegal access exception e throw new sqlexception can t access driver props get property driver catch instantiation exception e throw new sqlexception can t instanciate driver props get property driver
reset the jdbc provider close all connections and re read properties
public connection get connection throws sqlexception return driver manager get connection props get property url props get property user props get property pass
allocate a connection
public void release connection connection c throws sqlexception c close
release a connection
public business object state prepare get xml xmlserializable worker write your code here throw new illegal bostate exception
prepares the xmlserializable object to be able to deliver its xml serialization
public business object state prepare set xml xmlserializable worker write your code here return serialized state get instance
prepares the xmlserializable object to be able to change its xml serialization
public void load properties string n throws ioexception super load properties n try set properties props catch sqlexception e throw new ioexception e to string
load properties from a file
public business object state prepare get attribute xmlserializable worker write your code here throw new illegal bostate exception
prepares the xmlserializable object to be able to deliver any attribute
public business object state prepare set attribute xmlserializable worker write your code here return modified state get instance
prepares the xmlserializable object to be able to change any attribute
public void load properties string c string n throws ioexception super load properties c n try set properties props catch sqlexception e throw new ioexception e to string
use the class loader of the given class to load a properties file
public connection get connection throws sqlexception if driver reset thread t thread current thread connection c null if connections contains key t c connection connections get t else synchronized props c driver manager get connection props get property url props get property user props get property pass connections put t c return c
allocate a connection
public void release connection connection c throws sqlexception for iterator i connections key set iterator i has next thread t thread i next connection d connection connections get t if d c d close connections remove t break
release a connection
public void close all connections throws sqlexception sqlexception ex null for iterator i connections values iterator i has next try connection i next close catch sqlexception e ex e if ex null throw ex
close all the active connections
private void set enabled alphabet boolean enable for button button m alphabet list button set enabled enable
enable or disable the alphabet
public void close connection connection connection throws system exception try connection close catch sqlexception e throw new system exception e
closes a connection
public object get service bundle bundle service registration registration query object factory service impl service new query object factory service impl bundle return service
creates a new service object
public void unget service bundle bundle service registration registration object service query object factory service impl qof service query object factory service impl service if qof service bundle class loader null qof service untrack qof service bundle class loader
releases a service object
public type get list type return type array list
customizes the type of code list code implementations
public type get map type return type hash map
customizes the type of code map code implementations
public type get set type return type hash set
customizes the type of code set code implementations
public string get class name class query definition class return query definition class get name impl
customizes the class name of the generated query object
public connection factory customizer get connection factory customizer class query definition class if query definition class is annotation present use session context class return new session context connection factory customizer else return new default connection factory customizer
customizes the implementation of get connection and set connection
public image descriptor get image descriptor string image name return verilog plugin image descriptor from plugin verilog plugin id image name
gets the image descriptor for a given image name
protected string convert to string outline element element if element instanceof vhdl outline element vhdl outline element vhdl element vhdl outline element element return vhdl element get short name if not a vhdl element something must be very wrong return
converts a name to a string using the type string
protected string get image name for type outline element element if element instanceof vhdl outline element vhdl outline element vhdl element vhdl outline element element return vhdl element get image name if not a vhdl element something must be very wrong return obj image
returns an image name to be used for the given type
public image get image string image name verilog plugin plugin verilog plugin get plugin image registry registry plugin get image registry image results null results registry get image name results registry get image name if results null image descriptor desc get image descriptor image name registry put image name desc results registry get image name return results
returns an image from the registery
protected string convert to string outline element element if element instanceof verilog outline element verilog outline element verilog element verilog outline element element return verilog element get long name something very wrong return element to string
converts a name to a string using the type string
protected string get image name for type outline element element if element instanceof verilog outline element verilog outline element verilog element verilog outline element element return verilog element get image name default return obj image
returns an image name to be used for the given type
public template store get template store if template store null template store new contribution template store get context type registry get plugin get preference store custtom templates preference name try template store load catch ioexception e get plugin get log log new status istatus error net sourceforge veditor istatus ok e non nls 1 non nls 2 return template store
returns this plug ins template store
public context type registry get context type registry if context type registry null create an configure the contexts available in the template editor context type registry new contribution context type registry context type registry add context type vhdl global context context type context type registry add context type verilog in statement context type context type context type registry add context type verilog in module context type context type context type registry add context type verilog out module context type context type return context type registry
returns this plug ins context type registry
public hdl editor set current hdl editor old current current this return old
makes this instance of the editor the current one
protected tree item find tree item tree item item outline element element if item get data instanceof outline element outline element e outline element item get data if e equals element return item look through the children for tree item child item get items tree item temp find tree item child element if temp null return temp return null
searches throught the tree item recursively and looks the specified element
public void show element outline element element if element null return tree viewer viewer get tree viewer viewer reveal element tree item tree items viewer get tree get items viewer get control set redraw false object expanded elements viewer get expanded elements force all the elements to be scanned in viewer expand all viewer set expanded elements expanded elements viewer get control set redraw true for tree item item tree items tree item target find tree item item element if target null viewer get tree set selection target viewer reveal element break
searches for the given element and if found makes it visible
private void create actions m copy text action new copy text action m copy hierarchy action new copy hierarchy action m refresh action new refresh action m goto definition new goto definition action m collapse all action new collapse all action m rescan all action new rescan all action m enable sort action new enable sort action
creates the actions
public boolean is sorter property object element string property return super is sorter property element property
called to determine whether an object is sortable or not
private void create menu
creates a menu for this view
private void create toolbar itool bar manager mgr get site get action bars get tool bar manager mgr add m enable sort action mgr add m refresh action mgr add m collapse all action mgr add m rescan all action
creates a toolbar for this view
public void apply idocument document if m element null display get current beep return string replace get replace string try document replace get offset get length get length replace catch bad location exception e
called when the user selects a proposal
public string get replace string if m element instanceof entity decl element m element instanceof component decl element return get component replace string else return m element get name
gets the replacement string based on the outline element associated
protected int get relevance template template string prefix for now all are equal return 0
returns the relevance scale of the template given the prefix
public hdl hierarchy page get hierarchy page iproject project hdl hierarchy page page null if project null try page hdl hierarchy page project get session property verilog plugin get hierarchy id catch core exception e e print stack trace return page
gets this projects hierarchy page
protected tree item find tree item tree item item outline element element if item get data instanceof outline element outline element e outline element item get data if e equals element return item else return null look through the children for tree item child item get items tree item temp find tree item child element if temp null return temp return null
searches through the tree item recursively and looks the specified element
public void show element outline element element m tree viewer get control set redraw false update object expanded elements m tree viewer get expanded elements force all the elements to be scanned in m tree viewer expand all m tree viewer set expanded elements expanded elements if select element element false display get current beep m tree viewer get control set redraw true
searches for the given element and if found makes it visible
protected string get template context string int context final string results switch context case iparser out of module results vhdl global context context type break default results vhdl global context context type break return results
this function should return a context string for the given context
public outline database get outline database outline database database null iproject project get project if project null try database outline database project get session property verilog plugin get outline database id if database null database create outline database project catch core exception e todo auto generated catch block e print stack trace return database
gets the outline database object for this project
public void show in hierarchy point cursor get cursor location outline container container try container get hdl document get outline container if container null outline element element container get line context cursor x cursor y if element null get hierarchy page null get hierarchy page show element element catch hdl parser exception e e print stack trace
shows the current object in the hierarchy
public outline container get outline container throws hdl parser exception return get outline container true
same as get outline container true
public boolean refresh outline throws hdl parser exception if m need to refresh m need to refresh false get outline container false clear iparser parser create parser get verilog plugin delete markers get file try parser parse catch hdl parser exception e throw e outline database database outline database get projects database get project database scan tree get file return true return false
refreshes the outline database if necessary
public int get context int document offset throws bad location exception string text get 0 document offset iparser parser parser factory create verilog parser text null get file try parser parse catch hdl parser exception e return parser get context
returns the context of the given offset
public int get context int document offset throws bad location exception return vhdl global context
returns the context of the given offset
public outline element get element at int document offset boolean do refresh throws bad location exception hdl parser exception int line get line of offset document offset int col document offset get line offset line return get outline container do refresh get line context line col
returns the element near the given document offset
private outline database create outline database iproject project do we already have an outline database outline database database null try database outline database project get session property verilog plugin get outline database id catch core exception e e print stack trace if not created yet make one if database null database new outline database project try project set session property verilog plugin get outline database id database database scan project catch core exception e todo auto generated catch block e print stack trace return database
creates an outline database and adds it to the project
public void show in outline point cursor get cursor location outline container container try container get hdl document get outline container if container null outline element element container get line context cursor x cursor y if element null outline page null outline page show element element catch hdl parser exception e e print stack trace
shows the current line in the hierarchy view
public boolean has hierarchy return get hierarchy page null
returns true if this editor has a hierarchy page
public boolean has outline return outline page null
returns true if this editor has an outline page
public void run iaction action if action get id equals compile compile action compile action new compile action compile action run
performs this action
protected void handle cursor position changed super handle cursor position changed
called every time a the cursor position may change
public void set active editor iaction action ieditor part target editor fixme there should be a way to do this from inside the editor but until then hdl editor hdl editor hdl editor target editor if hdl editor null hdl editor set current
sets the active editor for the delegate
protected iworkbench page get page iworkbench page page platform ui get workbench get active workbench window get active page return page
gets the current active page
public void un install m install count
removes the action from problems window
private void check and save editors if is need to save set get editor is dirty get editor do save null
checks the save before build flag and saves the current file
private int skip to close paran array list token tokens int start idx int num open 1 while start idx tokens size if tokens get start idx image equals num open else if tokens get start idx image equals num open if num open 0 break start idx return start idx
scans the token list for the next matching close parenthesis
public build config clone return new build config m name m enabled m build order m command m clean command m parser m work folder
creates a copy of this class
public image descriptor get image descriptor return verilog plugin get plugin get image descriptor refresh action image
gets an image descriptor for this action
public void set values map string string map string name m enabled boolean parse boolean map get string format enable str name m command map get string format command str name m clean command map get string format clean cmd str name m parser map get string format parser str name m work folder map get string format work folder str name m build order integer parse int map get string format build order str name m name map get string format name str name
sets the internal parameters using the name value pair
public image descriptor get image descriptor return verilog plugin get plugin get image descriptor goto def action image
gets an image descriptor for this action
private string convert tabs string text string results text if m use space for tab string indent string get indent string results text replace all t indent string return results
converts the tabs to spaces
private table item create table item build config build config table item item new table item m config table swt none build config get build order item set data build config update table item item return item
creates and returns a new table item in the configuration table
private void add space hash map integer array list integer list int line int col array list integer int list if list contains key line int list list get line else int list new array list integer list put line int list int list add col
adds a space location to a list of lines
protected void ok pressed m new name m name get text if m copy from get selection index 1 m selected config build config m copy from get data m copy from get text else m b use default true super ok pressed m ok pressed true
called when the ok button is pressed
protected void cancel pressed super cancel pressed
called when the cancel button is pressed
public build config get build config build config results null if m b use default default configuraion results new build config results set name m new name else copy a configuration build config source m selected config clone results source clone results set name m new name return results
returns a build configuration based on the user input
private string get indent string string results if m use space for tab for int i 0 i m indent size i results else results t return results
returns the string that is to be used for indenting
private string get line indent string line find the indent of the first line int first non space 0 for first non space 0 first non space line length first non space if character is whitespace line char at first non space false break return line substring 0 first non space
returns the indent string used before the first non white character
private outline database get outline database iproject project m editor get hdl document get project outline database database null try database outline database project get session property verilog plugin get outline database id catch core exception e return null return database
utility function for getting outline database
private void save fields table item selected items m config table get selection there should be only one selected item if selected items length 0 build config build config build config selected items 0 get data build config set name m name get text build config set command m build command get text build config set clean command m clean command get text build config set parser m error parser get text build config set work folder m work folder get text
updates the selected command with the values in the fields
private void save data hdl nature nature try nature get nature catch core exception e e print stack trace return vector build config commands new vector build config int build order 0 save fields for table item table item m config table get items build config command build config table item get data command set build order build order command set enabled table item get checked commands add command nature set commands commands to array new build config 0
saves the data to the nature
private void set defaults build config command new build config create table item command
sets the default values
private boolean closebracket string stringc string regex boolean closebracket true if stringc contains regex stringc contains int index assign0 stringc index of regex string substring0 stringc substring 0 index assign0 int leftbracket 1 int rightbracket 1 int c 1 int d 1 do leftbracket c substring0 index of string substrin substring0 substring c 1 substring0 substrin while c 1 substring0 stringc substring 0 index assign0 do rightbracket d substring0 index of string substri substring0 substring d 1 substring0 substri while d 1 if leftbracket rightbracket closebracket true else closebracket false return closebracket
to judge if the regex is in the close bracket
public string get pattern return m pattern string
gets the pattern string
protected void ok pressed m pattern string m pattern get text super ok pressed
called when the ok button is pressed
public string trim right string s string s s while s length 0 s char at s length 1 s s substring 0 s length 1 return s
trim only at right side of the string
protected void perform apply save data
called when the user clicks apply
public boolean has children outline element element return element has children
returns true if the given element has any children
public void stop b stop reading true
stops the reader from reading the stream any further
protected void sanitize char cbuf for int i 0 i cbuf length i if cbuf i 0x0100 cbuf i
removes two byte characters from the character array
private void insert element outline element element file info file info if file info current element null file info current element add child element else file info element list add element file info current element element
inserts an element into the element list
public void clear m file info current element null m file info element list clear m collapsibles clear m comments clear
removes all the outline elements
private boolean in string string stringc string regex boolean in string false if stringc contains regex stringc contains int index assign0 stringc index of regex string substring0 stringc substring 0 index assign0 int quotation 1 int c 1 do quotation c substring0 index of string substrin substring0 substring c 1 substring0 substrin while c 1 if quotation 2 1 in string true else in string false return in string
to see if the regex is within a string
public void add collapsible region collapsible collapsible if collapsible end line collapsible start line minimum collapsible size m collapsibles add collapsible
adds the position to the list of collapsible positions
public void add comment int end line string text boolean onlycomment m comments put end line new comment text onlycomment
adds a string to the comments list
public string get comments near outline element element int start line element get starting line look on the same line if m comments contains key start line return m comments get start line m comment look on previous lines string comment for int line start line 1 line if m comments contains key line break if m comments get line m onlycommentline break comment m comments get line m comment n comment return comment
gets the comments near the given element
private outline element get context outline element element int line int col outline element results null if is position inside element element line col is the line enclosed in one of the children for outline element child element get children results get context child line col if results null return results if not in children then this element is the parent return element this element does not enclose the line return null
recursively scans through the element and its children to find the
public outline element get line context int line int col outline element results null outline element top level elements get top level elements for outline element element top level elements results get context element line col if results null break return results
this function returns the context of the given line and column
public void add change listner outline database event event listener synchronized m listeners m listeners add event listener
adds a listener to the list of listeners
public void remove change listner outline database event event listener synchronized m listeners m listeners remove event listener
adds a listener to the list of listeners