001package com.hfg.xml.msofficexml.docx.wordprocessingml; 002 003 004import com.hfg.util.collection.OrderedMap; 005 006import java.util.Collection; 007import java.util.Map; 008 009//------------------------------------------------------------------------------ 010/** 011 Allowed values for the tab 'val' attribute. 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 WmlTabStyle 037{ 038 private static Map<String, WmlTabStyle> sValues = new OrderedMap<>(6); 039 040 /** 041 A bar tab does not result in a tab stop in the parent paragraph but instead a vertical bar is drawn at the location. 042 */ 043 public static final WmlTabStyle BAR = new WmlTabStyle("bar"); 044 045 /** 046 All text folowing and preceding the next tab shall be centered around the tab. 047 */ 048 public static final WmlTabStyle CENTER = new WmlTabStyle("center"); 049 050 /** 051 The current tab stop is cleared and shall be removed. 052 */ 053 public static final WmlTabStyle CLEAR = new WmlTabStyle("clear"); 054 055 /** 056 All following text is aligned around the first decimal character in the following text. 057 */ 058 public static final WmlTabStyle DECIMAL = new WmlTabStyle("decimal"); 059 060 /** 061 All following and preceding text is aligned against the trailing edge. 062 */ 063 public static final WmlTabStyle END = new WmlTabStyle("end"); 064 065 /** 066 All following and preceding text is aligned against the leading edge. 067 */ 068 public static final WmlTabStyle START = new WmlTabStyle("start"); 069 070 private String mString; 071 072 private WmlTabStyle(String inString) 073 { 074 mString = inString; 075 sValues.put(inString, this); 076 } 077 078 079 //########################################################################## 080 // PUBLIC METHODS 081 //########################################################################## 082 083 //--------------------------------------------------------------------------- 084 public static Collection<WmlTabStyle> values() 085 { 086 return sValues.values(); 087 } 088 089 //--------------------------------------------------------------------------- 090 public static WmlTabStyle valueOf(String inString) 091 { 092 return sValues.get(inString); 093 } 094 095 //--------------------------------------------------------------------------- 096 public String name() 097 { 098 return mString; 099 } 100 101 //--------------------------------------------------------------------------- 102 @Override 103 public String toString() 104 { 105 return name(); 106 } 107}