input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
private void set user area enabled boolean enabled location label set enabled enabled location path field set enabled enabled browse button set enabled enabled if file system selection area null file system selection area set enabled enabled | set the enablement state of the receiver |
protected style range get current link styled text text style range ranges text get style ranges int current selection end text get selection y int current selection start text get selection x for int i 0 i ranges length i if current selection start ranges i start current selection end ranges i start ranges i length return ranges i return null | finds the current link of the current selection |
protected void update hierarchy object tree element boolean white checked determine should be white checked tree element boolean should be at least gray determine should be at least gray checked tree element tree viewer set checked tree element should be at least gray set white checked tree element white checked if white checked tree viewer set grayed tree element should be at least gray proceed up the tree element hierarchy object parent tree content provider get parent tree element if parent null update hierarchy parent | set the checked state of self and all ancestors appropriately |
private void defaults button selected boolean selected if selected set build order widgets enablement false cache the current value as the custom order custom build order build list get items build list set items get default project order else set build order widgets enablement true string build order get current build order if build order null build list set items get default project order else build list set items build order | the defaults button has been selected update the other widgets as required |
public button get browse button return browse button | return the browse button |
protected void update for selection update enabled state true mark dirty | a selection has occured on one of the checkboxes or combos |
private iworkspace get workspace return resources plugin get workspace | return the workspace the build order is from |
private void update location field string selected path location path field set text text processor process selected path | update the location field based on the selected path |
private string get path from location field uri field uri try field uri new uri location path field get text catch urisyntax exception e return location path field get text return field uri get path | return the path on the location field |
private boolean includes string test array string search element for int i 0 i test array length i if search element equals test array i return true return false | return whether or not search element is in test array |
public uri get project location uri file system configuration configuration get selected configuration if configuration null return null return configuration get contributor get uri location path field get text | get the uri for the location field if possible |
public void init iworkbench workbench this workbench workbench set preference store pref util get internal preference store | see iworkbench preference page |
private void restore linking enabled integer val memento get integer iworkbench preference constants link navigator to editor if val null linking enabled val int value 0 | restores the linking enabled state |
private file system configuration get selected configuration if file system selection area null return file system support registry get instance get default configuration return file system selection area get selected configuration | return the selected contributor |
protected collection find enabled filters marker filter all filters get all filters array list filters new array list 0 for int i 0 i all filters length i if all filters i is enabled filters add all filters i return filters | find the filters enabled in the view |
public file system configuration get selected configuration iselection selection file systems get selection if selection instanceof istructured selection istructured selection structured istructured selection selection if structured size 1 return file system configuration structured get first element return null | return the selected configuration |
private void move selection down only do this operation on a single selection if this build list get selection count 1 int current index this build list get selection index if current index this build list get item count 1 string element to move this build list get item current index this build list remove current index this build list add element to move current index 1 this build list select current index 1 | move the current selection in the build list down |
public void set enabled boolean enabled file system title set enabled enabled file systems get control set enabled enabled | set the enablement state of the widget |
public string get project location if is default return platform get location to string return location path field get text | return the location for the project |
public void set detail button int index detail button id index | set the detail button |
protected void configure shell shell shell super configure shell shell if new variable shell set text ideworkbench messages path variable dialog shell title new variable else shell set text ideworkbench messages path variable dialog shell title existing variable | configures this dialogs shell setting the shells text |
private void move selection up int current index this build list get selection index only do this operation on a single selection if current index 0 this build list get selection count 1 string element to move this build list get item current index this build list remove current index this build list add element to move current index 1 this build list select current index 1 | move the current selection in the build list up |
private void toggle details area point window size get shell get size point old size get contents compute size swt default swt default if text null text dispose text null get button detail button id set text idialog constants show details label else create drop down text composite get contents get button detail button id set text idialog constants hide details label point new size get contents compute size swt default swt default get shell set size new point window size x window size y new size y old size y | toggles the unfolding of the details area |
public void add update finish listener ijob change listener listener update job add job change listener listener | add a listener for the end of the update |
protected control create dialog area composite parent top level composite composite parent composite composite super create dialog area parent initialize dialog units parent composite creates dialog area composite composite contents create composite parent composite creates and lay outs dialog area widgets create widgets contents validate possibly already incorrect variable definitions if type existing variable name entered location entered true validate variable value dialog apply dialog font parent composite return contents | creates and returns the contents of this dialog except for the button bar |
private void set children checked object element boolean checked object children types content provider get children element if children length 0 for int i 0 i children length i types viewer set checked children i checked | set the check state of the children of element to checked |
protected void perform defaults this default order button set selection true defaults button selected true max iters field load default super perform defaults | performs special processing when this pages defaults button has been pressed |
private composite create composite composite parent composite creates a composite with standard margins and spacing composite contents new composite parent composite swt none form layout layout new form layout contents set layout layout contents set layout data new grid data grid data fill both if new variable set title ideworkbench messages path variable dialog dialog title new variable else set title ideworkbench messages path variable dialog dialog title existing variable set message standard message return contents | creates and configures this dialogs main composite |
protected void handle invocation target exception e istatus error throwable target e get target exception if target instanceof core exception error core exception target get status else string msg target get message if msg null msg ideworkbench messages internal error error new status istatus error ideworkbench plugin ide workbench 1 msg target error dialog open error get control get shell null null error | handle the exception thrown when saving |
private void initialize project iproject get element get adapter iresource class no default and apply button set description nls bind ideworkbench messages project references page label project get name | initializes a project reference page |
private void save linking enabled imemento memento memento put integer iworkbench preference constants link navigator to editor linking enabled 1 0 | saves the linking enabled state |
public void remove update finish listener ijob change listener listener update job remove job change listener listener | remove a listener for the end of the update |
protected void create filter select buttons composite list area composite buttons new composite list area swt none grid layout button layout new grid layout 2 false button layout margin width 0 buttons set layout button layout create button buttons select all filters id marker messages filters dialog select all false create button buttons deselect all filters id marker messages filters dialog deselect all false | create the buttons for selecting the filters |
private void remove selection this build list remove this build list get selection indices | remove the current selection in the build list |
public welcome item get intro item return intro item | returns the intro item |
public void set selection iselection selection boolean reveal assert is true selection instanceof istructured selection istructured selection ssel istructured selection selection for iterator i ssel iterator i has next assert is true i next instanceof imarker if viewer null viewer set selection selection reveal | api method which sets the current selection of this viewer |
public void set active editor ieditor part part iaction bars action bars get action bars if action bars null action bars set global action handler action factory copy get id welcome editor part get copy action | the code welcome editor action contributor code implementation of this |
public void select reveal iselection selection structured selection ssel convert selection selection if ssel is empty get viewer get control set redraw false get viewer set selection ssel true get viewer get control set redraw true | selects and reveals the specified elements |
private iproperty change listener get working set listener working set listener new iproperty change listener non javadoc see org eclipse jface util iproperty change listener property change org eclipse jface util property change event public void property change property change event event clear enabled filters refresh viewer return working set listener | create a listener for working set changes |
private void set build order widgets enablement boolean value only change enablement of buttons leave list alone because you can t scroll it when disabled control children this button composite get children for int i 0 i children length i children i set enabled value | set the widgets that select build order to be enabled or diabled |
public boolean is format wrapped return format wrap equals format | returns whether or not the welcome editor input should be wrapped |
private void check state assume invalid if the controls not created yet if longevity text null max states text null max state size text null set valid false return if validate long text entry longevity text failed value set valid false return if validate max file states failed value set valid false return if validate max file state size failed value set valid false return set valid true set error message null | recomputes the pages error state by validating all |
public void parse input stream is try parser parse new input source is this catch saxexception e istatus status new status istatus error ideworkbench plugin ide workbench 1 ideworkbench messages welcome parser parse exception e ideworkbench plugin log ideworkbench messages welcome parser parse error status catch ioexception e istatus status new status istatus error ideworkbench plugin ide workbench 1 ideworkbench messages welcome parser parse exception e ideworkbench plugin log ideworkbench messages welcome parser parse error status | parse the contents of the input stream |
public void load natures nature map clear iextension point point platform get extension registry get extension point org eclipse core resources natures non nls 1 iextension extensions point get extensions for int i 0 i extensions length i iextension extension extensions i final string local id extension get simple identifier final string plugin id extension get namespace string nature id extension get unique identifier nature map put nature id new iplugin contribution public string get local id return local id public string get plugin id return plugin id | for dynamic ui |
private iworkspace description get workspace description return resources plugin get workspace get description | get the workspace description this page is operating on |
private void variable name modified updates and validates the variable name variable name variable name field get text validation status imessage provider none ok button set enabled validate variable name validate variable value name entered true | fires validations variable name first and updates enabled state for the |
public void handle event event event check state | sent when an event that the receiver has registered for occurs |
public void set filters preference string patterns string buffer sb new string buffer for int i 0 i patterns length i if i 0 sb append resource pattern filter comma separator sb append patterns i get plugin get preference store set value resource pattern filter filters tag sb to string remove value in old workbench preference store location ipreference store preference store ideworkbench plugin get default get preference store string stored patterns preference store get string resource pattern filter filters tag if stored patterns length 0 preference store set value resource pattern filter filters tag non nls 1 | saves the filters defined as strings in code patterns code |
public void handle exception throwable t try exception count if exception count 1 if closing return shell parent default parent if dialog null dialog get shell null dialog get shell is disposed parent dialog get shell message box box new message box parent swt icon error swt yes swt no swt system modal box set text msg fatal error recursive title box set message message format format msg fatal error new object msg fatal error recursive int result box open if result swt yes close workbench else if open question dialog t close workbench finally exception count | handles an event loop exception |
private void variable value modified updates and validates the variable value variable value variable value field get text trim validation status imessage provider none ok button set enabled validate variable value validate variable name location entered true | fires validations variable value first and updates enabled state for the |
public void init org eclipse ui iworkbench workbench | initializes this preference page for the given workbench |
protected void perform defaults super perform defaults preferences prefs resources plugin get plugin get plugin preferences long days prefs get default long resources plugin pref file state longevity day length long megabytes prefs get default long resources plugin pref max file state size megabytes this longevity text set text string value of days this max states text set text prefs get default string resources plugin pref max file states this max state size text set text string value of megabytes check state | performs special processing when this pages defaults button has been pressed |
public void shutdown if listener null resources plugin get workspace remove resource change listener listener | unhooks the code iresource change listener code |
private void select folder directory dialog dialog new directory dialog get shell dialog set text ideworkbench messages path variable dialog select folder title dialog set message ideworkbench messages path variable dialog select folder message dialog set filter path variable value string res dialog open if res null variable value new path res make absolute to osstring variable value field set text variable value | opens a dialog where the user can select a folder path |
private void create file system selection composite composite boolean enabled always use the default if that is all there is if file system support registry get instance has one file system return file system selection area new file system selection area file system selection area create contents composite file system selection area set enabled enabled | create the file system selection area |
private int validate integer text entry text text int value try value integer parse int text get text catch number format exception exception set error message message format format ideworkbench messages file history invalid new object exception get localized message return failed value be sure all values are non zero and positive if value 0 set error message ideworkbench messages file history must be positive return failed value return value | validate a text entry for an integer field |
public void run iaction action busy indicator show while window get shell get display new runnable public void run update manager ui open configuration manager window get shell | runs the action when selected |
private long validate long text entry text text long value try value long parse long text get text catch number format exception exception set error message message format format ideworkbench messages file history invalid new object exception get localized message return failed value be sure all values are non zero and positive if value 0 set error message ideworkbench messages file history must be positive return failed value return value | validate a text entry for a long field |
private void select file file dialog dialog new file dialog get shell dialog set text ideworkbench messages path variable dialog select file title dialog set filter path variable value string res dialog open if res null variable value new path res make absolute to osstring variable value field set text variable value | opens a dialog where the user can select a file path |
private int validate max file states int max file states validate integer text entry this max states text if max file states failed value return max file states if max file states file states maximum set error message nls bind ideworkbench messages file history above max entries string value of file states maximum return failed value return max file states | validate the maximum file states |
private long validate max file state size long max file state size validate long text entry this max state size text if max file state size failed value return max file state size if max file state size state size maximum set error message nls bind ideworkbench messages file history above max file size string value of state size maximum return failed value return max file state size | validate the maximum file state size |
protected void create buttons for button bar composite parent ok button create button parent idialog constants ok id idialog constants ok label true ok button set enabled type existing variable create button parent idialog constants cancel id idialog constants cancel label false | adds buttons to this dialogs button bar |
private istatus create status int severity string message return new status severity ideworkbench plugin get default get bundle get symbolic name severity message null | returns a new status object with the given severity and message |
public void prompt boolean force if force launch data get show dialog open 70576 make sure dialog gets dismissed on esc too if get return code cancel launch data workspace selected null return string recent launch data get recent workspaces if the selection dialog was not used then the workspace to use is either the most recent selection or the initial default if there is no history string workspace null if recent null recent length 0 workspace recent 0 if workspace null workspace length 0 workspace launch data get initial default launch data workspace selected workspace | show the dialog to the user if needed |
private void handle location browse button pressed directory dialog dialog new directory dialog location path field get shell dialog set message ideworkbench messages wizard new project creation page directory label string dir name get project location field value if dir name length 0 if ideresource info utils exists dir name dialog set filter path new path dir name to osstring string selected directory dialog open if selected directory null custom location field value selected directory location path field set text custom location field value | open an appropriate directory browser |
public void dispose if group composite null group composite is disposed false group composite dispose | disposes the groups widgets |
public void set label decorator ilabel decorator decorator do nothing | note for experimental use only |
protected void configure shell shell shell super configure shell shell shell set text ideworkbench messages choose workspace dialog dialog name | configures the given shell in preparation for opening this window |
public string get link target if create link return link target return null | returns the link target location entered by the user |
protected void ok pressed launch data workspace selected text get text super ok pressed | notifies that the ok button of this dialog has been pressed |
protected display create display return platform ui create display | creates the display used by the application |
protected void cancel pressed launch data workspace selected null super cancel pressed | notifies that the cancel button of this dialog has been pressed |
public string get initial default if initial default null set initial default system get property user dir non nls 1 file separator workspace non nls 1 return initial default | return the folder to be used as a default if no other information |
private file system configuration get selected configuration if file system selection area null return null return file system selection area get selected configuration | return the selected configuration or code null code |
private void set initial default string dir if dir null dir length 0 initial default null return dir new path dir to osstring while dir char at dir length 1 file separator char dir dir substring 0 dir length 1 initial default dir | set this datas initial default parameter to a properly formatted version |
private void refresh for focus update if focus elements null update filter selection focus elements refresh viewer | the focus elements have changed |
public string get variable value return variable value | returns the variable value |
private string get initial browse path file dir new file text get text while dir null dir exists dir dir get parent file return dir null dir get absolute path system get property user dir non nls 1 | return a string containing the path that is closest to the current |
private void handle variables button pressed int variable types iresource folder allow selecting file and folder variables when creating a linked file if type iresource file variable types iresource file path variable selection dialog dialog new path variable selection dialog link target field get shell variable types if dialog open idialog constants ok id string variable names string dialog get result if variable names null variable names length 1 link target field set text variable names 0 | opens a path variable selection dialog |
public boolean get show dialog return show dialog | return the currently selected workspace or null if nothing is selected |
public void set variable name string variable name this variable name variable name trim this original name this variable name | sets the variable name |
public void workspace selected string dir this just stores the selection it is not inserted and persisted until the workspace is actually selected selection dir | the argument workspace has been selected update the receiver |
public void set sorter resource sorter sorter tree viewer viewer get tree viewer viewer sorter viewer sorter viewer get sorter viewer get control set redraw false if viewer sorter sorter viewer refresh else viewer set sorter sorter viewer get control set redraw true settings put store sort type sorter get criteria update the sort actions checked state update action bars istructured selection viewer get selection | sets the resource sorter |
protected void preserve selection update job save selection get viewer get selection | save the current selection in the update for reselection after update |
public void toggle show dialog show dialog show dialog | toggle value of the show dialog persistent setting |
public void set variable value string variable value this variable value variable value | sets the variable value |
private void resolve variable ipath variable manager path variable manager resources plugin get workspace get path variable manager ipath path new path link target ipath resolved path path variable manager resolve path path if path equals resolved path resolved path label text set visible false resolved path label data set visible false else resolved path label text set visible true resolved path label data set visible true resolved path label data set text resolved path to osstring | tries to resolve the value entered in the link target field as a |
public void load default do load | initializes this field editor with the preference value from the |
public string get stored value iscope context scope context new iscope context get scope context ieclipse preferences node scope context 0 get node platform pi runtime return node get platform pref line separator null | returns the value that is currently stored for the encoding |
private iscope context get scope context if project null return new project scope project return new instance scope | answer the code iscope context code for the receiver this will be a |
private void populate choice combo string items choice combo set items items if get stored value null choice combo set text non nls 1 else select choice | populates the list of choices combo |
private void select choice string selection null map known values platform known platform line separators set keys known values key set string current get stored value if current null for iterator iter keys iterator iter has next string element string iter next if known values get element equals current selection element break string items choice combo get items for int i 0 i items length i string item items i if item equals selection choice combo select i break | select the item in the combo that matches the current preferences |
public void store string val if default button get selection choice combo get text equals non nls 1 val null else map line separators platform known platform line separators val string line separators get choice combo get text ieclipse preferences node get scope context get node platform pi runtime if val null node remove platform pref line separator else node put platform pref line separator val try node flush catch backing store exception e ideworkbench plugin log e get message e | store the currently selected line delimiter value in the preference |
private void compute related list selection build the connected component set for all projects in the workspace disjoint set set build connected components resources plugin get workspace get root get projects remove the connected components that the selected projects are in for iterator it selection iterator it has next set remove set it next the remainder of the projects in the disjoint set are unrelated to the selection projects to close clear set to list projects to close | computes the related projects of the selection |
public void set link target string target 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 |
private string prompt for workspace get the current workspace as the default choose workspace data data new choose workspace data platform get instance location get url choose workspace dialog dialog new choose workspace dialog window get shell data true false dialog prompt true return null if the user changed their mind string selection data get selection if selection null return null otherwise store the new selection and return the selection data write persisted data return selection | use the choose workspace dialog to get the new workspace from the user |
public void set default handler iaction handler this default handler handler if get action handler null handler null super set action handler handler | sets the default handler for this action |
public void dispose super dispose if busy cursor null busy cursor dispose if hand cursor null hand cursor dispose if this color listener null jface preferences get preference store remove property change listener this color listener | the code workbench part code implementation of this |
public string get feature image name if bundle group properties null return null url url bundle group properties get feature image url return url null null new path url get path last segment | returns the simple name of the feature image file |
public void resource changed iresource change event event don t bother looking at delta if selection not applicable if selection is of type iresource project iresource delta delta event get delta if delta null iresource delta proj deltas delta get affected children iresource delta changed for int i 0 i proj deltas length i iresource delta proj delta proj deltas i changing either the description or the open state can affect enablement if proj delta get flags iresource delta open iresource delta description 0 selection changed get structured selection return | handles a resource changed event by updating the enablement |
Subsets and Splits