public WorkspacePanel(final String id, final IModel workspaceModel, final IModel paramLabelModel, final boolean required) { // make the value of the combo field the model of this panel, for easy // value retriaval super(id, workspaceModel); // the label String requiredMark = required ? " *" : ""; Label label = new Label("paramName", paramLabelModel.getObject() + requiredMark); add(label); // the drop down field, with a decorator for validations choice = new DropDownChoice("paramValue", workspaceModel, new WorkspacesModel(), new WorkspaceChoiceRenderer()); choice.setRequired(required); // set the label to be the paramLabelModel otherwise a validation error would look like // "Parameter 'paramValue' is required" choice.setLabel(paramLabelModel); FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder("border"); feedback.add(choice); add(feedback); }
final DropDownChoice wsDropDown = (DropDownChoice) workspacePanel.getFormComponent();
workspacePanel = new WorkspacePanel("workspacePanel", wsModel, wsLabelModel, true); .getFormComponent(), dataStoreNamePanel.getFormComponent(), dataStoreInfoId); paramsForm.add(storeNameValidator);
new ResourceModel("enabled", "Enabled"))); workspacePanel = new WorkspacePanel("workspacePanel", new PropertyModel(model, "workspace"), new ResourceModel("workspace", "Workspace"), true); .getFormComponent(), namePanel.getFormComponent(), store.getId()); paramsForm.add(storeNameValidator);
workspacePanel = new WorkspacePanel("workspacePanel", wsModel, wsLabelModel, true); StoreNameValidator storeNameValidator = new StoreNameValidator( workspacePanel.getFormComponent(), dataStoreNamePanel.getFormComponent(), dataStoreInfoId);
final DropDownChoice wsDropDown = (DropDownChoice) workspacePanel.getFormComponent();
public WorkspacePanel( final String id, final IModel workspaceModel, final IModel paramLabelModel, final boolean required) { // make the value of the combo field the model of this panel, for easy // value retriaval super(id, workspaceModel); // the label String requiredMark = required ? " *" : ""; Label label = new Label("paramName", paramLabelModel.getObject() + requiredMark); add(label); // the drop down field, with a decorator for validations choice = new DropDownChoice( "paramValue", workspaceModel, new WorkspacesModel(), new WorkspaceChoiceRenderer()); choice.setRequired(required); // set the label to be the paramLabelModel otherwise a validation error would look like // "Parameter 'paramValue' is required" choice.setLabel(paramLabelModel); FormComponentFeedbackBorder feedback = new FormComponentFeedbackBorder("border"); feedback.add(choice); add(feedback); }
new WorkspacePanel( "workspacePanel", new PropertyModel(model, "workspace"), workspacePanel.getFormComponent(), namePanel.getFormComponent(), store.getId());
@Override void initUI(CoverageStoreInfo store) { dialog = new GeoServerDialog("dialog"); add(dialog); super.initUI(store); if (store.getId() != null) { //store id == null means the store is not part of catalog, forgo uniqueness check String workspaceId = store.getWorkspace().getId(); workspacePanel.getFormComponent().add( new CheckExistingResourcesInWorkspaceValidator(store.getId(), workspaceId)); } }
new ResourceModel("enabled", "Enabled"))); workspacePanel = new WorkspacePanel("workspacePanel", new PropertyModel(model, "workspace"), new ResourceModel("workspace", "Workspace"), true); .getFormComponent(), namePanel.getFormComponent(), store.getId()); form.add(storeNameValidator);
protected void initUI(final DataStoreInfo dataStoreInfo) { // the confirm dialog dialog = new GeoServerDialog("dialog"); add(dialog); super.initUI(dataStoreInfo); if (dataStoreInfo.getId() != null) { //null id means detached from catalog, don't bother with uniqueness check final String wsId = dataStoreInfo.getWorkspace().getId(); workspacePanel.getFormComponent().add( new CheckExistingResourcesInWorkspaceValidator(dataStoreInfo.getId(), wsId)); } }
new WorkspacePanel( "workspacePanel", new PropertyModel(model, "workspace"), workspacePanel.getFormComponent(), namePanel.getFormComponent(), store.getId());
protected void initUI(final DataStoreInfo dataStoreInfo) { // the confirm dialog dialog = new GeoServerDialog("dialog"); add(dialog); super.initUI(dataStoreInfo); if (dataStoreInfo.getId() != null) { // null id means detached from catalog, don't bother with uniqueness check final String wsId = dataStoreInfo.getWorkspace().getId(); workspacePanel .getFormComponent() .add( new CheckExistingResourcesInWorkspaceValidator( dataStoreInfo.getId(), wsId)); } }
new WorkspacePanel( "workspacePanel", new PropertyModel(model, "workspace"), workspacePanel.getFormComponent(), namePanel.getFormComponent(), store.getId());
@Override void initUI(CoverageStoreInfo store) { dialog = new GeoServerDialog("dialog"); add(dialog); super.initUI(store); if (store.getId() != null) { // store id == null means the store is not part of catalog, forgo uniqueness check String workspaceId = store.getWorkspace().getId(); workspacePanel .getFormComponent() .add( new CheckExistingResourcesInWorkspaceValidator( store.getId(), workspaceId)); } }