input
stringlengths
10
828
output
stringlengths
5
107
protected boolean is fixed style return expansion style twistie 0 expansion style tree node 0
returns samp true samp if the composite is fixed i
public color create color string key int r int g int b color c new color display r g b color prev c color color registry get key if prev c null prev c dispose color registry put key c return c
creates the color for the specified key using the provided rgb values
protected void update border color if is white background border get color border else border display get system color swt color widget background color bg get implied background if border get red bg get red border get green bg get green border get blue bg get blue border display get system color swt color widget dark shadow
computes the border color relative to the background
public control get text client return text client
returns the text client control
public void set background color bg this background bg update border color
sets the background color
public void set foreground color fg this foreground fg
sets the foreground color
public void set text client control text client if this text client null this text client dispose this text client text client
sets the text client control
public color get border color return border
returns the computed border color
public boolean is white background color bg get implied background return bg get red 255 bg get green 255 bg get blue 255
tests if the background is white
public color get color string key return color color registry get key
returns the color object for the provided key or samp null samp if
public void dispose iterator e color registry values iterator while e has next color e next dispose color registry null
disposes all the colors in the registry
public void mark shared this shared true
marks the colors shared
public color get title bar foreground return title bar foreground
returns the title bar foreground when title bar style is used
public boolean is busy return busy thread null
returns true if it is currently busy
public void set image image image if image this image is disposed this image image redraw
set the image
public void set background color bg super set background bg title label set background bg base bg bg
sets the background color of the header
public void set foreground color fg super set foreground fg title label set foreground fg
sets the foreground color of the header
public void set image image image this image image if image null create busy label else if image null busy label null if busy label is busy busy label dispose busy label null busy label set image image layout
sets the image to be rendered to the left of the title
public boolean is background image tiled return flags tiled 0
always returns true
public boolean is separator visible return flags separator 0
todo add javadoc experimental do not use yet
public string get tooltip text return null
returns the tool tip of this segment or code null code
public void set message string message this set message message messages none
sets the message for this form
public void show page control page if page current page return if page get parent this return control old page current page current page page show new page if page null if page is disposed page set visible true layout true page set visible true hide old after new page has been made visible in order to avoid flashing if old page null old page is disposed old page set visible false
shows the given page
public point compute size int w hint int h hint boolean changed check widget point size form text layout layout form text layout get layout if w hint swt default h hint swt default size layout compute size this w hint h hint changed else size new point w hint h hint rectangle trim compute trim 0 0 size x size y if debug textsize system out println form text computed size trim non nls 1 return new point trim width trim height
overrides the method by fully trusting the layout manager computed width
public boolean is link at int offset check if there is a link at the offset for int i 0 i link ranges length i if offset link ranges i 0 offset link ranges i 0 link ranges i 1 return true return false
returns true if a link is present at the given character location
public string get link at int offset check if there is a link at the offset for int i 0 i link ranges length i if offset link ranges i 0 offset link ranges i 0 link ranges i 1 return hrefs i return null
returns the link at the given offset if there is one
public void set enable editor activation with keyboard boolean enable if enable if keyboard activation listener null keyboard activation listener new key listener public void key pressed key event e viewer cell cell get focus cell if cell null viewer trigger editor activation event new column viewer editor activation event cell e public void key released key event e viewer get control add key listener keyboard activation listener else if keyboard activation listener null viewer get control remove key listener keyboard activation listener keyboard activation listener null
enable activation of cell editors by keyboard
public void apply fonts and colors table item control if color provider null if used decorators if there is no provider only apply set values if background null control set background background if foreground null control set foreground foreground else always set the value if there is a provider control set background background control set foreground foreground if font provider null if used decorators font null control set font font else control set font font clear
apply the fonts and colors to the control if
protected viewer row internal create new row part int style int row index table item item if row index 0 item new table item table style row index else item new table item table style return get viewer row from item item
create a new row with style at index
public void refresh boolean update labels boolean reveal refresh get root update labels reveal
refreshes this viewer with information freshly obtained from this
public void add object parent element or tree path object child elements assert is not null parent element or tree path assert elements not null child elements if is busy return widget widgets internal find items parent element or tree path if parent hasn t been realized yet just ignore the add if widgets length 0 return for int i 0 i widgets length i internal add widgets i parent element or tree path child elements
adds the given child elements to this viewer as children of the given
private widget internal find item tree path path widget widgets find items path get last segment for int i 0 i widgets length i widget widget widgets i if widget instanceof item item item item widget tree path p get tree path from item item if p equals path return widget return null
return the item at the given path or code null code
private boolean item exists item items object element if using element map widget existing items find items element optimization for two common cases if existing items length 0 return false else if existing items length 1 if items length 0 existing items 0 instanceof item item existing item item existing items 0 return get parent item existing item get parent item items 0 for int i 0 i items length i if items i get data equals element return true return false
see if element is the data of one of the elements in items
public rectangle get bounds return row get bounds column index
get the bounds of the cell
public object get element if element null return element return row get element
get the element this row represents
public string get text return row get text column index
return the text for the cell
public image get image return row get image column index
return the image for the cell
public void set background color background row set background column index background
set the background color of the cell
public void set foreground color foreground row set foreground column index foreground
set the foreground color of the cell
public void set font font font row set font column index font
set the font of the cell
public void set text string text row set text column index text
set the text for the cell
public void set image image image row set image column index image
set the image for the cell
public widget get item return row get item
return the item for the receiver
public control get control return row get control
get the control for this cell
public void set providers object provider if provider instanceof itree path label provider tree path label provider itree path label provider provider if provider instanceof iviewer label provider viewer label provider iviewer label provider provider if provider instanceof ilabel provider label provider ilabel provider provider if provider instanceof icolor provider color provider icolor provider provider if provider instanceof ifont provider font provider ifont provider provider
set the any providers for the receiver that can be adapted from provider
public void set label provider cell label provider label provider set label provider label provider true
set the label provider for the column
public void set editing support editing support editing support this editing support editing support
set the editing support
protected void handle dispose boolean dispose label provider listener registered cell label provider cell label provider label provider set label provider null false if dispose label provider cell label provider dispose editing support null listener null
disposes of the label provider if set unregisters the listener and
public ccombo get ccombo assert is not null ccombo return ccombo
returns this list viewers list control
public combo get combo assert is not null combo return combo
returns this list viewers list control
public column viewer get viewer return viewer
returns this code table viewer impl code viewer
public void collapse to level object element or tree path int level assert is not null element or tree path widget w internal get widget to select element or tree path if w null internal collapse to level w level
collapses the subtree rooted at the given element or tree path to the
public void cancel editing table editor impl cancel editing
cancels a currently active cell editor
public void edit element object element int column table editor impl edit element element column
starts editing the given element
public icell modifier get cell modifier return table editor impl get cell modifier
returns the cell modifier of this viewer
public viewer sorter get sorter if sorter instanceof viewer sorter return viewer sorter sorter return null
returns this viewers sorter or code null code if it does not have
public viewer comparator get comparator return sorter
return this viewers comparator used to sort elements
public boolean is cell editor active return table editor impl is cell editor active
returns whether there is an active cell editor
public void set cell editors cell editor editors table editor impl set cell editors editors
sets the cell editors of this table viewer
public void set cell modifier icell modifier modifier table editor impl set cell modifier modifier
sets the cell modifier of this table viewer
public void set column properties string column properties table editor impl set column properties column properties
sets the column properties of this table viewer
protected void fire tree collapsed final tree expansion event event object listeners tree listeners get listeners boolean old busy busy busy true try for int i 0 i listeners length i final itree viewer listener l itree viewer listener listeners i safe runnable run new safe runnable public void run l tree collapsed event finally busy old busy
fires a tree collapsed event
protected void fire tree expanded final tree expansion event event object listeners tree listeners get listeners boolean old busy busy busy true try for int i 0 i listeners length i final itree viewer listener l itree viewer listener listeners i safe runnable run new safe runnable public void run l tree expanded event finally busy old busy
fires a tree expanded event
private void set all checked boolean state tree item items for int i 0 i items length i items i set checked state tree item children items i get items set all checked state children
set the checked state of items and their children to state
protected void map element object element widget item if element map null object widget or widgets element map get element if widget or widgets null element map put element item else if widget or widgets instanceof widget if widget or widgets item element map put element new widget widget widget or widgets item else widget widgets widget widget or widgets int index of item arrays as list widgets index of item if index of item 1 int length widgets length system arraycopy widgets 0 widgets new widget length 1 0 length widgets length item element map put element widgets
adds the element item pair to the element map
public void update label viewer label label tree path element path tree path provider update label label element path
update the label for the element with tree path
public itree path label provider get tree path provider return tree path provider
return the itree path label provider for the receiver
public int category tree path parent path object element return category element
provide a category for the given element that will have the given parent
public int compare viewer viewer tree path parent path object e1 object e2 return compare viewer e1 e2
compare the given elements that will have the given parent
public boolean is sorter property tree path parent path object element string property return is sorter property element property
returns whether this viewer sorter would be affected
public void sort final viewer viewer final tree path parent path object elements arrays sort elements new comparator public int compare object a object b return tree path viewer sorter this compare viewer parent path a b
sorts the given elements in place modifying the given array
private object get element event event return event item get data
return the item for the event
protected void erase event event object element rectangle bounds event get bounds if event detail swt selected 0 color old foreground event gc get foreground color old background event gc get background event gc set background event item get display get system color swt color list selection event gc set foreground event item get display get system color swt color list selection text event gc fill rectangle bounds restore the old gc colors event gc set foreground old foreground event gc set background old background ensure that default selection is not drawn event detail swt selected
handle the erase event
protected void preserving selection runnable update code preserving selection update code false
attempts to preserves the current selection across a run of the given
public boolean get expanded state object element or tree path assert is not null element or tree path widget item internal get widget to select element or tree path if item instanceof item return get expanded item item return false
returns whether the node corresponding to the given element or tree path
private focus listener get button focus listener if button focus listener null button focus listener new focus listener non javadoc see org eclipse swt events focus listener focus gained org eclipse swt events focus event public void focus gained focus event e do nothing non javadoc see org eclipse swt events focus listener focus lost org eclipse swt events focus event public void focus lost focus event e dialog cell editor this focus lost return button focus listener
return a listener for button focus
public image get image object element image image provider get image element if decorator null if decorator instanceof label decorator label decorator ld2 label decorator decorator image decorated ld2 decorate image image element get decoration context if decorated null return decorated else image decorated decorator decorate image image element if decorated null return decorated return image
the code decorating label provider code implementation of this
public string get text object element string text provider get text element if decorator null if decorator instanceof label decorator label decorator ld2 label decorator decorator string decorated ld2 decorate text text element get decoration context if decorated null return decorated else string decorated decorator decorate text text element if decorated null return decorated return text
the code decorating label provider code implementation of this
public idecoration context get decoration context return decoration context
return the decoration context associated with this label provider
public void set decoration context idecoration context decoration context assert is not null decoration context this decoration context decoration context
set the decoration context that will be based to the decorator
public string get tool tip text object element return null
get the text displayed in the tool tip for object
public color get tool tip background color object object return null
return the background color used for the tool tip
public color get tool tip foreground color object object return null
the foreground color used to display the the text in the tool tip
public boolean use native tool tip object object return false
return whether or not to use the native tool tip
public int get tool tip time displayed object object return 0
the time in milliseconds the tool tip is shown for
public int get tool tip display delay time object object return 0
the time in milliseconds until the tool tip is displayed
protected void hook editing support control control needed for backwards comp with abstract tree viewer and table tree viewer who are not hooked this way others may already overwrite and provide their own impl if viewer editor null control add mouse listener new mouse adapter public void mouse down mouse event e workaround for bug 185817 if e count 2 handle mouse down e public void mouse double click mouse event e handle mouse down e
hook up the editing support
protected viewer row get viewer row point point item item get item at point if item null return get viewer row from item item return null
returns the viewer row at the given widget relative coordinates
public void set label provider ibase label provider label provider assert is true label provider instanceof itable label provider label provider instanceof ilabel provider label provider instanceof cell label provider update column parts label provider reset the label providers in the columns super set label provider label provider
the column viewer implementation of this code viewer code framework
private void update column parts ibase label provider label provider viewer column column int i 0 while column get viewer column i null column set label provider cell label provider create viewer label provider label provider false
clear the viewer parts for the columns
public void set filters viewer filter filters if filters length 0 reset filters else this filters new array list arrays as list filters refresh
sets the filters replacing any previous filters and triggers
public void cancel editing if viewer editor null viewer editor cancel editing
cancels a currently active cell editor if one is active
protected void apply editor value if viewer editor null viewer editor apply editor value
apply the value of the active cell editor if one is active
public void edit element object element int column if viewer editor null widget item find item element if item null viewer row row get viewer row from item item if row null viewer cell cell row get cell column if cell null get control set redraw false set selection new structured selection cell get element trigger editor activation event new column viewer editor activation event cell get control set redraw true
starts editing the given element at the given column index
public boolean is cell editor active if viewer editor null return viewer editor is cell editor active return false
returns whether there is an active cell editor
public cell label provider get label provider int column index viewer column column get viewer column column index if column null return column get label provider return null
returns the label provider associated with the column at the given index
protected void internal initialize tree control tree create children tree internal expand to level tree expand to level
initializes the tree with root items expanding to the appropriate
private void internal collect expanded items list result widget widget item items get children widget for int i 0 i items length i item item items i if get expanded item result add item internal collect expanded items result item
recursively collects all expanded items from the given widget
private object internal to element object element or path if element or path instanceof tree path return tree path element or path get last segment return element or path
if the argument is a tree path returns its last segment otherwise
protected widget internal get widget to select object element or tree path if element or tree path instanceof tree path tree path tree path tree path element or tree path if tree path get segment count 0 return get control widget candidates find items tree path get last segment for int i 0 i candidates length i widget candidate candidates i if candidate instanceof item continue if tree path equals get tree path from item item candidate get comparer return candidate return null return find item element or tree path
returns the widget to be selected for the given element or tree path