input
stringlengths
10
828
output
stringlengths
5
107
protected control create contents composite parent issue if the product subclasses this page then it should provide the help content platform ui get workbench get help system set help parent org eclipse ui internal iworkbench help context ids perspectives preference page composite composite create composite parent create open persp button group composite create open view button group composite create project perspective group composite create customize perspective composite return composite
creates the pages ui content
public iworking set get working set return working set filter get working set
returns the working set for this view
public void set int index object element f elements set index element f changed true
add a new element to the list of known elements
protected ipreference store get idepreference store return ideworkbench plugin get default get preference store
returns the ide preference store
public void remove int index if f elements remove index null f changed true
remove an element from the list of known elements
protected void perform defaults ipreference store store get idepreference store launch prompt button set selection true refresh button set selection store get default boolean ideinternal preferences refresh workspace on startup exit prompt button set selection store get default boolean ideinternal preferences exit prompt on close last window super perform defaults
the default button has been pressed
public void process if f changed f working set set elements iadaptable f elements to array new iadaptable f elements size
process the changes to this delta and update the working set if
public iterator get all checked list items list result new array list iterator list collections enum checked state store values iterator while list collections enum has next iterator current collection list list collections enum next iterator while current collection has next result add current collection next return result iterator
answer a flat collection of all of the checked elements in the
public void dispose path variables group dispose super dispose
disposes the path variables group
public boolean perform ok return path variables group perform ok
commits the temporary state to the path variable manager in response to user
public void log action link error string action plugin id string action class ideworkbench plugin log ideworkbench messages welcome item unable to load class action plugin id action class non nls 1
logs a error to the workbench log
protected void update widget state boolean enable linking top label set enabled enable linking path variables group set enabled enable linking
set the widget enabled state
private void open help topic string topic string href if href null platform ui get workbench get help system display help resource href else platform ui get workbench get help system display help resource topic
open a help topic
public void widget selected selection event e column selected need to sort int column table index of table column e widget if column sorter get top priority sorter reverse top priority else sorter set top priority column update sorting state viewer refresh idialog settings workbench settings get plugin get dialog settings idialog settings settings workbench settings get section tag sort section if settings null settings workbench settings add new section tag sort section sorter save state settings
handles the case of user selecting the
public set get all checked tree items return checked state store key set
answer a collection of all of the checked elements in the tree portion
protected string get finish step label wizard step steps return ideworkbench messages multi step wizard finish label
returns the label used on the finish button to
public resource sorter get sorter return resource sorter get tree viewer get sorter
returns the sorter
protected void initialize default page image descriptor image descriptor desc ideworkbench plugin get ideimage descriptor wizban newprj wiz png non nls 1 set default page image descriptor desc
sets the image banner for the wizard
private void create embedded page site composite parent page site new composite parent swt none page site set layout new grid layout page site set layout data new grid data grid data fill both
creates the control where the steps wizard will
public void set initial project name string name if name null initial project name null else initial project name name trim
sets the initial project name
protected marker filter get selected filter if selected filters length 1 return selected filters 0 return null
get the currently selected marker filter if there is only one selection
private void create step group composite parent step group new wizard step group step group create contents parent
creates the control for the step list
private void perform drag set data drag source event event if marker transfer get instance is supported type event data type event data get selected markers return if text transfer get instance is supported type event data type list selection istructured selection get viewer get selection to list try imarker markers new imarker selection size selection to array markers if markers null event data copy action create marker report markers catch array store exception e
the user is attempting to drag marker data
public shell get shell return get view site get shell
returns the shell to use for opening dialogs
protected void gray check hierarchy object tree element if this tree element is already gray then its ancestors all are as well if checked state store contains key tree element return no need to proceed upwards from here checked state store put tree element new array list if determine should be white checked tree element set white checked tree element true object parent tree content provider get parent tree element if parent null gray check hierarchy parent
logically gray check all ancestors of tree item by ensuring that they
protected string get status line message istructured selection selection if selection size 1 object o selection get first element if o instanceof iresource return iresource o get full path make relative to string else return resource navigator messages resource navigator one item selected if selection size 1 return nls bind resource navigator messages resource navigator status line string value of selection size return non nls 1
returns the message to show in the status line
public void initial check list item object element object parent tree content provider get parent element current tree selection parent as this is not done from the ui then set the box for updating from the selection to false list item checked element true false update hierarchy parent
set the initial checked state of the passed list element to true
public void finish array list resources new array list 10 find checked resources resources icontainer tree get input if working set null iworking set manager working set manager platform ui get workbench get working set manager working set working set manager create working set get working set name iadaptable resources to array new iadaptable resources size else working set set name get working set name working set set elements iadaptable resources to array new iadaptable resources size
implements iworking set page
private string get field editor label iresource resource if resource instanceof icontainer return container encoding title return file encoding title
return the label for the encoding field editor for the resource
public iworking set get selection return working set
implements iworking set page
private void create editable button composite composite this editable box new button composite swt check swt right this editable box set alignment swt left this editable box set text read only this editable box set selection this previous read only value this editable box set font composite get font grid data data new grid data data horizontal span 2 this editable box set layout data data
create the is editable button and its associated label as a child of
protected void handle open open event event istructured selection selection istructured selection event get selection get action group run default action selection
handles an open event from the viewer
private string get working set name return text get text
returns the name entered in the working set name field
private void create executable button composite composite this executable box new button composite swt check swt right this executable box set alignment swt left this executable box set text executable this executable box set selection this previous executable value this executable box set font composite get font grid data data new grid data data horizontal span 2 this executable box set layout data data
create the is executable button and its associated label as a child of
private void handle check state change final check state changed event event busy indicator show while get shell get display new runnable public void run iresource resource iresource event get element boolean state event get checked tree set grayed resource false if resource instanceof icontainer set subtree checked icontainer resource state true update parent state resource validate input
called when the checked state of a tree item changes
private void create archive button composite composite this archive box new button composite swt check swt right this archive box set alignment swt left this archive box set text archive this archive box set selection this previous archive value this archive box set font composite get font grid data data new grid data data horizontal span 2 this archive box set layout data data
create the is archive button and its associated label as a child of
protected void handle double click double click event event istructured selection selection istructured selection event get selection object element selection get first element 1 gbzia0 itpui win2000 double clicking in navigator should expand collapse containers tree viewer viewer get tree viewer if viewer is expandable element viewer set expanded state element viewer get expanded state element
handles a double click event from the viewer
private void create derived button composite composite this derived box new button composite swt check swt right this derived box set alignment swt left this derived box set text derived this derived box set selection this previous derived value this derived box set font composite get font grid data data new grid data data horizontal span 2 this derived box set layout data data
create the derived button and its associated label as a child of parent
private void create separator composite composite label separator new label composite swt separator swt horizontal grid data grid data new grid data grid data horizontal alignment grid data fill grid data grab excess horizontal space true separator set layout data grid data
create a separator that goes across the entire page
public void back pressed show page current page get previous page false
handles the back button pressed
public void next pressed show page current page get next page true
handles the next button pressed
protected void perform defaults nothing to update if we never made the box if this editable box null this editable box set selection false nothing to update if we never made the box if this executable box null this executable box set selection false nothing to update if we never made the box if this derived box null this derived box set selection false encoding editor load default if line delimiter editor null line delimiter editor load default
reset the editable box to the false
public void help pressed if current page null current page perform help
handles the help button pressed
protected void handle key pressed key event event get action group handle key pressed event
handles a key press event from the viewer
protected void populate list viewer final object tree element list viewer set input tree element list list items to check list checked state store get tree element if list items to check null iterator list items enum list items to check iterator while list items enum has next list viewer set checked list items enum next true
set the contents of the list viewer based upon the specified selected
public void set selection iworking set working set if working set null throw new illegal argument exception working set must not be null non nls 1 this working set working set if get shell null text null first check true initialize checked state text set text working set get name
implements iworking set page
private point calculate page size delta iwizard page page control page control page get control if page control null control not created yet return new point 0 0 point content size page control compute size swt default swt default true rectangle rect page site get client area point container size new point rect width rect height return new point math max 0 content size x container size x math max 0 content size y container size y
calculates the difference in size between the given
private void update size for page iwizard page page ensure the page container is large enough point delta calculate page size delta page if delta x 0 delta y 0 point site size page site get size grid data data grid data page site get layout data data height hint site size y delta y data width hint site size x delta x
computes the correct page site size for the given page
protected void handle key released key event event
handles a key release in the viewer
private void update parent state iresource child if child null child get parent null return icontainer parent child get parent boolean child checked false iresource members null try members parent members catch core exception ex handle core exception ex get shell ideworkbench messages resource working set page error ideworkbench messages resource working set page error update checked state for int i members length 1 i 0 i if tree get checked members i tree get grayed members i child checked true break tree set gray checked parent child checked update parent state parent
check and gray the resource parent if all resources of the
protected list get selected types object check elements types viewer get checked elements list selected new array list for int i 0 i check elements length i abstract node node abstract node check elements i if node is category selected add marker type node node get marker type return selected
returns the selected marker types
public void dispose if image unkown null image unkown dispose image unkown null
disposes the groups resources
private void add resources collection resources resource mapping mapping try resource traversal traversals mapping get traversals resource mapping context local context new null progress monitor for int i 0 i traversals length i resource traversal traversal traversals i iresource result traversal get resources for int j 0 j result length j resources add result j catch core exception e util log e return
add the resources for the mapping to resources
protected viewer sorter get sorter return 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 collator compare abstract node e1 get name abstract node e2 get name
return the sorter for the receiver
public boolean get enabled if variable table null variable table is disposed return variable table get enabled return true
returns the enabled state of the groups widgets
private void create open pref controls composite parent string name ideinternal preferences open required projects string label ideworkbench messages ideworkspace preference open referenced projects string names and values ideworkbench messages always ideinternal preferences pspm always ideworkbench messages never ideinternal preferences pspm never ideworkbench messages prompt ideinternal preferences pspm prompt open references editor new radio group field editor name label 3 names and values parent true open references editor set preference store get idepreference store open references editor set page this open references editor load
creates controls for the preference to open required projects when
public boolean can wizard finish if wizard null return wizard can finish return false
returns whether the current wizard can finish
public void edit imarker marker viewer edit element marker 3
activates the editor on the given marker
private void update valid state set valid max iters field is valid
updates the valid state of the page
public boolean can flip to next page if current page null return current page can flip to next page return false
returns whether the current page can flip to
protected frame list create frame list navigator frame source frame source new navigator frame source this frame list frame list new frame list frame source frame source connect to frame list return frame list
creates the frame source and frame list and connects them
public string get message if current page null return current page get message return null
returns the current pages message
public iwizard page get previous page if current page null return current page get previous page return null
returns the current pages previous page
private void create auto refresh controls composite parent this auto refresh button new button parent swt check this auto refresh button set text ideworkbench messages ideworkspace preference refresh button text this auto refresh button set tool tip text ideworkbench messages ideworkspace preference refresh button tool tip boolean auto refresh resources plugin get plugin get plugin preferences get boolean resources plugin pref auto refresh this auto refresh button set selection auto refresh
create the refresh controls
public void mark as done done true
sets the step as being done
protected void init resource sorter int sort type resource sorter name try int sort int 0 if memento null string sort str memento get string tag sorter if sort str null sort int new integer sort str int value else sort int settings get int store sort type if sort int resource sorter name sort int resource sorter type sort type sort int catch number format exception e set sorter new resource sorter sort type
initializes the sorter
private void create spacer composite composite label spacer new label composite swt none grid data spacer data new grid data spacer data horizontal span 2 spacer set layout data spacer data
adds in a spacer
protected void update status message istructured selection selection string message non nls 1 if selection null selection size 0 show stats on all items in the view message update summary visible else if selection size 1 use the message attribute of the marker object first selection get first element if first instanceof concrete marker message concrete marker first get description else if selection size 1 show stats on only those items in the selection message update summary selected selection get view site get action bars get status line manager set message message
updates that message displayed in the status line
private void create instructions group composite parent instruction label new label parent swt left instruction label set text ideworkbench messages multi step review wizard page instruction finish label grid data data new grid data data vertical alignment swt top data horizontal span 2 instruction label set layout data data instruction label set font parent get font
creates the control for the instructions
private void create step group composite parent step group new wizard step group step group create contents parent step group set selection listener new iselection changed listener public void selection changed selection changed event event if event get selection instanceof istructured selection istructured selection sel istructured selection event get selection wizard step step wizard step sel get first element if step null details field set text step get details
creates the control for the step list
protected void initialize dialog units control control compute and store a font metric gc gc new gc control gc set font control get font font metrics gc get font metrics gc dispose
initializes the computation of horizontal and vertical dialog units
private void create line separator editor controls composite parent composite line composite new composite parent swt none line composite set layout new grid layout line composite set layout data new grid data grid data horizontal align fill grid data grab horizontal line separator editor new line delimiter editor line composite line separator editor do load
create a composite that contains the line delimiter controls
protected void reset pressed types viewer set all checked true int on resource marker filter default on resource any resource button set selection on resource marker filter on any any resource in same project button set selection on resource marker filter on any in same container selected resource button set selection on resource marker filter on selected only selected resource and children button set selection on resource marker filter on selected and children working set group set selection on resource marker filter on working set update enabled state true
handles a press of the reset button
private void init temporary state string var names path variable manager get path variable names temp path variables clear for int i 0 i var names length i ipath value path variable manager get value var names i the value may not exist any more if value null boolean is file value to file is file if is file variable type iresource file 0 is file false variable type iresource folder 0 temp path variables put var names i value removed variable names clear
re initialize collections used to mantain temporary variable state
private void focus on styled text new text int caret offset if new text null return new text set focus new text set caret offset caret offset scrolled composite set origin 0 new text get location y
update the welcome page to start at the
protected composite create composite composite parent composite composite new composite parent swt none grid layout layout new grid layout layout margin width 0 layout margin height 0 composite set layout layout composite set layout data new grid data grid data vertical align fill grid data horizontal align fill return composite
creates the composite which will contain all the preference controls for
private void update enabled state int items selected count variable table get selection count edit button set enabled items selected count 1 remove button set enabled items selected count 0
updates button enabled state depending on the number of currently selected
private styled text next text styled text text int index 0 if text null return styled text texts get 0 else index texts index of text if we are not at the end if index texts size 1 return styled text texts get index 1 else return styled text texts get 0
finds the next text
protected void link to editor istructured selection selection if this this get site get page get active part return object obj selection get first element if obj instanceof ifile selection size 1 ifile file ifile obj iworkbench page page get site get page ieditor part editor resource util find editor page file if editor null page bring to top editor return
brings the corresponding editor to top if the selected resource is open
private styled text previous text styled text text int index 0 if text null return styled text texts get 0 else index texts index of text if we are at the beginning if index 0 return styled text texts get texts size 1 else return styled text texts get index 1
finds the previous text
public void refresh viewer schedule marker update util short delay
refresh the contents of the viewer
public void set elements object items this elements items
set the elements to display
protected styled text get current text return current text
returns the current text
protected void make actions set action group new main action group this
creates the action group which encapsulates all actions for the view
private void remove selected variables remove each selected element int selected indices variable table get selection indices for int i 0 i selected indices length i table item selected item variable table get item selected indices i string var name string selected item get data removed variable names add var name temp path variables remove var name update widget state null
removes the currently selected variables
protected welcome editor copy action get copy action return copy action
returns the copy action
private void refresh filter menu if filters menu null return filters menu remove all marker filter filters get all filters for int i 0 i filters length i filters menu add new filter enablement action filters i this
refresh the contents of the filter sub menu
private grid data set button layout data button button grid data data new grid data grid data horizontal align fill int width hint dialog convert horizontal dlus to pixels font metrics idialog constants button width data width hint math max width hint button compute size swt default swt default true x button set layout data data return data
sets the code grid data code on the specified button to
public iresource get resource if show selections if focus resources null focus resources length 1 focus resources 0 null return focus resources 0 return get workspace get root
returns the resource for which the task list is showing tasks
public boolean is default return use defaults button get selection
return whether or not we are currently showing the default location for
protected void update uiwith filter marker filter filter set selected types filter get selected types int on filter get on resource any resource button set selection on marker filter on any any resource in same project button set selection on marker filter on any in same container selected resource button set selection on marker filter on selected only selected resource and children button set selection on marker filter on selected and children working set group set selection on marker filter on working set working set group set working set filter get working set update enabled state true
update the ui with the contents of filter
public void tree expanded tree expansion event event object item event get element first see if the children need to be given their checked state at all if they ve already been realized then this won t be necessary if expanded tree nodes contains item expanded tree nodes add item check new tree elements tree content provider get children item
handle the expansionsion of an element in a tree viewer
private style range find next link styled text text if text null return null welcome item item welcome item text get data style range ranges text get style ranges int current selection end text get selection y for int i 0 i ranges length i if ranges i start current selection end if item is link at ranges i start return ranges i return null
finds the next link after the current selection
public void set enabled boolean enabled if variable table null variable table is disposed variable label set enabled enabled variable table set enabled enabled add button set enabled enabled if enabled update enabled state else edit button set enabled enabled remove button set enabled enabled
sets the enabled state of the groups widgets
protected void tree item checked object tree element boolean state recursively adjust all child tree elements appropriately set tree checked tree element state object parent tree content provider get parent tree element if parent null return now update upwards in the tree hierarchy if state gray check hierarchy parent else ungray check hierarchy parent update hierarchy tree element
callback thats invoked when the checked status of an item in the tree
private void update widget state string selected var name update variable table selected var name update enabled state
updates the widgets current state refreshes the table with the current
private style range find previous link styled text text if text null return null welcome item item welcome item text get data style range ranges text get style ranges int current selection start text get selection x for int i ranges length 1 i 1 i if ranges i start ranges i length current selection start if item is link at ranges i start ranges i length 1 return ranges i return null
finds the previous link before the current selection
private void create file system selection composite composite always use the default if that is all there is if file system support registry get instance has one file system return new label composite swt none file system selection area new file system selection area file system selection area create contents composite
create the file system selection area
public iselection get selection return viewer get selection
api method which returns the current selection
private string get default path display string uri default uri null if existing project null default uri existing project get location uri handle files specially assume a file if there is no project to query if default uri null default uri get scheme equals file scheme return platform get location append project name to string return default uri to string
return the path we are going to display