use of CCDD.CcddConstants.BaseDataTypeInfo in project CCDD by nasa.
the class CcddDataTypeHandler method isInteger.
/**
********************************************************************************************
* Determine if the specified data type is a signed or unsigned integer
*
* @param dataTypeName
* data type name
*
* @return true if the specified data type is a signed or unsigned integer
********************************************************************************************
*/
protected boolean isInteger(String dataTypeName) {
boolean isInteger = false;
// get the base data type for the specified data type
BaseDataTypeInfo baseDataType = getBaseDataType(dataTypeName);
// Set the flag to true if the base data type is an integer (signed or unsigned)
isInteger = baseDataType == BaseDataTypeInfo.UNSIGNED_INT || baseDataType == BaseDataTypeInfo.SIGNED_INT;
return isInteger;
}
use of CCDD.CcddConstants.BaseDataTypeInfo in project CCDD by nasa.
the class CcddDataTypeHandler method getBaseDataType.
/**
********************************************************************************************
* Get the base data type for the specified data type
*
* @param dataTypeName
* data type name
*
* @return Base data type for the specified data type; returns null if the data type doesn't
* exist
********************************************************************************************
*/
protected BaseDataTypeInfo getBaseDataType(String dataTypeName) {
BaseDataTypeInfo baseDataType = null;
// Get the data type information based on the type name
String[] dataType = getDataTypeInfo(dataTypeName);
// Check if the data type exists
if (dataType != null) {
// Get the associated base data type
baseDataType = BaseDataTypeInfo.getBaseType(dataType[DataTypesColumn.BASE_TYPE.ordinal()]);
}
return baseDataType;
}
use of CCDD.CcddConstants.BaseDataTypeInfo in project CCDD by nasa.
the class CcddDataTypeEditorDialog method createBasePrimitiveTypeCellEditor.
/**
********************************************************************************************
* Create the cell editor for base data types
********************************************************************************************
*/
private void createBasePrimitiveTypeCellEditor() {
// Create a combo box for displaying the base data types
final PaddedComboBox baseComboBox = new PaddedComboBox(dataTypeTable.getFont());
// Step through each base data type
for (BaseDataTypeInfo type : BaseDataTypeInfo.values()) {
// Add the data type to the list
baseComboBox.addItem(type.getName().toLowerCase());
}
// Add a listener to the combo box for focus changes
baseComboBox.addFocusListener(new FocusAdapter() {
/**
************************************************************************************
* Handle a focus gained event so that the combo box automatically expands when
* selected
************************************************************************************
*/
@Override
public void focusGained(FocusEvent fe) {
baseComboBox.showPopup();
}
});
// Create the data type cell editor for enumerations
baseTypeCellEditor = new DefaultCellEditor(baseComboBox);
}
use of CCDD.CcddConstants.BaseDataTypeInfo in project CCDD by nasa.
the class CcddScriptDataAccessHandler method getBaseDataType.
/**
********************************************************************************************
* Get the base type for the specified data type
*
* @param dataType
* primitive data type
*
* @return Base type for the specified data type; returns null if the data type doesn't exist
* or isn't a primitive type
********************************************************************************************
*/
public String getBaseDataType(String dataType) {
String baseType = null;
// Get the base data type information based on the data type
BaseDataTypeInfo baseTypeInfo = dataTypeHandler.getBaseDataType(dataType);
// Check if the data type exists
if (baseTypeInfo != null) {
// Get the base type for the data type
baseType = baseTypeInfo.getName();
}
return baseType;
}
Aggregations