Mercurial > dive4elements > river
view flys-client/src/main/java/de/intevation/flys/client/client/ui/CollectionView.java @ 7:a65793e08245
Radio buttons for each plugin are displayed if a new CollectionView is created.
flys-client/trunk@1315 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Fri, 11 Feb 2011 11:16:55 +0000 |
parents | e2b3966b40ca |
children | 8d9075c07667 |
line wrap: on
line source
package de.intevation.flys.client.client.ui; import com.google.gwt.core.client.GWT; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.ui.RadioButton; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; import com.smartgwt.client.widgets.tab.TabSet; import de.intevation.flys.client.shared.model.Collection; import de.intevation.flys.client.client.FLYSMessages; /** * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> */ public class CollectionView extends Window { /** The message class that provides i18n strings.*/ FLYSMessages messages = GWT.create(FLYSMessages.class); /** The collection to be displayed.*/ protected Collection collection; /** The parameter tab.*/ protected Tab parameterTab; /** The output tab.*/ protected Tab outputTab; /** * This constructor creates a new CollectionView that is used to display the * <i>collection</i>. * * @param collection The collection to be displayed. */ public CollectionView(Collection collection) { this.collection = collection; init(); } /** * This method handles the initial layout stuff. */ protected void init() { setWidth(600); setHeight(400); setCanDragResize(true); DateTimeFormat dtf = DateTimeFormat.getFormat(messages.date_format()); String lastAccess = dtf.format(collection.getLastAccess()); setTitle(lastAccess + " - " + collection.getName()); VLayout layout = new VLayout(); addItem(layout); if (isNew()) { layout.addMember(renderNew()); } } /** * This method returns true, if the Collection is new and no plugins has * been chosen. * * @return true, if the Collection is new. */ public boolean isNew() { return true; } /** * This method creates a Canvas displaying the plugins of FLYS. * * @return a Canvas that displays the plugins of FLYS. */ protected Canvas renderNew() { HLayout layout = new HLayout(); layout.setWidth100(); DynamicForm form = new DynamicForm(); RadioGroupItem radio = new RadioGroupItem("plugin"); radio.setShowTitle(false); radio.setVertical(false); radio.setValueMap( messages.winfo(), messages.minfo(), messages.map(), messages.fix()); form.setFields(radio); layout.addMember(form); return layout; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :