Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

XSSFBRichTextString.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* ====================================================================
  2. Licensed to the Apache Software Foundation (ASF) under one or more
  3. contributor license agreements. See the NOTICE file distributed with
  4. this work for additional information regarding copyright ownership.
  5. The ASF licenses this file to You under the Apache License, Version 2.0
  6. (the "License"); you may not use this file except in compliance with
  7. the License. You may obtain a copy of the License at
  8. http://www.apache.org/licenses/LICENSE-2.0
  9. Unless required by applicable law or agreed to in writing, software
  10. distributed under the License is distributed on an "AS IS" BASIS,
  11. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. See the License for the specific language governing permissions and
  13. limitations under the License.
  14. ==================================================================== */
  15. package org.apache.poi.xssf.binary;
  16. import org.apache.poi.ss.usermodel.Font;
  17. import org.apache.poi.util.Internal;
  18. import org.apache.poi.xssf.usermodel.XSSFRichTextString;
  19. /**
  20. * Wrapper class around String so that we can use it in Comment.
  21. * Nothing has been implemented yet except for {@link #getString()}.
  22. */
  23. @Internal
  24. class XSSFBRichTextString extends XSSFRichTextString {
  25. private final String string;
  26. XSSFBRichTextString(String string) {
  27. this.string = string;
  28. }
  29. @Override
  30. public void applyFont(int startIndex, int endIndex, short fontIndex) {
  31. }
  32. @Override
  33. public void applyFont(int startIndex, int endIndex, Font font) {
  34. }
  35. @Override
  36. public void applyFont(Font font) {
  37. }
  38. @Override
  39. public void clearFormatting() {
  40. }
  41. @Override
  42. public String getString() {
  43. return string;
  44. }
  45. @Override
  46. public int length() {
  47. return string.length();
  48. }
  49. @Override
  50. public int numFormattingRuns() {
  51. return 0;
  52. }
  53. @Override
  54. public int getIndexOfFormattingRun(int index) {
  55. return 0;
  56. }
  57. @Override
  58. public void applyFont(short fontIndex) {
  59. }
  60. }