001package com.hfg.xml.msofficexml.xlsx.spreadsheetml;
002
003
004import com.hfg.xml.msofficexml.xlsx.CellRef;
005import com.hfg.xml.msofficexml.xlsx.Xlsx;
006
007public class XlsxComment implements Cloneable
008{
009   private Xlsx    mParentDoc;
010
011   private String  mAuthor = "Unknown";
012   private CellRef mCellRef;
013   private SsmlXMLTag  mText;
014
015   //---------------------------------------------------------------------------
016   public XlsxComment(Xlsx inParentDoc)
017   {
018      mParentDoc = inParentDoc;
019   }
020
021   //---------------------------------------------------------------------------
022   public XlsxComment(String inValue)
023   {
024      setText(inValue);
025   }
026
027   //---------------------------------------------------------------------------
028   public XlsxComment setAuthor(String inValue)
029   {
030      mAuthor = inValue;
031      return this;
032   }
033
034
035   //---------------------------------------------------------------------------
036   @Override
037   public XlsxComment clone()
038   {
039      XlsxComment cloneObj;
040      try
041      {
042         cloneObj = (XlsxComment) super.clone();
043      }
044      catch (CloneNotSupportedException e)
045      {
046         throw new RuntimeException(e);
047      }
048
049      return cloneObj;
050   }
051
052   //---------------------------------------------------------------------------
053   public String getAuthor()
054   {
055      return mAuthor;
056   }
057
058   //---------------------------------------------------------------------------
059   public XlsxComment setCellRef(CellRef inValue)
060   {
061      mCellRef = inValue;
062      return this;
063   }
064
065   //---------------------------------------------------------------------------
066   public CellRef getCellRef()
067   {
068      return mCellRef;
069   }
070
071   //---------------------------------------------------------------------------
072   public XlsxComment setText(String inValue)
073   {
074      mText = new SsmlTextRun(mParentDoc).setText(inValue);
075      return this;
076   }
077
078   //---------------------------------------------------------------------------
079   public XlsxComment setText(SsmlTextRun inValue)
080   {
081      mText = inValue;
082      return this;
083   }
084
085   //---------------------------------------------------------------------------
086   public SsmlXMLTag getText()
087   {
088      return mText;
089   }
090}