project.getProjectLayoutConfiguration().addTab(userDefinedTabConfiguration);
return userDefinedTab;
}
private TabConfiguration getUserDefinedTabConfiguration() {
TabConfiguration tabConfiguration = new TabConfiguration();
tabConfiguration.setLabel(labelTextField.getValueAsString().trim());
List<TabColumnConfiguration> tabColConf = new ArrayList<TabColumnConfiguration>(colNo);
// TabColumnConfiguration[] tabColConf = new
// TabColumnConfiguration[colNo];
for (int i = 0; i < colNo; i++) {
TabColumnConfiguration tabCol = new TabColumnConfiguration();
String widthStr = colTextFields[i].getValueAsString();
int width = 0;
try {
width = Integer.parseInt(widthStr);
} catch (NumberFormatException e) {
}
// tabColConf[i].setWidth(width == 0 ? 0 : 1/width);
tabCol.setWidth(width == 0 ? 0 : (float) width / 100);
tabColConf.add(tabCol);
}
tabConfiguration.setColumns(tabColConf);
tabConfiguration.setName(UserDefinedTab.class.getName());
return tabConfiguration;
}