001package com.hfg.xml.msofficexml.docx.wordprocessingml; 002 003import java.util.Collection; 004import java.util.Map; 005 006import com.hfg.util.collection.OrderedMap; 007 008//------------------------------------------------------------------------------ 009/** 010 Allowed values for the tab 'leader' attribute which specifies the character to be 011 repeated as required to fill the tab space. 012 013 @author J. Alex Taylor, hairyfatguy.com 014 */ 015//------------------------------------------------------------------------------ 016// com.hfg XML/HTML Coding Library 017// 018// This library is free software; you can redistribute it and/or 019// modify it under the terms of the GNU Lesser General Public 020// License as published by the Free Software Foundation; either 021// version 2.1 of the License, or (at your option) any later version. 022// 023// This library is distributed in the hope that it will be useful, 024// but WITHOUT ANY WARRANTY; without even the implied warranty of 025// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 026// Lesser General Public License for more details. 027// 028// You should have received a copy of the GNU Lesser General Public 029// License along with this library; if not, write to the Free Software 030// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 031// 032// J. Alex Taylor, President, Founder, CEO, COO, CFO, OOPS hairyfatguy.com 033// jataylor@hairyfatguy.com 034//------------------------------------------------------------------------------ 035 036public class WmlTabLeader 037{ 038 private static Map<String, WmlTabLeader> sValues = new OrderedMap<>(6); 039 040 /** 041 A dot. 042 */ 043 public static final WmlTabLeader DOT = new WmlTabLeader("dot"); 044 045 /** 046 A heavy solid line or underscore. 047 */ 048 public static final WmlTabLeader HEAVY = new WmlTabLeader("heavy"); 049 050 /** 051 A hyphen or dash. 052 */ 053 public static final WmlTabLeader HYPHEN = new WmlTabLeader("hyphen"); 054 055 /** 056 A centered dot. 057 */ 058 public static final WmlTabLeader MIDDLE_DOT = new WmlTabLeader("middleDot"); 059 060 /** 061 No leader character. 062 */ 063 public static final WmlTabLeader NONE = new WmlTabLeader("none"); 064 065 /** 066 An underscore. 067 */ 068 public static final WmlTabLeader UNDERSCORE = new WmlTabLeader("underscore"); 069 070 private String mString; 071 072 073 //########################################################################## 074 // CONSTRUCTORS 075 //########################################################################## 076 077 private WmlTabLeader(String inString) 078 { 079 mString = inString; 080 sValues.put(inString, this); 081 } 082 083 084 //########################################################################## 085 // PUBLIC METHODS 086 //########################################################################## 087 088 //--------------------------------------------------------------------------- 089 public static Collection<WmlTabLeader> values() 090 { 091 return sValues.values(); 092 } 093 094 //--------------------------------------------------------------------------- 095 public static WmlTabLeader valueOf(String inString) 096 { 097 return sValues.get(inString); 098 } 099 100 //--------------------------------------------------------------------------- 101 public String name() 102 { 103 return mString; 104 } 105 106 //--------------------------------------------------------------------------- 107 @Override 108 public String toString() 109 { 110 return name(); 111 } 112}