if(index_scheme.equals("Select")){
data_type = new DataType(entity_ui.tf_pgtype.getText());
}
else{
data_type = new ArrayType(index_scheme,entity_ui.tf_starting_index.getText(),
entity_ui.tf_ending_index.getText());
data_type.name = entity_ui.tf_pgtype.getText();
data_type.type = "array";
}
entity_ui.entity.addPort(new Port(entity_ui.tf_pgname.getText(),
data_type ,entity_ui.cmb_mode.getSelectedItem().toString()));
String str = "Port " + entity_ui.tf_pgname.getText() + " of mode "
+ entity_ui.cmb_mode.getSelectedItem().toString() + " and type "
+ entity_ui.tf_pgtype.getText().toUpperCase();
str += !index_scheme.equals("Select") ?
" Range " + entity_ui.tf_starting_index.getText() + " "
+ index_scheme + " " + entity_ui.tf_ending_index.getText()
: "";
entity_ui.lst_ports.add(str);
entity_ui.tf_pgname.setText("");
}
else{//to add generics
DataType data_type = null;
String index_scheme = entity_ui.cmb_indexing_scheme.getSelectedItem().toString();
if(index_scheme.equals("Select")){
data_type = new DataType(entity_ui.tf_pgtype.getText());
}
else{
data_type = new ArrayType(index_scheme,entity_ui.tf_starting_index.getText(),
entity_ui.tf_ending_index.getText());
data_type.name = entity_ui.tf_pgtype.getText();
}
entity_ui.entity.addGeneric(new Generic(entity_ui.tf_pgname.getText(),
data_type));