input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
public void update enabled state if active text control null active text control is disposed set enabled true return if paste action null set enabled paste action is enabled return set enabled false | update the state |
private int get selected resource types iresource resources int types 0 for int i 0 i resources length i types resources i get type return types | returns a bit mask containing the types of resources in the selection |
protected list get action resources if inlined resource null return super get action resources list action resources new array list action resources add inlined resource return action resources | returns the elements that the action is to be performed on |
public void run if workbench window null action has been disposed return try about info feature prompt for feature if feature null open welcome page feature catch workbench exception e error dialog open error workbench window get shell ideworkbench messages quick start action error dialog title ideworkbench messages quick start action info read error e get status | the user has invoked this action |
public void update enabled state if active text control null active text control is disposed set enabled true return if select all action null set enabled select all action is enabled return set enabled false | update the state |
protected string get source label return data transfer messages file import from directory | answer the string to display as the label for the source specification field |
public void add text text text control if text control null return active text control text control text control add listener swt activate text control listener text control add listener swt deactivate text control listener we really want a selection listener but it is not supported so we use a key listener and a mouse listener to know when selection changes may have occured text control add key listener key adapter text control add mouse listener mouse adapter | add a code text code control to the handler |
public boolean open welcome page string feature id throws workbench exception about info feature find feature feature id if feature null feature get welcome page url null return false return open welcome page feature | opens the welcome page for the given feature |
public void handle event event event if event widget source browse button handle source browse button pressed super handle event event | handle all events and enablements for widgets in this dialog |
private boolean validate move iproject project string new name if project get name equals new name only the location changed return true iresource change description factory factory resource change validator get validator create delta factory factory move project new path new name return ide prompt to confirm shell ideworkbench messages copy project action confirm nls bind ideworkbench messages copy project action warning project get name factory get delta get model provider ids false no need to sync exec | validates the operation against the model providers |
protected boolean update selection istructured selection selection return super update selection selection get element selection null | the code add task action code implementation of this |
public void run basic new file resource wizard wizard new basic new file resource wizard wizard init platform ui get workbench get structured selection wizard set needs progress monitor true wizard dialog dialog new wizard dialog shell wizard dialog create dialog get shell set text ideworkbench messages create file action title platform ui get workbench get help system set help dialog get shell iidehelp context ids new file wizard dialog open | the code create file action code implementation of this |
protected void add to children zip entry parent zip entry child list child list list children get parent if child list null child list new array list children put parent child list child list add child | adds the specified child to the internal collection of the parents children |
private void log exception core exception exception ideworkbench plugin log exception get localized message exception | log the exception |
protected void create container ipath pathname if directory entry cache contains key pathname return zip entry parent if pathname segment count 1 parent root else parent zip entry directory entry cache get pathname remove last segments 1 zip entry new entry new zip entry pathname to string directory entry cache put pathname new entry add to children parent new entry | creates a new container zip entry with the specified name iff |
private tree get tree return this navigator tree | get the tree being edited |
protected void create file zip entry entry ipath pathname new path entry get name zip entry parent if pathname segment count 1 parent root else parent zip entry directory entry cache get pathname remove last segments 1 add to children parent entry | creates a new file zip entry with the specified name |
protected void initialize children new hash map 1000 enumeration entries zip file entries while entries has more elements zip entry entry zip entry entries next element if entry is directory ipath path new path entry get name add trailing separator int path segment count path segment count for int i 1 i path segment count i create container path upto segment i create file entry | initializes this objects children table based on the contents of |
protected void handle types edit button pressed super handle types edit button pressed | open a registered type selection dialog and note the selections |
private boolean validate move iresource resource ipath path iresource change description factory factory resource change validator get validator create delta factory factory move resource path return ide prompt to confirm get shell ideworkbench messages rename resource action confirm nls bind ideworkbench messages rename resource action warning resource get name factory get delta model provider ids true sync exec | validates the operation against the model providers |
protected boolean import resources list file system objects import operation operation new import operation get container full path get source directory file system structure provider instance this file system objects operation set context get shell return execute import operation operation | import the resources with extensions as specified by the user |
protected string get extension for string filename int n index filename last index of if n index 0 return filename substring n index 1 return non nls 1 | returns the extension portion of the passed filename string |
protected boolean is move return false | return whether the operation is a move or a copy |
public file system element get result return result | returns the resulting root file system element |
protected boolean has desired extension string filename if desired extensions null return true int extensions size desired extensions length for int i 0 i extensions size i if get extension for filename equals ignore case desired extensions i return true return false | returns a boolean indicating whether the extension of the passed filename |
public void run iprogress monitor monitor throws interrupted exception try this monitor monitor monitor begin task data transfer messages data transfer scanning matching iprogress monitor unknown result create element null root if result null result new file system element provider get label root null provider is folder root result set file system object root finally monitor done | runs the operation |
public void set desired extensions string extensions desired extensions extensions | sets the file extensions which are desired |
protected void initialize operation import operation op op set create container structure create container structure button get selection op set overwrite resources overwrite existing resources checkbox get selection | initializes the specified operation appropriately |
public ipath get location path return new path get project location field value | returns the current project location path as entered by |
protected boolean is exportable extension string extension if selected types null return true iterator itr selected types iterator while itr has next if extension equals ignore case string itr next return true return false | returns whether the extension provided is an extension that |
protected boolean update selection istructured selection selection return super update selection selection can delete get selected resources array | the code delete resource action code implementation of this |
protected void reset selection minimized file system element current root get file system tree this selection group set root current root | repopulate the view based on the currently entered directory |
public void copy files uri uris icontainer destination ifile store stores build file stores uris if stores null return copy file stores destination stores true null | copies the given uris and folders to the destination |
public istatus get status istatus errors new istatus error table size error table to array errors return new multi status platform ui plugin id istatus ok errors data transfer messages import operation import problems null | returns the status of the import operation |
private string get project location field value return location path field get text trim | returns the value of the project location field |
private iresource get current resource list resources get selected resources if resources size 1 return iresource resources get 0 return null | return the currently selected resource |
private void set resource attributes ifile target resource object file object if file object instanceof file try target resource set resource attributes resource attributes from file file file object catch core exception e inform the log that the attributes reading failed ideworkbench plugin get default get log log e get status | reuse the file atttributes set in the import |
private boolean validate delete iresource resources iresource change description factory factory resource change validator get validator create delta factory for int i 0 i resources length i iresource resource resources i factory delete resource return ide prompt to confirm shell ideworkbench messages delete resource action confirm ideworkbench messages delete resource action warning factory get delta get model provider ids false no need to sync exec | validates the operation against the model providers |
public void copy files final string file names icontainer destination ifile store stores build file stores file names if stores null return copy file stores destination stores true null | copies the given files and folders to the destination |
private void set project name file project file if there is no file or the user has already specified forget it if project file null return ipath path new path project file get path iproject description new description null try new description get workspace load project description path catch core exception exception no good couldn t get the name if new description null this description null this project name field set text non nls 1 else this description new description this project name field set text this description get name | set the project name using either the name of the |
protected boolean update selection istructured selection selection dispose text widget if selection size 1 return false if super update selection selection return false iresource current resource get current resource if current resource null current resource exists return false return true | the code rename resource action code implementation of this |
public void set text action handler text action handler action handler text action handler action handler | set the text action handler |
protected void set all selections boolean value super set all selections value | set all of the selections in the selection group to value |
private void report file info not found final string file name message shell get display sync exec new runnable public void run error dialog open error message shell get problems title nls bind ideworkbench messages copy files and folders operation info not found file name null | report that a file info could not be found |
protected void set source name string path if path length 0 string current items this source name field get items int selection index 1 for int i 0 i current items length i if current items i equals path selection index i if selection index 0 int old length current items length string new items new string old length 1 system arraycopy current items 0 new items 0 old length new items old length path this source name field set items new items selection index old length this source name field select selection index reset selection | sets the source name of the import to be the supplied path |
private void display error final istatus status message shell get display sync exec new runnable public void run error dialog open error message shell get problems title null status | display the supplied status in an error dialog |
protected zip file get specified zip source file return get specified zip source file archive path field get text | answer a handle to the zip file currently specified as being the source |
private zip file get specified zip source file string file name if file name length 0 return null try return new zip file file name catch zip exception e display error dialog data transfer messages zip import bad format catch ioexception e display error dialog data transfer messages zip import could not read archive path field set focus return null | answer a handle to the zip file currently specified as being the source |
protected tar file get specified tar source file return get specified tar source file archive path field get text | answer a handle to the zip file currently specified as being the source |
private void display error final string message message shell get display sync exec new runnable public void run message dialog open error message shell get problems title message | opens an error dialog to display the given message |
protected void update selections map map super update selections map | update the selections with those in map |
private tar file get specified tar source file string file name if file name length 0 return null try return new tar file file name catch tar exception e display error dialog data transfer messages tar import bad format catch ioexception e display error dialog data transfer messages zip import could not read archive path field set focus return null | answer a handle to the zip file currently specified as being the source |
protected void update widget enablements super update widget enablements | check if widgets are enabled or disabled by a change in the dialog |
protected list get markers list markers new array list iresource resource get resource idocument document get document abstract marker annotation model model get annotation model if resource null model null resource exists try imarker all markers resource find markers null true iresource depth zero if all markers null for int i 0 i all markers length i if includes ruler line model get marker position all markers i document markers add all markers i catch core exception x handle core exception x text editor messages select marker ruler action get marker return markers | returns all markers which include the rulers line of activity |
protected boolean validate source group file source directory get source directory if source directory null set message source empty message enable button group false return false if source conflicts with destination new path source directory get path set error message get source conflict message enable button group false return false list resources to export selection group get all white checked items if resources to export size 0 set error message data transfer messages file import none selected return false enable button group true set error message null return true | answer a boolean indicating whether selfs source specification |
protected ifile get file iresource resource if resource instanceof ifile return ifile resource return ifile iadaptable resource get adapter ifile class | returns the resource either casted to or adapted to an ifile |
protected void add marker iresource resource get resource if resource null return map attributes get initial attributes if f ask for label if ask for label attributes return try marker utilities create marker resource attributes f marker type catch core exception x handle core exception x text editor messages marker ruler action add marker | creates a new marker according to the specification of this action and |
protected boolean source conflicts with destination ipath source path icontainer container get specified container if container null return false ipath destination location get specified container get location if destination location null return destination location is prefix of source path null destination location is handled in wizard resource import page return false | returns whether the source location conflicts |
protected void remove markers final list markers try get resource get workspace run new iworkspace runnable public void run iprogress monitor monitor throws core exception for int i 0 i markers size i imarker marker imarker markers get i marker delete null iworkspace avoid update null catch core exception x handle core exception x text editor messages marker ruler action remove markers | removes the given markers |
protected void perform save as iprogress monitor progress monitor ipreference store store editors ui get preference store string key get editor site get id internal delegate save as non nls 1 store set value key true super perform save as progress monitor | the code text editor code implementation of this code abstract text editor code |
protected ifolder get folder iresource resource if resource instanceof ifolder return ifolder resource return ifolder iadaptable resource get adapter ifolder class | returns the resource either casted to or adapted to an ifolder |
protected string get operation title return ideworkbench messages copy files and folders operation operation title | returns the task title for this operations progress dialog |
private void hide revision information if f change ruler column instanceof irevision ruler column irevision ruler column f change ruler column set revision information null if f line number ruler column instanceof irevision ruler column irevision ruler column f line number ruler column set revision information null f is revision information shown false f revision info null | hides revision information in this editor |
protected string get problems message return ideworkbench messages copy files and folders operation problem message | returns the message for this operations problems dialog |
private irevision ruler column get revision column if f change ruler column instanceof irevision ruler column return irevision ruler column f change ruler column if f line number ruler column instanceof irevision ruler column return irevision ruler column f line number ruler column return null | returns the revision ruler column of this editor creating one if needed |
protected string get problems title return ideworkbench messages copy files and folders operation copy failed title | returns the title for this operations problems dialog |
private void install change ruler model ichange ruler column column get change column if column null get or create differ column set model get source viewer get annotation model ioverview ruler ruler get overview ruler if ruler null ruler add annotation type org eclipse ui workbench texteditor quickdiff change non nls 1 ruler add annotation type org eclipse ui workbench texteditor quickdiff addition non nls 1 ruler add annotation type org eclipse ui workbench texteditor quickdiff deletion non nls 1 ruler update | installs the differ annotation model with the current quick diff display |
protected boolean get validate conflict source return false | returns whether the source file in a destination collision will be |
private boolean is accessible iresource resource switch resource get type case iresource file return true case iresource folder return true case iresource project return iproject resource is open default return false | returns whether the given resource is accessible |
public button get project from directory radio return project from directory radio | method used for test suite |
public checkbox tree viewer get projects list return projects list | method used for test suite |
private boolean is project in workspace string project name if project name null return false iproject workspace projects get projects in workspace for int i 0 i workspace projects length i if project name equals workspace projects i get name return true return false | determine if the project with the given name is in the current workspace |
public button get copy checkbox return copy checkbox | method used for test suite |
private void show line number ruler show change ruler false if f line number ruler column null ivertical ruler v get vertical ruler if v instanceof composite ruler composite ruler c composite ruler v c add decorator 1 create line number ruler column if f is revision information shown irevision ruler column column get revision column column set revision information f revision info | shows the line number ruler column |
protected ichange ruler column create change ruler column ichange ruler column column new change ruler column get shared colors column set hover create change hover f change ruler column column initialize change ruler column f change ruler column return f change ruler column | creates a new change ruler column for quick diff display independent of the |
private void create java file from document iprogress monitor monitor ipath location idocument document throws core exception try monitor begin task text editor messages text file document provider begin task saving 2000 file buffers get text file buffer manager connect location monitor itext file buffer buffer file buffers get text file buffer manager get text file buffer location buffer get document set document get buffer commit monitor true file buffers get text file buffer manager disconnect location monitor finally monitor done | creates the given file with the given document content |
private ifile get workspace file ifile store file store iworkspace root workspace root resources plugin get workspace get root ifile files workspace root find files for location new path file store to uri get path if files null files length 1 return files 0 return null | checks whether there given file store points |
private boolean handle save as ipreference store store editors ui get preference store string key get editor site get id internal delegate save as non nls 1 return store get boolean key | tells whether this class should handle |
protected ifile store get file store file info info ipath path info f text file buffer get location return file buffers get file store at location path | returns the file store denoted by the given info |
public void initialize this set size preferences height preferences width this set layout new java awt border layout this add get jsplit pane java awt border layout center jpanel tmp new jpanel save button new jbutton save save button add action listener this close button new jbutton close close button add action listener this tmp add save button tmp add close button this add tmp border layout south | this method initializes this |
private jsplit pane get jsplit pane if j split pane null j split pane new jsplit pane scroll pane tmp new scroll pane tmp add get jtree j split pane set left component tmp properties panel new properties panel this j split pane set right component properties panel j split pane set divider location 165 return j split pane | this method initializes j split pane |
public void set in scope string attribute name object value string scope set in scope attribute name value get current request scope | sets the attribute in the context specified |
public object get in scope string attribute name string scope return get in scope attribute name get current request scope | gets the attribute in the context specified null otherwise |
protected permission key mount permission key http servlet request request return new permission key request get servlet path | by default the permission key uses code request |
public void push action form form action mapping mapping string path throws exception if path null this push form mapping new action forward path | push an action action event with this path and form |
public void push action form form action mapping mapping action forward forward this push create action event form mapping forward | push an action action event with this forward and form |
public void push action event event this stack push event | push an action action event |
public action event get last return stack peek | returns the top of the stack history without pop |
public action event pop return stack pop | pop the last action of the stack |
public action event remove int i return stack remove i | remove the object at index |
public to load to to boolean lock throws business exception logger entering model bean model null try id model id to get id if model id null throw new business exception error registro nao encontrado model dao find by id model id lock if model null throw new business exception error registro nao encontrado dao refresh model bean helper util copy properties to model catch exception e throw new business exception e get message e logger exiting return to | carrega um bean do modelo |
public void add order string property boolean ascending order list add new order property ascending | adds an order property |
protected void flush session throws persistence exception logger entering try persistence flush session catch persistence exception e persistence rollback transaction throw e logger exiting | flush na sess o |
protected void clear session throws persistence exception logger entering try persistence clear session catch persistence exception e persistence rollback transaction throw e logger exiting | flush na sess o |
protected void commit transacao throws persistence exception logger entering try persistence commit transaction catch persistence exception e persistence rollback transaction throw e logger exiting | commit da transa o |
public boolean add if string str object param final condition conditions if if chk param conditions add str param return true return false | adds the sentence if the parameter match the conditions |
public void sql statement this is sql true | means that this statement to be an sql statement |
protected paging bean config paging http servlet request request action form form action mapping mapping throws exception return paging config config paging request form mapping | configura pagina o |
public boolean and if string str object param final condition conditions if if chk param conditions and str param return true return false | adds the sentence if the parameter match the conditions |
public boolean or if string str object param final condition conditions if if chk param conditions or str param super buffer get capacity return true return false | adds the sentence if the parameter match the conditions |
Subsets and Splits