idx int64 0 165k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
125,500 | void registerEventBuses ( ) { if ( ! eventsRegistered ) { Mvc . graph ( ) . inject ( this ) ; eventBusV . register ( androidComponent ) ; eventsRegistered = true ; logger . trace ( "+Event2V bus registered for view - '{}'." , androidComponent . getClass ( ) . getSimpleName ( ) ) ; } else { logger . trace ( "!Event2V bu... | Register event bus for views . |
125,501 | void unregisterEventBuses ( ) { if ( eventsRegistered ) { eventBusV . unregister ( androidComponent ) ; eventsRegistered = false ; logger . trace ( "-Event2V bus unregistered for view - '{}' and its controllers." , androidComponent . getClass ( ) . getSimpleName ( ) ) ; Mvc . graph ( ) . release ( this ) ; } else { log... | Unregister event bus for views . |
125,502 | public void inject ( Object target , Class < ? extends Annotation > injectAnnotation ) throws ProvideException , ProviderMissingException , CircularDependenciesException { if ( monitors != null ) { int size = monitors . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { monitors . get ( i ) . onInject ( target ) ; } } do... | Inject all fields annotated by the given injectAnnotation |
125,503 | private void recordVisitField ( Object object , Field objectField , Field field ) { Map < String , Set < String > > bag = visitedFields . get ( object ) ; if ( bag == null ) { bag = new HashMap < > ( ) ; visitedFields . put ( object , bag ) ; } Set < String > fields = bag . get ( objectField ) ; String objectFiledKey =... | Records the field of a target object is visited |
125,504 | private boolean isFieldVisited ( Object object , Field objectField , Field field ) { Map < String , Set < String > > bag = visitedFields . get ( object ) ; if ( bag == null ) { return false ; } String objectFiledKey = objectField == null ? "" : objectField . toGenericString ( ) ; Set < String > fields = bag . get ( obj... | Indicates whether the field of a target object is visited |
125,505 | private void throwCircularDependenciesException ( ) throws CircularDependenciesException { String msg = "Circular dependencies found. Check the circular graph below:\n" ; boolean firstNode = true ; String tab = " " ; for ( String visit : visitedInjectNodes ) { if ( ! firstNode ) { msg += tab + "->" ; tab += tab ; } ms... | Print readable circular graph |
125,506 | protected List < ImageDTO > extractImagesFromCursor ( Cursor cursor , int offset , int limit ) { List < ImageDTO > images = new ArrayList < > ( ) ; int count = 0 ; int begin = offset > 0 ? offset : 0 ; if ( cursor . moveToPosition ( begin ) ) { do { ImageDTO image = extractOneImageFromCurrentCursor ( cursor ) ; images ... | Extract a list of imageDTO from current cursor with the given offset and limit . |
125,507 | protected List < VideoDTO > extractVideosFromCursor ( Cursor cursor , int offset , int limit ) { List < VideoDTO > videos = new ArrayList < > ( ) ; int count = 0 ; int begin = offset > 0 ? offset : 0 ; if ( cursor . moveToPosition ( begin ) ) { do { VideoDTO video = extractOneVideoFromCursor ( cursor ) ; videos . add (... | Extract a list of videoDTO from current cursor with the given offset and limit . |
125,508 | public static void setField ( Object obj , Field field , Object value ) { boolean accessible = field . isAccessible ( ) ; if ( ! accessible ) { field . setAccessible ( true ) ; } try { field . set ( obj , value ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } field . setAccessible ( accessible ) ;... | Sets value to the field of the given object . |
125,509 | public static Object getFieldValue ( Object obj , Field field ) { Object value = null ; boolean accessible = field . isAccessible ( ) ; if ( ! accessible ) { field . setAccessible ( true ) ; } try { value = field . get ( obj ) ; } catch ( IllegalAccessException e ) { e . printStackTrace ( ) ; } field . setAccessible ( ... | Gets value of the field of the given object . |
125,510 | public PageSnapshot highlight ( WebElement element ) { try { highlight ( element , Color . red , 3 ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE , rfe ) ; } return this ; } | Highlights WebElement within the page with Color . red and line width 3 . |
125,511 | public PageSnapshot highlight ( WebElement element , Color color , int lineWidth ) { try { image = ImageProcessor . highlight ( image , new Coordinates ( element , devicePixelRatio ) , color , lineWidth ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_ME... | Highlights WebElement within the page with provided color and line width . |
125,512 | public PageSnapshot blur ( WebElement element ) { try { image = ImageProcessor . blurArea ( image , new Coordinates ( element , devicePixelRatio ) ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE , rfe ) ; } return this ; } | Blur provided element within the page only . |
125,513 | public PageSnapshot monochrome ( WebElement element ) { try { image = ImageProcessor . monochromeArea ( image , new Coordinates ( element , devicePixelRatio ) ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE , rfe ) ; } return this ; } | Makes an element withing a page monochrome - applies gray - and - white filter . Original colors remain on the rest of the page . |
125,514 | public PageSnapshot blurExcept ( WebElement element ) { try { image = ImageProcessor . blurExceptArea ( image , new Coordinates ( element , devicePixelRatio ) ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_MESSAGE , rfe ) ; } return this ; } | Blurs all the page except the element provided . |
125,515 | public PageSnapshot cropAround ( WebElement element , int offsetX , int offsetY ) { try { image = ImageProcessor . cropAround ( image , new Coordinates ( element , devicePixelRatio ) , offsetX , offsetY ) ; } catch ( RasterFormatException rfe ) { throw new ElementOutsideViewportException ( ELEMENT_OUT_OF_VIEWPORT_EX_ME... | Crop the image around specified element with offset . |
125,516 | public static boolean imagesAreEqualsWithDiff ( BufferedImage image1 , BufferedImage image2 , String pathFileName , double deviation ) { BufferedImage output = new BufferedImage ( image1 . getWidth ( ) , image1 . getHeight ( ) , BufferedImage . TYPE_INT_RGB ) ; int width1 = image1 . getWidth ( null ) ; int width2 = ima... | Extends the functionality of imagesAreEqualsWithDiff but creates a third BufferedImage and applies pixel manipulation to it . |
125,517 | public DrawerProfile setAvatar ( Context context , Bitmap avatar ) { mAvatar = new BitmapDrawable ( context . getResources ( ) , avatar ) ; notifyDataChanged ( ) ; return this ; } | Sets an avatar image to the drawer profile |
125,518 | public DrawerProfile setRoundedAvatar ( Context context , Bitmap image ) { return setAvatar ( new RoundedAvatarDrawable ( new BitmapDrawable ( context . getResources ( ) , image ) . getBitmap ( ) ) ) ; } | Sets a rounded avatar image to the drawer profile |
125,519 | public DrawerProfile setBackground ( Context context , Bitmap background ) { mBackground = new BitmapDrawable ( context . getResources ( ) , background ) ; notifyDataChanged ( ) ; return this ; } | Sets a background to the drawer profile |
125,520 | public DrawerItem setImageMode ( int imageMode ) { if ( imageMode != ICON && imageMode != AVATAR && imageMode != SMALL_AVATAR ) { throw new IllegalArgumentException ( "Image mode must be either ICON or AVATAR." ) ; } mImageMode = imageMode ; notifyDataChanged ( ) ; return this ; } | Sets an image mode to the drawer item |
125,521 | public DrawerItem setTextSecondary ( String textSecondary , int textMode ) { mTextSecondary = textSecondary ; setTextMode ( textMode ) ; notifyDataChanged ( ) ; return this ; } | Sets a secondary text with a given text mode to the drawer item |
125,522 | public DrawerItem setTextMode ( int textMode ) { if ( textMode != SINGLE_LINE && textMode != TWO_LINE && textMode != THREE_LINE ) { throw new IllegalArgumentException ( "Image mode must be either SINGLE_LINE, TWO_LINE or THREE_LINE." ) ; } mTextMode = textMode ; notifyDataChanged ( ) ; return this ; } | Sets a text mode to the drawer item |
125,523 | public DrawerView addProfile ( DrawerProfile profile ) { if ( profile . getId ( ) <= 0 ) { profile . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerProfile oldProfile : mProfileAdapter . getItems ( ) ) { if ( oldProfile . getId ( ) == profile . getId ( ) ) { mProfileAda... | Adds a profile to the drawer view |
125,524 | public DrawerProfile findProfileById ( long id ) { for ( DrawerProfile profile : mProfileAdapter . getItems ( ) ) { if ( profile . getId ( ) == id ) { return profile ; } } return null ; } | Gets a profile from the drawer view |
125,525 | public DrawerView clearProfiles ( ) { for ( DrawerProfile profile : mProfileAdapter . getItems ( ) ) { profile . detach ( ) ; } mProfileAdapter . clear ( ) ; updateProfile ( ) ; return this ; } | Removes all profiles from the drawer view |
125,526 | public DrawerView addItems ( List < DrawerItem > items ) { mAdapter . setNotifyOnChange ( false ) ; for ( DrawerItem item : items ) { if ( item . getId ( ) <= 0 ) { item . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerItem oldItem : mAdapter . getItems ( ) ) { if ( old... | Adds items to the drawer view |
125,527 | public DrawerView addItem ( DrawerItem item ) { if ( item . getId ( ) <= 0 ) { item . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerItem oldItem : mAdapter . getItems ( ) ) { if ( oldItem . getId ( ) == item . getId ( ) ) { mAdapter . remove ( oldItem ) ; break ; } } i... | Adds an item to the drawer view |
125,528 | public DrawerItem findItemById ( long id ) { for ( DrawerItem item : mAdapter . getItems ( ) ) { if ( item . getId ( ) == id ) { return item ; } } return null ; } | Gets an item from the drawer view |
125,529 | public DrawerView selectItemById ( long id ) { mAdapterFixed . clearSelection ( ) ; int count = mAdapter . getCount ( ) ; for ( int i = 0 ; i < count ; i ++ ) { if ( mAdapter . getItem ( i ) . getId ( ) == id ) { mAdapter . select ( i ) ; return this ; } } return this ; } | Selects an item from the drawer view |
125,530 | public DrawerView clearItems ( ) { for ( DrawerItem item : mAdapter . getItems ( ) ) { item . detach ( ) ; } mAdapter . clear ( ) ; updateList ( ) ; return this ; } | Removes all items from the drawer view |
125,531 | public DrawerView addFixedItems ( List < DrawerItem > items ) { mAdapterFixed . setNotifyOnChange ( false ) ; for ( DrawerItem item : items ) { if ( item . getId ( ) <= 0 ) { item . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerItem oldItem : mAdapterFixed . getItems (... | Adds fixed items to the drawer view |
125,532 | public DrawerView addFixedItem ( DrawerItem item ) { if ( item . getId ( ) <= 0 ) { item . setId ( System . nanoTime ( ) * 100 + Math . round ( Math . random ( ) * 100 ) ) ; } for ( DrawerItem oldItem : mAdapterFixed . getItems ( ) ) { if ( oldItem . getId ( ) == item . getId ( ) ) { mAdapterFixed . remove ( oldItem ) ... | Adds a fixed item to the drawer view |
125,533 | public DrawerItem findFixedItemById ( long id ) { for ( DrawerItem item : mAdapterFixed . getItems ( ) ) { if ( item . getId ( ) == id ) { return item ; } } return null ; } | Gets a fixed item from the drawer view |
125,534 | public DrawerView clearFixedItems ( ) { for ( DrawerItem item : mAdapterFixed . getItems ( ) ) { item . detach ( ) ; } mAdapterFixed . clear ( ) ; updateFixedList ( ) ; return this ; } | Removes all fixed items from the drawer view |
125,535 | public void setAdapter ( ListAdapter adapter ) { if ( mAdapter != null ) { mAdapter . unregisterDataSetObserver ( mDataObserver ) ; } mAdapter = adapter ; if ( mAdapter != null ) { mAdapter . registerDataSetObserver ( mDataObserver ) ; mAreAllItemsSelectable = mAdapter . areAllItemsEnabled ( ) ; } setupChildren ( ) ; } | Sets the data behind this LinearListView . |
125,536 | public void setEmptyView ( View emptyView ) { mEmptyView = emptyView ; final ListAdapter adapter = getAdapter ( ) ; final boolean empty = ( ( adapter == null ) || adapter . isEmpty ( ) ) ; updateEmptyStatus ( empty ) ; } | Sets the view to show if the adapter is empty |
125,537 | private void fillBuffer ( ) throws IOException { if ( ! endOfInput && ( lastCoderResult == null || lastCoderResult . isUnderflow ( ) ) ) { encoderIn . compact ( ) ; int position = encoderIn . position ( ) ; int c = reader . read ( encoderIn . array ( ) , position , encoderIn . remaining ( ) ) ; if ( c == - 1 ) { endOfI... | Fills the internal char buffer from the reader . |
125,538 | public T header ( String name , String value ) { Collection < String > l = headers . get ( name ) ; if ( l == null ) { l = new ArrayList < String > ( ) ; } l . add ( value ) ; headers . put ( name , l ) ; return derived . cast ( this ) ; } | Add a header . |
125,539 | public T queryString ( String name , String value ) { List < String > l = queryString . get ( name ) ; if ( l == null ) { l = new ArrayList < String > ( ) ; } l . add ( value ) ; queryString . put ( name , l ) ; return derived . cast ( this ) ; } | Add a query param . |
125,540 | public static Link create ( final String text , final TextStyle ts , final NamedObject table ) { return new Link ( text , ts , '#' + table . getName ( ) ) ; } | Create a new styled Link to a table |
125,541 | public static Link create ( final String text , final NamedObject table ) { return new Link ( text , null , '#' + table . getName ( ) ) ; } | Create a new Link to a table |
125,542 | public static Link create ( final String text , final TextStyle ts , final String ref ) { return new Link ( text , ts , '#' + ref ) ; } | Create a new styled link to a given ref |
125,543 | public static Link create ( final String text , final String ref ) { return new Link ( text , null , '#' + ref ) ; } | Create a new link to a given ref |
125,544 | public static Link create ( final String text , final TextStyle ts , final File file ) { return new Link ( text , ts , file . toURI ( ) . toString ( ) ) ; } | Create a new styled link to a given file |
125,545 | public static Link create ( final String text , final File file ) { return new Link ( text , null , file . toURI ( ) . toString ( ) ) ; } | Create a new link to a given file |
125,546 | public static Link create ( final String text , final TextStyle ts , final URL url ) { return new Link ( text , ts , url . toString ( ) ) ; } | Create a new styled link to a given url |
125,547 | public static Link create ( final String text , final URL url ) { return new Link ( text , null , url . toString ( ) ) ; } | Create a new link to a given url |
125,548 | public TableCellStyleBuilder borderAll ( final Length size , final Color borderColor , final BorderAttribute . Style style ) { final BorderAttribute bs = new BorderAttribute ( size , borderColor , style ) ; this . bordersBuilder . all ( bs ) ; return this ; } | Add a border style for all the borders of this cell . |
125,549 | public TableCellStyleBuilder borderBottom ( final Length size , final Color borderColor , final BorderAttribute . Style style ) { final BorderAttribute bs = new BorderAttribute ( size , borderColor , style ) ; this . bordersBuilder . bottom ( bs ) ; return this ; } | Add a border style for the bottom border of this cell . |
125,550 | public TableCellStyleBuilder borderLeft ( final Length size , final Color borderColor , final BorderAttribute . Style style ) { final BorderAttribute bs = new BorderAttribute ( size , borderColor , style ) ; this . bordersBuilder . left ( bs ) ; return this ; } | Add a border style for the left border of this cell . |
125,551 | public TableCellStyleBuilder borderRight ( final Length size , final Color borderColor , final BorderAttribute . Style style ) { final BorderAttribute bs = new BorderAttribute ( size , borderColor , style ) ; this . bordersBuilder . right ( bs ) ; return this ; } | Add a border style for the right border of this cell . |
125,552 | public TableCellStyleBuilder borderTop ( final Length size , final Color borderColor , final BorderAttribute . Style style ) { final BorderAttribute bs = new BorderAttribute ( size , borderColor , style ) ; this . bordersBuilder . top ( bs ) ; return this ; } | Add a border style for the top border of this cell . |
125,553 | public boolean add ( final K key , final V value ) { final V curValue = this . valueByKey . get ( key ) ; if ( curValue == null ) { if ( this . mode == Mode . UPDATE ) return false ; } else { if ( this . mode == Mode . CREATE ) return false ; } if ( this . closed && ! this . valueByKey . containsKey ( key ) ) { throw n... | If mode is update then the key must exist . If the mode is create then the key must not exist . Otherwise the key may exist . If the container is frozen no new key - value pair is accepted . |
125,554 | public void appendEAttribute ( final Appendable appendable , final CharSequence attrName , final String attrRawValue ) throws IOException { appendable . append ( ' ' ) . append ( attrName ) . append ( "=\"" ) . append ( this . escaper . escapeXMLAttribute ( attrRawValue ) ) . append ( '"' ) ; } | Append a space and new element to the appendable element the name of the element is attrName and the value is attrRawValue . The will be escaped if necessary |
125,555 | public void appendAttribute ( final Appendable appendable , final CharSequence attrName , final boolean attrValue ) throws IOException { this . appendAttribute ( appendable , attrName , Boolean . toString ( attrValue ) ) ; } | Append a new element to the appendable element the name of the element is attrName and the value is the boolean attrValue . |
125,556 | public void appendAttribute ( final Appendable appendable , final CharSequence attrName , final CharSequence attrValue ) throws IOException { appendable . append ( ' ' ) . append ( attrName ) . append ( "=\"" ) . append ( attrValue ) . append ( '"' ) ; } | Append a space then a new element to the appendable element the name of the element is attrName and the value is attrValue . The value won t be escaped . |
125,557 | public void appendTag ( final Appendable appendable , final CharSequence tagName , final String content ) throws IOException { appendable . append ( '<' ) . append ( tagName ) . append ( '>' ) . append ( this . escaper . escapeXMLContent ( content ) ) . append ( "</" ) . append ( tagName ) . append ( '>' ) ; } | Append a content inside a tag |
125,558 | public static OdsFactory create ( final Logger logger , final Locale locale ) { final PositionUtil positionUtil = new PositionUtil ( new EqualityUtil ( ) , new TableNameUtil ( ) ) ; final WriteUtil writeUtil = WriteUtil . create ( ) ; final XMLUtil xmlUtil = XMLUtil . create ( ) ; final DataStyles format = DataStylesBu... | create an ods factory |
125,559 | private AnonymousOdsDocument createAnonymousDocument ( ) { final OdsElements odsElements = OdsElements . create ( this . positionUtil , this . xmlUtil , this . writeUtil , this . format , this . libreOfficeMode ) ; return AnonymousOdsDocument . create ( this . logger , this . xmlUtil , odsElements ) ; } | Create a new empty document for an anonymous writer . Use addTable to add tables . |
125,560 | private NamedOdsDocument createNamedDocument ( ) { final OdsElements odsElements = OdsElements . create ( this . positionUtil , this . xmlUtil , this . writeUtil , this . format , this . libreOfficeMode ) ; return NamedOdsDocument . create ( this . logger , this . xmlUtil , odsElements ) ; } | Create a new empty document for a normal writer . Use addTable to add tables . |
125,561 | public OdsFileWriterAdapter createWriterAdapter ( final File file ) throws IOException { final NamedOdsDocument document = this . createNamedDocument ( ) ; final ZipUTF8WriterBuilder zipUTF8Writer = ZipUTF8WriterImpl . builder ( ) . noWriterBuffer ( ) ; final OdsFileWriterAdapter writerAdapter = OdsFileWriterAdapter . ... | Create an adapter for a writer . |
125,562 | public Position getPosition ( final String pos ) { final String s = pos . toUpperCase ( Locale . US ) ; final int len = s . length ( ) ; int status = 0 ; int row = 0 ; int col = 0 ; int n = 0 ; while ( n < len ) { final char c = s . charAt ( n ) ; switch ( status ) { case BEGIN_LETTER : case BEGIN_DIGIT : status ++ ; i... | Convert a cell position string like B3 to the column number . |
125,563 | public static Color fromRGB ( final int red , final int green , final int blue ) { if ( ColorHelper . helper == null ) ColorHelper . helper = new ColorHelper ( ) ; return ColorHelper . helper . getFromRGB ( red , green , blue ) ; } | Create a color from RGB values |
125,564 | public Color getFromRGB ( final int red , final int green , final int blue ) { return this . getFromString ( "#" + this . toHexString ( red ) + this . toHexString ( green ) + this . toHexString ( blue ) ) ; } | Helper function to create any available color string from color values . |
125,565 | public static FractionStyleBuilder create ( final String name , final Locale locale ) { checker . checkStyleName ( name ) ; return new FractionStyleBuilder ( name , locale ) ; } | Create a new number style builder with the name name minimum integer digits is minIntDigits and decimal places is decPlaces . |
125,566 | public void appendXMLToTable ( final XMLUtil util , final Appendable appendable , final int count ) throws IOException { appendable . append ( "<table:table-column" ) ; util . appendEAttribute ( appendable , "table:style-name" , this . name ) ; if ( count > 1 ) util . appendAttribute ( appendable , "table:number-column... | Append the XML to the table representation |
125,567 | public void addToContentStyles ( final StylesContainer stylesContainer ) { stylesContainer . addContentStyle ( this ) ; if ( this . defaultCellStyle != null ) { stylesContainer . addContentStyle ( this . defaultCellStyle ) ; } } | Add this style to a styles container |
125,568 | private void setDateTimeNow ( ) { final Date dt = new Date ( ) ; this . dateTime = MetaElement . DF_DATE . format ( dt ) + "T" + MetaElement . DF_TIME . format ( dt ) ; } | Store the date and time of the document creation in the MetaElement data . |
125,569 | synchronized public E get ( ) { if ( this . isClosed ( ) ) throw new NoSuchElementException ( ) ; while ( this . elements . isEmpty ( ) ) { try { this . wait ( ) ; } catch ( final InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; } } return this . elements . remo... | Get an element from the bus . Blocking method . |
125,570 | public static boolean openFile ( final File f ) { if ( desktop != null && f . exists ( ) && f . isFile ( ) ) { try { desktop . open ( f ) ; return true ; } catch ( final IOException e ) { Logger . getLogger ( FastOds . class . getName ( ) ) . log ( Level . SEVERE , "Can't open file " + f + " in appropriate application"... | Opens a file with the default application . |
125,571 | public void saveAs ( final File file ) throws IOException { try { final FileOutputStream out = new FileOutputStream ( file ) ; try { this . save ( out ) ; } finally { out . flush ( ) ; out . close ( ) ; } } catch ( final FileNotFoundException e ) { this . logger . log ( Level . SEVERE , "Can't open " + file , e ) ; thr... | Save the new file . |
125,572 | public void saveAs ( final String filename , final ZipUTF8WriterBuilder builder ) throws IOException { try { final FileOutputStream out = new FileOutputStream ( filename ) ; final ZipUTF8Writer writer = builder . build ( out ) ; try { this . save ( writer ) ; } finally { writer . close ( ) ; } } catch ( final FileNotFo... | Save the document to filename . |
125,573 | public F content ( final String string ) { this . curRegionBox . set ( Text . content ( string ) ) ; return ( F ) this ; } | Set the text content of the section |
125,574 | public static Footer simpleFooter ( final String text , final TextStyle ts ) { return new SimplePageSectionBuilder ( ) . text ( Text . styledContent ( text , ts ) ) . buildFooter ( ) ; } | Create a simple footer with a styled text |
125,575 | public static Header simpleHeader ( final String text , final TextStyle ts ) { return new SimplePageSectionBuilder ( ) . text ( Text . styledContent ( text , ts ) ) . buildHeader ( ) ; } | Create a simple header with a styled text |
125,576 | public BordersBuilder all ( final Length size , final Color color , final BorderAttribute . Style style ) { return this . all ( new BorderAttribute ( size , color , style ) ) ; } | Set all borders |
125,577 | public TableCellStyle addChildCellStyle ( final TableCellStyle style , final TableCell . Type type ) { final TableCellStyle newStyle ; final DataStyle dataStyle = this . format . getDataStyle ( type ) ; if ( dataStyle == null ) { newStyle = style ; } else { newStyle = this . stylesContainer . addChildCellStyle ( style ... | Create an automatic style for this TableCellStyle and this type of cell . Do not produce any effect if the type is Type . STRING or Type . VOID . |
125,578 | public void flushRows ( final XMLUtil util , final ZipUTF8Writer writer , final SettingsElement settingsElement ) throws IOException { this . ensureContentBegin ( util , writer ) ; final int lastTableIndex = this . tables . size ( ) - 1 ; if ( lastTableIndex == - 1 ) return ; int tableIndex = this . flushPosition . get... | Flush the rows from the last position to the current position |
125,579 | public void flushTables ( final XMLUtil util , final ZipUTF8Writer writer ) throws IOException { this . ensureContentBegin ( util , writer ) ; final int lastTableIndex = this . tables . size ( ) - 1 ; if ( lastTableIndex < 0 ) return ; int tableIndex = this . flushPosition . getTableIndex ( ) ; Table table = this . tab... | Flush the tables . |
125,580 | public void writePostamble ( final XMLUtil util , final ZipUTF8Writer writer ) throws IOException { if ( this . autofilters != null ) this . appendAutofilters ( writer , util ) ; writer . write ( "</office:spreadsheet>" ) ; writer . write ( "</office:body>" ) ; writer . write ( "</office:document-content>" ) ; writer .... | Write the postamble into the given writer . Used by the FinalizeFlusher and by standard write method |
125,581 | public void writePreamble ( final XMLUtil util , final ZipUTF8Writer writer ) throws IOException { writer . putNextEntry ( new ZipEntry ( "content.xml" ) ) ; writer . write ( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" ) ; writer . write ( "<office:document-content xmlns:office=\"urn:oasis:names:tc:opendocument:xmlns:... | Write the preamble into the given writer . Used by the MetaAndStylesElementsFlusher and by standard write method |
125,582 | public TextBuilder parStyledContent ( final String text , final TextStyle ts ) { return this . par ( ) . styledSpan ( text , ts ) ; } | Create a new paragraph with a text content |
125,583 | public void addChildCellStyle ( final TableCellStyle style , final TableCell . Type type ) { this . odsElements . addChildCellStyle ( style , type ) ; } | Add a cell style for a given data type . Use only if you want to flush data before the end of the document construction . Do not produce any effect if the type is Type . STRING or Type . VOID |
125,584 | public static PreprocessedRowsFlusher create ( final XMLUtil xmlUtil , final List < TableRow > tableRows ) throws IOException { return new PreprocessedRowsFlusher ( xmlUtil , tableRows , new StringBuilder ( STRING_BUILDER_SIZE ) ) ; } | Create an new rows flusher |
125,585 | public static Text styledContent ( final String text , final TextStyle ts ) { return Text . builder ( ) . parStyledContent ( text , ts ) . build ( ) ; } | Create a simple Text object with a style |
125,586 | public synchronized void flushAdaptee ( ) throws IOException { OdsFlusher flusher = this . flushers . poll ( ) ; if ( flusher == null ) return ; while ( flusher != null ) { this . adaptee . update ( flusher ) ; if ( flusher . isEnd ( ) ) { this . stopped = true ; this . notifyAll ( ) ; return ; } flusher = this . flush... | Flushes all available flushers to the adaptee writer . The thread falls asleep if we reach the end of the queue without a FinalizeFlusher . |
125,587 | public synchronized void waitForData ( ) { while ( this . flushers . isEmpty ( ) && this . isNotStopped ( ) ) { try { this . wait ( ) ; } catch ( final InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new RuntimeException ( e ) ; } } } | wait for the data |
125,588 | public String escapeTableName ( final String tableName ) { boolean toQuote = false ; int apostropheCount = 0 ; for ( int i = 0 ; i < tableName . length ( ) ; i ++ ) { final char c = tableName . charAt ( i ) ; if ( Character . isWhitespace ( c ) || c == '.' ) { toQuote = true ; } else if ( c == '\'' ) { toQuote = true ;... | 9 . 2 . 1 Referencing Table Cells |
125,589 | public TableCellStyle addChildCellStyle ( final TableCellStyle style , final DataStyle dataStyle ) { final ChildCellStyle childKey = new ChildCellStyle ( style , dataStyle ) ; TableCellStyle anonymousStyle = this . anonymousStyleByChildCellStyle . get ( childKey ) ; if ( anonymousStyle == null ) { this . addDataStyle (... | Add a child style that mixes the cell style with a data style to the container |
125,590 | public boolean addDataStyle ( final DataStyle dataStyle ) { if ( dataStyle . isHidden ( ) ) { return this . dataStylesContainer . add ( dataStyle . getName ( ) , Dest . CONTENT_AUTOMATIC_STYLES , dataStyle ) ; } else { return this . dataStylesContainer . add ( dataStyle . getName ( ) , Dest . STYLES_COMMON_STYLES , dat... | Create a new data style into styles container . No duplicate style name is allowed . Must be used if the table - cell style already exists . |
125,591 | public boolean addMasterPageStyle ( final MasterPageStyle masterPageStyle ) { if ( this . masterPageStylesContainer . add ( masterPageStyle . getName ( ) , masterPageStyle ) ) { masterPageStyle . addEmbeddedStyles ( this ) ; return true ; } else return false ; } | Create a new master page style into styles container . No duplicate style name is allowed . |
125,592 | public boolean addNewDataStyleFromCellStyle ( final TableCellStyle style ) { final boolean ret = this . addContentStyle ( style ) ; return this . addDataStyle ( style . getDataStyle ( ) ) && ret ; } | Add the data style taken from a cell style |
125,593 | public boolean addPageStyle ( final PageStyle ps ) { boolean ret = this . addMasterPageStyle ( ps . getMasterPageStyle ( ) ) ; ret = this . addPageLayoutStyle ( ps . getPageLayoutStyle ( ) ) && ret ; return ret ; } | Add a page style |
125,594 | public void writeContentAutomaticStyles ( final XMLUtil util , final Appendable appendable ) throws IOException { final Iterable < ObjectStyle > styles = this . objectStylesContainer . getValues ( Dest . CONTENT_AUTOMATIC_STYLES ) ; for ( final ObjectStyle style : styles ) assert style . isHidden ( ) : style . toString... | Write the various styles in the automatic styles . |
125,595 | public RegionPageSectionBuilder region ( final PageSectionContent . Region region ) { switch ( region ) { case LEFT : this . curRegionBox = this . leftRegionBox ; break ; case CENTER : this . curRegionBox = this . centerRegionBox ; break ; case RIGHT : this . curRegionBox = this . rightRegionBox ; break ; default : thr... | Switch to a new region |
125,596 | public boolean add ( final K key , final S subcontainer , final V value ) { final S curSubcontainer = this . subcontainerByKey . get ( key ) ; if ( curSubcontainer == null ) { if ( this . mode == Mode . UPDATE ) return false ; } else { if ( this . mode == Mode . CREATE ) return false ; if ( subcontainer != curSubcontai... | Add a value to this multi container |
125,597 | public void setTooltip ( final String tooltip ) { String escapedXMLContent = this . xmlUtil . escapeXMLContent ( tooltip ) ; if ( escapedXMLContent . contains ( "\n" ) ) { escapedXMLContent = escapedXMLContent . replaceAll ( "\r?\n" , "</text:p><text:p>" ) ; } this . tooltip = escapedXMLContent ; } | Set a tooltip |
125,598 | public void setTooltip ( final String tooltip , final Length width , final Length height , final boolean visible ) { this . setTooltip ( tooltip ) ; this . tooltipParameter = TooltipParameter . create ( width , height , visible ) ; } | Set a tooltip of a given size |
125,599 | public ParagraphBuilder span ( final String text ) { final ParagraphElement paragraphElement = new Span ( text ) ; this . paragraphElements . add ( paragraphElement ) ; return this ; } | Create a span in the current paragraph . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.