input
stringlengths 10
828
| output
stringlengths 5
107
|
---|---|
protected void internal expand to level widget widget int level if level all levels level 0 if widget instanceof item widget get data null is expandable item widget null widget get data return create children widget if widget instanceof item set expanded item widget true if level all levels level 1 item children get children widget if children null int new level level all levels all levels level 1 for int i 0 i children length i internal expand to level children i new level | recursively expands the subtree rooted at the given widget to the given |
public void update object element string properties assert is not null element widget items find items element for int i 0 i items length i internal update items i element properties | updates the given elements presentation when one or more of its |
private void virtual refresh expanded items widget parent widget widget object element int index if widget instanceof tree if element null tree widget set item count 0 return virtual lazy update child count widget get children widget length else if tree item widget get expanded prevent set data callback tree item widget set text non nls 1 virtual lazy update widget parent index else return item items get children widget for int i 0 i items length i item item items i object data item get data virtual refresh expanded items widget item data i | traverses the visible expanded part of the tree and updates child |
private viewer row create new row part viewer row parent int style int row index if parent null if row index 0 return get viewer row from item new tree item tree style row index return get viewer row from item new tree item tree style if row index 0 return get viewer row from item new tree item tree item parent get item swt none row index return get viewer row from item new tree item tree item parent get item swt none | create a new viewer row at row index |
protected void internal remove object elements or paths object input get input for int i 0 i elements or paths length i object element elements or paths i if equals element input set input null return widget child items internal find items element for int j 0 j child items length j widget child item child items j if child item instanceof item disassociate item child item child item dispose | removes the given elements from this viewer |
private void virtual lazy update child count widget widget int current child count boolean old busy busy busy false try if content provider is tree based tree path tree path if widget instanceof item tree path get tree path from item item widget else tree path tree path empty ilazy tree path content provider get content provider update child count tree path current child count else ilazy tree content provider get content provider update child count widget get data current child count finally busy old busy | update the child count |
public string get tooltip text return tooltip text | returns the tooltip text |
public void set tooltip text string tooltip text this tooltip text tooltip text | set the tool tip text |
public boolean has new tooltip text return this tooltip text null | return whether or not the tool tip text has been set |
public color get tooltip background color return tooltip background color | return the tool tip background color |
public void set tooltip background color color tooltip background color this tooltip background color tooltip background color | set the background |
public boolean has new tooltip background color return tooltip background color null | return whether or not the tool tip background color has been set |
public color get tooltip foreground color return tooltip foreground color | return the foreground |
public void set tooltip foreground color color tooltip foreground color this tooltip foreground color tooltip foreground color | set the foreground |
public void add object elements assert elements not null elements object filtered filter elements ilabel provider label provider ilabel provider get label provider for int i 0 i filtered length i object element filtered i int ix index for element element insert item label provider element ix | adds the given elements to this list viewer |
public void set selection iselection selection boolean reveal super set selection selection reveal | sets a new selection for this viewer and optionally makes it visible |
public void insert object element int position if get comparator null has filters add element return insert item ilabel provider get label provider element position | inserts the given element into this list viewer at the given position |
private boolean is expandable item item tree path parent path object element object element or tree path element if is tree path content provider if parent path null element or tree path parent path create child path element else element or tree path get tree path from item item return is expandable element or tree path | return whether the given element is expandable |
private void internal remove final object elements object input get input for int i 0 i elements length i if equals elements i input set input null return int ix get element index elements i if ix 0 list remove ix list map remove ix unmap element elements i get control | removes the given elements from this list viewer |
public void remove final object elements assert elements not null elements if elements length 0 return preserving selection new runnable public void run internal remove elements | removes the given elements from this list viewer |
public void set selection feedback enabled boolean value select feedback enabled value | sets whether selection feedback should be provided during dragging |
public object get segment int index return segments index | returns the element at the specified index in this path |
public int get segment count return segments length | returns the number of elements in this path |
public object get first segment if segments length 0 return null return segments 0 | returns the first element in this path or code null code if this |
public void set scroll expand enabled boolean value expand enabled value scroll enabled value | sets whether auto scrolling and expanding should be provided during dragging |
public object get last segment if segments length 0 return null return segments segments length 1 | returns the last element in this path or code null code if this |
public int hash code ielement comparer comparer int result 0 for int i 0 i segments length i if comparer null result segments i hash code else result comparer hash code segments i return result | returns a hash code computed from the hash codes of the segments using |
public void set expand enabled boolean value expand enabled value | sets whether auto expanding should be provided during dragging |
public boolean equals tree path other path ielement comparer comparer if other path null return false if segments length other path segments length return false for int i 0 i segments length i if comparer null if segments i equals other path segments i return false else if comparer equals segments i other path segments i return false return true | returns whether this path is equivalent to the given path using the |
public boolean starts with tree path tree path ielement comparer comparer int this segment count get segment count int other segment count tree path get segment count if other segment count this segment count return equals tree path comparer if other segment count this segment count return false for int i 0 i other segment count i object other segment tree path get segment i if comparer null if other segment equals segments i return false else if comparer equals other segment segments i return false return true | returns whether this path starts with the same segments as the given |
public void set scroll enabled boolean value scroll enabled value | sets whether auto scrolling should be provided during dragging |
public void remove final object elements or tree paths assert elements not null elements or tree paths if elements or tree paths length 0 return if is busy return preserving selection new runnable public void run internal remove elements or tree paths | removes the given elements from this viewer |
public void not visible added object element int index int required count do get item count 1 object new cache new object required count system arraycopy cached elements 0 new cache 0 index if index cached elements length system arraycopy cached elements index new cache index 1 cached elements length index new cache index element cached elements new cache do set item count required count | a non visible item has been added |
public void remove indices int indices if indices length 1 remove indices from to indices 0 indices 0 int required count do get item count indices length arrays sort indices object new cache new object required count int index in new cache 0 int next to skip 0 for int i 0 i cached elements length i if next to skip indices length i indices next to skip next to skip else new cache index in new cache cached elements i cached elements new cache | the elements with the given indices need to be removed from the |
public void remove indices from to int from int to int index after to to 1 object new cache new object cached elements length index after to from system arraycopy cached elements 0 new cache 0 from if index after to cached elements length system arraycopy cached elements index after to new cache from cached elements length index after to | the elements between the given indices inclusive need to be removed |
public void remove final object parent final object elements assert elements not null elements if elements length 0 return if is busy return preserving selection new runnable public void run internal remove parent elements | removes the given elements from this viewer whenever they appear as |
public void add object elements assert elements not null elements if is busy return object filtered filter elements for int i 0 i filtered length i object element filtered i int index index for element element create item element index | adds the given elements to this table viewer |
private void create item object element int index if virtual manager null update item internal create new row part swt none index get item element else virtual manager not visible added element index | create a new table item at index if required |
public void remove object elements or tree paths remove new object elements or tree paths | removes the given element from the viewer |
protected void initialize cell editor value cell editor cell editor viewer cell cell object value get value cell get element cell editor set value value | initialize the editor |
protected void save cell editor value cell editor cell editor viewer cell cell object value cell editor get value set value cell get element value | save the value of the cell editor back to the model |
public object get element at int index if index 0 index do get item count item i do get item index if i null return i get data return null | returns the element with the given index from this table viewer |
public void create composite parent assert is true control null control create control parent see 1 gd5 ca6 itpui all task view set selection does not work control is created with get visible true by default this causes composite set focus to work incorrectly the cell editor s control grabs focus instead even if it is not active make the control invisible here by default deactivate | creates the control for this cell editor under the given parent control |
public void reveal object element or tree path assert is not null element or tree path widget w internal expand element or tree path true if w instanceof item show item item w | this implementation of reveal reveals the given element or tree path |
public void insert object element int position apply editor value if get comparator null has filters add element return if position 1 position do get item count if is busy return create item element position | inserts the given element into this table viewer at the given position |
private void internal virtual refresh all object root get root icontent provider content provider get content provider invalidate for lazy if content provider instanceof ilazy content provider content provider instanceof istructured content provider don t cache if the root is null but cache if it is not lazy if root null virtual manager cached elements get sorted children root do set item count virtual manager cached elements length do clear all | refresh all with virtual elements |
public void remove final object elements assert elements not null elements if is busy return if elements length 0 return preserving selection new runnable public void run internal remove elements | removes the given elements from this table viewer |
public void set content provider icontent provider provider the actual check is in assert content provider type super set content provider provider | the code abstract tree viewer code implementation of this method |
public void set item count int count if is busy return int old count do get item count if count old count need to disassociate elements that are being disposed for int i count i old count i item item do get item i if item get data null disassociate item do set item count count if virtual manager null virtual manager adjust cache size count get control redraw | set the item count of the receiver |
public void replace object element int index if is busy return item item do get item index refresh item item element | replace the entries starting at index with elements |
public void clear int index item item do get item index if item get data null disassociate item do clear index | clear the table item at the specified index |
protected void focus cell changed viewer cell cell | called by the framework when the focus cell has changed |
protected void handle dispose dispose event event if content provider null content provider input changed this get input null content provider dispose content provider null if label provider null label provider remove listener label provider listener label provider dispose label provider null input null | handles a dispose event on this viewers control |
public void dispose clear listeners | the code base label provider code implementation of this |
protected void fire label provider changed final label provider changed event event object listeners get listeners for int i 0 i listeners length i final ilabel provider listener l ilabel provider listener listeners i safe runnable run new safe runnable public void run l label provider changed event | fires a label provider changed event to all registered listeners only |
public void put property string property object value if value null properties remove property else properties put property value | set the given property to the given value |
public ielement comparer get element comparer if element2 tree paths null return null return element2 tree paths get comparer | returns the element comparer passed in when the tree selection |
public viewer cell get cell point point int index get column index point return get cell index | get the viewer cell at point |
public int get column index point point int count get column count if there are no columns the column index is 0 if count 0 return 0 for int i 0 i count i if get bounds i contains point return i return 1 | get the column index of the point |
public viewer cell get cell int column if column 0 return new viewer cell viewer row clone column get element return null | get a viewer cell for the column at index |
public void set expanded state object element or tree path boolean expanded assert is not null element or tree path if is busy return widget item internal expand element or tree path false if item instanceof item if expanded create children item set expanded item item expanded | sets whether the node corresponding to the given element or tree path is |
public void activate column viewer editor activation event activation event activate | activate the editor but also inform the editor which event triggered its activation |
public boolean is navigation event column viewer viewer event event switch event key code case swt arrow up case swt arrow down case swt arrow left case swt arrow right case swt home case swt page down case swt page up case swt end return true default return false | is the given event an event which moves the selection to another cell |
protected comparator get comparator if comparator null comparator policy get comparator return comparator | returns the comparator used to sort strings |
public void sort final viewer viewer object elements arrays sort elements new comparator public int compare object a object b return viewer comparator this compare viewer a b | sorts the given elements in place modifying the given array |
public grid data factory span int h span int v span data horizontal span h span data vertical span v span return this | sets the grid data span |
public grid data factory span point span data horizontal span span x data vertical span span y return this | sets the grid data span |
public grid data factory hint int x hint int y hint data width hint x hint data height hint y hint return this | sets the width and height hints |
public grid data factory hint point hint data width hint hint x data height hint hint y return this | sets the width and height hints |
public grid data factory indent int h indent int v indent data horizontal indent h indent data vertical indent v indent return this | sets the indent of the control within the cell |
public grid layout factory copy return new grid layout factory create | creates a copy of the reciever |
public grid data factory indent point indent data horizontal indent indent x data vertical indent indent y return this | sets the indent of the control within the cell |
public grid layout factory equal width boolean equal l make columns equal width equal return this | sets whether the columns should be forced to be equal width |
public grid data factory grab boolean horizontal boolean vertical data grab excess horizontal space horizontal data grab excess vertical space vertical return this | determines whether extra horizontal or vertical space should be allocated to |
public grid layout factory spacing int h spacing int v spacing l horizontal spacing h spacing l vertical spacing v spacing return this | sets the spacing for layouts created with this factory |
public grid layout factory spacing point spacing l horizontal spacing spacing x l vertical spacing spacing y return this | sets the spacing for layouts created with this factory |
public grid data factory min size int min x int min y data minimum width min x data minimum height min y return this | sets the minimum size for the control |
public grid layout factory margins point margins l margin width margins x l margin height margins y return this | sets the margins for layouts created with this factory |
public grid layout factory margins int width int height l margin width width l margin height height return this | sets the margins for layouts created with this factory |
public grid data factory min size point min data minimum width min x data minimum height min y return this | sets the minimum size for the control |
public grid layout factory extended margins int left int right int top int bottom l margin left left l margin right right l margin top top l margin bottom bottom return this | sets the margins for layouts created with this factory |
public grid data factory exclude boolean should exclude data exclude should exclude return this | instructs the grid layout to ignore this control when performing layouts |
public grid layout factory extended margins rectangle difference rect l margin left difference rect x l margin top difference rect y l margin bottom difference rect y difference rect height l margin right difference rect x difference rect width return this | sets the margins for layouts created with this factory |
public grid layout factory num columns int num columns l num columns num columns return this | sets the number of columns in the layout |
public grid data create return copy data data | creates a new grid data instance |
public grid layout create return copy layout l | creates a new grid layout and initializes it with values from the factory |
public void apply to composite c c set layout copy layout l | creates a new grid layout and attaches it to the given composite |
public grid data factory copy return new grid data factory create | creates a copy of the reciever |
public void generate layout composite c apply to c layout generator generate layout c | applies this layout to the given composite and attaches default grid data |
public void apply to control control control set layout data create | sets the layout data on the given control |
protected tree path get tree path from item item item linked list segments new linked list while item null object segment item get data assert is not null segment segments add first segment item get parent item item return new tree path segments to array | returns the tree path for the given item |
public iselection get selection control control get control if control null control is disposed return tree selection empty widget items get selection get control array list list new array list items length for int i 0 i items length i widget item items i if item get data null list add get tree path from item item item return new tree selection tree path list to array new tree path list size get comparer | this implementation of get selection returns an instance of |
private font record default font record font record record font record string to font record get jface resources default font if record null font default font calculate default font record create font jface resources default font default font get font data default font dispose string to font record put jface resources default font record return record | returns the default font record |
public int open if get shell null create the window create if init dialog return super open return dialog cancel | opens this window creating it first if it has not yet been created |
protected boolean init dialog doing nothing return true | initialize the dialog after all controls have been created |
protected void configure shell shell shell super configure shell shell if title null shell set text title | configures the given shell in preparation for opening this window in it |
protected button get ok button return get button idialog constants ok id | gets the ok button |
protected void set ok button text string label ok label label | sets the text for ok button |
final protected void set result object value result value | sets the dialog result |
protected item get item at point point return null | this implementation of |
Subsets and Splits