input
stringlengths
10
828
output
stringlengths
5
107
protected void update widget enablements
updates the enable state of this pages controls
protected boolean validate destination group return true
returns whether this pages destination specification controls currently all
protected void display error dialog string message message dialog open error get container get shell ideworkbench messages wizard export page error dialog title message
display an error dialog with the specified message
protected boolean validate options group return true
returns whether this pages options groups controls currently all contain
protected void setup selections based on selected types
update the tree to only select those elements that match the selected types
private ifolder create folder handle string folder name iworkspace root workspace root container get workspace get root ipath folder path container get full path append folder name ifolder folder handle workspace root get folder folder path return folder handle
creates a folder resource handle for the folder with the given name
protected boolean validate source group return true
returns whether this pages source specification controls currently all
protected void update selections final map map runnable runnable new runnable public void run selection group update selections map busy indicator show while get shell get display runnable
update the selections with those in map
protected void create options group composite parent options group group options group new group parent swt none grid layout layout new grid layout options group set layout layout options group set layout data new grid data grid data horizontal align fill grid data grab horizontal options group set text ideworkbench messages wizard export page options options group set font parent get font create options group buttons options group
create the options specification widgets
protected void handle types edit button pressed object new selected types query resource types to export 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
queries the user for the types of resources to be exported and selects
protected void display resources selected count int selected resource count if selected resource count 1 resource details description set text ideworkbench messages wizard export page one resource selected else resource details description set text nls bind ideworkbench messages wizard export page resource count message new integer selected resource count
displays a description message that indicates a selection of resources
protected void display error dialog string message message dialog open error get container get shell get error dialog title message
display an error dialog with the specified message
public boolean close if dlg title image null dlg title image dispose return super close
the code save as dialog code implementation of this code window code
private ifolder create folder handle icontainer container string folder name return container get folder new path folder name
creates a folder resource handle for the folder with the given name
protected void display error dialog throwable exception string message exception get message some system exceptions have no message if message null message nls bind ideworkbench messages wizard data transfer exception message exception display error dialog message
display an error dislog with the information from the
private iproject create project handle iworkspace root root string project name return root get project project name
creates a project resource handle for the project with the given name
protected boolean source conflicts with destination ipath source path return false
returns whether or not the source location conflicts
protected string get error dialog title return ideworkbench messages wizard export page internal error title
get the title for an error dialog
private boolean is valid container if container get type iresource project container get type iresource folder return false try iworkspace workspace ideworkbench plugin get plugin workspace iproject project container get project string nature ids project get description get nature ids for int i 0 i nature ids length i iproject nature descriptor descriptor workspace get nature descriptor nature ids i if descriptor null descriptor is linking allowed false return false catch core exception exception project does not exist or is closed return false return true
returns whether the container specified in the constructor is
private void initialize controls if original file null resource group set container full path original file get parent get full path resource group set resource original file get name else if original name null resource group set resource original name set dialog complete validate page
initializes the controls of this dialog
private iworkspace root get workspace root return ideworkbench plugin get plugin workspace get root
returns the workspace root resource handle
private boolean no open projects iproject projects ideworkbench plugin get plugin workspace get root get projects for int i 0 i projects length i if projects i is open return false return true
returns whether or not the passed workspace has any
protected void update status istatus status if first link check status null don t show the first validation result as an error fixes bug 29659 status new status new status istatus ok status get plugin status get code status get message status get exception super update status new status else super update status status
update the dialogs status line to reflect the given status
private void apply validation result string error msg int code boolean allow finish false if error msg null code istatus ok error msg non nls 1 allow finish true else if first location check code istatus ok else code istatus error update status new status code ideworkbench plugin ide workbench code error msg null get ok button set enabled allow finish
check the message
protected void set dialog complete boolean value ok button set enabled value
sets the completion state of this dialog and adjusts the enable state of
private string check valid string valid check valid name if valid null return valid return location area check valid location
check whether the entries are valid
public void set original file ifile original file this original file original file
sets the original file to use
public void set original name string original name this original name original name
set the original file name to use
private string check valid name string name this project name field get text iworkspace workspace get project get workspace istatus name status workspace validate name name iresource project if name status is ok return name status get message iproject new project workspace get root get project name if new project exists return nls bind ideworkbench messages copy project action already exists name return null
check if the entries in the widget are valid
private void update status int severity string message update status new status severity ideworkbench plugin ide workbench severity message null
update the dialogs status line to reflect the given status
public boolean get export all types value if export all types radio null return initial export all types value return export all types radio get selection
returns the current selection value of the export all types radio
private boolean validate page if resource group are all values valid if resource group get resource equals non nls 1 set error message resource group get problem message else set error message null return false set error message null return true
returns whether this pages visual components all contain valid values
protected void compute result array list list new array list list add this project name field get text list add location area get project location set result list
the code project location selection dialog code implementation of this
private void check initial selections iterator items to check get initial element selections iterator while items to check has next file system element current element file system element items to check next if current element is directory selection group initial check tree item current element else selection group initial check list item current element
visually checks the previously specified elements in the container left
private ierror message reporter get error reporter return new ierror message reporter non javadoc see org eclipse ui internal ide dialogs project contents location area ierror message reporter report error java lang string public void report error string error message set error message error message boolean valid error message null if valid valid validate page set page complete valid
get an error reporter for the receiver
private void validate linked resource boolean valid validate folder name if valid ifolder link handle create folder handle folder name field get text istatus status linked resource group validate link location link handle if status get severity istatus error get ok button set enabled true else get ok button set enabled false if status is ok false update status status else get ok button set enabled false
checks whether the folder name and link location are valid
private void create name listener listener listener new listener public void handle event event event set location for selection apply validation result check valid this project name field add listener swt modify listener
create the listener that is used to validate the entries for the receiver
public ipath get location path return new path location area get project location
returns the current project location path as entered by
public string get resource field value if resource name field null return initial export field value return resource name field get text
returns the current contents of the resource name entry field
public boolean get expand all on open return expand all on open
returns whether the tree view of the file system element
public uri get location uri return location area get project location uri
returns the current project location uri as entered by
private boolean validate folder name string name folder name field get text iworkspace workspace container get workspace istatus name status workspace validate name name iresource folder if equals name non nls 1 update status istatus error ideworkbench messages new folder dialog folder name empty return false if name status is ok false update status name status return false ipath path new path name if container get folder path exists container get file path exists update status istatus error nls bind ideworkbench messages new folder dialog already exists name return false update status istatus ok non nls 1 return true
checks if the folder name is valid
private itree content provider get file provider return new workbench content provider public object get children object o if o instanceof file system element return file system element o get files get children o return new object 0
returns a content provider for code file system element code s that returns
private string get copy name for string project name iworkspace workspace get project get workspace if workspace get root get project project name exists return project name int counter 1 while true string name segment if counter 1 name segment nls bind ideworkbench messages copy project action copy name two args new integer counter project name else name segment nls bind ideworkbench messages copy project action copy name one arg project name if workspace get root get project name segment exists return name segment counter
generates a new name for the project that does not have any collisions
private iproject get project return this project
get the project being manipulated
private itree content provider get folder provider return new workbench content provider public object get children object o if o instanceof file system element return file system element o get folders get children o return new object 0
returns a content provider for code file system element code s that returns
protected ipath get resource path return get path from text this resource name field
return the path for the resource field
private void initialize dialog initialize page if get initial element selections is empty get ok button set enabled false else check initial selections selection group about to open if expand all on open selection group expand all
initializes this dialogs controls
private ierror message reporter get error reporter return new ierror message reporter non javadoc see org eclipse ui internal ide dialogs project contents location area ierror message reporter report error java lang string public void report error string error message set message error message
get an error reporter for the receiver
protected list get selected resources if selected resources null iresource source resource get source resource if source resource null select appropriate resources source resource return selected resources
returns this pages collection of currently specified resources to be
public void set initial project name string name if name null initial project field value null else initial project field value name trim if location area null location area update project name name trim
sets the initial project name that this page will use when
public void set expand all on open boolean expand all expand all on open expand all
set whether the tree view of the file system element
protected void ok pressed array list list new array list list add get project get name list add location area get project location set result list super ok pressed
the code project location move dialog code implementation of this
protected iresource get source resource 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 root iresource project iresource folder iresource file if result is ok workspace get root exists test path return workspace get root find member test path return null
returns the resource object specified in the resource name entry field
public void selection changed istructured selection selection marker null set enabled false if selection size 1 return object o selection get first element if o instanceof imarker return imarker selected marker imarker o iresource resource selected marker get resource if resource instanceof ifile marker selected marker set enabled true
sets marker to the current selection if the selection is an instance of
public boolean use defaults return location area is default
returns the use defaults
public void run get the selected markers bookmark navigator bookmark navigator get view structured viewer viewer bookmark navigator get viewer istructured selection selection istructured selection viewer get selection if selection is empty return list list selection to list imarker markers new imarker list size list to array markers set clipboard markers create bookmark report markers
performs this action
public void selection changed istructured selection sel set enabled sel is empty
updates enablement based on the current selection
public string get types field value if types to export field null return initial types field value return types to export field get text
returns the current contents of the types entry field or its set
public void dispose iresource resource iresource viewer get input if resource null resource get workspace remove resource change listener this
the visual part that is using this content provider is about
public boolean has children object element if element instanceof iworkspace return true else return false
has children method comment
public void set initial attributes map initial attributes this initial attributes initial attributes
sets initial attributes to use when creating a new bookmark
public bookmark navigator get view return view
returns the bookmarks view
protected list get types to export list result new array list string tokenizer tokenizer new string tokenizer types to export field get text type delimiter while tokenizer has more tokens string current extension tokenizer next token trim if current extension equals non nls 1 result add current extension return result
returns the resource extensions currently specified to be exported
public void run final istructured selection sel get structured selection if sel is empty return try get view get workspace run new iworkspace runnable public void run iprogress monitor monitor throws core exception for iterator iter sel iterator iter has next object o iter next if o instanceof imarker imarker marker imarker o marker delete null catch core exception e error dialog open error get view get shell bookmark messages remove bookmark error title null e get status
delete the marker selection
public void run imarker markers iprogress monitor monitor for int i 0 i markers length i monitor sub task util get property imarker message markers i run markers i
runs this resolution
public map get initial attributes return initial attributes
returns the initial attributes to use when creating a new bookmark
public void handle event event event widget source event widget if source export all types radio source types to export field source resource name field reset selected resources else if source export specified types radio reset selected resources types to export field set focus else if source resource details button handle resource details button pressed else if source resource browse button handle resource browse button pressed else if source types to export edit button handle types edit button pressed set page complete determine page completion update widget enablements
the code wizard export page code implementation of this
private void create creation time area composite parent string creation bookmark messages marker creation time text font font parent get font composite composite new composite parent swt none grid layout layout new grid layout layout num columns 2 composite set layout layout label label new label composite swt none label set text creation label set font font creation time new label composite swt none creation time set font font
method create creation time area
protected void configure shell shell new shell super configure shell new shell if title null new shell set text marker messages properties dialog title else new shell set text title
method declared on window
protected void handle resource browse button pressed iresource current folder get source resource if current folder null current folder get type iresource file current folder current folder get parent ipath container path query for container icontainer current folder ideworkbench messages wizard export page select resources to export if container path null null means user cancelled string relative path container path make relative to string if relative path to string equals resource name field get text reset selected resources resource name field set text relative path
opens a container selection dialog and displays the users subsequent
public collection get registered filters collection filtered filters new array list iterator registered iterator registered filters iterator while registered iterator has next problem filter next problem filter registered iterator next if next is filtered out by activity continue filtered filters add next return filtered filters
get the collection of currently registered filters
protected void create seperator composite parent label seperator new label parent swt null grid data grid data new grid data grid data fill horizontal grid data horizontal span 2 seperator set layout data grid data
creates a seperator
protected void handle resource details button pressed iadaptable source get source resource if source null source resources plugin get workspace get root select appropriate resources source if source instanceof ifile source ifile source get parent set resource to display iresource source object newly selected resources query individual resources to export source if newly selected resources null selected resources arrays as list newly selected resources display resources selected count selected resources size
opens a resource selection dialog and records the users subsequent
private int get scope value iconfiguration element element string scope element get attribute scope if scope null return 1 if scope equals on any return marker filter on any if scope equals on selected only return marker filter on selected only if scope equals on selected and children return marker filter on selected and children if scope equals on any in same container return marker filter on any in same container return 1
get the constant for scope from element
private void create creation time area composite parent label label new label parent swt none label set text marker messages properties dialog creation time text creation time new label parent swt none
method create creation time area
private int get severity value iconfiguration element element string severity element get attribute severity if severity null return 1 if severity equals info return problem filter severity info if severity equals warning return problem filter severity warning if severity equals error return problem filter severity error return 1
get the constant for scope from element
private void initialize resolutions sorter resolutions sorter new viewer sorter non javadoc see org eclipse jface viewers viewer sorter compare org eclipse jface viewers viewer java lang object java lang object public int compare viewer viewer object e1 object e2 return imarker resolution e1 get label compare to imarker resolution e1 get label
create the resolutions sorter
private void save changes try resources plugin get workspace run new iworkspace runnable public void run iprogress monitor monitor throws core exception if marker null create marker else if is dirty update marker null catch core exception e error dialog open error get shell bookmark messages error text null e get status return
saves the changes made in the dialog if needed
protected void handle types edit button pressed object new selected types query resource types to export if new selected types null ie did not press cancel list result new array list new selected types length for int i 0 i new selected types length i result add ifile editor mapping new selected types i get extension set types to export result
queries the user for the types of resources to be exported and
private void create description area composite parent label label new label parent swt none label set text marker messages properties dialog description text description text new text parent swt single swt border grid data grid data new grid data grid data fill horizontal grid data width hint convert horizontal dlus to pixels 400 description text set layout data grid data description text add modify listener new modify listener public void modify text modify event e mark dirty
creates the area for the description field
private void update marker throws core exception set the marker attributes from the current dialog field values do not use set attributes map as that overwrites any attributes not covered by the dialog map attrs get marker attributes from dialog for iterator i attrs key set iterator i has next string key string i next object val attrs get key marker set attribute key val
creates or updates the marker
private void remove values object value hash map cache collection keys to remove new array list iterator keys cache key set iterator while keys has next string key string keys next object next cache get key if next instanceof collection collection collection collection next if collection contains value collection remove value if collection is empty keys to remove add key break else if cache get key equals value keys to remove add key iterator keys to remove iterator keys to remove iterator while keys to remove iterator has next cache remove keys to remove iterator next
remove the value from all of the collection sets in cache
private map get marker attributes from dialog map attribs new hash map attribs put imarker message description text get text return attribs
returns the marker attributes to save back to the marker
public string get category imarker marker try return get category marker get type catch core exception e util log e return null
get the category associated with marker
public string get category string marker type if categories contains key marker type return string categories get marker type return null
get the category associated with marker type
public table sorter get sorter for string type if hierarchy orders contains key type return table sorter hierarchy orders get type table sorter sorter find sorter in children type get root type if sorter null return new table sorter new ifield 0 new int 0 new int 0 return sorter
return the table sorter that corresponds to type
public void set file name string value if resource group null initial file name value else resource group set resource value
sets the value of this pages file name field or stores
protected void init drag and drop int operations dnd drop copy transfer transfer types new transfer marker transfer get instance text transfer get instance drag source listener listener new drag source adapter public void drag set data drag source event event perform drag set data event public void drag finished drag source event event viewer add drag support operations transfer types listener
adds drag and drop support to the bookmark navigator
protected void reset selected resources resource details description set text ideworkbench messages wizard export page details message selected resources null if export current selection export current selection false if resource name field get text length current selection length resource name field set text resource name field get text substring current selection length else resource name field set text non nls 1
resets this pages selected resources collection and updates its controls
private marker type get root type if root type null root type marker types model get instance get type imarker problem return root type
return the list of root marker types
private workbench marker resolution get selected workbench resolution object selection get selected resolution if selection null selection instanceof workbench marker resolution return null return workbench marker resolution selection
return the single selected workbench marker resolution if there is one
protected istatus validate linked resource ipath container path resource group get container full path ipath new file path container path append resource group get resource ifile new file handle create file handle new file path istatus status linked resource group validate link location new file 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
private table sorter find sorter in children string type name marker type type marker type types type get all sub types table sorter default sorter null if hierarchy orders contains key type get id default sorter table sorter hierarchy orders get type get id for int i 0 i types length i marker type subtypes types i get all sub types for int j 0 j subtypes length j table sorter sorter find sorter in children type name subtypes j if sorter null return sorter return default sorter
find the best match sorter for type name in the children
private imarker resolution get selected resolution iselection selection resolutions list get selection if selection instanceof istructured selection return null object first istructured selection selection get first element return imarker resolution first
return the marker resolution that is currenly selected
public int get size return get array length
get the size of the receiver
public concrete marker get marker int index return markers index
return the markers at index
public collection get marker groups return marker groups values
return the field marker groups in the receiver
public void update markers collection added markers collection removed markers list list new array list as list list add all added markers list remove all removed markers markers new concrete marker list size list to array markers
add the added markers to the receiver
public void refresh all for int i 0 i markers length i markers i refresh
refresh all of the markers in the receiver