* @return a combobox set up to display the list of available raster tables if the StoreInfo is
* new, or a non editable text box if we're editing an existing StoreInfo
*/
private FormComponent addTableNameComponent(final IModel paramsModel, final boolean isNew) {
final FormComponent tableNameComponent;
final String panelId = "tableNamePanel";
if (isNew) {
RasterTableSelectionPanel selectionPanel;
selectionPanel = new RasterTableSelectionPanel(panelId, paramsModel, storeEditForm,
server, port, instance, user, password);
add(selectionPanel);
DropDownChoice tableDropDown = selectionPanel.getFormComponent();
tableNameComponent = tableDropDown;
} else {
/*
* We're editing an existing store. Don't allow to change the table name, it could be
* catastrophic for the Catalog/ResourcePool as ability to get to the coverage is really
* based on the Store's URL and the CoverageInfo is tied to it
*/
final IModel paramValue = new MapModel(paramsModel, TABLE_NAME);
final String resourceKey = RESOURCE_KEY_PREFIX + "." + TABLE_NAME;
final IModel paramLabelModel = new ResourceModel(resourceKey, TABLE_NAME);
final boolean required = true;
TextParamPanel tableNamePanel;
tableNamePanel = new TextParamPanel(panelId, paramValue, paramLabelModel, required);
add(tableNamePanel);
tableNameComponent = tableNamePanel.getFormComponent();
tableNameComponent.setEnabled(false);
final String titleKey = resourceKey + ".title";
ResourceModel titleModel = new ResourceModel(titleKey);
String title = String.valueOf(titleModel.getObject());