public EnumDescriptor getDescriptorForTypeIDString (String string) { if (MidpTypes.TYPEID_ALERT_TYPE.getString ().equals (string)) return MidpEnumDescriptor.alertTypePD; //TODO return null; }
public static String createDisplayNameFromTypeID(TypeID type) { String str = type.getString(); int i = str.lastIndexOf('.'); return i >= 0 ? str.substring(i + 1) : str; }
public static String getOptimalizedFQNClassName (TypeID type) { // assert TypeID.Kind.COMPONENT.equals (type.getKind ()); String className = type.getString (); if (className.startsWith (PREFIX_LCDUI)) return className.substring (PREFIX_LCDUI.length ()); else if (className.startsWith (PREFIX_MIDLET)) return className.substring (PREFIX_MIDLET.length ()); return className; }
public PrimitiveDescriptor getDescriptorForTypeIDString (String string) { if (MidpTypes.TYPEID_CHAR.getString ().equals (string)) return intPD; if (MidpTypes.TYPEID_BYTE.getString ().equals (string)) return bytePD; if (MidpTypes.TYPEID_SHORT.getString ().equals (string)) return shortPD; if (MidpTypes.TYPEID_INT.getString ().equals (string)) return intPD; if (MidpTypes.TYPEID_LONG.getString ().equals (string)) return longPD; if (MidpTypes.TYPEID_FLOAT.getString ().equals (string)) return floatPD; if (MidpTypes.TYPEID_DOUBLE.getString ().equals (string)) return doublePD; if (MidpTypes.TYPEID_BOOLEAN.getString ().equals (string)) return booleanPD; if (MidpTypes.TYPEID_JAVA_LANG_STRING.getString ().equals (string)) return stringPD; if (MidpTypes.TYPEID_JAVA_CODE.getString ().equals (string)) return stringPD; //TODO return null; }
public static String getSimpleClassName (TypeID type) { assert TypeID.Kind.COMPONENT.equals (type.getKind ()); String string = type.getString (); int i = string.lastIndexOf ('.'); return i >= 0 ? string.substring (i + 1) : string; }
public static String getSuggestedMainName(TypeID type) { String instanceName = type.getString(); int index = instanceName.lastIndexOf('.'); // NOI18N if (index >= 0) instanceName = instanceName.substring(index + 1); if (type.getDimension() > 0) instanceName += ARRAY_SUFFIX; if (instanceName.length () <= 0) instanceName = "object"; // NOI18N char[] chars = instanceName.toCharArray(); for (int i = 0; i < chars.length; i++) { if (Character.isLetter(chars[i])) { if (Character.isUpperCase(chars[i])) { if (i == 0) chars[i] = Character.toLowerCase(chars[i]); else if (i + 1 < chars.length) { if (Character.isUpperCase(chars[i+1])) chars[i] = Character.toLowerCase(chars[i]); else break; } else chars[i] = Character.toLowerCase(chars[i]); } else break; } } return new String (chars); }
public static String getFQNClassName (TypeID type) { assert TypeID.Kind.COMPONENT.equals (type.getKind ()); return type.getString (); }
public void run() { for (ComponentElement element : componentElements) { String string = element.getTypeID().getString(); if (MidpTypes.isValidFQNClassName(string)) { if (registry.getComponentDescriptor(new TypeID(TypeID.Kind.COMPONENT, string)) == null) { unresolved.add(string); } } } } });
public void run () { for (ComponentDescriptor descriptor : registry.getComponentDescriptors ()) { TypeID thisType = descriptor.getTypeDescriptor ().getThisType (); String string = thisType.getString (); if (! checkForJavaIdentifierCompliant (string)) continue; if (! registry.isInHierarchy (ClassCD.TYPEID, thisType) || ClassCD.TYPEID.equals (thisType)) continue; registryMap.put (string, descriptor); } } });
static EnumDescriptor getDescriptor (String projectType, TypeID type) { assert Debug.isFriend (PropertyValue.class); assert type.getKind () == TypeID.Kind.ENUM; assert type.getDimension () == 0; for (EnumDescriptorFactory factory : factoriesLookupResult.allInstances ()) { if (projectType == null || ! projectType.equals (factory.getProjectType ())) continue; EnumDescriptor descriptor = factory.getDescriptorForTypeIDString (type.getString ()); if (descriptor != null) return descriptor; } throw Debug.error ("No EnumDescriptorFactory found", type); // NOI18N }
public void run(WorkingCopy parameter) throws Exception { parameter.toPhase(JavaSource.Phase.PARSED); String typeFqn = getComponent().getType().getString(); if (!fullyNamesList.contains(typeFqn)) { fullyNamesList.add(typeFqn); } DesignComponent connector = MidpDatabindingSupport.getConnector(getComponent(), bindedProperty); for (String fqn : fullyNamesList) { if (bindedProperty == null) { SourceUtils.resolveImport(parameter, new TreePath(parameter.getCompilationUnit()), fqn); } else if (connector != null) { SourceUtils.resolveImport(parameter, new TreePath(parameter.getCompilationUnit()), fqn); } } } }).commit();
static PrimitiveDescriptor getDescriptor (String projectType, TypeID type) { assert Debug.isFriend (PropertyValue.class); assert type.getKind () == TypeID.Kind.PRIMITIVE; assert type.getDimension () == 0; for (PrimitiveDescriptorFactory factory : factoriesLookupResult.allInstances ()) { if (projectType == null || ! projectType.equals (factory.getProjectType ())) continue; PrimitiveDescriptor descriptor = factory.getDescriptorForTypeIDString (type.getString ()); if (descriptor != null) return descriptor; } Debug.warning ("No PrimitiveDescriptorFactory found", type); // NOI18N return null; }
assert (typeId != null); if (DEBUG_UNDO) System.out.println("Affected ComponentID: " + designComponent.getComponentID() + ", type: " + designComponent.getType().getString()); // NOI18N if (DEBUG_UNDO) System.out.println("Currently not handling this in type in GameController.designChanged() typeId: " + typeId.getString()); // NOI18N