idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
13,400
public CreateIssueParams notifiedUserIds ( List notifiedUserIds ) { for ( Object notifiedUserId : notifiedUserIds ) { parameters . add ( new NameValuePair ( "notifiedUserId[]" , notifiedUserId . toString ( ) ) ) ; } return this ; }
Sets the issue notified users .
64
7
13,401
public CreateIssueParams textCustomFields ( List < CustomFiledValue > customFieldValueList ) { for ( CustomFiledValue customFiledValue : customFieldValueList ) { textCustomField ( customFiledValue ) ; } return this ; }
Sets the text type custom field with Map .
55
10
13,402
public CreateIssueParams multipleListCustomField ( CustomFiledItems customFiledItems ) { for ( Object id : customFiledItems . getCustomFieldItemIds ( ) ) { parameters . add ( new NameValuePair ( "customField_" + customFiledItems . getCustomFieldId ( ) , id . toString ( ) ) ) ; } return this ; }
Sets the multiple list type custom field .
82
9
13,403
public CreateIssueParams multipleListCustomFields ( List < CustomFiledItems > customFiledItemsList ) { for ( CustomFiledItems customFiledItems : customFiledItemsList ) { multipleListCustomField ( customFiledItems ) ; } return this ; }
Sets the multiple list type custom field with Map .
59
11
13,404
public String getSharedFileEndpoint ( Object projectIdOrKey , Object sharedFileId ) throws BacklogException { return buildEndpoint ( "projects/" + projectIdOrKey + "/files/" + sharedFileId ) ; }
Returns the endpoint of shared file .
49
7
13,405
public String getWikiAttachmentEndpoint ( Object wikiId , Object attachmentId ) throws BacklogException { return buildEndpoint ( "wikis/" + wikiId + "/attachments/" + attachmentId ) ; }
Returns the endpoint of Wiki page s attachment file .
45
10
13,406
public CreateWebhookParams description ( String description ) { String value = ( description == null ) ? "" : description ; parameters . add ( new NameValuePair ( "description" , value ) ) ; return this ; }
Sets the description parameter .
47
6
13,407
public AddPullRequestCommentParams notifiedUserIds ( List < Long > notifiedUserIds ) { for ( Long notifiedUserId : notifiedUserIds ) { parameters . add ( new NameValuePair ( "notifiedUserId[]" , String . valueOf ( notifiedUserId ) ) ) ; } return this ; }
Sets the notified users .
70
6
13,408
public UpdatePullRequestParams notifiedUserIds ( List < Long > notifiedUserIds ) { for ( Long notifiedUserId : notifiedUserIds ) { parameters . add ( new NameValuePair ( "notifiedUserId[]" , notifiedUserId . toString ( ) ) ) ; } return this ; }
Sets the pull request notified users .
68
8
13,409
public UpdatePullRequestParams attachmentIds ( List < Long > attachmentIds ) { for ( Long attachmentId : attachmentIds ) { parameters . add ( new NameValuePair ( "attachmentId[]" , attachmentId . toString ( ) ) ) ; } return this ; }
Sets the pull request attachment files .
62
8
13,410
@ Override public void encodeEnd ( final FacesContext context , final UIComponent component ) throws IOException { final ResponseWriter responseWriter = context . getResponseWriter ( ) ; final Sheet sheet = ( Sheet ) component ; // update column mappings on render sheet . updateColumnMappings ( ) ; // sort data sheet ....
Encodes the Sheet component
104
5
13,411
protected void encodeMarkup ( final FacesContext context , final Sheet sheet , final ResponseWriter responseWriter ) throws IOException { /* * <div id="..." name="..." class="" style=""> */ final String styleClass = sheet . getStyleClass ( ) ; final String clientId = sheet . getClientId ( context ) ; final Integer widt...
Encodes the HTML markup for the sheet .
564
9
13,412
protected void encodeOptionalAttr ( final WidgetBuilder wb , final String attrName , final String value ) throws IOException { if ( value != null ) { wb . attr ( attrName , value ) ; } }
Encodes an optional attribute to the widget builder specified .
50
11
13,413
protected void encodeInvalidData ( final FacesContext context , final Sheet sheet , final WidgetBuilder wb ) throws IOException { wb . attr ( "errors" , sheet . getInvalidDataValue ( ) ) ; }
Encodes the necessary JS to render invalid data .
47
10
13,414
protected void encodeColHeaders ( final FacesContext context , final Sheet sheet , final WidgetBuilder wb ) throws IOException { final JavascriptVarBuilder vb = new JavascriptVarBuilder ( null , false ) ; for ( final SheetColumn column : sheet . getColumns ( ) ) { if ( ! column . isRendered ( ) ) { continue ; } vb . ap...
Encode the column headers
122
5
13,415
protected void encodeData ( final FacesContext context , final Sheet sheet , final WidgetBuilder wb ) throws IOException { final JavascriptVarBuilder jsData = new JavascriptVarBuilder ( null , false ) ; final JavascriptVarBuilder jsRowKeys = new JavascriptVarBuilder ( null , false ) ; final JavascriptVarBuilder jsStyle...
Encode the row data . Builds row data style data and read only object .
563
17
13,416
protected JavascriptVarBuilder encodeRow ( final FacesContext context , final String rowKey , final JavascriptVarBuilder jsData , final JavascriptVarBuilder jsRowStyle , final JavascriptVarBuilder jsStyle , final JavascriptVarBuilder jsReadOnly , final Sheet sheet , final int rowIndex ) throws IOException { // encode r...
Encode a single row .
385
6
13,417
private void encodeHiddenInputs ( final ResponseWriter responseWriter , final Sheet sheet , final String clientId ) throws IOException { responseWriter . startElement ( "input" , null ) ; responseWriter . writeAttribute ( "id" , clientId + "_input" , "id" ) ; responseWriter . writeAttribute ( "name" , clientId + "_inpu...
Encode hidden input fields
644
5
13,418
private void encodeFooter ( final FacesContext context , final ResponseWriter responseWriter , final Sheet sheet ) throws IOException { // footer final UIComponent footer = sheet . getFacet ( "footer" ) ; if ( footer != null ) { responseWriter . startElement ( "div" , null ) ; responseWriter . writeAttribute ( "class" ...
Encode the sheet footer
127
6
13,419
private void encodeHeader ( final FacesContext context , final ResponseWriter responseWriter , final Sheet sheet ) throws IOException { // header final UIComponent header = sheet . getFacet ( "header" ) ; if ( header != null ) { responseWriter . startElement ( "div" , null ) ; responseWriter . writeAttribute ( "class" ...
Encode the Sheet header
120
5
13,420
protected void encodeFilterValues ( final FacesContext context , final ResponseWriter responseWriter , final Sheet sheet , final String clientId ) throws IOException { int renderCol = 0 ; for ( final SheetColumn column : sheet . getColumns ( ) ) { if ( ! column . isRendered ( ) ) { continue ; } if ( column . getValueEx...
Encodes the filter values .
206
6
13,421
protected void encodeSortVar ( final FacesContext context , final Sheet sheet , final WidgetBuilder wb ) throws IOException { final JavascriptVarBuilder vb = new JavascriptVarBuilder ( null , false ) ; for ( final SheetColumn column : sheet . getColumns ( ) ) { if ( ! column . isRendered ( ) ) { continue ; } if ( colum...
Encodes a javascript sort var that informs the col header event of the column s sorting options . The var is an array of boolean indicating whether or not the column is sortable .
152
36
13,422
protected void decodeFilters ( final FacesContext context , final Sheet sheet , final Map < String , String > params , final String clientId ) { int renderCol = 0 ; for ( final SheetColumn column : sheet . getColumns ( ) ) { if ( ! column . isRendered ( ) ) { continue ; } if ( column . getValueExpression ( "filterBy" )...
Decodes the filter values
121
5
13,423
private void decodeSelection ( final FacesContext context , final Sheet sheet , final String jsonSelection ) { if ( LangUtils . isValueBlank ( jsonSelection ) ) { return ; } try { // data comes in: [ [row, col, oldValue, newValue] ... ] final JSONArray array = new JSONArray ( jsonSelection ) ; sheet . setSelectedRow ( ...
Decodes the user Selection JSON data
201
7
13,424
private void decodeSubmittedValues ( final FacesContext context , final Sheet sheet , final String jsonData ) { if ( LangUtils . isValueBlank ( jsonData ) ) { return ; } try { // data comes in as a JSON Object with named properties for the row and columns // updated this is so that // multiple updates to the same cell ...
Converts the JSON data received from the in the request params into our sumitted values map . The map is cleared first .
314
25
13,425
public RequestParameterBuilder paramJson ( String name , Object value ) throws UnsupportedEncodingException { return paramJson ( name , value , null ) ; }
Adds a request parameter to the URL without specifying a data type of the given parameter value . Parameter s value is converted to JSON notation when adding . Furthermore it will be encoded according to the acquired encoding .
34
41
13,426
public RequestParameterBuilder paramJson ( String name , Object value , String type ) throws UnsupportedEncodingException { String encodedJsonValue = encodeJson ( value , type ) ; if ( added || originalUrl . contains ( "?" ) ) { buffer . append ( "&" ) ; } else { buffer . append ( "?" ) ; } buffer . append ( name ) ; b...
Adds a request parameter to the URL with specifying a data type of the given parameter value . Data type is sometimes required especially for Java generic types because type information is erased at runtime and the conversion to JSON will not work properly . Parameter s value is converted to JSON notation when adding ....
119
68
13,427
public String encodeJson ( Object value , String type ) throws UnsupportedEncodingException { jsonConverter . setType ( type ) ; String jsonValue ; if ( value == null ) { jsonValue = "null" ; } else { jsonValue = jsonConverter . getAsString ( null , null , value ) ; } return URLEncoder . encode ( jsonValue , encoding )...
Convertes give value to JSON and encodes the converted value with a proper encoding . Data type is sometimes required especially for Java generic types because type information is erased at runtime and the conversion to JSON will not work properly .
86
45
13,428
public String build ( ) { String url = buffer . toString ( ) ; if ( url . length ( ) > 2083 ) { LOG . warning ( "URL " + url + " is longer than 2083 chars (" + buffer . length ( ) + "). It may not work properly in old IE versions." ) ; } return url ; }
Builds the end result .
72
6
13,429
public RequestParameterBuilder reset ( ) { buffer = new StringBuilder ( originalUrl ) ; jsonConverter . setType ( null ) ; added = false ; return this ; }
Resets the internal state in order to be reused .
37
11
13,430
public DynaFormControl addControl ( final Object data , final int colspan , final int rowspan ) { return addControl ( data , DynaFormControl . DEFAULT_TYPE , colspan , rowspan ) ; }
Adds control with given data default type colspan and rowspan .
47
13
13,431
public DynaFormControl addControl ( final Object data , final String type , final int colspan , final int rowspan ) { final DynaFormControl dynaFormControl = new DynaFormControl ( data , type , colspan , rowspan , row , elements . size ( ) + 1 , dynaFormModel . getControls ( ) . size ( ) + 1 , extended ) ; elements . a...
Adds control with given data type colspan and rowspan .
130
12
13,432
public DynaFormLabel addLabel ( final String value , final int colspan , final int rowspan ) { return addLabel ( value , true , colspan , rowspan ) ; }
Adds a label with given text colspan and rowspan .
39
12
13,433
public DynaFormLabel addLabel ( final String value , final boolean escape , final int colspan , final int rowspan ) { final DynaFormLabel dynaFormLabel = new DynaFormLabel ( value , escape , colspan , rowspan , row , elements . size ( ) + 1 , extended ) ; elements . add ( dynaFormLabel ) ; dynaFormModel . getLabels ( )...
Adds a label with given text escape flag colspan and rowspan .
113
14
13,434
private void getColumns ( final UIComponent parent ) { for ( final UIComponent child : parent . getChildren ( ) ) { if ( child instanceof SheetColumn ) { columns . add ( ( SheetColumn ) child ) ; } } }
Grabs the UIColumn children for the parent specified .
54
13
13,435
public void reset ( ) { resetSubmitted ( ) ; resetSort ( ) ; resetInvalidUpdates ( ) ; localValues . clear ( ) ; for ( final SheetColumn c : getColumns ( ) ) { c . setFilterValue ( null ) ; } }
Resets all filters sorting and submitted values .
56
9
13,436
public void setSubmittedValue ( final FacesContext context , final String rowKey , final int col , final String value ) { submittedValues . put ( new SheetRowColIndex ( rowKey , col ) , value ) ; }
Updates a submitted value .
47
6
13,437
public String getSubmittedValue ( final String rowKey , final int col ) { return submittedValues . get ( new SheetRowColIndex ( rowKey , col ) ) ; }
Retrieves the submitted value for the row and col .
37
12
13,438
public void setLocalValue ( final String rowKey , final int col , final Object value ) { localValues . put ( new SheetRowColIndex ( rowKey , col ) , value ) ; }
Updates a local value .
41
6
13,439
public Object getLocalValue ( final String rowKey , final int col ) { return localValues . get ( new SheetRowColIndex ( rowKey , col ) ) ; }
Retrieves the submitted value for the rowKey and col .
36
13
13,440
public void setRowVar ( final FacesContext context , final String rowKey ) { if ( context == null ) { return ; } if ( rowKey == null ) { context . getExternalContext ( ) . getRequestMap ( ) . remove ( getVar ( ) ) ; } else { final Object value = getRowMap ( ) . get ( rowKey ) ; context . getExternalContext ( ) . getReq...
Updates the row var for iterations over the list . The var value will be updated to the value for the specified rowKey .
102
26
13,441
public Object getValueForCell ( final FacesContext context , final String rowKey , final int col ) { // if we have a local value, use it // note: can't check for null, as null may be the submitted value final SheetRowColIndex index = new SheetRowColIndex ( rowKey , col ) ; if ( localValues . containsKey ( index ) ) { r...
Gets the object value of the row and col specified . If a local value exists that is returned otherwise the actual value is return .
141
27
13,442
public String getRenderValueForCell ( final FacesContext context , final String rowKey , final int col ) { // if we have a submitted value still, use it // note: can't check for null, as null may be the submitted value final SheetRowColIndex index = new SheetRowColIndex ( rowKey , col ) ; if ( submittedValues . contain...
Gets the render string for the value the given cell . Applys the available converters to convert the value .
188
23
13,443
protected String getRowHeaderValueAsString ( final FacesContext context ) { final ValueExpression veRowHeader = getRowHeaderValueExpression ( ) ; final Object value = veRowHeader . getValue ( context . getELContext ( ) ) ; if ( value == null ) { return Constants . EMPTY_STRING ; } else { return value . toString ( ) ; }...
Gets the row header text value as a string for use in javascript
82
14
13,444
public List < Object > getSortedValues ( ) { List < Object > filtered = getFilteredValue ( ) ; if ( filtered == null || filtered . isEmpty ( ) ) { filtered = sortAndFilter ( ) ; } return filtered ; }
The sorted list of values .
52
6
13,445
public int getSortColRenderIndex ( ) { final ValueExpression veSortBy = getValueExpression ( PropertyKeys . sortBy . name ( ) ) ; if ( veSortBy == null ) { return - 1 ; } final String sortByExp = veSortBy . getExpressionString ( ) ; int colIdx = 0 ; for ( final SheetColumn column : getColumns ( ) ) { if ( ! column . is...
Gets the rendered col index of the column corresponding to the current sortBy . This is used to keep track of the current sort column in the page .
172
31
13,446
public List < Object > sortAndFilter ( ) { final List filteredList = getFilteredValue ( ) ; filteredList . clear ( ) ; rowMap = new HashMap <> ( ) ; rowNumbers = new HashMap <> ( ) ; final Collection < ? > values = ( Collection < ? > ) getValue ( ) ; if ( values == null || values . isEmpty ( ) ) { return filteredList ;...
Sorts and filters the data
361
6
13,447
@ Override protected Object getRowKeyValue ( final FacesContext context ) { final ValueExpression veRowKey = getValueExpression ( PropertyKeys . rowKey . name ( ) ) ; if ( veRowKey == null ) { throw new RuntimeException ( "RowKey required on sheet!" ) ; } final Object value = veRowKey . getValue ( context . getELContex...
Gets the rowKey for the current row
119
9
13,448
protected String getRowKeyValueAsString ( final Object key ) { final String result = key . toString ( ) ; return "r_" + StringUtils . deleteWhitespace ( result ) ; }
Gets the row key value as a String suitable for use in javascript rendering .
44
16
13,449
protected SortOrder convertSortOrder ( ) { final String sortOrder = getSortOrder ( ) ; if ( sortOrder == null ) { return SortOrder . UNSORTED ; } else { final SortOrder result = SortOrder . valueOf ( sortOrder . toUpperCase ( Locale . ENGLISH ) ) ; return result ; } }
Convert to PF SortOrder enum since we are leveraging PF sorting code .
73
15
13,450
@ Override public void validate ( final FacesContext context ) { // iterate over submitted values and attempt to convert to the proper // data type. For successful values, remove from submitted and add to // local values map. for failures, add a conversion message and leave in // the submitted state final Iterator < En...
Converts each submitted value into a local value and stores it back in the hash . If all values convert without error then the component is valid and we can proceed to the processUpdates .
717
38
13,451
@ Override public Object saveState ( final FacesContext context ) { final Object values [ ] = new Object [ 8 ] ; values [ 0 ] = super . saveState ( context ) ; values [ 1 ] = submittedValues ; values [ 2 ] = localValues ; values [ 3 ] = invalidUpdates ; values [ 4 ] = columnMapping ; values [ 5 ] = getFilteredValue ( )...
Saves the state of the submitted and local values and the bad updates .
105
15
13,452
@ Override public void restoreState ( final FacesContext context , final Object state ) { if ( state == null ) { return ; } final Object values [ ] = ( Object [ ] ) state ; super . restoreState ( context , values [ 0 ] ) ; final Object restoredSubmittedValues = values [ 1 ] ; final Object restoredLocalValues = values [...
Restores the state for the submitted local and bad values .
401
12
13,453
public int getMappedColumn ( final int renderCol ) { if ( columnMapping == null || renderCol == - 1 ) { return renderCol ; } else { final Integer result = columnMapping . get ( renderCol ) ; if ( result == null ) { throw new IllegalArgumentException ( "Invalid index " + renderCol ) ; } return result ; } }
Maps the rendered column index to the real column index .
78
11
13,454
public int getRenderIndexFromRealIdx ( final int realIdx ) { if ( columnMapping == null || realIdx == - 1 ) { return realIdx ; } for ( final Entry < Integer , Integer > entry : columnMapping . entrySet ( ) ) { if ( entry . getValue ( ) . equals ( realIdx ) ) { return entry . getKey ( ) ; } } return realIdx ; }
Provides the render column index based on the real index
93
11
13,455
public void updateColumnMappings ( ) { columnMapping = new HashMap <> ( ) ; int realIdx = 0 ; int renderCol = 0 ; for ( final SheetColumn column : getColumns ( ) ) { if ( column . isRendered ( ) ) { columnMapping . put ( renderCol , realIdx ) ; renderCol ++ ; } realIdx ++ ; } }
Updates the column mappings based on the rendered attribute
85
11
13,456
public String getInvalidDataValue ( ) { final JavascriptVarBuilder vb = new JavascriptVarBuilder ( null , true ) ; for ( final SheetInvalidUpdate sheetInvalidUpdate : getInvalidUpdates ( ) ) { final Object rowKey = sheetInvalidUpdate . getInvalidRowKey ( ) ; final int col = getRenderIndexFromRealIdx ( sheetInvalidUpdat...
Generates the bad data var value for this sheet .
160
11
13,457
public void renderRowUpdateScript ( final FacesContext context , final Set < String > dirtyRows ) { final String jsVar = resolveWidgetVar ( ) ; final StringBuilder eval = new StringBuilder ( ) ; for ( final String rowKey : dirtyRows ) { setRowVar ( context , rowKey ) ; final int rowIndex = rowNumbers . get ( rowKey ) ;...
Adds eval scripts to the ajax response to update the rows dirtied by the most recent successful update request .
515
23
13,458
public void renderBadUpdateScript ( final FacesContext context ) { final String widgetVar = resolveWidgetVar ( ) ; final String invalidValue = getInvalidDataValue ( ) ; StringBuilder sb = new StringBuilder ( "PF('" + widgetVar + "')" ) ; sb . append ( ".cfg.errors=" ) ; sb . append ( invalidValue ) ; sb . append ( ";" ...
Adds eval scripts to update the bad data array in the sheet to render validation failures produced by the most recent ajax update attempt .
249
27
13,459
public void appendUpdateEvent ( final Object rowKey , final int colIndex , final Object rowData , final Object oldValue , final Object newValue ) { updates . add ( new SheetUpdate ( rowKey , colIndex , rowData , oldValue , newValue ) ) ; }
Appends an update event
58
5
13,460
public Integer getHeight ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . height ) ; if ( result == null ) { return null ; } // this will handle any type so long as its convertable to integer return Integer . valueOf ( result . toString ( ) ) ; }
The height of the sheet . Note this is applied to the inner div which is why it is recommend you use this property instead of a style class .
65
30
13,461
public void setFilteredValue ( final java . util . List _filteredValue ) { getStateHelper ( ) . put ( PropertyKeys . filteredValue , _filteredValue ) ; }
Sets the filtered list .
40
6
13,462
public String getStyle ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . style , null ) ; if ( result == null ) { return null ; } return result . toString ( ) ; }
The style value
47
3
13,463
public String getSortOrder ( ) { // if we have a toggled sort in our state, use it final String result = ( String ) getStateHelper ( ) . eval ( PropertyKeys . sortOrder , SortOrder . ASCENDING . toString ( ) ) ; return result ; }
The sort direction
61
3
13,464
public void setSortOrder ( final java . lang . String sortOrder ) { // when updating, make sure we store off the original so it may be // restored final String orig = ( String ) getStateHelper ( ) . get ( PropertyKeys . origSortOrder ) ; if ( orig == null ) { // do not call getSortOrder as it defaults to ascending, we ...
Update the sort direction
145
4
13,465
public String getErrorMessage ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . errorMessage ) ; if ( result == null ) { return null ; } return result . toString ( ) ; }
The error message to display when the sheet is in error .
47
12
13,466
private void encodeHandle ( final FacesContext context , final SlideOut slideOut ) throws IOException { final ResponseWriter writer = context . getResponseWriter ( ) ; String styleClass = SlideOut . HANDLE_CLASS ; if ( slideOut . getHandleStyleClass ( ) != null ) { styleClass = styleClass + " " + slideOut . getHandleSt...
HTML markup for the tab handle .
228
7
13,467
private void encodeIcon ( final FacesContext context , final SlideOut slideOut ) throws IOException { if ( slideOut . getIcon ( ) == null ) { return ; } // fontawesome icons are OK but themeroller we need to add styles String icon = slideOut . getIcon ( ) . trim ( ) ; if ( icon . startsWith ( "ui" ) ) { icon = "ui-icon...
HTML markup for the tab handle icon if defined .
177
10
13,468
public DynaFormRow createRegularRow ( ) { final DynaFormRow dynaFormRow = new DynaFormRow ( regularRows . size ( ) + 1 , false , this ) ; regularRows . add ( dynaFormRow ) ; return dynaFormRow ; }
Creates a new regular row .
61
7
13,469
public DynaFormRow createExtendedRow ( ) { if ( extendedRows == null ) { extendedRows = new ArrayList < DynaFormRow > ( ) ; } final DynaFormRow dynaFormRow = new DynaFormRow ( extendedRows . size ( ) + 1 , true , this ) ; extendedRows . add ( dynaFormRow ) ; return dynaFormRow ; }
Creates a new extended row .
88
7
13,470
public void removeRegularRow ( final DynaFormRow rowToBeRemoved ) { final int idx = rowToBeRemoved != null ? regularRows . indexOf ( rowToBeRemoved ) : - 1 ; if ( idx >= 0 ) { removeRow ( regularRows , rowToBeRemoved , idx ) ; } }
Removes the passed regular row .
71
7
13,471
public void removeExtendedRow ( final DynaFormRow rowToBeRemoved ) { final int idx = rowToBeRemoved != null ? extendedRows . indexOf ( rowToBeRemoved ) : - 1 ; if ( idx >= 0 ) { removeRow ( extendedRows , rowToBeRemoved , idx ) ; } }
Removes the passed extended row .
72
7
13,472
public JavascriptVarBuilder appendRowColProperty ( final int row , final int col , final String propertyValue , final boolean quoted ) { return appendProperty ( "r" + row + "_c" + col , propertyValue , quoted ) ; }
appends a property with the name rYY_cXX where YY is the row and XX is he column .
50
24
13,473
public JavascriptVarBuilder appendText ( final String value , final boolean quoted ) { if ( quoted ) { sb . append ( "\"" ) ; if ( value != null ) { sb . append ( EscapeUtils . forJavaScript ( value ) ) ; } sb . append ( "\"" ) ; } else if ( value != null ) { sb . append ( value ) ; } return this ; }
Appends text to the var string
88
7
13,474
public JavascriptVarBuilder closeVar ( ) { if ( isObject ) { sb . append ( "}" ) ; } else { sb . append ( "]" ) ; } if ( isVar ) { sb . append ( ";" ) ; } return this ; }
Closes the array or object .
57
7
13,475
public String getHeaderText ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . headerText , null ) ; if ( result == null ) { return null ; } return result . toString ( ) ; }
The fixed column count .
49
5
13,476
public Boolean isReadonlyCell ( ) { return Boolean . valueOf ( getStateHelper ( ) . eval ( PropertyKeys . readonlyCell , Boolean . FALSE ) . toString ( ) ) ; }
Flag indicating whether this cell is read only . the var reference will be available .
42
16
13,477
public Integer getColWidth ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . colWidth , null ) ; if ( result == null ) { return null ; } return Integer . valueOf ( result . toString ( ) ) ; }
The column width
55
3
13,478
public Collection < SelectItem > getFilterOptions ( ) { return ( Collection < SelectItem > ) getStateHelper ( ) . eval ( PropertyKeys . filterOptions , null ) ; }
The filterOptions expression
38
4
13,479
public Sheet getSheet ( ) { if ( sheet != null ) { return sheet ; } UIComponent parent = getParent ( ) ; while ( parent != null && ! ( parent instanceof Sheet ) ) { parent = parent . getParent ( ) ; } return ( Sheet ) parent ; }
Get the parent sheet
62
4
13,480
protected boolean validateRequired ( final FacesContext context , final Object newValue ) { // If our value is valid, enforce the required property if present if ( isValid ( ) && isRequired ( ) && isEmpty ( newValue ) ) { final String requiredMessageStr = getRequiredMessage ( ) ; FacesMessage message ; if ( null != req...
Validates the value against the required flags on this column .
238
12
13,481
private void requestCameraPermission ( ) { Log . w ( "BARCODE-SCANNER" , "Camera permission is not granted. Requesting permission" ) ; final String [ ] permissions = new String [ ] { Manifest . permission . CAMERA } ; if ( ! shouldShowRequestPermissionRationale ( Manifest . permission . CAMERA ) ) { requestPermissions ...
Handles the requesting of the camera permission . This includes showing a Snackbar message of why the permission is needed then sending the request .
313
28
13,482
@ Override public boolean onTouch ( View v , MotionEvent event ) { boolean b = scaleGestureDetector . onTouchEvent ( event ) ; boolean c = gestureDetector . onTouchEvent ( event ) ; return b || c || v . onTouchEvent ( event ) ; }
Called when a touch event is dispatched to a view . This allows listeners to get a chance to respond before the target view .
62
26
13,483
protected boolean onTap ( float rawX , float rawY ) { Log . d ( "CAPTURE-FRAGMENT" , "got tap at: (" + rawX + ", " + rawY + ")" ) ; Barcode barcode = null ; if ( mMode == MVBarcodeScanner . ScanningMode . SINGLE_AUTO ) { BarcodeGraphic graphic = mGraphicOverlay . getFirstGraphic ( ) ; if ( graphic != null ) { barcode =...
onTap is called to capture the oldest barcode currently detected and return it to the caller .
466
19
13,484
@ Override public void onNewItem ( int id , Barcode item ) { mGraphic . setId ( id ) ; if ( mListener != null ) mListener . onNewBarcodeDetected ( id , item ) ; }
Start tracking the detected item instance within the item overlay .
51
11
13,485
@ Override public void draw ( Canvas canvas ) { Barcode barcode = mBarcode ; if ( barcode == null ) { return ; } // Draws the bounding box around the barcode. RectF rect = getViewBoundingBox ( barcode ) ; canvas . drawRect ( rect , mOverlayPaint ) ; /** * Draw the top left corner */ canvas . drawLine ( rect . left , re...
Draws the barcode annotations for position size and raw value on the supplied canvas .
378
17
13,486
protected int addClasspathElements ( Collection < ? > elements , URL [ ] urls , int startPosition ) throws MojoExecutionException { for ( Object object : elements ) { try { if ( object instanceof Artifact ) { urls [ startPosition ] = ( ( Artifact ) object ) . getFile ( ) . toURI ( ) . toURL ( ) ; } else if ( object ins...
Add classpath elements to a classpath URL set
203
10
13,487
public Collection < File > getClasspath ( String scope ) throws MojoExecutionException { try { Collection < File > files = classpathBuilder . buildClasspathList ( getProject ( ) , scope , getProjectArtifacts ( ) , isGenerator ( ) ) ; if ( getLog ( ) . isDebugEnabled ( ) ) { getLog ( ) . debug ( "GWT SDK execution class...
Build the GWT classpath for the specified scope
152
10
13,488
private void checkGwtUserVersion ( ) throws MojoExecutionException { InputStream inputStream = Thread . currentThread ( ) . getContextClassLoader ( ) . getResourceAsStream ( "org/codehaus/mojo/gwt/mojoGwtVersion.properties" ) ; Properties properties = new Properties ( ) ; try { properties . load ( inputStream ) ; } cat...
Check gwt - user dependency matches plugin version
312
9
13,489
public String getProjectName ( MavenProject project ) { File dotProject = new File ( project . getBasedir ( ) , ".project" ) ; try { Xpp3Dom dom = Xpp3DomBuilder . build ( ReaderFactory . newXmlReader ( dotProject ) ) ; return dom . getChild ( "name" ) . getValue ( ) ; } catch ( Exception e ) { getLogger ( ) . warn ( "...
Read the Eclipse project name for . project file . Fall back to artifactId on error
116
17
13,490
private List < Artifact > getScopeArtifacts ( final MavenProject project , final String scope ) { if ( SCOPE_COMPILE . equals ( scope ) ) { return project . getCompileArtifacts ( ) ; } if ( SCOPE_RUNTIME . equals ( scope ) ) { return project . getRuntimeArtifacts ( ) ; } else if ( SCOPE_TEST . equals ( scope ) ) { retu...
Get artifacts for specific scope .
118
6
13,491
private List < String > getSourceRoots ( final MavenProject project , final String scope ) { if ( SCOPE_COMPILE . equals ( scope ) || SCOPE_RUNTIME . equals ( scope ) ) { return project . getCompileSourceRoots ( ) ; } else if ( SCOPE_TEST . equals ( scope ) ) { List < String > sourceRoots = new ArrayList < String > ( )...
Get source roots for specific scope .
156
7
13,492
private List < Resource > getResources ( final MavenProject project , final String scope ) { if ( SCOPE_COMPILE . equals ( scope ) || SCOPE_RUNTIME . equals ( scope ) ) { return project . getResources ( ) ; } else if ( SCOPE_TEST . equals ( scope ) ) { List < Resource > resources = new ArrayList < Resource > ( ) ; reso...
Get resources for specific scope .
134
6
13,493
private String getProjectReferenceId ( final String groupId , final String artifactId , final String version ) { return groupId + ":" + artifactId + ":" + version ; }
Cut from MavenProject . java
38
7
13,494
public String [ ] getModules ( ) { // module has higher priority if set by expression if ( module != null ) { return new String [ ] { module } ; } if ( modules == null ) { //Use a Set to avoid duplicate when user set src/main/java as <resource> Set < String > mods = new HashSet < String > ( ) ; Collection < String > so...
FIXME move to DefaultGwtModuleReader !
525
10
13,495
private boolean isDeprecated ( JavaMethod method ) { if ( method == null ) return false ; for ( Annotation annotation : method . getAnnotations ( ) ) { if ( "java.lang.Deprecated" . equals ( annotation . getType ( ) . getFullyQualifiedName ( ) ) ) { return true ; } } return method . getTagByName ( "deprecated" ) != nul...
Determine if a client service method is deprecated .
88
11
13,496
public Set < GwtModule > getInherits ( ) throws GwtModuleReaderException { if ( inherits != null ) { return inherits ; } inherits = new HashSet < GwtModule > ( ) ; addInheritedModules ( inherits , getLocalInherits ( ) ) ; return inherits ; }
Build the set of inhertied modules . Due to xml inheritence mecanism there may be cicles in the inheritence graph so we build a set of inherited modules
71
35
13,497
protected Collection < ResourceFile > getAllResourceFiles ( ) throws MojoExecutionException { try { Set < ResourceFile > sourcesAndResources = new HashSet < ResourceFile > ( ) ; Set < String > sourcesAndResourcesPath = new HashSet < String > ( ) ; sourcesAndResourcesPath . addAll ( getProject ( ) . getCompileSourceRoot...
Collect GWT java source code and module descriptor to be added as resources .
495
15
13,498
private String escapeHtml ( String html ) { if ( html == null ) { return null ; } return html . replaceAll ( "&" , "&amp;" ) . replaceAll ( "<" , "&lt;" ) . replaceAll ( ">" , "&gt;" ) ; }
Escape an html string . Escaping data received from the client helps to prevent cross - site script vulnerabilities .
62
22
13,499
public boolean parse ( String criteria , Map < String , ? extends Object > attributes ) throws CriteriaParseException { if ( criteria == null ) { return true ; } else { try { return Boolean . parseBoolean ( FREEMARKER_BUILTINS . eval ( criteria , attributes ) ) ; } catch ( TemplateException ex ) { throw new CriteriaPar...
Parses the provided criteria expression which must have a boolean value .
86
14