Author: [EMAIL PROTECTED]
Date: Wed Nov 12 14:17:15 2008
New Revision: 4034
Modified:
branches/1_6_clean_events/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/DialogBox.java
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/TabBar.java
Log:
Renaming TabWrapper and CaptionWrapper to Tab and Caption, huddle with John
concluded that these methods should be public after all.
Modified:
branches/1_6_clean_events/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
==============================================================================
---
branches/1_6_clean_events/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
(original)
+++
branches/1_6_clean_events/reference/code-museum/src/com/google/gwt/museum/client/defaultmuseum/VisualsForDialogBox.java
Wed Nov 12 14:17:15 2008
@@ -35,7 +35,7 @@
public class VisualsForDialogBox extends AbstractIssue {
enum VisibleEvents {
- mouseDown, mouseEnter, mouseLeave, mouseMove, mouseUp,captionMouseDown
+ mouseDown, mouseEnter, mouseLeave, mouseMove, mouseUp, captionMouseDown
}
private final class VisibleDialogBox extends DialogBox {
@@ -75,6 +75,11 @@
}
@Override
+ public DialogBox.Caption getCaption() {
+ return super.getCaption();
+ }
+
+ @Override
public void onBrowserEvent(Event event) {
switch (event.getTypeInt()) {
case Event.ONMOUSEDOWN:
@@ -183,7 +188,7 @@
final VisibleDialogBox dialog = new VisibleDialogBox();
dialog.setModal(false);
dialog.center();
- dialog.getCaptionWrapper().addMouseDownHandler(new MouseDownHandler() {
+ dialog.getCaption().addMouseDownHandler(new MouseDownHandler() {
public void onMouseDown(MouseDownEvent event) {
dialog.pass(VisibleEvents.captionMouseDown);
}
Modified:
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/DialogBox.java
==============================================================================
---
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/DialogBox.java
(original)
+++
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/DialogBox.java
Wed Nov 12 14:17:15 2008
@@ -78,15 +78,14 @@
MouseListener {
/**
* Set of characteristic interfaces supported by the [EMAIL PROTECTED]
DialogBox}
caption
- * wrappers.
- *
+ *
* Note that this set might expand over time, so implement this
interface at
* your own risk.
*/
- public interface CaptionWrapper extends HasAllMouseHandlers {
+ public interface Caption extends HasAllMouseHandlers {
}
- private class CaptionWrapperImpl extends HTML implements CaptionWrapper {
+ private class CaptionImpl extends HTML implements Caption {
}
private class MouseHandler implements MouseDownHandler, MouseUpHandler,
@@ -118,7 +117,7 @@
*/
private static final String DEFAULT_STYLENAME = "gwt-DialogBox";
- private CaptionWrapperImpl caption = new CaptionWrapperImpl();
+ private CaptionImpl caption = new CaptionImpl();
private boolean dragging;
private int dragStartX, dragStartY;
private int windowWidth;
@@ -183,11 +182,11 @@
}
/**
- * Provides access to the widget that displays the dialog's caption.
+ * Provides access to the dialog's caption.
*
- * @return the Caption widget wrapper
+ * @return the logical caption for this dialog box
*/
- public CaptionWrapper getCaptionWrapper() {
+ public Caption getCaption() {
return caption;
}
Modified:
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/TabBar.java
==============================================================================
---
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/TabBar.java
(original)
+++
branches/1_6_clean_events/user/src/com/google/gwt/user/client/ui/TabBar.java
Wed Nov 12 14:17:15 2008
@@ -78,7 +78,7 @@
* Note that this set might expand over time, so implement this
interface at
* your own risk.
*/
- public interface TabWrapper extends HasAllKeyHandlers, HasClickHandlers {
+ public interface Tab extends HasAllKeyHandlers, HasClickHandlers {
}
/**
@@ -87,8 +87,7 @@
* [EMAIL PROTECTED] SourcesClickEvents} is not implemented due to the fact
that
only a
* single observer is needed.
*/
- private class ClickDelegatePanel extends Composite implements
- HasClickHandlers, HasAllKeyHandlers, TabWrapper {
+ private class ClickDelegatePanel extends Composite implements Tab {
private SimplePanel focusablePanel;
private boolean enabled = true;
@@ -225,7 +224,7 @@
/**
* Adds a new tab with the specified widget.
*
- * @param widget the new tab's widget.
+ * @param widget the new tab's widget
*/
public void addTab(Widget widget) {
insertTab(widget, getTabCount());
@@ -249,6 +248,20 @@
}
/**
+ * Gets the given tab.
+ *
+ * @param index the tab's index
+ * @return the tab wrapper
+ */
+ public final Tab getTab(int index) {
+ if (index >= getTabCount()) {
+ return null;
+ }
+ ClickDelegatePanel p = (ClickDelegatePanel) panel.getWidget(index + 1);
+ return p;
+ }
+
+ /**
* Gets the number of tabs present.
*
* @return the tab count
@@ -281,20 +294,6 @@
}
/**
- * Gets the wrapper for the given tab.
- *
- * @param index the tab's index.
- * @return the tab wrapper
- */
- public final TabWrapper getTabWrapper(int index) {
- if (index >= getTabCount()) {
- return null;
- }
- ClickDelegatePanel p = (ClickDelegatePanel) panel.getWidget(index + 1);
- return p;
- }
-
- /**
* Inserts a new tab at the specified index.
*
* @param text the new tab's text
@@ -328,8 +327,8 @@
/**
* Inserts a new tab at the specified index.
*
- * @param widget widget to be used in the new tab.
- * @param beforeIndex the index before which this tab will be inserted.
+ * @param widget widget to be used in the new tab
+ * @param beforeIndex the index before which this tab will be inserted
*/
public void insertTab(Widget widget, int beforeIndex) {
insertTabWidget(widget, beforeIndex);
@@ -349,7 +348,9 @@
}
/**
- * @deprecated add a click handler to the individual tab wrappers
instead.
+ * @deprecated add a [EMAIL PROTECTED] BeforeSelectionHandler} instead.
Alternatively, if
+ * you need to access to the individual tabs, add a click handler to each
+ * [EMAIL PROTECTED] Tab} element instead.
*/
public void onClick(Widget sender) {
}
@@ -404,7 +405,7 @@
* Programmatically selects the specified tab. Use index -1 to specify
that no
* tab should be selected.
*
- * @param index the index of the tab to be selected.
+ * @param index the index of the tab to be selected
* @return <code>true</code> if successful, <code>false</code> if the
change
* is denied by the [EMAIL PROTECTED] BeforeSelectionHandler}.
*/
@@ -496,8 +497,8 @@
/**
* Inserts a new tab at the specified index.
*
- * @param widget widget to be used in the new tab.
- * @param beforeIndex the index before which this tab will be inserted.
+ * @param widget widget to be used in the new tab
+ * @param beforeIndex the index before which this tab will be inserted
*/
protected void insertTabWidget(Widget widget, int beforeIndex) {
checkInsertBeforeTabIndex(beforeIndex);
--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---