diff --git a/extra/jheidi/initMySQLTypes.ajl b/extra/jheidi/initTypes$mysql.ajl similarity index 100% rename from extra/jheidi/initMySQLTypes.ajl rename to extra/jheidi/initTypes$mysql.ajl diff --git a/extra/jheidi/initTypes$oracle.ajl b/extra/jheidi/initTypes$oracle.ajl new file mode 100644 index 00000000..c078bcbc --- /dev/null +++ b/extra/jheidi/initTypes$oracle.ajl @@ -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"); + + + + + + + + + +