idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
13,400 | public static String getFirstAuthorizationGrant ( RamlAction action , RamlRoot document ) { List < String > grants = getAuthorizationGrants ( action , document ) ; if ( grants . isEmpty ( ) ) { return null ; } return grants . get ( 0 ) ; } | Returns authorization grant for provided action . It searches for authorization grants defined for provided action some of parent resources or the root of the document . If authorization grants found is a list - the method will return the first grant in the list . |
13,401 | public static List < String > removeDuplicates ( List < String > list ) { return list . stream ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; } | Remove duplicates from provided list . |
13,402 | public static String getFormat ( TypeDeclaration param ) { if ( param == null ) { return null ; } if ( param instanceof NumberTypeDeclaration ) { return ( ( NumberTypeDeclaration ) param ) . format ( ) ; } if ( param instanceof DateTimeTypeDeclaration ) { return ( ( DateTimeTypeDeclaration ) param ) . format ( ) ; } re... | IF it has a format defined this will return it |
13,403 | public static String getDescription ( TypeDeclaration type ) { if ( type == null || type . description ( ) == null ) { return null ; } else { return type . description ( ) . value ( ) ; } } | Safely get description from a type with null checks |
13,404 | public static String getExample ( TypeDeclaration type ) { if ( type == null || type . example ( ) == null ) { return null ; } else { return type . example ( ) . value ( ) ; } } | Safely get example from a type with null checks |
13,405 | public static String getDisplayName ( TypeDeclaration type ) { if ( type == null || type . displayName ( ) == null ) { return null ; } else { return type . displayName ( ) . value ( ) ; } } | Safely get Display name from a type with null checks |
13,406 | public static boolean isRequired ( TypeDeclaration type ) { if ( type == null || type . required ( ) == null ) { return true ; } else { return type . required ( ) ; } } | Safely get required from a type with null checks |
13,407 | public boolean isArray ( ) { if ( type == null ) { return false ; } return type . isArray ( ) || List . class . isAssignableFrom ( type ) || Set . class . isAssignableFrom ( type ) ; } | Quick check to see if this is an array type or not |
13,408 | public static String convertContentTypeToQualifier ( String contentType ) { if ( contentType . equals ( MediaType . APPLICATION_JSON_VALUE ) ) { return "AsJson" ; } if ( contentType . equals ( MediaType . APPLICATION_OCTET_STREAM_VALUE ) ) { return "AsBinary" ; } if ( contentType . equals ( MediaType . TEXT_PLAIN_VALUE... | Converts an http contentType into a qualifier that can be used within a Java method |
13,409 | public static List < String > extractUriParams ( String url ) { List < String > outParams = new ArrayList < > ( ) ; if ( StringUtils . hasText ( url ) ) { String [ ] split = StringUtils . split ( url , "/" ) ; for ( String part : split ) { int indexOfStart = part . indexOf ( "{" ) ; int indexOfEnd = part . indexOf ( "}... | Extracts a list of URI Parameters from a url |
13,410 | public static boolean isValidJavaClassName ( String input ) { if ( ! StringUtils . hasText ( input ) ) { return false ; } if ( ! Character . isJavaIdentifierStart ( input . charAt ( 0 ) ) ) { return false ; } if ( input . length ( ) > 1 ) { for ( int i = 1 ; i < input . length ( ) ; i ++ ) { if ( ! Character . isJavaId... | Utility method to check if a string can be used as a valid class name |
13,411 | public static String getAllResourcesNames ( String url , boolean singularize ) { StringBuilder stringBuilder = new StringBuilder ( ) ; if ( StringUtils . hasText ( url ) ) { String [ ] resources = SLASH . split ( url ) ; int lengthCounter = 0 ; for ( int i = resources . length - 1 ; i >= Config . getResourceTopLevelInC... | Attempts to infer the name of a resource from a resources s full URL . |
13,412 | public static String singularize ( String target ) { String result = Inflector . singularize ( target ) ; if ( ( target . endsWith ( "ss" ) ) && ( result . equals ( target . substring ( 0 , target . length ( ) - 1 ) ) ) ) { result = target ; } return result ; } | Singularises a string . uses underlying raml parser system |
13,413 | public static String cleanNameForJavaEnum ( String enumConstant ) { if ( ! StringUtils . hasText ( enumConstant ) ) { return enumConstant ; } List < String > nameGroups = new ArrayList < > ( asList ( splitByCharacterTypeCamelCase ( enumConstant ) ) ) ; nameGroups . removeIf ( s -> containsOnly ( s . replaceAll ( ILLEGA... | Cleans a string with characters that are not valid as a java identifier enum |
13,414 | private static String convertActionTypeToIntent ( RamlActionType actionType , boolean isIdInPath ) { switch ( actionType ) { case DELETE : return "delete" ; case GET : return "get" ; case POST : if ( ! isIdInPath ) { return "create" ; } case PUT : return "update" ; case PATCH : return "modify" ; default : return "do" ;... | Attempts to convert the Http Verb into a textual representation of Intent based on REST conventions |
13,415 | private void loadInfosFromSettings ( ScmProviderRepositoryWithHost repo ) { if ( username == null || password == null ) { String host = repo . getHost ( ) ; int port = repo . getPort ( ) ; if ( port > 0 ) { host += ":" + port ; } Server server = this . settings . getServer ( host ) ; if ( server != null ) { setPassword... | Load username password from settings . |
13,416 | protected InfoScmResult info ( ScmRepository repository , ScmFileSet fileSet ) throws ScmException { CommandParameters commandParameters = new CommandParameters ( ) ; if ( GitScmProviderRepository . PROTOCOL_GIT . equals ( scmManager . getProviderByRepository ( repository ) . getScmType ( ) ) && this . shortRevisionLen... | Get info from scm . |
13,417 | private String format ( Object [ ] arguments ) { Locale l = Locale . getDefault ( ) ; if ( locale != null ) { String [ ] parts = locale . split ( "_" , 3 ) ; if ( parts . length <= 1 ) { l = new Locale ( locale ) ; } else if ( parts . length == 2 ) { l = new Locale ( parts [ 0 ] , parts [ 1 ] ) ; } else { l = new Local... | Formats the given argument using the configured format template and locale . |
13,418 | public String getScmBranch ( ) throws MojoExecutionException { try { ScmRepository repository = getScmRepository ( ) ; ScmProvider provider = scmManager . getProviderByRepository ( repository ) ; if ( GitScmProviderRepository . PROTOCOL_GIT . equals ( provider . getScmType ( ) ) ) { ScmFileSet fileSet = new ScmFileSet ... | Get the branch info for this revision from the repository . For svn it is in svn info . |
13,419 | public String getRevision ( ) throws MojoExecutionException { if ( format != null && ! useScm ) { return revision ; } useScm = false ; try { return this . getScmRevision ( ) ; } catch ( ScmException e ) { if ( ! StringUtils . isEmpty ( revisionOnScmFailure ) ) { getLog ( ) . warn ( "Cannot get the revision information ... | Get the revision info from the repository . For svn it is svn info |
13,420 | public CreateIssueParams estimatedHours ( BigDecimal estimatedHours ) { if ( estimatedHours == null ) { parameters . add ( new NameValuePair ( "estimatedHours" , "" ) ) ; } else { parameters . add ( new NameValuePair ( "estimatedHours" , estimatedHours . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toPlainString ( ) )... | Sets the issue estimate hours . |
13,421 | public CreateIssueParams actualHours ( BigDecimal actualHours ) { if ( actualHours == null ) { parameters . add ( new NameValuePair ( "actualHours" , "" ) ) ; } else { parameters . add ( new NameValuePair ( "actualHours" , actualHours . setScale ( 2 , BigDecimal . ROUND_HALF_UP ) . toPlainString ( ) ) ) ; } return this... | Sets the issue actual hours . |
13,422 | public CreateIssueParams milestoneIds ( List milestoneIds ) { for ( Object milestoneId : milestoneIds ) { parameters . add ( new NameValuePair ( "milestoneId[]" , milestoneId . toString ( ) ) ) ; } return this ; } | Sets the issue milestones . |
13,423 | public CreateIssueParams notifiedUserIds ( List notifiedUserIds ) { for ( Object notifiedUserId : notifiedUserIds ) { parameters . add ( new NameValuePair ( "notifiedUserId[]" , notifiedUserId . toString ( ) ) ) ; } return this ; } | Sets the issue notified users . |
13,424 | public CreateIssueParams textCustomFields ( List < CustomFiledValue > customFieldValueList ) { for ( CustomFiledValue customFiledValue : customFieldValueList ) { textCustomField ( customFiledValue ) ; } return this ; } | Sets the text type custom field with Map . |
13,425 | 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 . |
13,426 | public CreateIssueParams multipleListCustomFields ( List < CustomFiledItems > customFiledItemsList ) { for ( CustomFiledItems customFiledItems : customFiledItemsList ) { multipleListCustomField ( customFiledItems ) ; } return this ; } | Sets the multiple list type custom field with Map . |
13,427 | public String getSharedFileEndpoint ( Object projectIdOrKey , Object sharedFileId ) throws BacklogException { return buildEndpoint ( "projects/" + projectIdOrKey + "/files/" + sharedFileId ) ; } | Returns the endpoint of shared file . |
13,428 | public String getWikiAttachmentEndpoint ( Object wikiId , Object attachmentId ) throws BacklogException { return buildEndpoint ( "wikis/" + wikiId + "/attachments/" + attachmentId ) ; } | Returns the endpoint of Wiki page s attachment file . |
13,429 | public CreateWebhookParams description ( String description ) { String value = ( description == null ) ? "" : description ; parameters . add ( new NameValuePair ( "description" , value ) ) ; return this ; } | Sets the description parameter . |
13,430 | public AddPullRequestCommentParams notifiedUserIds ( List < Long > notifiedUserIds ) { for ( Long notifiedUserId : notifiedUserIds ) { parameters . add ( new NameValuePair ( "notifiedUserId[]" , String . valueOf ( notifiedUserId ) ) ) ; } return this ; } | Sets the notified users . |
13,431 | 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 . |
13,432 | 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 . |
13,433 | public void encodeEnd ( final FacesContext context , final UIComponent component ) throws IOException { final ResponseWriter responseWriter = context . getResponseWriter ( ) ; final Sheet sheet = ( Sheet ) component ; sheet . updateColumnMappings ( ) ; sheet . sortAndFilter ( ) ; encodeMarkup ( context , sheet , respon... | Encodes the Sheet component |
13,434 | protected void encodeMarkup ( final FacesContext context , final Sheet sheet , final ResponseWriter responseWriter ) throws IOException { final String styleClass = sheet . getStyleClass ( ) ; final String clientId = sheet . getClientId ( context ) ; final Integer width = sheet . getWidth ( ) ; final Integer height = sh... | Encodes the HTML markup for the sheet . |
13,435 | 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 . |
13,436 | 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 . |
13,437 | 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 |
13,438 | 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 . |
13,439 | 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 { final Strin... | Encode a single row . |
13,440 | 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 |
13,441 | private void encodeFooter ( final FacesContext context , final ResponseWriter responseWriter , final Sheet sheet ) throws IOException { final UIComponent footer = sheet . getFacet ( "footer" ) ; if ( footer != null ) { responseWriter . startElement ( "div" , null ) ; responseWriter . writeAttribute ( "class" , "ui-data... | Encode the sheet footer |
13,442 | private void encodeHeader ( final FacesContext context , final ResponseWriter responseWriter , final Sheet sheet ) throws IOException { final UIComponent header = sheet . getFacet ( "header" ) ; if ( header != null ) { responseWriter . startElement ( "div" , null ) ; responseWriter . writeAttribute ( "class" , "ui-data... | Encode the Sheet header |
13,443 | 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 . |
13,444 | 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 . |
13,445 | 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 |
13,446 | private void decodeSelection ( final FacesContext context , final Sheet sheet , final String jsonSelection ) { if ( LangUtils . isValueBlank ( jsonSelection ) ) { return ; } try { final JSONArray array = new JSONArray ( jsonSelection ) ; sheet . setSelectedRow ( array . getInt ( 0 ) ) ; sheet . setSelectedColumn ( shee... | Decodes the user Selection JSON data |
13,447 | private void decodeSubmittedValues ( final FacesContext context , final Sheet sheet , final String jsonData ) { if ( LangUtils . isValueBlank ( jsonData ) ) { return ; } try { final JSONObject obj = new JSONObject ( jsonData ) ; final Iterator < String > keys = obj . keys ( ) ; while ( keys . hasNext ( ) ) { final Stri... | Converts the JSON data received from the in the request params into our sumitted values map . The map is cleared first . |
13,448 | 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 . |
13,449 | 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 .... |
13,450 | 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 . |
13,451 | 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 . |
13,452 | public RequestParameterBuilder reset ( ) { buffer = new StringBuilder ( originalUrl ) ; jsonConverter . setType ( null ) ; added = false ; return this ; } | Resets the internal state in order to be reused . |
13,453 | 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 . |
13,454 | 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 . |
13,455 | 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 . |
13,456 | 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 . |
13,457 | 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 . |
13,458 | public void reset ( ) { resetSubmitted ( ) ; resetSort ( ) ; resetInvalidUpdates ( ) ; localValues . clear ( ) ; for ( final SheetColumn c : getColumns ( ) ) { c . setFilterValue ( null ) ; } } | Resets all filters sorting and submitted values . |
13,459 | 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 . |
13,460 | 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 . |
13,461 | public void setLocalValue ( final String rowKey , final int col , final Object value ) { localValues . put ( new SheetRowColIndex ( rowKey , col ) , value ) ; } | Updates a local value . |
13,462 | 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 . |
13,463 | 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 . |
13,464 | public Object getValueForCell ( final FacesContext context , final String rowKey , final int col ) { final SheetRowColIndex index = new SheetRowColIndex ( rowKey , col ) ; if ( localValues . containsKey ( index ) ) { return localValues . get ( index ) ; } setRowVar ( context , rowKey ) ; final SheetColumn column = getC... | Gets the object value of the row and col specified . If a local value exists that is returned otherwise the actual value is return . |
13,465 | public String getRenderValueForCell ( final FacesContext context , final String rowKey , final int col ) { final SheetRowColIndex index = new SheetRowColIndex ( rowKey , col ) ; if ( submittedValues . containsKey ( index ) ) { return submittedValues . get ( index ) ; } final Object value = getValueForCell ( context , r... | Gets the render string for the value the given cell . Applys the available converters to convert the value . |
13,466 | 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 |
13,467 | public List < Object > getSortedValues ( ) { List < Object > filtered = getFilteredValue ( ) ; if ( filtered == null || filtered . isEmpty ( ) ) { filtered = sortAndFilter ( ) ; } return filtered ; } | The sorted list of values . |
13,468 | 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 . |
13,469 | 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 |
13,470 | 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 . getELContext ( ) ) ; i... | Gets the rowKey for the current row |
13,471 | 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 . |
13,472 | 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 . |
13,473 | public void validate ( final FacesContext context ) { final Iterator < Entry < SheetRowColIndex , String > > entries = submittedValues . entrySet ( ) . iterator ( ) ; final boolean hadBadUpdates = ! getInvalidUpdates ( ) . isEmpty ( ) ; getInvalidUpdates ( ) . clear ( ) ; while ( entries . hasNext ( ) ) { final Entry <... | 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 . |
13,474 | 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 ( ) ; values [... | Saves the state of the submitted and local values and the bad updates . |
13,475 | 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 [ 2 ] ; fina... | Restores the state for the submitted local and bad values . |
13,476 | 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 . |
13,477 | 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 |
13,478 | 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 |
13,479 | 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 . |
13,480 | 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 . |
13,481 | 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 . |
13,482 | 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 |
13,483 | public Integer getHeight ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . height ) ; if ( result == null ) { return null ; } 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 . |
13,484 | public void setFilteredValue ( final java . util . List _filteredValue ) { getStateHelper ( ) . put ( PropertyKeys . filteredValue , _filteredValue ) ; } | Sets the filtered list . |
13,485 | public String getStyle ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . style , null ) ; if ( result == null ) { return null ; } return result . toString ( ) ; } | The style value |
13,486 | public String getSortOrder ( ) { final String result = ( String ) getStateHelper ( ) . eval ( PropertyKeys . sortOrder , SortOrder . ASCENDING . toString ( ) ) ; return result ; } | The sort direction |
13,487 | public void setSortOrder ( final java . lang . String sortOrder ) { final String orig = ( String ) getStateHelper ( ) . get ( PropertyKeys . origSortOrder ) ; if ( orig == null ) { getStateHelper ( ) . put ( PropertyKeys . origSortOrder , getStateHelper ( ) . eval ( PropertyKeys . sortOrder ) ) ; } getStateHelper ( ) .... | Update the sort direction |
13,488 | 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 . |
13,489 | 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 . |
13,490 | private void encodeIcon ( final FacesContext context , final SlideOut slideOut ) throws IOException { if ( slideOut . getIcon ( ) == null ) { return ; } String icon = slideOut . getIcon ( ) . trim ( ) ; if ( icon . startsWith ( "ui" ) ) { icon = "ui-icon " + icon + " ui-slideouttab-icon" ; } final ResponseWriter writer... | HTML markup for the tab handle icon if defined . |
13,491 | public DynaFormRow createRegularRow ( ) { final DynaFormRow dynaFormRow = new DynaFormRow ( regularRows . size ( ) + 1 , false , this ) ; regularRows . add ( dynaFormRow ) ; return dynaFormRow ; } | Creates a new regular row . |
13,492 | 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 . |
13,493 | 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 . |
13,494 | 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 . |
13,495 | 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 . |
13,496 | 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 |
13,497 | public JavascriptVarBuilder closeVar ( ) { if ( isObject ) { sb . append ( "}" ) ; } else { sb . append ( "]" ) ; } if ( isVar ) { sb . append ( ";" ) ; } return this ; } | Closes the array or object . |
13,498 | public String getHeaderText ( ) { final Object result = getStateHelper ( ) . eval ( PropertyKeys . headerText , null ) ; if ( result == null ) { return null ; } return result . toString ( ) ; } | The fixed column count . |
13,499 | 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 . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.