@Override public String getDescription() { return delegateFormat.getDescription(); } };
/** * Returns the descriptions for the available DataFormats. * * <p>Arrrg! Put these in the select box. * * @return Descriptions for user to choose from */ public static List listDataFormatsDescriptions() { List list = new ArrayList(); Format[] formats = GridFormatFinder.getFormatArray(); final int length = formats.length; for (int i = 0; i < length; i++) { if (!list.contains(formats[i].getDescription())) { list.add(formats[i].getDescription()); } } return Collections.synchronizedList(list); }
/** * After user has selected Description can aquire Format based on description. * * @param description */ public static Format aquireFactory(String description) { Format[] formats = GridFormatFinder.getFormatArray(); Format format = null; final int length = formats.length; for (int i = 0; i < length; i++) { format = formats[i]; if (format.getDescription().equals(description)) { return format; } } return null; }
@Override protected void populateItem(ListItem item) { final String coverageFactoryName = item.getDefaultModelObjectAsString(); final Map<String, Format> coverages = getAvailableCoverageStores(); Format format = coverages.get(coverageFactoryName); final String description = format.getDescription(); SubmitLink link; link = new SubmitLink("resourcelink") { @Override public void onSubmit() { setResponsePage(new CoverageStoreNewPage(coverageFactoryName)); } }; link.setEnabled(thereAreWorkspaces); link.add(new Label("resourcelabel", coverageFactoryName)); item.add(link); item.add(new Label("resourceDescription", description)); Image icon = new Image("storeIcon", icons.getStoreIcon(format.getClass())); // TODO: icons could provide a description too to be used in alt=... icon.add(new AttributeModifier("alt", true, new Model(""))); item.add(icon); } };
@Override protected void populateItem(ListItem item) { final String coverageFactoryName = item.getDefaultModelObjectAsString(); final Map<String, Format> coverages = getAvailableCoverageStores(); Format format = coverages.get(coverageFactoryName); final String description = format.getDescription(); SubmitLink link; link = new SubmitLink("resourcelink") { @Override public void onSubmit() { setResponsePage( new CoverageStoreNewPage(coverageFactoryName)); } }; link.setEnabled(thereAreWorkspaces); link.add(new Label("resourcelabel", coverageFactoryName)); item.add(link); item.add(new Label("resourceDescription", description)); Image icon = new Image("storeIcon", icons.getStoreIcon(format.getClass())); // TODO: icons could provide a description too to be used in alt=... icon.add(new AttributeModifier("alt", new Model(""))); item.add(icon); } };