input
stringlengths
10
828
output
stringlengths
5
107
private iproject get default project handle string project name this get plugin preferences get string preference constants default synd project name return resources plugin get workspace get root get project project name
creates a project resource handle for the current project name field value
private iproject get default project handle string project name this get plugin preferences get string preference constants default favorites project name return resources plugin get workspace get root get project project name
creates a project resource handle for the current project name field value
public void output element element writer out throws ioexception if this is the root element we could pre initialize the namespace stack with the namespaces print element out element 0 create namespace stack out flush
print out an code
public frame list create frame list common navigator frame source frame source new common navigator frame source this frame list new frame list frame source frame source connect to frame list return frame list
creates the frame source and frame list and connects them
protected tree frame create frame object input tree frame frame super create frame input frame set name navigator get frame name input frame set tool tip text navigator get frame tool tip text input return frame
returns a new frame
protected void frame changed tree frame frame iresource resource iresource frame get input iproject project resource get project if project null project is open false message dialog open information navigator get view site get shell browser uimessages navigator frame source closed project title nls bind browser uimessages navigator frame source closed project message project get name this frame list back else super frame changed frame navigator update title
also updates the navigators title
protected string do substitutions string token string url boolean substituted false string buffer new token new string buffer token string substitution marker 1 non nls 1 int index new token index of substitution marker while index 1 new token replace index index substitution marker length url index new token index of substitution marker index url length substituted true if substituted return new token to string return null
replaces any occurrences of code 1 code or code 1 code with
public string get id return element get attribute id non nls 1
returns the id of this browser
public boolean is available if delegate null element get attribute attr factory class null element get attribute attr factory class length 0 return true try return get delegate is available catch exception e trace trace trace severe error calling delegate to string e get message non nls 1 non nls 2 return false
checks whether the factory can work on the user system
protected boolean perform drop object data if data instanceof string string s string data if s null s length 0 return true file f new file s 0 try view set url f to url to external form catch exception e todo return true
performs any work associated with the drop
protected boolean validate drop int operation transfer data transfer type if file transfer get instance is supported type transfer type return true if resource transfer get instance is supported type transfer type return true if local selection transfer get instance is supported type transfer type return true return false
validates dropping on the given object
public string to string string s browser ext get id get name get os non nls 1 non nls 2 non nls 3 get executable get parameters non nls 1 non nls 2 non nls 3 string locations get default locations if locations null int size locations length for int i 0 i size i s locations i non nls 1 return s
return a string representation of this object
public void copy point selection browser combo get selection int length selection y selection x if length 0 text transfer plain text transfer text transfer get instance try browser clipboard set contents new string browser combo get text substring selection x selection y new transfer plain text transfer catch swterror error copy to clipboard failed this happens when another application is accessing the clipboard while we copy ignore the error fixes 1 gdqavn
copies the selected text to the clipboard
public void cut point selection browser combo get selection if selection y selection x copy delete
moves the selected text to the clipboard
public void delete point selection browser combo get selection string text browser combo get text if selection x selection y text text substring 0 selection x text substring selection y browser combo set text text browser combo set selection new point selection x selection x
deletes the character to the right of the caret
public void paste text transfer transfer text transfer get instance point selection browser combo get selection string text browser combo get text string new text string browser clipboard get contents transfer if new text null new text length 0 text text substring 0 selection x new text text substring selection y browser combo set text text set the selection to the end of the paste int x selection x new text length browser combo set selection new point x x
replaces the selection with the clipboard text or insert the text at
public void run if browser null browser combo null return if type cut cut else if type copy copy else if type paste paste
implementation of method defined on code iaction code
private icontainer get actual target iresource mouse target icontainer target null if cursor is on a file return the parent if mouse target get type iresource file target mouse target get parent else target icontainer mouse target return target
returns the actual target of the drop given the resource under the
public void init iworkbench window window do nothing
initializes this action delegate with the workbench window it will work in
public void run iaction action try iworkbench browser support browser support browser uiplugin get instance get workbench get browser support iweb browser browser browser support create browser iworkbench browser support location bar iworkbench browser support navigation bar null null null browser open url null catch exception e trace trace trace severe error opening browser e non nls 1
performs this action
public void set image image image if image this image is disposed this image image web browser editor update title image image
set the image
public iaction get copy action return copy action
returns the copy action
public iaction get cut action return cut action
returns the cut action
protected web browser editor input get web browser editor input ieditor input input get editor input if input instanceof web browser editor input return web browser editor input input return null
returns the web editor input if available
public void stop bundle context context throws exception super stop context browser manager safe dispose
shuts down this plug in and saves all plug in state
public iaction get paste action return paste action
returns the paste action
public registry open sub key string sub key name throws win32 exception registry result new registry get hkey get sub key sub key name if result exists return result else throw new win32 exception no such sub key result to string
opens a child sub key of this sub key
public iadaptable create element imemento memento url url2 null int new style 0 try new style memento get integer memento style int value if new style 0 url new url memento get string memento url catch exception e could not determine the style string id2 null try id2 memento get string memento id if id2 null id2 length 1 id2 null catch exception e ignore return new web browser editor input url2 new style id2
creates an code ielement code from the state captured within an
public boolean equals object obj if this obj return true if obj instanceof web browser editor input return false web browser editor input other web browser editor input obj if url null url equals obj return false return can replace input other
indicates whether some other object is equal to this one
public boolean set focus if get content null return get content set focus return super set focus
if content is set transfers focus to the content
protected boolean is name locked return name null
returns true if the name is locked and cannot be changed
public void reflow boolean flush cache composite c composite get content rectangle client area get client area if c null return point new size c compute size client area width swt default flush cache set min size new size update page increment layout flush cache
recomputes the body layout and the scroll bars
public string get name if name null return name return browser uimessages view web browser title
returns the name of this editor input for display purposes
public boolean close final boolean result new boolean 1 display get default async exec new runnable public void run result 0 get editor site get page close editor web browser editor this false return result 0
close the editor correctly
public string get browser id return id
returns the browser id
public boolean is statusbar visible return style iworkbench browser support status 0
returns true if the status bar should be shown
public boolean is location bar local return style browser viewer location bar 0
returns true if the toolbar should be shown
public void home browser set text non nls 1
navigate to the home url
public void save state imemento memento if style iworkbench browser support persistent 0 url null memento put string memento url url to external form memento put integer memento style style if id null memento put string memento id id
saves the state of an element within a memento
public string to string return web browser editor input url style id non nls 1 non nls 2 non nls 3 non nls 4
converts this object to a string
public void set url string url set url url true
loads a url
protected boolean is web file string name return name ends with html name ends with htm name ends with gif non nls 1 non nls 2 non nls 3 name ends with jpg non nls 1
return true if the filename has a web extension
protected void init drag and drop transfer transfers new transfer local selection transfer get instance resource transfer get instance file transfer get instance drop target drop target new drop target viewer dnd drop copy dnd drop default drop target set transfer transfers drop target add drop listener new web browser view drop adapter viewer
adds drag and drop support to the view
public void init iworkbench workbench do nothing
initializes this preference page using the passed workbench
public void add property change listener property change listener listener if property listeners null property listeners new array list property listeners add listener
add a property change listener to this instance
protected void perform defaults internal set selection web browser preference is default use internal browser external set selection web browser preference is default use internal browser browser manager get instance current browser null browser manager get instance setup default browsers table viewer refresh checked browser browser manager get instance get current web browser if checked browser null table viewer set checked checked browser true super perform defaults
performs special processing when this pages defaults button has been
public boolean perform ok int choice if internal get selection choice web browser preference internal else choice web browser preference external web browser preference set browser choice choice if checked browser null browser manager get instance set current web browser checked browser return true
method declared on ipreference page
public boolean forward if browser null return false return browser forward
navigate to the next session history item
public boolean back if browser null return false return browser back
navigate to the previous session history item
public boolean is back enabled if browser null return false return browser is back enabled
returns code true code if the receiver can navigate to the previous
public boolean is forward enabled if browser null return false return browser is forward enabled
returns code true code if the receiver can navigate to the next
public void refresh if browser null browser refresh else text refresh try thread sleep 50 catch exception e ignore
refresh the current page
public string get url if browser null return browser get url return text get url
returns the current url
protected void update history if combo null return string temp combo get text if history null history web browser preference get internal web browser history string history list new string history size history to array history list combo set items history list combo set text temp
update the history list to the global shared copy
public void load throws ioexception file not found exception input stream in string input file name get input file name if input file name null in system in else in new file input stream input file name properties properties new properties properties load in in close set properties properties
loads the properties
public void parse args string args int n args length if n 2 0 throw new illegal argument exception arguments must be in option value pairs for int i 0 i n i 2 string option args i string value args i 1 if option equals action option set action value else if option equals key option set key name value else if option equals input option set input file name value else if option equals output option set output file name value else throw new illegal argument exception unknown option option
parses the command line arguments
public uri get uri string string return uriutil to uri string
return a uri for the supplied string from the user
public void store throws ioexception file not found exception string output file name get output file name output stream out if output file name null out system out else out new file output stream output file name properties properties get properties properties store out null out close
stores the properties
public void update properties properties get properties string key name get key name string key value properties get property this key name if key value null key value length 0 return string action get action if is encoded key value if action equals decode action key value decode key value else if action equals encode action key value encode key value properties set property key name key value
updates the properties list
private void update extend button state path variables group path variable element selection path variables group get selection button extend button get button extend id if extend button null return if selection length 1 ifile info info ideresource info utils get file info selection 0 path if info exists info is directory extend button set enabled true else extend button set enabled false else extend button set enabled false
updates the enabled state of the extend button based on the
protected istructured content provider get content provider return new workbench content provider public object get children object element if element instanceof iworkspace return new object 0 iproject projects iworkspace element get root get projects return projects null new object 0 projects
returns a content provider for the reference project
private void check initial selections iterator items to check get initial element selections iterator while items to check has next iresource current element iresource items to check next if current element get type iresource file selection group initial check list item current element else selection group initial check tree item current element
visually checks the previously specified elements in the container left
private void initialize dialog selection group add check state listener new icheck state listener public void check state changed check state changed event event get ok button set enabled selection group get checked element count 0 if get initial element selections is empty get ok button set enabled false else check initial selections
initializes this dialogs controls
protected void ok pressed list chosen container path list new array list ipath return value group get container full path if return value null chosen container path list add return value set result chosen container path list super ok pressed
the code container selection dialog code implementation of this
protected void ok pressed iterator result enum selection group get all checked list items array list list new array list while result enum has next list add result enum next set result list super ok pressed
the code resource selection dialog code implementation of this
protected ifolder create folder handle ipath folder path return ideworkbench plugin get plugin workspace get root get folder folder path
creates a folder resource handle for the folder with the given workspace
protected void add to history list history string new entry history remove new entry history add 0 new entry since only one new item was added we can be over the limit by at most one item if history size combo history length history remove combo history length
adds an entry to a history while taking care of duplicate history items
protected label create bold label composite parent string text label label new label parent swt none label set font jface resources get banner font label set text text grid data data new grid data data vertical alignment grid data fill data horizontal alignment grid data fill label set layout data data return label
creates a new label with a bold font
protected void create link target string link target linked resource group get link target if link target null link target path new path link target else link target path null
creates the link target path if a link target has been specified
protected void create options group buttons group options group
creates the import export options group controls
protected void compute result do nothing here as we need to know the result
creates the folder using the name and link target entered
public string get link target if create link link target field null link target field is disposed false return link target field get text return null
returns the link target location entered by the user
protected boolean determine page completion boolean complete validate source group validate destination group validate options group avoid draw flicker by not clearing the error message unless all is valid if complete set error message null return complete
returns whether this page is complete
protected void display error dialog string message message dialog open error get container get shell ideworkbench messages wizard import page error dialog title message
display an error dialog with the specified message
protected ipath get container full path iworkspace workspace ideworkbench plugin get plugin workspace make the path absolute to allow for optional leading slash ipath test path get resource path istatus result workspace validate path test path to string iresource project iresource folder if result is ok return test path return null
returns the path of the container resource specified in the container
protected ipath get path from text text text field string text text field get text do not make an empty path absolute so as not to confuse with the root if text length 0 return new path text return new path text make absolute
get a path from the supplied text widget
private ischeduling rule create rule iresource resource iresource parent resource get parent while parent null if parent exists return resource get workspace get rule factory create rule resource resource parent parent parent get parent return resource get workspace get root
returns the scheduling rule to use when creating the resource at the
protected ipath get container full path iworkspace workspace ideworkbench plugin get plugin workspace make the path absolute to allow for optional leading slash ipath test path get resource path if test path equals workspace get root get full path return test path istatus result workspace validate path test path to string iresource project iresource folder iresource root if result is ok return test path return null
returns the path of the container resource specified in the container
protected list extract non local resources list original list vector result new vector original list size iterator resources enum original list iterator while resources enum has next iresource current resource iresource resources enum next if current resource is local iresource depth zero result add element current resource return result
returns a new subcollection containing only those resources which are not
private void handle variables button pressed path variable selection dialog dialog new path variable selection dialog get shell type if dialog open idialog constants ok id string variable names string dialog get result if variable names null ipath variable manager path variable manager resources plugin get workspace get path variable manager ipath path path variable manager get value variable names 0 if path null link target field set text path to osstring
opens a path variable selection dialog
protected ipath query for container icontainer initial selection string msg return query for container initial selection msg null
queries the user to supply a container resource
protected icontainer get specified container iworkspace workspace ideworkbench plugin get plugin workspace ipath path get container full path if workspace get root exists path return icontainer workspace get root find member path return null
returns the container resource specified in the container name entry field
protected void handle container browse button pressed see if the user wishes to modify this container selection ipath container path query for container get specified container ideworkbench messages wizard import page select folder label if a container was selected then put its name in the container name field if container path null container name field set text container path make relative to string
opens a container selection dialog and displays the users subsequent
public void set container icontainer container this container container
sets the container to use for link validation
public void handle event event event widget source event widget if source container browse button handle container browse button pressed set page complete determine page completion update widget enablements
the code wizard import page code implementation of this
public void set link target string target initial link target target if link target field null link target field is disposed false link target field set text target
sets the value of the link target field
public void handle event event ev set page complete validate page
the code wizard new folder creation page code implementation of this
protected icontainer get specified container iworkspace workspace ideworkbench plugin get plugin workspace ipath path get container full path if workspace get root exists path iresource resource workspace get root find member path if resource get type iresource file return null return icontainer resource return null
returns the container resource specified in the container name entry field
protected list get selected resources iterator resources to export iterator this get selected resources iterator list resources to export new array list while resources to export iterator has next resources to export add resources to export iterator next return resources to export
returns this pages collection of currently specified resources to be
private boolean validate file type ifile store link target store boolean valid true if type iresource file link target store fetch info is directory set error message ideworkbench messages wizard new link page link target not file valid false else if type iresource folder link target store fetch info is directory set error message ideworkbench messages wizard new link page link target not folder valid false return valid
validates the type of the given file against the link type specified
protected void initialize page iterator it current selection iterator if it has next object next it next iresource selected resource null if next instanceof iresource selected resource iresource next else if next instanceof iadaptable selected resource iresource iadaptable next get adapter iresource class if selected resource null if selected resource get type iresource file selected resource selected resource get parent if selected resource is accessible resource group set container full path selected resource get full path set page complete false
initializes this pages controls
protected void handle container browse button pressed see if the user wishes to modify this container selection ipath container path query for container get specified container ideworkbench messages wizard import page select folder label ideworkbench messages wizard import page select folder title if a container was selected then put its name in the container name field if container path null null means user cancelled set error message null container name field set text container path make relative to string
opens a container selection dialog and displays the users subsequent
protected void restore widget values
restores control settings that were saved in the previous instance of this
private boolean validate link target name string link target name boolean valid true if equals link target name non nls 1 set error message ideworkbench messages wizard new link page link target empty valid false else ipath path new path non nls 1 if path is valid path link target name false set error message ideworkbench messages wizard new link page link target invalid valid false return valid
validates the name of the link target
public void handle event event event widget source event widget if source container browse button handle container browse button pressed update widget enablements
the code wizard resource import page code implementation of this
protected void save widget values
saves control settings that are to be restored in the next instance of
protected void handle types edit button pressed type filtering dialog dialog new type filtering dialog get container get shell get types to import dialog open object new selected types dialog get result if new selected types null ie did not press cancel this selected types new array list new selected types length for int i 0 i new selected types length i this selected types add new selected types i setup selections based on selected types
open a registered type selection dialog and note the selections
protected void update page completion boolean page complete determine page completion set page complete page complete if page complete set message null
determine if the page is complete and update the page appropriately
protected istatus validate linked resource ipath container path resource group get container full path ipath new folder path container path append resource group get resource ifolder new folder handle create folder handle new folder path istatus status linked resource group validate link location new folder handle if status get severity istatus error if first link check set message status get message else set error message status get message else if status get severity istatus warning set message status get message warning set error message null return status
checks whether the linked resource target is valid
protected void set all selections boolean value selection group set all selections value
set all of the selections in the selection group to value

Dataset Card for "CS_finetuning"

Reference

@article{Mastropaolo2022TransferLearningForCodeRelatedTasks
  title={Using Transfer Learning for Code-Related Tasks},
  author={Mastropaolo, Antonio and Cooper, Nathan and Nader Palacio, David and Scalabrino, Simone and
Poshyvanyk, Denys and Oliveto, Rocco and Bavota, Gabriele},
  journal={arXiv preprint arXiv:2206.08574},
  year={2022}
}
Downloads last month
31
Edit dataset card