Skip to content

Commit

Permalink
Fix warnings in New* pages
Browse files Browse the repository at this point in the history
  • Loading branch information
smithkm committed Jan 18, 2016
1 parent 89a78b9 commit e5e76d0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
Expand Up @@ -55,7 +55,7 @@ public class NewFeatureTypePage extends GeoServerSecuredPage {

String name;

Form form;
Form<?> form;

AttributesProvider attributesProvider;

Expand All @@ -75,11 +75,11 @@ public NewFeatureTypePage(String workspaceName, String storeName) {
}
this.storeId = di.getId();

form = new Form("form");
form = new Form<>("form");
form.setOutputMarkupId(true);
add(form);

form.add(new TextField("name", new PropertyModel(this, "name")).setRequired(true));
form.add(new TextField<>("name", new PropertyModel<>(this, "name")).setRequired(true));

attributesProvider = new AttributesProvider();
attributeTable = new GeoServerTablePanel<AttributeDescription>("attributes",
Expand Down Expand Up @@ -207,8 +207,8 @@ SimpleFeatureType buildFeatureType() {
return builder.buildFeatureType();
}

private Link cancelLink() {
return new Link("cancel") {
private Link<Void> cancelLink() {
return new Link<Void>("cancel") {

@Override
public void onClick() {
Expand All @@ -218,17 +218,17 @@ public void onClick() {
};
}

Component editAttributeLink(final IModel itemModel) {
Component editAttributeLink(final IModel<AttributeDescription> itemModel) {
GeoServerAjaxFormLink link = new GeoServerAjaxFormLink("link") {

@Override
protected void onClick(AjaxRequestTarget target, Form form) {
AttributeDescription attribute = (AttributeDescription) itemModel.getObject();
protected void onClick(AjaxRequestTarget target, Form<?> form) {
AttributeDescription attribute = itemModel.getObject();
setResponsePage(new AttributeEditPage(attribute, NewFeatureTypePage.this));
}

};
link.add(new Label("name", new PropertyModel(itemModel, "name")));
link.add(new Label("name", new PropertyModel<String>(itemModel, "name")));
return link;
}

Expand All @@ -239,7 +239,7 @@ protected Component headerPanel() {
header.add(new GeoServerAjaxFormLink("addNew", form) {

@Override
public void onClick(AjaxRequestTarget target, Form form) {
public void onClick(AjaxRequestTarget target, Form<?> form) {
AttributeDescription attribute = new AttributeDescription();
setResponsePage(new AttributeNewPage(attribute, NewFeatureTypePage.this));
}
Expand All @@ -248,7 +248,7 @@ public void onClick(AjaxRequestTarget target, Form form) {
header.add(new GeoServerAjaxFormLink("removeSelected", form) {

@Override
public void onClick(AjaxRequestTarget target, Form form) {
public void onClick(AjaxRequestTarget target, Form<?> form) {
attributesProvider.removeAll(attributeTable.getSelection());
attributeTable.clearSelection();
target.add(form);
Expand All @@ -263,7 +263,7 @@ protected Component upDownFragment(String id, final AttributeDescription attribu
if (attributesProvider.isFirst(attribute)) {
upDown.add(new PlaceholderLink("up"));
} else {
ImageAjaxLink upLink = new ImageAjaxLink("up", new PackageResourceReference(getClass(),
ImageAjaxLink<Void> upLink = new ImageAjaxLink<Void>("up", new PackageResourceReference(getClass(),
"../../img/icons/silk/arrow_up.png")) {
@Override
protected void onClick(AjaxRequestTarget target) {
Expand All @@ -277,7 +277,7 @@ protected void onClick(AjaxRequestTarget target) {
if (attributesProvider.isLast(attribute)) {
upDown.add(new PlaceholderLink("down"));
} else {
ImageAjaxLink downLink = new ImageAjaxLink("down", new PackageResourceReference(getClass(),
ImageAjaxLink<Void> downLink = new ImageAjaxLink<Void>("down", new PackageResourceReference(getClass(),
"../../img/icons/silk/arrow_down.png")) {
@Override
protected void onClick(AjaxRequestTarget target) {
Expand All @@ -301,7 +301,7 @@ protected ComponentAuthorizer getPageAuthorizer() {
*
* @author Andrea Aime
*/
class PlaceholderLink extends ImageAjaxLink {
class PlaceholderLink extends ImageAjaxLink<Void> {

public PlaceholderLink(String id) {
super(id, new PackageResourceReference(NewFeatureTypePage.class, "../../img/icons/blank.png"));
Expand Down
Expand Up @@ -79,7 +79,7 @@ public NewLayerPage(String storeId) {
this.storeId = storeId;

// the store selector, used when no store is initially known
Form selector = new Form("selector");
Form<?> selector = new Form<Void>("selector");
selector.add(storesDropDown());
selector.setVisible(storeId == null);
add(selector);
Expand All @@ -93,7 +93,7 @@ public NewLayerPage(String storeId) {
selectLayers.setVisible(storeId != null);
selectLayersContainer.add(selectLayers);

selectLayers.add(storeName = new Label("storeName", new Model()));
selectLayers.add(storeName = new Label("storeName", new Model<String>()));
if(storeId != null) {
StoreInfo store = getCatalog().getStore(storeId, StoreInfo.class);
storeName.setDefaultModelObject(store.getName());
Expand All @@ -110,7 +110,7 @@ protected Component getComponentForProperty(String id,
if (property == NewLayerPageProvider.NAME) {
return new Label(id, property.getModel(itemModel));
} else if (property == NewLayerPageProvider.PUBLISHED) {
final Resource resource = (Resource) itemModel.getObject();
final Resource resource = itemModel.getObject();
final CatalogIconFactory icons = CatalogIconFactory.get();
if(resource.isPublished()) {
PackageResourceReference icon = icons.getEnabledIcon();
Expand All @@ -121,7 +121,7 @@ protected Component getComponentForProperty(String id,
return new Label(id);
}
} else if(property == NewLayerPageProvider.ACTION) {
final Resource resource = (Resource) itemModel.getObject();
final Resource resource = itemModel.getObject();
if(resource.isPublished()) {
return resourceChooserLink(id, itemModel, new ParamResourceModel("publishAgain", this));
} else {
Expand Down Expand Up @@ -171,7 +171,7 @@ protected Component getComponentForProperty(String id,
}

Component newFeatureTypeLink() {
return new AjaxLink("createFeatureType") {
return new AjaxLink<Void>("createFeatureType") {

@Override
public void onClick(AjaxRequestTarget target) {
Expand All @@ -183,7 +183,7 @@ public void onClick(AjaxRequestTarget target) {
}

Component newSQLViewLink() {
return new AjaxLink("createSQLView") {
return new AjaxLink<Void>("createSQLView") {

@Override
public void onClick(AjaxRequestTarget target) {
Expand All @@ -195,7 +195,7 @@ public void onClick(AjaxRequestTarget target) {
}

Component newCoverageViewLink() {
return new AjaxLink("createCoverageView") {
return new AjaxLink<Void>("createCoverageView") {

@Override
public void onClick(AjaxRequestTarget target) {
Expand All @@ -207,7 +207,7 @@ public void onClick(AjaxRequestTarget target) {
}

Component newCascadedWFSStoredQueryLink() {
return new AjaxLink("createCascadedWFSStoredQuery") {
return new AjaxLink<Void>("createCascadedWFSStoredQuery") {

@Override
public void onClick(AjaxRequestTarget target) {
Expand All @@ -219,19 +219,18 @@ public void onClick(AjaxRequestTarget target) {
}

Component newWMSImportLink() {
return new AjaxLink("createWMSImport") {
return new AjaxLink<Void>("createWMSImport") {

@Override
public void onClick(AjaxRequestTarget target) {
WMSStoreInfo wms = getCatalog().getStore(storeId, WMSStoreInfo.class);
PageParameters pp = new PageParameters().add("storeId", storeId);
setResponsePage(WMSLayerImporterPage.class, pp);
}
};
}

private DropDownChoice storesDropDown() {
final DropDownChoice stores = new DropDownChoice("storesDropDown", new Model(),
private DropDownChoice<StoreInfo> storesDropDown() {
final DropDownChoice<StoreInfo> stores = new DropDownChoice<>("storesDropDown", new Model<StoreInfo>(),
new StoreListModel(), new StoreListChoiceRenderer());
stores.setOutputMarkupId(true);
stores.add(new AjaxFormComponentUpdatingBehavior("onchange") {
Expand Down Expand Up @@ -271,8 +270,8 @@ protected void onUpdate(AjaxRequestTarget target) {
return stores;
}

SimpleAjaxLink resourceChooserLink(String id, IModel itemModel, IModel label) {
return new SimpleAjaxLink(id, itemModel, label) {
SimpleAjaxLink<Resource> resourceChooserLink(String id, IModel<Resource> itemModel, IModel<String> label) {
return new SimpleAjaxLink<Resource>(id, itemModel, label) {

@Override
protected void onClick(AjaxRequestTarget target) {
Expand All @@ -298,7 +297,7 @@ void updateSpecialFunctionPanels(StoreInfo store) {
createCascadedWFSStoredQueryContainer.setVisible(false);
if (store instanceof DataStoreInfo) {
try {
DataAccess da = ((DataStoreInfo) store).getDataStore(null);
DataAccess<?,?> da = ((DataStoreInfo) store).getDataStore(null);

createSQLViewContainer.setVisible(da instanceof JDBCDataStore);

Expand Down

0 comments on commit e5e76d0

Please sign in to comment.