input
stringlengths
10
828
output
stringlengths
5
107
private 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
private void load filters preferences string preference ideworkbench plugin get default get preference store get string get filters preference name if preference equals ipreference store string default default create default filter return string reader reader new string reader preference try restore filters xmlmemento create read root reader catch workbench exception e ideworkbench plugin log e get localized message e
load the filters preference
private void create creation time area composite parent label label new label parent swt none label set text task list messages task prop creation time creation time new label parent swt none
method create creation time area
protected tree viewer create viewer composite parent tree viewer viewer new tree viewer parent swt multi swt h scroll swt v scroll viewer set use hashlookup true init content provider viewer init label provider viewer init filters viewer init listeners viewer return viewer
creates the viewer
protected void show system label boolean system label showing system settings label set visible system label showing user filter composite set visible system label showing user filter composite get parent layout
show or hide the system label
protected void create buttons for button bar composite parent create button parent idialog constants ok id idialog constants ok label true if is editable create button parent idialog constants cancel id idialog constants cancel label false
creates only the ok button if showing problem properties otherwise creates
protected control create dialog area composite parent composite dialog area composite super create dialog area parent dialog area set layout new grid layout 2 false create filters area dialog area composite selected composite create selected filter area dialog area selected composite set layout data new grid data swt fill swt fill true true update uifrom filter filters list set selection new structured selection filters 0 create reset area dialog area create separator line dialog area apply dialog font dialog area return dialog area
method declared on dialog
protected void write filters settings xmlmemento memento marker filter filters get user filters for int i 0 i filters length i imemento child memento create child tag filter entry filters i get name filters i save filter settings child
write the filter settings to the memento
private label create system settings label composite wrapper return new label wrapper swt none
create the label for system filters
private void create description area composite parent label label new label parent swt none label set text task list messages task prop description int style swt single swt border if is editable style swt read only description text new text parent style 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
creates the area for the description field
private void create default filter marker filter filter create filter marker messages marker filter default filter name set filters new marker filter filter
create a default filter for the receiver
public string get status summary visible if visible marker counts null return non nls 1 return nls bind task list messages task list status summary visible new integer sum visible marker counts get status summary breakdown visible marker counts
returns a one line string containing a summary of the number
public void run get the selected markers task list task list get task list table viewer viewer task list get table viewer istructured selection selection istructured selection viewer get selection if selection is empty return task list cancel editing list list selection to list imarker markers new imarker list size list to array markers set clipboard markers task list create marker report markers update paste enablement task list update paste enablement
performs this action
public string get status summary selected istructured selection selection int selected marker counts get marker counts selection to list return nls bind task list messages task list status summary selected new integer sum selected marker counts get status summary breakdown selected marker counts
returns a one line string containing a summary of the number
protected void init filters tree viewer viewer viewer add filter pattern filter viewer add filter working set filter
adds the filters to the viewer
public void run iselection markers get task list get selection if markers instanceof istructured selection iterator selections istructured selection markers iterator while selections has next imarker next marker imarker selections next get task list set property next marker imarker done boolean true
sets the completed value of the currently selected
public boolean should enable istructured selection selection if selection is empty return false for iterator i selection iterator i has next imarker marker imarker i next if marker util is marker type marker imarker task marker util is complete marker marker util is editable marker return false return true
returns whether this action should be enabled for the given selection
public void run task properties dialog dialog new task properties dialog get shell dialog set resource get task list get resource int result dialog open if result window ok show marker dialog get marker
opens the new task dialog and shows the newly created task when done
private void show marker final imarker marker if marker null return if get task list should show marker need to do this in an async exec even though we re in the ui thread here since the task list updates itself with the addition in an async exec which hasn t been processed yet get shell get display async exec new runnable public void run get task list set selection new structured selection marker true else message dialog open information get shell task list messages new task not shown title task list messages new task not shown msg
show the newly created marker
private string get status summary breakdown int counts return nls bind task list messages task list status summary breakdown new object new integer counts tasks new integer counts errors new integer counts warnings new integer counts infos
returns a one line string containing a summary of the number of
public void run filters dialog dialog new filters dialog get shell tasks filter filter get task list get filter dialog set filter filter int result dialog open if result window ok get task list filter changed
performs this action
private void create severity area composite parent label label new label parent swt none label set text task list messages task prop severity workaround for bug 11078 can t get a read only combo box severity label new label parent swt none severity combo new combo composite swt read only severity combo set items new string task list messages get string task list error non nls 1 task list messages get string task list warning non nls 1 task list messages get string task list info non nls 1
creates the area for the severity field
public int compare viewer viewer object e1 object e2 imarker m1 imarker e1 imarker m2 imarker e2 return compare column value m1 m2 0
compares two markers sorting first by the main column of this sorter
private void init linking enabled try the dialog settings first which remember the last choice string setting settings get iworkbench preference constants link navigator to editor if setting null linking enabled setting equals true non nls 1 return if not in the dialog settings check the preference store for the default setting use the ui plugin s preference store since this is a public preference abstract uiplugin ui plugin abstract uiplugin platform get plugin platform ui plugin id linking enabled ui plugin get preference store get boolean iworkbench preference constants link navigator to editor
initializes the linking enabled setting from the preference store
public string get title summary if visible marker counts null return non nls 1 int visible marker count sum visible marker counts tasks filter filter task list get filter if filter is showing all return nls bind task list messages task list title summary unfiltered new integer visible marker count else return nls bind task list messages task list title summary filtered new integer visible marker count new integer get total marker count
returns a one line string containing a summary of the number items
private int sum int counts int sum 0 for int i 0 l counts length i l i sum counts i return sum
returns the sum of the given counts
private string get location text iresource resource if resource is local iresource depth zero return not local text ipath resolved location resource get location ipath location resolved location if resource is linked location resource get raw location if location null return file not found string location string location to osstring if resolved location null is path variable resource no path variable used display the file not exist message in the location fixes bug 33318 file file resolved location to file if file exists location string file not exist text non nls 1 return location string
get the location of a resource
private string get resolved location text iresource resource if resource is local iresource depth zero return not local text ipath location resource get location if location null if resource is linked return undefined path variable return file not found string location string location to osstring file file location to file if file exists location string file not exist text non nls 1 return location string
get the resolved location of a resource
protected void init listeners tree viewer viewer viewer add selection changed listener new iselection changed listener public void selection changed selection changed event event handle selection changed event viewer add double click listener new idouble click listener public void double click double click event event handle double click event viewer add open listener new iopen listener public void open open event event handle open event viewer get control add key listener new key listener public void key pressed key event event handle key pressed event public void key released key event event handle key released event
adds the listeners to the viewer
private boolean is path variable iresource resource if resource is linked return false ipath resolved location resource get location if resolved location null missing path variable return true ipath raw location resource get raw location if resolved location equals raw location return false return true
returns whether the given resource is a linked resource bound
private int compare creation time imarker m1 imarker m2 long result try result m1 get creation time m2 get creation time catch core exception e result 0 if result 0 return 1 else if result 0 return 1 return 0
compares the creation time of two markers
public void reset property value object property
the code resource property source code implementation of this
private int get category order imarker marker if marker util is marker type marker imarker problem switch marker util get severity marker case imarker severity error return 4 case imarker severity warning return 3 case imarker severity info return 2 else if marker util is marker type marker imarker task return 1 return 1000
returns the sort order for the given marker based on its category
private void update marker counts imarker delta marker delta int difference if visible marker counts null return if marker delta is subtype of imarker problem int severity marker delta get attribute imarker severity imarker severity warning switch severity case imarker severity error visible marker counts errors difference break case imarker severity warning visible marker counts warnings difference break case imarker severity info visible marker counts infos difference break else if marker delta is subtype of imarker task visible marker counts tasks difference
updates the marker counts for the given delta
public void set property value object name object value
the code resource property source code implementation of this
private int get completed order imarker marker if marker util is marker type marker imarker task return marker util is complete marker 2 1 return 0
returns the sort order for the given marker based on its completion status
private int get priority order imarker marker if marker util is marker type marker imarker task return marker util get priority marker return 1
returns the sort order for the given marker based on its priority
protected file get file iresource resource ipath location resource get location if location null return null return location to file
get the java
private string get size string ifile file if file is local iresource depth zero return not local text ipath location file get location if location null if file is linked return undefined path variable return file not found file local file location to file if local file exists return long to string local file length return file not found
return a string that indicates the size of the supplied file
public void dispose if input null input get workspace remove resource change listener this input null
the visual part that is using this content provider is about
public void decorate object element idecoration decoration if element instanceof iresource false return iresource resource iresource element if resource is linked ipath location resource get location if location null location to file exists decoration add overlay link else decoration add overlay link warning
adds the linked resource overlay if the given element is a linked
public tasks filter get filter if filter null filter new tasks filter return filter
returns the filter which this dialog is configuring
public boolean are all values valid return problem type problem none
returns a boolean indicating whether all controls in this group
public ipath get container full path return container group get container full path
returns the path of the currently selected container
private boolean is editable return marker null marker util is editable marker
returns whether the marker is editable
public string get problem message return problem message
returns an error message indicating the current problem with the value
private boolean is task return marker null marker util is marker type marker imarker task
returns code true code if a task is being created or modified
public string get resource return resource name field get text
returns a string that is the path of the currently selected
public object find set object o disjoint set node node disjoint set node objects to nodes get o if node null return null if o node parent node parent find set node parent return node parent
returns the set token for the given object or null if the
public void remove set object o object set find set o if set null return for iterator it objects to nodes key set iterator it has next object next it next remove the set representative last otherwise find set will fail if next set find set next set it remove objects to nodes remove set
removes all elements belonging to the set of the given object
public void to list list list list add all objects to nodes key set
copies all objects in the disjoint set to the provided list
public void handle event event e validate controls if client null client handle event e
handles events for all controls in the group
public void set allow existing resources boolean value allow existing resources value
sets the flag indicating whether existing resources are permitted
protected void set selected filter selection changed event event iselection selection event get selection if selection instanceof istructured selection collection list istructured selection selection to list marker filter selected new marker filter list size list to array selected selected filters selected else selected filters new marker filter 0 update uifrom filter
set the selected filter from event
public void set container full path ipath path iresource initial resources plugin get workspace get root find member path if initial null if initial instanceof icontainer initial initial get parent container group set selected container icontainer initial validate controls
sets the value of this pages container
public void set focus select the whole resource name resource name field set selection 0 resource name field get text length resource name field set focus
gives focus to the resource name field and selects its contents
protected void remove filters iselection selection if selection instanceof istructured selection list to remove istructured selection selection to list marker filter new filters new marker filter filters length to remove size int index 0 for int i 0 i filters length i if to remove contains filters i continue new filters index filters i index filters new filters filters list refresh update uifrom filter
remove the filters in selection
public void set resource string value resource name field set text value validate controls
sets the value of this pages resource name
protected void editor activated ieditor part editor if is linking enabled return ifile file resource util get file editor get editor input if file null iselection new selection new structured selection file if get tree viewer get selection equals new selection get tree viewer get tree show selection else get tree viewer set selection new selection true
an editor has been activated
protected boolean validate controls don t attempt to validate controls until they have been created if container group null return false problem type problem none problem message non nls 1 if validate container validate resource name return false ipath path container group get container full path append resource name field get text return validate full resource path path
validates the values for each of the groups controls
private void create new filter string new name marker filter new filters new marker filter filters length 1 system arraycopy filters 0 new filters 0 filters length marker filter filter new filter new name new filters filters length filter filters new filters filters list refresh filters list set selection new structured selection filter true filters list get control set focus
create a new filter called new name
private map get marker attributes from dialog map attribs new hash map 11 if is task attribs put imarker message description text get text int i priority combo get selection index if i 1 attribs put imarker priority new integer imarker priority high i attribs put imarker done completed checkbox get selection boolean true boolean false return attribs
returns the marker attributes to save back to the marker
protected boolean validate full resource path ipath resource path iworkspace workspace resources plugin get workspace istatus result workspace validate path resource path to string iresource folder if result is ok problem type problem path invalid problem message result get message return false if allow existing resources workspace get root get folder resource path exists workspace get root get file resource path exists problem type problem resource exist problem message ideworkbench messages resource group name exists return false return true
returns a code boolean code indicating whether the specified resource
protected void fill context menu imenu manager menu istructured selection selection istructured selection get viewer get selection get action group set context new action context selection get action group fill context menu menu
called when the context menu is about to open
public void set filter tasks filter filter this filter filter
sets the filter which this dialog is to configure
protected boolean validate resource name string resource name resource name field get text if resource name equals non nls 1 problem type problem resource empty problem message nls bind ideworkbench messages resource group empty name resource type return false if new path is valid path resource name non nls 1 problem type problem name invalid problem message nls bind ideworkbench messages resource group invalid filename resource name return false return true
returns a code boolean code indicating whether the resource name rep
public void container selection changed icontainer container selected container container if allow new container name if container null container name field set text non nls 1 else string text container get full path make relative to string container name field set text text container name field set tool tip text text fire an event so the parent can update its controls if listener null event change event new event change event type swt selection change event widget this listener handle event change event
the container selection has changed in the tree view
protected void create separator line composite parent build the separator line label separator new label parent swt horizontal swt separator grid data gd new grid data grid data fill horizontal gd horizontal span 2 separator set layout data gd
creates a separator line above the ok cancel buttons bar
public string get image path imarker marker string icon path icons full non nls 1 if is marker type marker imarker problem switch marker get attribute imarker severity imarker severity warning case imarker severity error return icon path obj16 error tsk gif non nls 1 case imarker severity warning return icon path obj16 warn tsk gif non nls 1 case imarker severity info return icon path obj16 info tsk gif non nls 1 return null
returns the relative path for the image
public void create contents string message create contents message sizing selection pane height sizing selection pane width
creates the contents of the composite
protected void create list viewer composite parent int width int height list viewer checkbox table viewer new check list parent swt border grid data data new grid data grid data fill both data width hint width data height hint height list viewer get table set layout data data list viewer get table set font parent get font list viewer set content provider list content provider list viewer set label provider list label provider list viewer add check state listener this
create this groups list viewer
private image get current image if current image null current image create image elcl16 step current gif non nls 1 return current image
return the image indicating a step is current
public image descriptor get image descriptor object o iresource resource get resource o return resource null null get base image resource
returns an image descriptor for this object
private image get done image if done image null done image create image elcl16 step done gif non nls 1 return done image
return the image indicating a step is done
private icontent provider get step provider return new workbench content provider public object get children object parent element if parent element instanceof step root return step root parent element get steps else return null
returns the content provider for the step viewer
public object get parent object o iresource resource get resource o return resource null null resource get parent
returns the parent of the given object
protected iadaptable get initial input iadaptable input get site get page get input if input null iresource resource null if input instanceof iresource resource iresource input else resource iresource input get adapter iresource class if resource null switch resource get type case iresource file return resource get parent case iresource folder case iresource project case iresource root return resource default unknown resource type fall through break return resources plugin get workspace get root
returns the initial input for the viewer
protected void create tree viewer composite parent int width int height tree tree new tree parent swt check swt border grid data data new grid data grid data fill both data width hint width data height hint height tree set layout data data tree set font parent get font tree viewer new checkbox tree viewer tree tree viewer set content provider tree content provider tree viewer set label provider tree label provider tree viewer add tree listener this tree viewer add check state listener this tree viewer add selection changed listener this
create this groups tree viewer
public void mark step as done if current step null current step mark as done
marks the current step as being done
protected iresource get resource object o if o instanceof iresource return iresource o if o instanceof iadaptable return iresource iadaptable o get adapter iresource class return null
returns the resource corresponding to this object
protected button create radio button composite parent string text button button new button parent swt radio button set text text button set font parent get font button add selection listener new selection adapter non javadoc see org eclipse swt events selection listener widget selected org eclipse swt events selection event public void widget selected selection event e update for selection return button
creates a radio button with the given parent and text
public void set current step wizard step step wizard step old step current step current step step if step viewer null if old step null step viewer update old step null if current step null step viewer update current step null update the layout so that there is enough room for the icon now if old step null current step null parent composite layout true
sets the current step being worked on
public void set selection listener iselection changed listener listener if selection listener null step viewer null step viewer remove selection changed listener selection listener selection listener listener if selection listener null step viewer null step viewer add selection changed listener selection listener
set the current listener interested when the selection
public ipath get container full path if allow new container name string path name container name field get text if path name null path name length 1 return null the user may not have made this absolute so do it for them return new path path name make absolute if selected container null return null return selected container get full path
returns the currently entered container name
public void set steps wizard step steps if step viewer null step viewer set input new step root steps parent composite layout true
sets the steps to be displayed
protected boolean determine should be at least gray checked object tree element if any list items associated with tree element are checked then it retains its gray checked status regardless of its children list checked list checked state store get tree element if checked null checked is empty return true if any children of tree element are still gray checked then tree element must remain gray checked as well object children tree content provider get children tree element for int i 0 i children length i if checked state store contains key children i return true return false
returns a boolean indicating whether the passed tree element should be
protected object get action filter object o if o instanceof iresource switch iresource o get type case iresource file return file adapter case iresource folder return folder adapter case iresource project return project adapter if o instanceof imarker return marker adapter return null
returns the iaction filter for an object
public resource pattern filter get pattern filter return this pattern filter
returns the pattern filter for this view
public object get adapter object o class adapter type if adapter type is instance o return o if adapter type iworkbench adapter class return get workbench element o if adapter type ipersistable element class return get persistable element o if adapter type ielement factory class return get element factory o if adapter type iaction filter class return get action filter o if adapter type iundo context class return get undo context o return null
returns an object which is an instance of the given class
public void modify object element string property object value item item item element imarker marker imarker item get data set property marker property value
modifies a marker as a result of a successfully completed direct editing
public void set selected container icontainer container selected container container expand to and select the specified container list items to expand new array list icontainer parent container get parent while parent null items to expand add 0 parent parent parent get parent tree viewer set expanded elements items to expand to array tree viewer set selection new structured selection container true
sets the selected existing container
protected object get element factory object o if o instanceof iresource return resource factory if o instanceof iworkspace return workspace factory return null
returns an object which is an instance of ielement factory
protected object get persistable element object o if o instanceof iresource return new resource factory iresource o if o instanceof iworkspace return workspace factory return null
returns an object which is an instance of ipersistable element
protected object get workbench element object o if o instanceof iresource switch iresource o get type case iresource file return file adapter case iresource folder return folder adapter case iresource project return project adapter if o instanceof iworkspace root return root adapter if o instanceof iworkspace return workspace adapter if o instanceof imarker return marker adapter return null
returns an object which is an instance of iworkbench adapter
protected object get undo context object o if o instanceof iworkspace return platform ui get workbench get operation support get undo context return null
returns the iundo context for an object
protected image descriptor get base image iresource resource return platform ui get workbench get shared images get image descriptor ishared images img obj folder
answer the appropriate base image to use for the passed resource optionally
public string get label object o root resource has no name return ideworkbench messages workspace
returns the name of this element
public boolean test attribute object target string name string value if target instanceof iproject return false iproject proj iproject target if name equals nature try return proj is accessible proj has nature value catch core exception e return false else if name equals open value value to lower case return proj is open value equals true non nls 1 return super test attribute target name value
returns whether the specific attribute matches the state of the target
protected image descriptor get base image iresource resource icontent type content type null do we need to worry about checking here if resource instanceof ifile content type ide guess content type ifile resource issue move ide specific images image descriptor image platform ui get workbench get editor registry get image descriptor resource get name content type if image null image platform ui get workbench get shared images get image descriptor ishared images img obj file return image
answer the appropriate base image to use for the passed resource optionally
public int index of object element return f elements index of element
returns the index of this element in the list of known elements