From b041c6804bc0d5e1dba70e1c9385e10a0983f9cd Mon Sep 17 00:00:00 2001 From: Par Winzell Date: Thu, 16 Dec 2010 17:54:39 +0000 Subject: [PATCH] Since GWT is clearly moving away from (deprecating) TabPanel, let's ween ourselves off of it. However, TabLayoutPanel is a RequiresResize widget, which means it's not a drop-in replacement; it needs to be part of a layout. The easiest way to accomplish this, if you have a degree of control over your page, is with something like: RootLayoutPanel.get().add(new ConfigEditorPanel(barHeight)); git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6387 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../admin/web/client/ConfigEditorPanel.java | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/threerings/admin/web/client/ConfigEditorPanel.java b/src/main/java/com/threerings/admin/web/client/ConfigEditorPanel.java index bb262c941..112ae4ad7 100644 --- a/src/main/java/com/threerings/admin/web/client/ConfigEditorPanel.java +++ b/src/main/java/com/threerings/admin/web/client/ConfigEditorPanel.java @@ -26,10 +26,11 @@ import java.util.Map.Entry; import com.google.common.collect.Maps; +import com.google.gwt.dom.client.Style; import com.google.gwt.core.client.GWT; import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.rpc.ServiceDefTarget; -import com.google.gwt.user.client.ui.TabPanel; +import com.google.gwt.user.client.ui.TabLayoutPanel; import com.threerings.admin.web.client.ConfigEditorTab.ConfigAccessor; import com.threerings.admin.web.gwt.ConfigField; @@ -44,12 +45,24 @@ import com.threerings.gwt.util.PopupCallback; * The main panel of the configuration editor. All service calls are routed through here. * Subclass this class in your project. */ -@SuppressWarnings("deprecation") -public abstract class ConfigEditorPanel extends TabPanel +public abstract class ConfigEditorPanel extends TabLayoutPanel implements ConfigAccessor { - public ConfigEditorPanel () + /** + * Create a ConfigEditorPanel with the given bar height, measured in pixels. + */ + public ConfigEditorPanel (int barPixelHeight) { + this(barPixelHeight, Style.Unit.PX); + } + + /** + * Create a ConfigEditorPanel with the given bar height, measured in the given unit. + */ + public ConfigEditorPanel (int barHeight, Style.Unit unit) + { + super(barHeight, unit); + addStyleName("configEditorPanel"); ((ServiceDefTarget)_configsvc).setServiceEntryPoint(getServiceEntryPoint()); _configsvc.getConfiguration(new PopupCallback() {