[kune-commits] r780 - in sandbox3: . src/main/java/org/op
src/main/java/org/op/client src/main/java/org/op/public
vjrj
vjrj at ourproject.org
Thu Jul 3 04:28:35 CEST 2008
Author: vjrj
Date: 2008-07-03 04:28:30 +0200 (Thu, 03 Jul 2008)
New Revision: 780
Removed:
sandbox3/src/main/java/org/op/client/DefaultTabPanel.java
sandbox3/src/main/java/org/op/client/DefaultTabbedForm.java
Modified:
sandbox3/pom.xml
sandbox3/src/main/java/org/op/Sandbox.gwt.xml
sandbox3/src/main/java/org/op/client/DefaultBorderLayout.java
sandbox3/src/main/java/org/op/client/EntityWorkspace.java
sandbox3/src/main/java/org/op/client/FakeToolbar.java
sandbox3/src/main/java/org/op/client/Sandbox.java
sandbox3/src/main/java/org/op/client/SiteBar.java
sandbox3/src/main/java/org/op/client/Workspace.java
sandbox3/src/main/java/org/op/public/Sandbox.html
sandbox3/src/main/java/org/op/public/sandbox.css
Log:
more ext probes
Modified: sandbox3/pom.xml
===================================================================
--- sandbox3/pom.xml 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/pom.xml 2008-07-03 02:28:30 UTC (rev 780)
@@ -123,16 +123,19 @@
</dependency>
<!-- ui -->
+<!--
<dependency>
<groupId>com.extjs</groupId>
<artifactId>gxt</artifactId>
<version>1.0-beta2</version>
</dependency>
+-->
+
<dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
- <version>2.0.4-beta2</version>
+ <version>2.0.4</version>
</dependency>
<dependency>
Modified: sandbox3/src/main/java/org/op/Sandbox.gwt.xml
===================================================================
--- sandbox3/src/main/java/org/op/Sandbox.gwt.xml 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/Sandbox.gwt.xml 2008-07-03 02:28:30 UTC (rev 780)
@@ -8,9 +8,11 @@
<script src="js/ext/adapter/ext/ext-base.js" />
<script src="js/ext/ext-all.js" />
+<!--
<inherits name='com.extjs.gxt.ui.GXT' />
<stylesheet src="css/ext-all.css" />
<stylesheet src="css/xtheme-gray.css" />
+ -->
<stylesheet src="js/ext/resources/css/ext-all.css"/>
<stylesheet src="js/ext/resources/css/xtheme-gray.css"/>
Modified: sandbox3/src/main/java/org/op/client/DefaultBorderLayout.java
===================================================================
--- sandbox3/src/main/java/org/op/client/DefaultBorderLayout.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/DefaultBorderLayout.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -12,7 +12,7 @@
public class DefaultBorderLayout {
public enum Position {
- NORTH, CENTER, SOUTH, EAST, WEST
+ NORTH, CENTER, SOUTH, EAST, WEST
}
protected static final int DEF_TOOLBAR_HEIGHT = 22;
@@ -20,111 +20,115 @@
private static final int NO_SIZE = -1;
private static RegionPosition[] regionPositions = new RegionPosition[] { RegionPosition.NORTH,
- RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
+ RegionPosition.CENTER, RegionPosition.SOUTH, RegionPosition.EAST, RegionPosition.WEST };
private final Panel mainPanel;
public DefaultBorderLayout() {
- mainPanel = new Panel();
- mainPanel.setLayout(new BorderLayout());
- mainPanel.setBorder(false);
+ mainPanel = new Panel();
+ mainPanel.setLayout(new BorderLayout());
+ mainPanel.setBorder(false);
}
+ public void setBorder(final boolean border) {
+ mainPanel.setBorder(border);
+ }
+
protected void add(final Panel panel, final Position position) {
- add(panel, position, false);
+ add(panel, position, false);
}
protected void add(final Panel panel, final Position position, final boolean split) {
- add(panel, position, split, NO_SIZE);
+ add(panel, position, split, NO_SIZE);
}
protected void add(final Panel panel, final Position position, final boolean split, final int size) {
- RegionPosition regionPosition = regionPositions[position.ordinal()];
- BorderLayoutData borderLayoutData = new BorderLayoutData(regionPosition);
- borderLayoutData.setSplit(split);
- if (split) {
- borderLayoutData.setUseSplitTips(true);
- borderLayoutData.setCollapseModeMini(true);
- }
- if (size != NO_SIZE) {
- switch (position) {
- case NORTH:
- case SOUTH:
- panel.setHeight(size);
- break;
- case EAST:
- case WEST:
- panel.setWidth(size);
- }
- }
- mainPanel.add(panel, borderLayoutData);
- doLayoutIfNeeded();
+ final RegionPosition regionPosition = regionPositions[position.ordinal()];
+ final BorderLayoutData borderLayoutData = new BorderLayoutData(regionPosition);
+ borderLayoutData.setSplit(split);
+ if (split) {
+ borderLayoutData.setUseSplitTips(true);
+ borderLayoutData.setCollapseModeMini(true);
+ }
+ if (size != NO_SIZE) {
+ switch (position) {
+ case NORTH:
+ case SOUTH:
+ panel.setHeight(size);
+ break;
+ case EAST:
+ case WEST:
+ panel.setWidth(size);
+ }
+ }
+ mainPanel.add(panel, borderLayoutData);
+ doLayoutIfNeeded();
}
protected void add(final Panel panel, final Position position, final int size) {
- add(panel, position, false, size);
+ add(panel, position, false, size);
}
protected void add(final Panel panel, final Widget widget) {
- panel.add(widget);
- // FIXME: test if this is is necessary
- if (panel.isRendered()) {
- panel.syncSize();
- panel.doLayout();
- }
- // FIXME: useDoLayoutIfNeeded
- if (mainPanel.isRendered()) {
- mainPanel.syncSize();
- mainPanel.doLayout();
- }
+ panel.add(widget);
+ // FIXME: test if this is is necessary
+ if (panel.isRendered()) {
+ panel.syncSize();
+ panel.doLayout();
+ }
+ // FIXME: useDoLayoutIfNeeded
+ if (mainPanel.isRendered()) {
+ mainPanel.syncSize();
+ mainPanel.doLayout();
+ }
}
protected Toolbar createBottomBar(final Panel panel) {
- return createBottomBar(panel, null);
+ return createBottomBar(panel, null);
}
protected Toolbar createBottomBar(final Panel panel, final String cssStyle) {
- final Toolbar bottomToolbar = new Toolbar();
- bottomToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
- if (cssStyle != null) {
- bottomToolbar.setCls(cssStyle);
- }
- panel.setBottomToolbar(bottomToolbar);
- return bottomToolbar;
+ final Toolbar bottomToolbar = new Toolbar();
+ bottomToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ bottomToolbar.setCls(cssStyle);
+ }
+ panel.setBottomToolbar(bottomToolbar);
+ return bottomToolbar;
}
protected Toolbar createTopBar(final Panel panel) {
- return createTopBar(panel, null);
+ return createTopBar(panel, null);
}
protected Toolbar createTopBar(final Panel panel, final String cssStyle) {
- final Toolbar topToolbar = new Toolbar();
- topToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
- if (cssStyle != null) {
- topToolbar.setCls(cssStyle);
- }
- panel.setTopToolbar(topToolbar);
- return topToolbar;
+ final Toolbar topToolbar = new Toolbar();
+ topToolbar.setHeight(DEF_TOOLBAR_HEIGHT);
+ if (cssStyle != null) {
+ topToolbar.setCls(cssStyle);
+ }
+ panel.setTopToolbar(topToolbar);
+ return topToolbar;
}
protected void doLayoutIfNeeded() {
- if (mainPanel.isRendered()) {
- mainPanel.doLayout();
- }
+ if (mainPanel.isRendered()) {
+ mainPanel.doLayout();
+ }
}
protected Panel getPanel() {
- return mainPanel;
+ return mainPanel;
}
protected void setCls(final String style) {
- mainPanel.setCls(style);
+ mainPanel.setCls(style);
}
protected void setPanel(final Panel panel, final View view) {
- Widget widget = (Widget) view;
- panel.clear();
- add(panel, widget);
+ final Widget widget = (Widget) view;
+ panel.clear();
+ add(panel, widget);
}
}
Deleted: sandbox3/src/main/java/org/op/client/DefaultTabPanel.java
===================================================================
--- sandbox3/src/main/java/org/op/client/DefaultTabPanel.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/DefaultTabPanel.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -1,23 +0,0 @@
-package org.op.client;
-
-import com.extjs.gxt.ui.client.widget.TabItem;
-import com.extjs.gxt.ui.client.widget.TabPanel;
-
-public class DefaultTabPanel {
-
- private final TabPanel tabPanel;
-
- public DefaultTabPanel() {
- tabPanel = new TabPanel();
- tabPanel.setTabScroll(true);
- }
-
- public void addTabItem(final TabItem item) {
- tabPanel.add(item);
- tabPanel.setSelection(item);
- }
-
- public TabPanel getTabPanel() {
- return tabPanel;
- }
-}
Deleted: sandbox3/src/main/java/org/op/client/DefaultTabbedForm.java
===================================================================
--- sandbox3/src/main/java/org/op/client/DefaultTabbedForm.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/DefaultTabbedForm.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -1,45 +0,0 @@
-package org.op.client;
-
-import com.extjs.gxt.ui.client.Style.HorizontalAlignment;
-import com.extjs.gxt.ui.client.widget.Button;
-import com.extjs.gxt.ui.client.widget.TabItem;
-import com.extjs.gxt.ui.client.widget.TabPanel;
-import com.extjs.gxt.ui.client.widget.form.FormPanel;
-import com.extjs.gxt.ui.client.widget.layout.FormLayout;
-
-public class DefaultTabbedForm {
- private final FormPanel formPanel;
- private final TabPanel tabPanel;
-
- public DefaultTabbedForm(final int width, final int labelWidth) {
- formPanel = new FormPanel();
- formPanel.setFrame(true);
- formPanel.setLabelWidth(labelWidth);
- formPanel.setBorder(false);
- formPanel.setWidth(width);
- formPanel.setButtonAlign(HorizontalAlignment.RIGHT);
-
- tabPanel = new TabPanel();
- formPanel.add(tabPanel);
- }
-
- public void addButton(final Button button) {
- formPanel.addButton(button);
- }
-
- public void addTab(final String title, final TabItem tab) {
- tab.setTitle(title);
- tab.setLayout(new FormLayout());
- tab.setAutoHeight(true);
- // tab.setPaddings(10);
- tabPanel.add(tab);
- if (tabPanel.isRendered()) {
- tabPanel.render(tab.getElement());
- }
- }
-
- public FormPanel getForm() {
- return formPanel;
- }
-
-}
Modified: sandbox3/src/main/java/org/op/client/EntityWorkspace.java
===================================================================
--- sandbox3/src/main/java/org/op/client/EntityWorkspace.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/EntityWorkspace.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -11,97 +11,122 @@
public class EntityWorkspace extends DefaultBorderLayout {
private static final String SAMPLE_COLOR = "blue";
- private final FakeToolbar contentTopBar;
- private final FakeToolbar containerTopBar;
+ private final Toolbar contentTopBar;
@SuppressWarnings("unused")
private final Toolbar contentBottomBar;
@SuppressWarnings("unused")
- private final Toolbar containerBottomBar;
private final Panel container;
private final Panel content;
private final Panel bottom;
private final Panel title;
private final Panel subTitle;
+ private final FakeToolbar containerTopBar;
+ private final FakeToolbar containerBottomBar;
public EntityWorkspace() {
- super.setCls("entityworkspace");
- Panel titles = new Panel();
- titles.setBorder(false);
- titles.setLayout(new AnchorLayout());
+ super.setCls("entityworkspace");
+ final Panel titles = new Panel();
+ titles.setBorder(false);
+ titles.setLayout(new AnchorLayout());
- title = new Panel();
- title.setBorder(false);
- title.setBaseCls("entity-title");
- subTitle = new Panel();
- subTitle.setBorder(false);
- subTitle.setBaseCls("entity-subtitle");
- bottom = new Panel();
- bottom.setBorder(false);
- bottom.setBaseCls("entity-bottom");
+ title = new Panel();
+ title.setBorder(false);
+ title.setBaseCls("entity-title");
+ subTitle = new Panel();
+ subTitle.setBorder(false);
+ subTitle.setBaseCls("entity-subtitle");
+ bottom = new Panel();
+ bottom.setBorder(false);
+ bottom.setBaseCls("entity-bottom");
- RoundedBorderDecorator roundedTitle = new RoundedBorderDecorator(title, RoundedBorderDecorator.TOPLEFT);
- roundedTitle.setColor(SAMPLE_COLOR);
- // roundedTitle.addStyleName("entity-title-rd");
- roundedTitle.setHeight("" + DEF_TOOLBAR_HEIGHT);
+ final RoundedBorderDecorator roundedTitle = new RoundedBorderDecorator(title, RoundedBorderDecorator.TOPLEFT);
+ roundedTitle.setColor(SAMPLE_COLOR);
+ // roundedTitle.addStyleName("entity-title-rd");
+ roundedTitle.setHeight("" + DEF_TOOLBAR_HEIGHT);
- RoundedBorderDecorator roundedBottom = new RoundedBorderDecorator(bottom, RoundedBorderDecorator.BOTTOMLEFT);
- roundedBottom.setColor(SAMPLE_COLOR);
- // roundedBottom.addStyleName("entity-bottom-rd");
- roundedBottom.setHeight("" + DEF_TOOLBAR_HEIGHT);
+ final RoundedBorderDecorator roundedBottom = new RoundedBorderDecorator(bottom,
+ RoundedBorderDecorator.BOTTOMLEFT);
+ roundedBottom.setColor(SAMPLE_COLOR);
+ // roundedBottom.addStyleName("entity-bottom-rd");
+ roundedBottom.setHeight("" + DEF_TOOLBAR_HEIGHT);
- titles.add(roundedTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
- titles.add(subTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ titles.add(roundedTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ titles.add(subTitle, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
- DefaultBorderLayout contentWrap = new DefaultBorderLayout();
- DefaultBorderLayout containerWrap = new DefaultBorderLayout();
- content = new Panel();
- container = new Panel();
- container.setCollapsible(true);
- content.setPaddings(5);
- container.setPaddings(5);
+ final DefaultBorderLayout contentWrap = new DefaultBorderLayout();
+ final DefaultBorderLayout containerWrap = new DefaultBorderLayout();
+ containerWrap.setBorder(true);
+ content = new Panel();
+ container = new Panel();
+ container.setBorder(false);
+ container.setCollapsible(true);
+ content.setPaddings(5);
+ container.setPaddings(5);
- Panel bottomPanel = new Panel();
- bottomPanel.setBorder(false);
- bottomPanel.setLayout(new AnchorLayout());
- bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
+ final Panel bottomPanel = new Panel();
+ bottomPanel.setBorder(false);
+ bottomPanel.setLayout(new AnchorLayout());
+ bottomPanel.add(roundedBottom, new AnchorLayoutData("100% -" + DEF_TOOLBAR_HEIGHT));
- contentTopBar = new FakeToolbar();
- containerTopBar = new FakeToolbar();
- contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
- containerWrap.add(containerTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
- contentWrap.add(content, Position.CENTER);
- containerWrap.add(container, Position.CENTER);
- contentBottomBar = createBottomBar(content);
- containerBottomBar = createBottomBar(container);
+ // contentTopBar = new FakeToolbar();
+ contentTopBar = createTopBar(content);
+ containerTopBar = new FakeToolbar();
+ containerBottomBar = new FakeToolbar();
+ containerTopBar.addClass("faketoolbar-bottom-line");
+ containerBottomBar.addClass("faketoolbar-top-line");
+ // contentWrap.add(contentTopBar.getPanel(), Position.NORTH, false,
+ // DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(containerTopBar.getPanel(), Position.NORTH, false, DEF_TOOLBAR_HEIGHT);
+ containerWrap.add(container, Position.CENTER);
+ containerWrap.add(containerBottomBar.getPanel(), Position.SOUTH, false, DEF_TOOLBAR_HEIGHT);
+ contentWrap.add(content, Position.CENTER);
+ contentBottomBar = createBottomBar(content);
- add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
- add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
- add(containerWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
- add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT);
+ add(titles, DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT * 2);
+ add(contentWrap.getPanel(), DefaultBorderLayout.Position.CENTER);
+ add(containerWrap.getPanel(), DefaultBorderLayout.Position.EAST, true, 175);
+ add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT);
}
+ public void addItemToContainerBottomBar(final View view) {
+ containerBottomBar.add((Widget) view);
+ }
+
+ public void addItemToContainerTopBar(final View view) {
+ containerTopBar.add((Widget) view);
+ }
+
public void addItemToContentTopBar(final View view) {
- contentTopBar.add((Widget) view);
+ // final Container container = new Container();
+ // final Widget widget = (Widget) view;
+ // container.add(widget);
+ // component.setEl(widget.getElement());
+ // final Adapter adapter = new Adapter(component);
+ // final WidgetComponent component = new WidgetComponent((Widget) view);
+ // contentTopBar.getElement().appendChild(component.getElement());
+ // contentTopBar.getElement().appendChild(container.getElement());
+ // contentTopBar.addElement(container.getElement());
+ setPanel(content, view);
}
public void setBottom(final View view) {
- setPanel(bottom, view);
+ setPanel(bottom, view);
}
public void setContainer(final View view) {
- setPanel(container, view);
+ setPanel(container, view);
}
public void setContent(final View view) {
- setPanel(content, view);
+ setPanel(content, view);
}
public void setSubtitle(final View view) {
- setPanel(subTitle, view);
+ setPanel(subTitle, view);
}
public void setTitle(final View view) {
- setPanel(title, view);
+ setPanel(title, view);
}
}
Modified: sandbox3/src/main/java/org/op/client/FakeToolbar.java
===================================================================
--- sandbox3/src/main/java/org/op/client/FakeToolbar.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/FakeToolbar.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -1,9 +1,7 @@
package org.op.client;
-import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.layout.FitLayout;
public class FakeToolbar {
private final Panel container;
@@ -11,40 +9,52 @@
// private final Panel horPanel;
public FakeToolbar() {
- container = new Panel();
- container.setLayout(new FitLayout());
- container.setBorder(false);
- container.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
- container.setWidth("100%");
- container.setCls("x-toolbar");
- // x-panel-tbar x-panel-tbar-noheader
- container.setCls("x-panel-tbar");
- // container.setCls("x-panel-tbar-noheader");
- // container.setCls("x-panel-header");
- // container.setCls("x-panel-header-noborder");
- // container.setCls("x-unselectable");
- // horPanel = new Panel();
- // horPanel.setLayout(new HorizontalLayout(3));
- // horPanel.setBorder(false);
- // horPanel.setCls("x-toolbar");
- // horPanel.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
- // horPanel.setWidth("100%");
- container.add(new Label("testkk"));
- // container.add(horPanel);
- // <div class="x-toolbar x-small-editor" id="ext-gen74" style="height:
- // 17px;"><table cellspacing="0"><tbody><tr/></tbody></table></div>
+ container = new Panel();
+ // container.setFrame(true);
+ // container.setLayout(new FitLayout());
+ container.setBorder(false);
+ container.setBodyBorder(false);
+ container.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ container.setWidth("100%");
+ container.setHeader(false);
+ // container.addClass("x-toolbar");
+ // x-panel-tbar x-panel-tbar-noheader
+ container.setBaseCls("x-toolbar");
+ container.addClass("x-panel");
+ // container.addClass("x-panel-tbar-noheader");
+ // container.setBodyStyle("x-panel-tbar");
+ // Adapter adapter = new Adapter();
+ // container.setCls("x-panel-tbar-noheader");
+ // container.setCls("x-panel-header");
+ // container.setCls("x-panel-header-noborder");
+ // container.setCls("x-unselectable");
+ // horPanel = new Panel();
+ // horPanel.setLayout(new HorizontalLayout(3));
+ // horPanel.setBorder(false);
+ // horPanel.setCls("x-toolbar");
+ // horPanel.setHeight(DefaultBorderLayout.DEF_TOOLBAR_HEIGHT);
+ // horPanel.setWidth("100%");
+ // container.add(horPanel);
+ // <div class="x-toolbar x-small-editor" id="ext-gen74" style="height:
+ // 17px;"><table cellspacing="0"><tbody><tr/></tbody></table></div>
+
}
public void add(final Widget widget) {
- // horPanel.add(widget);
- if (container.isRendered()) {
- container.doLayout(true);
- }
+ // horPanel.add(widget);
+ container.add(widget);
+ if (container.isRendered()) {
+ container.doLayout(true);
+ }
}
+ public void addClass(final String cls) {
+ container.addClass(cls);
+ }
+
public Panel getPanel() {
- return container;
+ return container;
}
}
Modified: sandbox3/src/main/java/org/op/client/Sandbox.java
===================================================================
--- sandbox3/src/main/java/org/op/client/Sandbox.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/Sandbox.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -18,125 +18,130 @@
public class Sandbox implements EntryPoint {
class LabelWrapper extends Label implements View {
- public LabelWrapper(final String text) {
- super(text);
- }
+ public LabelWrapper(final String text) {
+ super(text);
+ }
}
class MenuBarWrapper extends Composite implements View {
- public MenuBarWrapper() {
+ public MenuBarWrapper() {
- // Make a command that we will execute from all leaves.
- Command cmd = new Command() {
- public void execute() {
- Window.alert("You selected a menu item!");
- }
- };
+ // Make a command that we will execute from all leaves.
+ final Command cmd = new Command() {
+ public void execute() {
+ Window.alert("You selected a menu item!");
+ }
+ };
- // Make some sub-menus that we will cascade from the top menu.
- MenuBar fooMenu = new MenuBar(true);
- fooMenu.addItem("the", cmd);
- fooMenu.addItem("foo", cmd);
- fooMenu.addItem("menu", cmd);
+ // Make some sub-menus that we will cascade from the top menu.
+ final MenuBar fooMenu = new MenuBar(true);
+ fooMenu.addItem("the", cmd);
+ fooMenu.addItem("foo", cmd);
+ fooMenu.addItem("menu", cmd);
- MenuBar barMenu = new MenuBar(true);
- barMenu.addItem("the", cmd);
- barMenu.addItem("bar", cmd);
- barMenu.addItem("menu", cmd);
+ final MenuBar barMenu = new MenuBar(true);
+ barMenu.addItem("the", cmd);
+ barMenu.addItem("bar", cmd);
+ barMenu.addItem("menu", cmd);
- MenuBar bazMenu = new MenuBar(true);
- bazMenu.addItem("the", cmd);
- bazMenu.addItem("baz", cmd);
- bazMenu.addItem("menu", cmd);
+ final MenuBar bazMenu = new MenuBar(true);
+ bazMenu.addItem("the", cmd);
+ bazMenu.addItem("baz", cmd);
+ bazMenu.addItem("menu", cmd);
- // Make a new menu bar, adding a few cascading menus to it.
- MenuBar menu = new MenuBar();
- menu.addItem("foo", fooMenu);
- menu.addItem("bar", barMenu);
- menu.addItem("baz", bazMenu);
- initWidget(menu);
- }
+ // Make a new menu bar, adding a few cascading menus to it.
+ final MenuBar menu = new MenuBar();
+ menu.addItem("foo", fooMenu);
+ menu.addItem("bar", barMenu);
+ menu.addItem("baz", bazMenu);
+ initWidget(menu);
+ }
}
/**
* This is the entry point method.
*/
public void onModuleLoad() {
- // final DefaultTabbedForm form = new DefaultTabbedForm(300, 75);
- //
- // form.addButton(new Button("Save"));
- //
- // final TabItem tab = new TabItem();
- //
- // final TextField field1 = new TextField();
- // final TextField field2 = new TextField();
- // field1.setFieldLabel("Nombre");
- // field2.setFieldLabel("App");
- // tab.add(field1);
- // tab.add(field2);
- //
- // final TabItem tab2 = new TabItem();
- // final TextField field3 = new TextField();
- // final TextField field4 = new TextField();
- // field3.setFieldLabel("Nombre");
- // field4.setFieldLabel("App");
- // tab2.add(field3);
- // tab2.add(field4);
- //
- // form.addTab("Primero", tab);
- // form.addTab("Segundo", tab2);
- // dialog.add(form.getForm());
+ // final DefaultTabbedForm form = new DefaultTabbedForm(300, 75);
+ //
+ // form.addButton(new Button("Save"));
+ //
+ // final TabItem tab = new TabItem();
+ //
+ // final TextField field1 = new TextField();
+ // final TextField field2 = new TextField();
+ // field1.setFieldLabel("Nombre");
+ // field2.setFieldLabel("App");
+ // tab.add(field1);
+ // tab.add(field2);
+ //
+ // final TabItem tab2 = new TabItem();
+ // final TextField field3 = new TextField();
+ // final TextField field4 = new TextField();
+ // field3.setFieldLabel("Nombre");
+ // field4.setFieldLabel("App");
+ // tab2.add(field3);
+ // tab2.add(field4);
+ //
+ // form.addTab("Primero", tab);
+ // form.addTab("Segundo", tab2);
+ // dialog.add(form.getForm());
- final Workspace wk = new Workspace();
- // EntityCnt ent = new EntityCnt();
+ final Workspace wk = new Workspace();
+ // EntityCnt ent = new EntityCnt();
- Panel panel = new Panel();
- panel.setBorder(false);
- panel.setPaddings(5);
- panel.setLayout(new FitLayout());
- // panel.add(ent.getPanel());
- panel.add(wk.getPanel());
+ final Panel panel = new Panel();
+ panel.setBorder(false);
+ panel.setPaddings(5);
+ panel.setLayout(new FitLayout());
+ // panel.add(ent.getPanel());
+ panel.add(wk.getPanel());
- new Viewport(panel);
- wk.getEntityWorkspace().addItemToContentTopBar(new MenuBarWrapper());
- wk.getEntityWorkspace().setContainer(new LabelWrapper("Container"));
- wk.getEntityWorkspace().setContent(new LabelWrapper("Content"));
- wk.getEntityWorkspace().setBottom(new LabelWrapper("Bottom"));
- wk.getEntityWorkspace().setTitle(new LabelWrapper("Title"));
- wk.getEntityWorkspace().setSubtitle(new LabelWrapper("Subtitle"));
- wk.getSiteBar().add(new LabelWrapper("sitebar-right"));
- // final TabItem item1 = new TabItem();
- // item1.setText("Nose que1");
- // item1.add(new Label("Hola 1"));
- // tabPanel.addTabItem(item1);
- //
- // final TabItem item2 = new TabItem();
- // item2.setText("Nose que2");
- // item2.add(new Label("Hola 2"));
- // tabPanel.addTabItem(item2);
- // final TextField field1 = new TextField();
- // final TextField field2 = new TextField();
- // field1.setFieldLabel("Nombre");
- // field2.setFieldLabel("App");
- // item1.add(field1);
- // item2.add(field2);
- //
- // final Window window = new Window();
- // window.add(tabPanel.getTabPanel());
- // RootPanel.get().add(panel);
- // window.setTitle("Layout Window");
- // window.setClosable(true);
- // window.setWidth(600);
- // window.setHeight(350);
- // window.setPlain(true);
- // window.setLayout(new BorderLayout());
- // final BorderLayoutData centerData = new
- // BorderLayoutData(RegionPosition.CENTER);
- // // final Panel panel = new Panel();
- // // panel.add(form.getForm());
- // window.add(form.getForm(), centerData);
- // window.setCloseAction(Window.HIDE);
- // RootPanel.get("slot1").add(window);
- // window.show();
+ new Viewport(panel);
+ wk.getEntityWorkspace().addItemToContentTopBar(new MenuBarWrapper());
+ wk.getEntityWorkspace().addItemToContainerTopBar(new MenuBarWrapper());
+ wk.getEntityWorkspace().addItemToContainerBottomBar(new MenuBarWrapper());
+ wk.getEntityWorkspace().addItemToContainerBottomBar(new LabelWrapper("otro"));
+ wk.getEntityWorkspace().setContainer(new LabelWrapper("Container"));
+ wk.getEntityWorkspace().setContent(new LabelWrapper("Content"));
+ // wk.getEntityWorkspace().setContent(fooMenu);
+ wk.getEntityWorkspace().setBottom(new LabelWrapper("Bottom"));
+ wk.getEntityWorkspace().setTitle(new LabelWrapper("Title"));
+ wk.getEntityWorkspace().setSubtitle(new LabelWrapper("Subtitle"));
+ wk.getSiteBar().add(new LabelWrapper("sitebar-right"));
+
+ // final TabItem item1 = new TabItem();
+ // item1.setText("Nose que1");
+ // item1.add(new Label("Hola 1"));
+ // tabPanel.addTabItem(item1);
+ //
+ // final TabItem item2 = new TabItem();
+ // item2.setText("Nose que2");
+ // item2.add(new Label("Hola 2"));
+ // tabPanel.addTabItem(item2);
+ // final TextField field1 = new TextField();
+ // final TextField field2 = new TextField();
+ // field1.setFieldLabel("Nombre");
+ // field2.setFieldLabel("App");
+ // item1.add(field1);
+ // item2.add(field2);
+ //
+ // final Window window = new Window();
+ // window.add(tabPanel.getTabPanel());
+ // RootPanel.get().add(panel);
+ // window.setTitle("Layout Window");
+ // window.setClosable(true);
+ // window.setWidth(600);
+ // window.setHeight(350);
+ // window.setPlain(true);
+ // window.setLayout(new BorderLayout());
+ // final BorderLayoutData centerData = new
+ // BorderLayoutData(RegionPosition.CENTER);
+ // // final Panel panel = new Panel();
+ // // panel.add(form.getForm());
+ // window.add(form.getForm(), centerData);
+ // window.setCloseAction(Window.HIDE);
+ // RootPanel.get("slot1").add(window);
+ // window.show();
}
}
Modified: sandbox3/src/main/java/org/op/client/SiteBar.java
===================================================================
--- sandbox3/src/main/java/org/op/client/SiteBar.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/SiteBar.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -2,32 +2,26 @@
import org.ourproject.kune.platf.client.View;
-import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
import com.gwtext.client.widgets.Panel;
-public class SiteBar extends DefaultBorderLayout {
+public class SiteBar {
- private final Panel rightPanel;;
+ private final Panel panel;
public SiteBar() {
- rightPanel = createDefPanel();
- // rightPanel.setAutoWidth(true);
- Panel centerPanel = createDefPanel();
- add(centerPanel, Position.CENTER);
- add(rightPanel, Position.EAST);
- rightPanel.add(new Label("Site"));
+ panel = new Panel();
+ panel.setBorder(false);
}
public void add(final View view) {
- setPanel(rightPanel, view);
+ panel.add((Widget) view);
+ if (panel.isRendered()) {
+ panel.doLayout(false);
+ }
}
- private Panel createDefPanel() {
- Panel panel = new Panel();
- // panel.setLayout(new HorizontalLayout(3));
- panel.setAutoWidth(true);
- panel.setHeight(DEF_TOOLBAR_HEIGHT);
- panel.setBorder(false);
- return panel;
+ public Panel getPanel() {
+ return panel;
}
}
Modified: sandbox3/src/main/java/org/op/client/Workspace.java
===================================================================
--- sandbox3/src/main/java/org/op/client/Workspace.java 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/client/Workspace.java 2008-07-03 02:28:30 UTC (rev 780)
@@ -5,17 +5,17 @@
private final SiteBar sitebar;
public Workspace() {
- sitebar = new SiteBar();
- entity = new Entity();
- add(sitebar.getPanel(), DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT);
- add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
+ sitebar = new SiteBar();
+ entity = new Entity();
+ add(sitebar.getPanel(), DefaultBorderLayout.Position.NORTH, DEF_TOOLBAR_HEIGHT);
+ add(entity.getPanel(), DefaultBorderLayout.Position.CENTER);
}
public EntityWorkspace getEntityWorkspace() {
- return entity.getEntityWorkspace();
+ return entity.getEntityWorkspace();
}
public SiteBar getSiteBar() {
- return sitebar;
+ return sitebar;
}
}
Modified: sandbox3/src/main/java/org/op/public/Sandbox.html
===================================================================
--- sandbox3/src/main/java/org/op/public/Sandbox.html 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/public/Sandbox.html 2008-07-03 02:28:30 UTC (rev 780)
@@ -18,28 +18,14 @@
<!-- -->
<title>Wrapper HTML for Sandbox 3</title>
- <!-- -->
- <!-- Use normal html, such as style -->
- <!-- -->
- <style type="text/css">
- body,td,a,div,.p{font-family:arial,sans-serif}
- div,td{color:#000000}
- a:link,.w,.w a:link{color:#0000cc}
- a:visited{color:#551a8b}
- a:active{color:#ff0000}
- </style>
- <!-- -->
- <!-- This script loads your compiled module. -->
- <!-- If you add any GWT meta tags, they must -->
- <!-- be added before this line. -->
- <!-- -->
<!--
<link rel="stylesheet" type="text/css" href="js/ext/resources/css/ext-all.css"/>
<link id="theme" rel="stylesheet" type="text/css" href="js/ext/resources/css/xtheme-gray.css"/>
-->
<script type="text/javascript" language="javascript" src="org.op.Sandbox.nocache.js"></script>
+ <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.5.2/build/base/base-min.css">
</head>
<!-- -->
Modified: sandbox3/src/main/java/org/op/public/sandbox.css
===================================================================
--- sandbox3/src/main/java/org/op/public/sandbox.css 2008-06-11 20:19:21 UTC (rev 779)
+++ sandbox3/src/main/java/org/op/public/sandbox.css 2008-07-03 02:28:30 UTC (rev 780)
@@ -35,6 +35,18 @@
}
+.faketoolbar-top-line {
+border-top-color: rgb(208, 208, 208);
+border-top-style: solid;
+border-top-width: 1px;
+}
+
+.faketoolbar-bottom-line {
+border-bottom-color: rgb(208, 208, 208);
+border-bottom-style: solid;
+border-bottom-width: 1px;
+}
+
.entity-bottom-rd {
}
\ No newline at end of file
More information about the kune-commits
mailing list