Commit e5f514bb by Jay

created PlaceholderOptions static enum

parent de298607
package performa.orm.types;
import java.util.*;
import oneit.utils.*;
/**
* This class was generated using constGen.bat.
* DO NOT MODIFY THIS CODE.
* Edit the associated .xml file, and regenerate this file
* constGen (directory) (file minus extension)
* e.g. constGen C:\...\sql FieldType
*/
public class PlaceholderOptions extends AbstractEnumerated
{
public static final EnumeratedFactory FACTORY_PlaceholderOptions = new PlaceholderOptionsFactory();
public static final PlaceholderOptions FIRST_NAME = new PlaceholderOptions ("FIRST_NAME", "FIRST_NAME", "First Name", false);
public static final PlaceholderOptions SURNAME = new PlaceholderOptions ("SURNAME", "SURNAME", "Surname", false);
public static final PlaceholderOptions EMAIL_ADDRESS = new PlaceholderOptions ("EMAIL_ADDRESS", "EMAIL_ADDRESS", "Email Address", false);
public static final PlaceholderOptions LOCATION = new PlaceholderOptions ("LOCATION", "LOCATION", "Location", false);
public static final PlaceholderOptions JOB_TITLE = new PlaceholderOptions ("JOB_TITLE", "JOB_TITLE", "Job Title", false);
public static final PlaceholderOptions JOB_REFERENCE = new PlaceholderOptions ("JOB_REFERENCE", "JOB_REFERENCE", "Job Reference", false);
private static final PlaceholderOptions[] allPlaceholderOptionss =
new PlaceholderOptions[] { FIRST_NAME,SURNAME,EMAIL_ADDRESS,LOCATION,JOB_TITLE,JOB_REFERENCE};
private static PlaceholderOptions[] getAllPlaceholderOptionss ()
{
return allPlaceholderOptionss;
}
private transient String Placeholder;
private PlaceholderOptions (String name, String value, String description, boolean disabled)
{
super (name, value, description, disabled);
}
public String getPlaceholder()
{
return Placeholder;
}
public static final Comparator COMPARE_BY_POSITION = new CompareEnumByPosition (allPlaceholderOptionss);
static
{
defineAdditionalData ();
}
public boolean isEqual (PlaceholderOptions other)
{
return this.name.equals (other.name);
}
public Enumeration getAllInstances ()
{
return PlaceholderOptions.getAll ();
}
private Object readResolve() throws java.io.ObjectStreamException
{
return PlaceholderOptions.forName (this.name);
}
public EnumeratedFactory getFactory ()
{
return FACTORY_PlaceholderOptions;
}
public static PlaceholderOptions forName (String name)
{
if (name == null) { return null; }
PlaceholderOptions[] all = getAllPlaceholderOptionss();
int enumIndex = AbstractEnumerated.getIndexForName (all, name);
return all[enumIndex];
}
public static PlaceholderOptions forValue (String value)
{
if (value == null) { return null; }
PlaceholderOptions[] all = getAllPlaceholderOptionss();
int enumIndex = AbstractEnumerated.getIndexForValue (getAllPlaceholderOptionss (), value);
return all[enumIndex];
}
public static java.util.Enumeration getAll ()
{
return AbstractEnumerated.getAll (getAllPlaceholderOptionss());
}
public static PlaceholderOptions[] getPlaceholderOptionsArray ()
{
return (PlaceholderOptions[])getAllPlaceholderOptionss().clone ();
}
public static void defineAdditionalData ()
{
FIRST_NAME.Placeholder = "$firstName";
SURNAME.Placeholder = "$surname";
EMAIL_ADDRESS.Placeholder = "$emailAddress";
LOCATION.Placeholder = "$location";
JOB_TITLE.Placeholder = "$jobTitle";
JOB_REFERENCE.Placeholder = "$jobReference";
}
static class PlaceholderOptionsFactory implements EnumeratedFactory
{
public AbstractEnumerated getForName (String name)
{
return PlaceholderOptions.forName (name);
}
public AbstractEnumerated getForValue (String name)
{
return PlaceholderOptions.forValue (name);
}
public Enumeration getAll ()
{
return PlaceholderOptions.getAll ();
}
}
public Map getAdditionalAttributes ()
{
Map attribs = new HashMap ();
attribs.put ("Placeholder", ArrayFormatter.toObject(getPlaceholder()));
return attribs;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<CONSTANT package="performa.orm.types" name="PlaceholderOptions">
<DATA name="Placeholder" type="String"/>
<VALUE name="FIRST_NAME" value="FIRST_NAME" description="First Name" Placeholder='"$firstName"' />
<VALUE name="SURNAME" value="SURNAME" description="Surname" Placeholder='"$surname"' />
<VALUE name="EMAIL_ADDRESS" value="EMAIL_ADDRESS" description="Email Address" Placeholder='"$emailAddress"' />
<VALUE name="LOCATION" value="LOCATION" description="Location" Placeholder='"$location"' />
<VALUE name="JOB_TITLE" value="JOB_TITLE" description="Job Title" Placeholder='"$jobTitle"' />
<VALUE name="JOB_REFERENCE" value="JOB_REFERENCE" description="Job Reference" Placeholder='"$jobReference"' />
</CONSTANT>
</ROOT>
\ No newline at end of file
......@@ -103,13 +103,13 @@
<oneit:skin tagName="button_dropdown" label="Placeholder Variable" class="btn btn-default">
<li><oneit:button value="First Name" cssClass=" " name="firstName" skin="link" onClick="insertAtCaret('$firstName')" /></li>
<li><oneit:button value="Surname" cssClass=" " name="surname" skin="link" onClick="insertAtCaret('$surname')" /></li>
<li><oneit:button value="Email Address" cssClass=" " name="emailAddress" skin="link" onClick="insertAtCaret('$emailAddress')" /></li>
<li><oneit:button value="Location" cssClass=" " name="location" skin="link" onClick="insertAtCaret('$location')" /></li>
<li><oneit:button value="Job Title" cssClass=" " name="jobTitle" skin="link" onClick="insertAtCaret('$jobTitle')" /></li>
<li><oneit:button value="Job Reference" cssClass=" " name="jobReference" skin="link" onClick="insertAtCaret('$jobReference')" /></li>
<%
for(PlaceholderOptions option : PlaceholderOptions.getPlaceholderOptionsArray())
{
%>
<li><oneit:button value="<%= option.getDescription() %>" cssClass=" " name="<%= option.getDescription() %>" skin="link" onClick="<%=" insertAtCaret('"+ option.getPlaceholder() +"'); return false;"%>" /></li>
<% } %>
</oneit:skin>
</oneit:skin>
</oneit:layout_field>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment