input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
private void add mnemonic build set action action int index string buffer label new string buffer add the numerical accelerator if index 9 label append label append index label append label append action get working set get label action set text label to string | adds a mnemonic accelerator to actions in the mru list of |
private iworkbench get workbench return get window configurer get workbench configurer get workbench | returns the workbench |
public long get feature image crc if bundle group properties null return null if calculated image crc feature image crc calculate image crc bundle group properties get feature image url calculated image crc feature image crc null return feature image crc | returns the crc of the feature image as supplied in the properties file |
private istatus validate file type ifile info link target file if type iresource file link target file is directory return create status istatus error ideworkbench messages create linked resource group link target not file else if type iresource folder link target file is directory return create status istatus error ideworkbench messages create linked resource group link target not folder return status ok status | validates the type of the given file against the link type specified in |
public string get feature label if product properties null return product properties get product name if bundle group properties null return bundle group properties get feature label return null | returns a label for the feature plugn or code null code |
public string get feature id string id null if product properties null id product properties get product id else if bundle group properties null id bundle group properties get feature id return id null id non nls 1 | returns the id for this feature |
public void run iproject project get project if project null return sel provider sel provider new sel provider sel provider project selection new structured selection project property dialog action prop action new property dialog action workbench window get shell sel provider prop action run | opens the project properties dialog |
public void selection changed iworkbench part part iselection sel set enabled get project null | update the enablement state when a the selection changes |
public void part activated iworkbench part part super part activated part set enabled get project null | update the enablement state when a new part is activated |
public string get about text return product properties null null product properties get about text | returns the text to show in an about dialog for this product |
private iproject get project iworkbench part part get active part object selection null if part instanceof ieditor part selection ieditor part part get editor input else iselection sel workbench window get selection service get selection if sel null sel instanceof istructured selection selection istructured selection sel get first element if selection null return null if selection instanceof iadaptable return null iresource resource iresource iadaptable selection get adapter iresource class if resource null return null return resource get project | returns a project from the selection of the active part |
public string get app name return product properties null null product properties get app name | returns the application name or code null code |
private void internal set working set iworking set working set this working set working set empty working set working set null working set is aggregate working set working set is empty | set the internal working set fields specific to the navigator |
public file system contributor get contributor return contributor | return the contributor for the receiver |
protected point compute menu location styled text text point result text get location at offset text get caret offset result y text get line height if text get client area contains result return null return result | hook to compute the menu location if the focus widget is |
public string get product name return product properties null null product properties get product name | returns the product name or code null code |
public string get provider name return bundle group properties null null bundle group properties get provider name | returns the provider name or code null code |
public string get version id return bundle group properties null bundle group properties get feature version non nls 1 | returns the feature version id |
public project image registry get project image registry if project image registry null project image registry new project image registry project image registry load return project image registry | return the manager that maps project nature ids to images |
public list get all checked list items final array list return value new array list ielement filter pass through filter new ielement filter public void filter elements collection elements iprogress monitor monitor return value add all elements public void filter elements object elements iprogress monitor monitor for int i 0 i elements length i return value add elements i try get all checked list items pass through filter null catch interrupted exception exception return new array list return return value | returns a flat list of all of the leaf elements which are checked |
public url get welcome page url if product properties null return product properties get welcome page url if bundle group properties null return bundle group properties get welcome page url return null | returns a code url code for the welcome page |
public file system configuration get default configuration return default configuration | return the default file system configuration the local file system |
public marker image provider registry get marker image provider registry if marker image provider registry null marker image provider registry new marker image provider registry return marker image provider registry | returns the marker image provider registry for the workbench |
public string get welcome perspective id return bundle group properties null null bundle group properties get welcome perspective | returns the id of a perspective in which to show the welcome page |
public boolean has one file system return registered contributions size 0 | return whether or not there is only one file system registered |
public void add provider iconfiguration element element descriptor desc new descriptor desc element element desc plugin bundle platform get bundle element get namespace desc id element get attribute att id desc marker type element get attribute att marker type desc image path element get attribute att icon desc class name element get attribute att provider class if desc image path null desc image descriptor get image descriptor desc if desc class name null don t need to keep these references desc element null desc plugin bundle null descriptors add desc | creates a descriptor for the marker provider extension |
public about info get primary info iproduct product platform get product return product null null new about info product | returns the about information of the primary feature |
public image descriptor get nature image string nature id return image descriptor map get nature id | returns the image for the given nature id or |
public void compute hash code hash code 19 for int i 0 i values length i hash code hash code 37 values i hash code | computes the hash code for this instance |
public void add help marker help registry registry iextension registry extension registry platform get extension registry marker help registry registry read registry extension registry ideworkbench plugin ide workbench ideworkbench plugin pl marker help read registry extension registry ideworkbench plugin ide workbench ideworkbench plugin pl marker resolution | get the marker help that is defined in the plugin registry |
public void load project image registry reader reader new project image registry reader reader read project nature images platform get extension registry this | reads from the plugin registry |
public string get tips and tricks href return bundle group properties null null bundle group properties get tips and tricks href | returns a code string code for the tips and trick href |
public void set nature image string nature id image descriptor image map put nature id image | sets the image for the given nature id |
protected void update action bars istructured selection selection resource navigator action group group get action group if group null group set context new action context selection group update action bars | updates the action bar actions |
private string get banner title if parser get title null return non nls 1 return parser get title | returns the title obtained from the parser |
protected string get description iconfiguration element config iconfiguration element children config get children tag description if children length 1 return children 0 get value return non nls 1 | this method extracts description as a subelement of |
public void compute hash code hash code 19 if type null hash code hash code 37 type hash code for int i 0 i attributes length i hash code hash code 37 attributes i hash code | computes the hash code for this instance |
protected void log error iconfiguration element element string text iextension extension element get declaring extension string plugin id extension get namespace string buffer buf new string buffer buf append plugin plugin id extension non nls 2 non nls 1 extension get extension point unique identifier buf append n text non nls 1 ideworkbench plugin log buf to string | logs the error in the workbench log using the provided |
public void finished throws ioexception output stream close if gzip output stream null gzip output stream close | do all required cleanup now that were finished with the |
public void close throws ioexception spec says to write 1024 bytes of zeros at the end byte zeros new byte 1024 cursize 1024 write zeros 0 1024 default block size for tar files is 10240 so we have to pad the end of the file to be a multiple of this size if byteswritten 10240 0 int length 10240 byteswritten 10240 cursize length zeros new byte length write zeros 0 length super close | close the output stream and write any necessary padding |
private void write tar entry entry ifile contents throws ioexception core exception ipath location contents get location if location null throw new file not found exception contents get full path to osstring java io file local file location to file entry set size local file length output stream put next entry entry input stream content stream contents get contents false try int n byte read buffer new byte 4096 while n content stream read read buffer 0 output stream write read buffer 0 n finally if content stream null content stream close output stream close entry | write the contents of the file to the tar archive |
public void close entry throws ioexception byte data new byte 512 int len 512 datapos if len 0 datapos 0 cursize len write data 0 len | close the current entry in the tar file |
public boolean cancel clear provider cache return true | called when the user presses the cancel button |
protected void log unknown element iconfiguration element element log error element unknown extension tag found element get name non nls 1 | logs a registry error when the configuration element is unknown |
public void close throws ioexception entry enumeration stream close | close the tar file input stream |
public void write byte b int off int len throws ioexception super write b off len datapos datapos len 512 byteswritten len cursize len if cursize 0 throw new ioexception too much data written for current file non nls 1 | writes data for the current file into the archive |
public int get device major return major | if this file is a device inode returns its major number |
protected void clear provider cache archive file manipulations clear provider cache get container get shell | clears the cached structure provider after first finalizing |
protected void read elements iconfiguration element elements for int i 0 i elements length i if read element elements i log unknown element elements i | read each element one at a time by calling the |
public int get device minor return minor | if this file is a device inode returns its minor number |
public input stream get input stream tar entry entry throws tar exception ioexception if entry stream null entry stream skip to entry entry input stream in new file input stream file first check if it s a gzipinput stream try in new gzipinput stream in catch ioexception e in new file input stream file entry stream new tar input stream in entry public void close ignore close since we want to reuse the stream if entry stream null system out println huh non nls 1 return entry stream | returns a new input stream for the given file in the tar archive |
private welcome item get intro item return parser get intro item | returns the intro item or code null code |
protected void update status line istructured selection selection string msg get status line message selection get view site get action bars get status line manager set message msg | updates the message shown in the status line |
public string get link destination return linkdest | if this file represents a symbolic link or hard link this is |
protected boolean close zip file zip file file try file close catch ioexception e display error dialog nls bind data transfer messages zip import could not close file get name return false return true | attempts to close the passed zip file and answers a boolean indicating success |
protected void add error string message throwable e error table add new status istatus error ideworkbench plugin ide workbench 0 message e | add a new entry to the error table with the passed information |
public void set device major int major this major major | sets the major number of the device if this entry represents a device |
protected void clear provider cache if provider cache null close zip file provider cache get zip file provider cache null | clears the cached structure provider after first finalizing |
public void set device minor int minor this minor minor | sets the minor number of the device if this entry represents a device |
protected void create options group composite parent overwrite checkbox overwrite existing resources checkbox new button parent swt check overwrite existing resources checkbox set text data transfer messages file import overwrite existing overwrite existing resources checkbox set font parent get font | create the options specification widgets |
public void set group name string groupname this groupname groupname | sets the name of the group of this file |
public void set link destination string linkdest this linkdest linkdest | if this file represents a symbolic or hard link sets the path name |
private boolean ensure zip source is valid zip file specified file get specified zip source file if specified file null return false return archive file manipulations close zip file specified file get container get shell | answer a boolean indicating whether the specified source currently exists |
public list get result return error table | answer the error table |
protected boolean ensure source is valid zip file specified file get specified source file if specified file null return false return close zip file specified file | answer a boolean indicating whether the specified source currently exists |
protected void initialize throws ioexception if use tar format exporter new tar file exporter destination filename use compression else exporter new zip file exporter destination filename use compression | initialize this operation |
public boolean finish if super finish return false clear provider cache return true | the finish button was pressed |
protected boolean ensure source is valid if archive file manipulations is tar file source name field get text return ensure tar source is valid return ensure zip source is valid | answer a boolean indicating whether the specified source currently exists |
protected itree content provider get file provider return new workbench content provider public object get children object o if o instanceof minimized file system element minimized file system element element minimized file system element o return element get files current provider get children element return new object 0 | returns a content provider for code file system element code s that returns |
public boolean finish if super finish return false archive file manipulations clear provider cache get container get shell return true | the finish button was pressed |
protected resource navigator action group get action group return action group | returns the action group |
protected minimized file system element get file system tree zip file source file get specified source file if source file null clear out the provider as well this current provider null return null zip file structure provider provider get structure provider source file this current provider provider return select files provider get root provider | answer the root file system element that represents the contents of the |
protected itree content provider get file provider return new workbench content provider public object get children object o if o instanceof minimized file system element minimized file system element element minimized file system element o adaptable list l if zip current provider null l element get files zip current provider else l element get files tar current provider return l get children element return new object 0 | returns a content provider for code file system element code s that returns |
protected itree content provider get folder provider return new workbench content provider public object get children object o if o instanceof minimized file system element minimized file system element element minimized file system element o return element get folders current provider get children element return new object 0 public boolean has children object o if o instanceof minimized file system element minimized file system element element minimized file system element o if element is populated return get children element length 0 else if we have not populated then wait until asked return true return false | returns a content provider for code file system element code s that returns |
protected void set action group resource navigator action group action group this action group action group | sets the action group |
protected boolean execute export operation archive file export operation op op set create leadup structure create directory structure button get selection op set use compression compress contents checkbox get selection op set use tar format targz format button get selection try get container run true true op catch interrupted exception e return false catch invocation target exception e display error dialog e get target exception return false istatus status op get status if status is ok error dialog open error get container get shell data transfer messages data transfer export problems null no special message status return false return true | export the passed resource and recursively export all of its child resources |
protected string get source label return data transfer messages zip import from file | answer the string to display as the label for the source specification field |
protected void create options group buttons group options group font font options group get font compress checkbox compress contents checkbox new button options group swt check swt left compress contents checkbox set text data transfer messages zip export compress contents compress contents checkbox set font font create directory structure options options group font initial setup create directory structure button set selection true create selection only button set selection false compress contents checkbox set selection true | create the export options specification widgets |
protected zip file get specified source file return get specified source file source name field get text | answer a handle to the zip file currently specified as being the source |
private zip file get specified 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 source name field set focus return null | answer a handle to the zip file currently specified as being the source |
protected string get source label return data transfer messages archive import from file | answer the string to display as the label for the source specification field |
protected string get output suffix if zip format button get selection return zip non nls 1 else if compress contents checkbox get selection return tar gz non nls 1 else return tar non nls 1 | answer the suffix that files exported from this wizard should have |
protected zip file structure provider get structure provider zip file target zip if provider cache null provider cache new zip file structure provider target zip else if provider cache get zip file get name equals target zip get name clear provider cache ie new value so finalize remove old value provider cache new zip file structure provider target zip else if provider cache get zip file equals target zip close zip file target zip ie duplicate handle to same zip return provider cache | returns a structure provider for the specified zip file |
public void read input stream is throws ioexception try parser new welcome parser catch parser configuration exception e throw ioexception new ioexception init cause e catch saxexception e throw ioexception new ioexception init cause e parser parse is | read the contents of the welcome page |
protected boolean execute export operation archive file export operation op op set create leadup structure create directory structure button get selection op set use compression compress contents checkbox get selection try get container run true true op catch interrupted exception e return false catch invocation target exception e display error dialog e get target exception return false istatus status op get status if status is ok error dialog open error get container get shell data transfer messages data transfer export problems null no special message status return false return true | export the passed resource and recursively export all of its child resources |
protected zip file get specified zip source file return get specified zip source file source name field get text | answer a handle to the zip file currently specified as being the source |
public boolean finish if ensure target is valid return false list resources to export get white checked resources save dirty editors if possible but do not stop if not all are saved save dirty editors about to invoke the operation so save our state save widget values if resources to export size 0 return execute export operation new archive file export operation null resources to export get destination value message dialog open information get container get shell data transfer messages data transfer information data transfer messages file export none selected return false | the finish button was pressed |
protected ishow in source get show in source return new ishow in source public show in context get show in context return new show in context get viewer get input get viewer get selection | returns the code ishow in source code for this view |
protected void handle source browse button pressed string selected file query zip file to import if selected file null if selected file equals source name field get text be sure it is valid before we go setting any names zip file source file get specified source file selected file if source file null close zip file source file set source name selected file selection group set focus | open a file dialog so that the user can specify 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 source name field set focus return null | answer a handle to the zip file currently specified as being the source |
protected string get destination label return data transfer messages zip export destination label | answer the string to display in the receiver as the destination type |
protected boolean import resources list file system objects zip file zip file get specified source file zip file structure provider structure provider get structure provider zip file import operation operation new import operation get container full path structure provider get root structure provider this file system objects operation set context get shell boolean result execute import operation operation close zip file zip file return result | import the resources with extensions as specified by the user |
protected tar file get specified tar source file return get specified tar source file source name field get text | answer a handle to the zip file currently specified as being the source |
public void read file url url welcome editor input get editor input get about info get welcome page url if url null should not happen return input stream is null try is url open stream read is catch ioexception e istatus status new status istatus error ideworkbench plugin ide workbench 1 ideworkbench messages welcome editor access exception e ideworkbench plugin log ideworkbench messages welcome editor read file error status finally try if is null is close catch ioexception e | reads the welcome file |
protected void initialize operation import operation op op set overwrite resources overwrite existing resources checkbox get selection | initializes the specified operation appropriately |
protected string get output suffix return zip non nls 1 | answer the suffix that files exported from this wizard should have |
protected void handle destination browse button pressed file dialog dialog new file dialog get container get shell swt save dialog set filter extensions new string zip non nls 1 non nls 2 dialog set text data transfer messages zip export select destination title string current source string get destination value int last separator index current source string last index of file separator if last separator index 1 dialog set filter path current source string substring 0 last separator index string selected file name dialog open if selected file name null set error message null set destination value selected file name | open an appropriate destination browser so that the user can specify a source |
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 source name field set focus return null | answer a handle to the zip file currently specified as being the source |
protected string query zip file to import file dialog dialog new file dialog source name field get shell swt open dialog set filter extensions file import mask dialog set text data transfer messages zip import source title string current source string source name field get text int last separator index current source string last index of file separator if last separator index 1 dialog set filter path current source string substring 0 last separator index return dialog open | opens a file selection dialog and returns a string representing the |
protected void reset selection super reset selection set all selections true | repopulate the view based on the currently entered directory |