Skip to content

Commit

Permalink
Style/Workspace generics
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsCharlier committed Jan 18, 2016
1 parent 9296637 commit 9611fc2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
Expand Up @@ -9,16 +9,18 @@
import org.geoserver.catalog.StyleInfo;
import org.geoserver.web.GeoServerApplication;

public class StyleDetachableModel extends LoadableDetachableModel {
public class StyleDetachableModel extends LoadableDetachableModel<StyleInfo> {

String id;
private static final long serialVersionUID = 1429186780251933703L;

String id;

public StyleDetachableModel(StyleInfo style) {
this.id = style.getId();
}

@Override
protected Object load() {
protected StyleInfo load() {
StyleInfo style = GeoServerApplication.get().getCatalog().getStyle( id );

// Make sure the legend object isn't null
Expand All @@ -30,7 +32,6 @@ protected Object load() {

@Override
protected void onDetach() {
// TODO Auto-generated method stub
super.onDetach();
}

Expand Down
Expand Up @@ -11,14 +11,15 @@
/**
* Simple choice renderer for {@link WorkspaceInfo}
*/
@SuppressWarnings("serial")
public class WorkspaceChoiceRenderer extends ChoiceRenderer {
public class WorkspaceChoiceRenderer extends ChoiceRenderer<WorkspaceInfo> {

public Object getDisplayValue(Object object) {
return ((WorkspaceInfo) object).getName();
private static final long serialVersionUID = 9065816461497078542L;

public Object getDisplayValue(WorkspaceInfo object) {
return object.getName();
}

public String getIdValue(Object object, int index) {
return ((WorkspaceInfo) object).getId();
public String getIdValue(WorkspaceInfo object, int index) {
return object.getId();
}
}

0 comments on commit 9611fc2

Please sign in to comment.