001package Torello.JavaDoc.Annotations; 002 003import java.lang.annotation.Retention; 004import java.lang.annotation.Target; 005 006import Torello.HTML.TagNode; 007 008import java.lang.annotation.Repeatable; 009 010import static java.lang.annotation.RetentionPolicy.SOURCE; 011import static java.lang.annotation.ElementType.*; 012 013// EXPORTS: 014// public Background background() default Background.Blue; 015// public String title() default ""; 016// public String divCSSClass() default ""; 017// public String tableCSSClass() default ""; 018// 019// 020// The following files are all related to this Java-Doc Upgrader Annotation: 021// 022// * Torello.JDUInternal.SimpleFeatures.IntoHTMLTableProc 023// This is the primary or "Work Horse" Method for Generating the HTML-Table that is inserted 024// into the Detail-Entry "description()" section. 025// 026// * User-Annotations.css 027// For the CSS Color Choices/Options/Definitions 028// Since there are a suite of Color-Choices which have been presented to the user 029 030 031/** 032 * Requests that the Java-Doc Upgrader convert the Description area of a Java-Doc Web-Page 033 * Detail-Section into an HTML {@code <TABLE>} Element. The Description portion of the Detail 034 * Description <B STYLE='color: red;'><I>MUST</I></B> be initially loaded with a series lines 035 * which begin with HTML {@code <BR />} elements. 036 * 037 * <BR /><BR />The following documentation example should help elucidate how this annotation may 038 * be used. This example is copied from the {@link IntoHTMLTable.Background} enum documentaion. 039 * To view all examples of using this annotation, please review the color selections which are 040 * offered in the Nested-Enum (again, named '{@link IntoHTMLTable.Background Background}') for this 041 * class. 042 * 043 * @see Background 044 */ 045@Retention(SOURCE) 046@Target({FIELD, CONSTRUCTOR, METHOD}) 047@Torello.JavaDoc.Annotations.CSSLinks(FileNames="IHTBackground.css") 048public @interface IntoHTMLTable 049{ 050 /** 051 * This is the complete list of values that may be assigned to the Annotation-Element 052 * named {@link #background()}. 053 * 054 * <BR /><BR />The Documentation for the below Enum-Constants contains explicit examples for 055 * how to use this Annotation, along with how each of the provided Color-Choices are rendered 056 * inside of a Web-Browser Tabl. 057 */ 058 public enum Background 059 { 060 /** 061 * This is the "default" color-assignment which is used whenever no value is 062 * provided to the background value. 063 * 064 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_STANDARD_EX> 065 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_STANDARD_DIV> 066 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BROWN_SPAN> 067 */ 068 Standard(new TagNode("<DIV CLASS='block IHTA Standard'>")), 069 070 /** 071 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_D_EX> 072 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_D_DIV> 073 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_SPAN> 074 */ 075 BlueDither (new TagNode("<DIV CLASS='block IHTA BlueDither'>")), 076 077 /** 078 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_D_EX> 079 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_D_DIV> 080 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_SPAN> 081 */ 082 GreenDither (new TagNode("<DIV CLASS='block IHTA GreenDither'>")), 083 084 /** 085 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_D_EX> 086 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_D_DIV> 087 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_SPAN> 088 */ 089 GrayDither (new TagNode("<DIV CLASS='block IHTA GrayDither'>")), 090 091 /** 092 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BROWN_EX> 093 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BROWN_DIV> 094 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BROWN_SPAN> 095 */ 096 Brown (new TagNode("<DIV CLASS='block IHTA Brown'>")), 097 098 /** 099 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_EX> 100 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_DIV> 101 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BLUE_SPAN> 102 */ 103 Blue (new TagNode("<DIV CLASS='block IHTA Blue'>")), 104 105 /** 106 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_EX> 107 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_DIV> 108 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GREEN_SPAN> 109 */ 110 Green (new TagNode("<DIV CLASS='block IHTA Green'>")), 111 112 /** 113 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_EX> 114 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_DIV> 115 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_GRAY_SPAN> 116 */ 117 Gray (new TagNode("<DIV CLASS='block IHTA Gray'>")); 118 119 /** 120 * The HTML {@code <DIV>} Tag which is used to wrap the contents of the 121 * Description-Box. 122 */ 123 public final TagNode DIV; 124 125 private Background(TagNode DIV) 126 { this.DIV = DIV; } 127 }; 128 129 /** 130 * Allows a user to select the CSS-Class, and therefore the Colors, assigned to both the 131 * HTML-Table, and the Title-Background for the Description-Area of this Detail-Element. 132 * 133 * <BR /><BR />This is the "default" color-assignment which is used whenever no value is 134 * provided to the background value. 135 * 136 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_STANDARD_EX> 137 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_STANDARD_DIV> 138 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_BROWN_SPAN> 139 */ 140 public Background background() default Background.Standard; 141 142 /** 143 * This is the Title-{@code String} that is placed at the top of the HTML-Table. It will be 144 * placed onto a small background Text-Box that is mono-colored according to the settings which 145 * are assigned to the {@link Background} passed to this Annotation (or the default 146 * {@code Background}, if no such color is passed or requeted to the {@link #background()} 147 * Annotation-Element. 148 * 149 * <BR /><BR /><B CLASS=JDDescLabel>Title-{@code String} Rules:</B> 150 * 151 * <BR /><UL CLASS=JDUL> 152 * <LI>This {@code String} may not contain the characters: '\t', '\n' or '\r'</LI> 153 * <LI>May it be more than <B STYLE='color:red;'>{@code 300} Characters</B> long.</LI> 154 * </UL> 155 */ 156 public String title() default ""; 157 158 /** 159 * This is an Optional Annotation-Element that should only be used if they provided 160 * Color-Settings that are offered by the {@link Background} 'enum' do not contain a sufficient 161 * number of choices to properly render the HTML-Table which needs to be rendered. 162 * 163 * <BR /><BR />It is expected that the value provided to this {@code String} be a valid CSS 164 * {@code 'Class-Name'}. The Error-Checking Logic for the processor of this annotation will, 165 * indeed check the {@code String} that is provided. 166 * 167 * <BR /><BR />This is, likely, a lesser used feature of the {@code IntoHTMLTable}-Annotation. 168 * It provides for the ability to assign a self-designated CSS-Class to the 169 * Primary-{@code <DIV>} element. <B><I>It is usually much easier to either:</B></I> 170 * 171 * <BR /><BR /><UL CLASS=JDUL> 172 * <LI>Provide a value to the {@link #background()} Annotation-Element</LI> 173 * <LI>Provided no value, and allow that the default 174 * {@link Background#Standard Background}-Value be assigned.</LI> 175 * </UL> 176 * 177 * <BR /><BR /><B CLASS=JDDescLabel>Multiple CSS Classes</B> 178 * 179 * <BR />It is permissible to pass multiple CSS-Classes to this {@code String}-Element. In 180 * order to apply multiple classes, simple separate them with white-space characters, in such 181 * a way no different than if they had been used or applied inside of an Inline-CSS 182 * {@code STYLE}-Attribute. 183 */ 184 public String divCSSClass() default ""; 185 186 /** 187 * 188 * <EMBED CLASS='external-html' DATA-FILE-ID=IHT_TABLE_CSS_CLASS> 189 */ 190 public String tableCSSClass() default ""; 191}