Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEOS-7697] Error <Field 'latLonBoundingBox' is required> when creati…
…ng layer
- Loading branch information
Showing
3 changed files
with
88 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/web/core/src/main/java/org/geoserver/web/wicket/FeedbackMessageCleaner.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,39 @@ | |||
/* (c) 2016 Open Source Geospatial Foundation - all rights reserved | |||
* This code is licensed under the GPL 2.0 license, available at the root | |||
* application directory. | |||
*/ | |||
package org.geoserver.web.wicket; | |||
|
|||
import org.apache.wicket.Component; | |||
import org.apache.wicket.feedback.FeedbackMessage; | |||
import org.apache.wicket.feedback.FeedbackMessages; | |||
import org.apache.wicket.util.visit.IVisit; | |||
import org.apache.wicket.util.visit.IVisitor; | |||
|
|||
/** | |||
* Cleans messages in components recursively | |||
* | |||
* @author Andrea Aime | |||
*/ | |||
public class FeedbackMessageCleaner<C extends Component, R> implements IVisitor<C, R> { | |||
|
|||
int level; | |||
|
|||
/** | |||
* Builds a cleaner removing all messages at or above the specified level. See {@link FeedbackMessage} for a list of levels | |||
* @param level | |||
*/ | |||
public FeedbackMessageCleaner(int level) { | |||
this.level = level; | |||
} | |||
|
|||
@Override | |||
public void component(C component, IVisit<R> visit) { | |||
if (component.hasFeedbackMessage()) { | |||
FeedbackMessages messages = component.getFeedbackMessages(); | |||
messages.clear(message -> message.getLevel() >= level); | |||
} | |||
|
|||
} | |||
|
|||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters