Mercurial > dive4elements > river
diff flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java @ 1287:95ecb98c6015
Added skeleton for editor window.
flys-client/trunk@2873 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 30 Sep 2011 13:42:00 +0000 |
parents | |
children | f4deeafa60b3 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/chart/StyleEditorWindow.java Fri Sep 30 13:42:00 2011 +0000 @@ -0,0 +1,93 @@ +package de.intevation.flys.client.client.ui.chart; + +import com.google.gwt.core.client.GWT; + +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.layout.HLayout; +import com.smartgwt.client.widgets.Button; + +import com.smartgwt.client.widgets.events.ClickEvent; +import com.smartgwt.client.widgets.events.ClickHandler; + +import de.intevation.flys.client.shared.model.Collection; +import de.intevation.flys.client.shared.model.CollectionItemAttribute; +import de.intevation.flys.client.client.ui.CollectionView; + +import de.intevation.flys.client.client.FLYSConstants; + +/** + * @author <a href="mailto:raimund.renkert@intevation.de">Raimund Renkert</a> + */ +public class StyleEditorWindow +extends Window +implements ClickHandler +{ + /** The interface that provides i18n messages. */ + protected FLYSConstants MSG = GWT.create(FLYSConstants.class); + + /** The collection */ + protected Collection collection; + + /** The parent collection view */ + protected CollectionView view; + + /** The attributes */ + protected CollectionItemAttribute attributes; + + /** Main layout */ + protected VLayout layout; + + + public StyleEditorWindow ( + Collection collection, + CollectionItemAttribute attributes) + { + this.collection = collection; + this.attributes = attributes; + this.layout = new VLayout(); + + init(); + initPanels(); + } + + + protected void init() { + setTitle(MSG.properties()); + setWidth(250); + + setCanDragReposition(true); + setCanDragResize(true); + setKeepInParentRect(true); + + layout.setWidth100(); + layout.setHeight100(); + + } + + + protected void initPanels() { + HLayout buttons = new HLayout(); + Button accept = new Button(MSG.label_ok()); + Button cancel = new Button(MSG.label_cancel()); + cancel.addClickHandler(this); + + + buttons.addMember(accept); + buttons.addMember(cancel); + layout.addMember(buttons); + + addItem(layout); + } + + + public void setCollectionView (CollectionView view) { + this.view = view; + setParentElement(this.view.getParentElement()); + } + + + public void onClick(ClickEvent event) { + this.hide(); + } +}