You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CreationHelper.java 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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.ss.usermodel;
  16. import org.apache.poi.common.usermodel.HyperlinkType;
  17. import org.apache.poi.ss.util.AreaReference;
  18. import org.apache.poi.ss.util.CellReference;
  19. /**
  20. * An object that handles instantiating concrete
  21. * classes of the various instances one needs for
  22. * HSSF and XSSF.
  23. * Works around a limitation in Java where we
  24. * cannot have static methods on interfaces or abstract
  25. * classes.
  26. * This allows you to get the appropriate class for
  27. * a given interface, without you having to worry
  28. * about if you're dealing with HSSF or XSSF.
  29. */
  30. public interface CreationHelper {
  31. /**
  32. * Creates a new RichTextString instance
  33. * @param text The text to initialise the RichTextString with
  34. */
  35. RichTextString createRichTextString(String text);
  36. /**
  37. * Creates a new DataFormat instance
  38. */
  39. DataFormat createDataFormat();
  40. /**
  41. * Creates a new Hyperlink, of the given type
  42. */
  43. Hyperlink createHyperlink(HyperlinkType type);
  44. /**
  45. * Creates FormulaEvaluator - an object that evaluates formula cells.
  46. *
  47. * @return a FormulaEvaluator instance
  48. */
  49. FormulaEvaluator createFormulaEvaluator();
  50. /**
  51. * Creates a XSSF-style Color object, used for extended sheet
  52. * formattings and conditional formattings
  53. */
  54. ExtendedColor createExtendedColor();
  55. /**
  56. * Creates a ClientAnchor. Use this object to position drawing object in a sheet
  57. *
  58. * @return a ClientAnchor instance
  59. * @see org.apache.poi.ss.usermodel.Drawing
  60. */
  61. ClientAnchor createClientAnchor();
  62. /**
  63. * Creates an AreaReference.
  64. *
  65. * @param reference cell reference
  66. * @return an AreaReference instance
  67. */
  68. AreaReference createAreaReference(String reference);
  69. /**
  70. * Creates an area ref from a pair of Cell References..
  71. *
  72. * @param topLeft cell reference
  73. * @param bottomRight cell reference
  74. * @return an AreaReference instance
  75. */
  76. AreaReference createAreaReference(CellReference topLeft, CellReference bottomRight);
  77. }