make oracle and mysql specific

This commit is contained in:
servertood
2008-12-29 20:05:22 +00:00
parent 7d20737ff9
commit 4027aefdee
2 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,77 @@
import javax.swing.*;
import java.util.*;
WindowContext context = argObj("windowContext");
Combo types = context.get("/types");
String[] typesArray = new String[] { "varchar2", "char", "number", "date", "timestamp", "clob", "blob", "bfile", "xmltype" };
types.setModel(new DefaultComboBoxModel(typesArray));
types.events("typeChangeEvents");
Object[] widgets = new Object[] { context.get("/binary"), context.get("/unsigned"), context.get("/zeroFill"),
context.get("/lengthSet"), context.get("/defaultValue") };
// p, i, u, b, u, z, n, a, l
int[] ZERO_6 = new int[] { 0, 2, 1, 1, 1 };
int[] SEVEN = new int[] { 0, 2, 1, 2, 1 };
int[] EIGHT_12 = new int[] { 0, 0, 0, 1, 1 };
int[] THIRT_14 = new int[] { 1, 0, 0, 2, 1 };
int[] FIFT_18 = new int[] { 1, 0, 0, 0, 0 };
int[] NINT_20 = new int[] { 0, 0, 0, 2, 1 };
int[] TWEN1_24 = new int[] { 0, 0, 0, 0, 0 };
int[] TWEN5_26 = new int[] { 0, 0, 0, 1, 1 };
int[] TWEN7 = new int[] { 0, 0, 0, 0, 1 };
int[] TWEN8 = new int[] { 0, 0, 0, 0, 1 };
HashObject typeMap = new HashObject();
HashObject defSizeMap = new HashObject();
types.setProperty("typeStateMap", typeMap);
types.setProperty("defSizeMap", defSizeMap);
types.setProperty("widgets", widgets);
/*for (int i=0; i < typesArray.length; i++)
{
if (i < 6)
typeMap.put(typesArray[i], ZERO_6);
else if ( i == 6 )
typeMap.put(typesArray[i], SEVEN);
else if ( i < 12 )
typeMap.put(typesArray[i], EIGHT_12);
else if ( i < 14 )
typeMap.put(typesArray[i], THIRT_14);
else if ( i < 18 )
typeMap.put(typesArray[i], FIFT_18);
else if ( i < 20 )
typeMap.put(typesArray[i], NINT_20);
else if ( i < 23 )
typeMap.put(typesArray[i], TWEN1_24);
else if ( i < 26 )
typeMap.put(typesArray[i], TWEN5_26);
else if ( i == 26 )
typeMap.put(typesArray[i], TWEN7);
else
typeMap.put(typesArray[i], TWEN8);
}
defSizeMap.put(typesArray[12], "50");
defSizeMap.put(typesArray[13], "50");
defSizeMap.put(typesArray[18], "50");
defSizeMap.put(typesArray[19], "50");
defSizeMap.put(typesArray[24], "'Y', 'N'");
defSizeMap.put(typesArray[25], "'Y', 'N'");
defSizeMap.put(typesArray[26], "'Y', 'N'");*/
types.select("varchar2");