svn changeset:5285/svn branch:trunktags/6.7.0.beta1
@@ -21,12 +21,12 @@ import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.DateTimeService; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.CalendarEntry; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.CalendarPanel; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.ICalendarPanel; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IDateField; | |||
public class ICalendarField extends IDateField { | |||
private final CalendarPanel calPanel; | |||
private final ICalendarPanel calPanel; | |||
private SimplePanel hourPanel; | |||
@@ -44,7 +44,7 @@ public class ICalendarField extends IDateField { | |||
public ICalendarField() { | |||
super(); | |||
setStyleName(CLASSNAME); | |||
calPanel = new CalendarPanel(this); | |||
calPanel = new ICalendarPanel(this); | |||
add(calPanel); | |||
entrySource = new EntrySource(); | |||
calPanel.setCalendarEntrySource(entrySource); | |||
@@ -212,7 +212,7 @@ public class ICalendarField extends IDateField { | |||
} | |||
private class EntrySource implements CalendarPanel.CalendarEntrySource { | |||
private class EntrySource implements ICalendarPanel.CalendarEntrySource { | |||
private final HashMap dates = new HashMap(); | |||
@@ -32,11 +32,11 @@ import com.google.gwt.user.client.ui.FocusWidget; | |||
import com.google.gwt.user.client.ui.HasFocus; | |||
import com.google.gwt.user.client.ui.HasWidgets; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.ContextMenu; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IContextMenu; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.Field; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IView; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.Notification; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.Notification.HideEvent; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.INotification; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.INotification.HideEvent; | |||
/** | |||
* Entry point classes define <code>onModuleLoad()</code>. | |||
@@ -69,7 +69,7 @@ public class ApplicationConnection { | |||
private final WidgetSet widgetSet; | |||
private ContextMenu contextMenu = null; | |||
private IContextMenu contextMenu = null; | |||
private Timer loadTimer; | |||
private Timer loadTimer2; | |||
@@ -107,7 +107,7 @@ public class ApplicationConnection { | |||
configuration = cnf; | |||
if (isDebugMode()) { | |||
console = new DebugConsole(this, cnf); | |||
console = new IDebugConsole(this, cnf); | |||
} else { | |||
console = new NullConsole(); | |||
} | |||
@@ -512,9 +512,9 @@ public class ApplicationConnection { | |||
} | |||
if (html.length() != 0) { | |||
Notification n = new Notification(1000 * 60 * 45); // 45min | |||
INotification n = new INotification(1000 * 60 * 45); // 45min | |||
n.addEventListener(new NotificationRedirect(url)); | |||
n.show(html, Notification.CENTERED_TOP, "system"); | |||
n.show(html, INotification.CENTERED_TOP, "system"); | |||
} else { | |||
redirect(url); | |||
} | |||
@@ -880,9 +880,9 @@ public class ApplicationConnection { | |||
* | |||
* @return IContextMenu object | |||
*/ | |||
public ContextMenu getContextMenu() { | |||
public IContextMenu getContextMenu() { | |||
if (contextMenu == null) { | |||
contextMenu = new ContextMenu(); | |||
contextMenu = new IContextMenu(); | |||
if (usePaintableIdsInDOM) { | |||
DOM.setElementProperty(contextMenu.getElement(), "id", | |||
"PID_TOOLKIT_CM"); | |||
@@ -925,7 +925,7 @@ public class ApplicationConnection { | |||
* messages, such as session expired. | |||
* | |||
*/ | |||
private class NotificationRedirect implements Notification.EventListener { | |||
private class NotificationRedirect implements INotification.EventListener { | |||
String url; | |||
NotificationRedirect(String url) { | |||
@@ -956,7 +956,7 @@ public class ApplicationConnection { | |||
return info; | |||
} | |||
private final Tooltip tooltip = new Tooltip(this); | |||
private final ITooltip tooltip = new ITooltip(this); | |||
/** | |||
* Component may want to delegate Tooltip handling to client. Layouts add |
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.Icon; | |||
public class Caption extends HTML { | |||
public class ICaption extends HTML { | |||
public static final String CLASSNAME = "i-caption"; | |||
@@ -31,11 +31,11 @@ public class Caption extends HTML { | |||
/** | |||
* | |||
* @param component | |||
* optional owner of caption. If not set, getOwner will | |||
* return null | |||
* optional owner of caption. If not set, getOwner will return | |||
* null | |||
* @param client | |||
*/ | |||
public Caption(Paintable component, ApplicationConnection client) { | |||
public ICaption(Paintable component, ApplicationConnection client) { | |||
super(); | |||
this.client = client; | |||
owner = component; |
@@ -7,14 +7,14 @@ package com.itmill.toolkit.terminal.gwt.client; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
public class CaptionWrapper extends FlowPanel { | |||
public class ICaptionWrapper extends FlowPanel { | |||
public static final String CLASSNAME = "i-captionwrapper"; | |||
Caption caption; | |||
ICaption caption; | |||
Paintable widget; | |||
public CaptionWrapper(Paintable toBeWrapped, ApplicationConnection client) { | |||
caption = new Caption(toBeWrapped, client); | |||
public ICaptionWrapper(Paintable toBeWrapped, ApplicationConnection client) { | |||
caption = new ICaption(toBeWrapped, client); | |||
add(caption); | |||
widget = toBeWrapped; | |||
add((Widget) widget); |
@@ -16,7 +16,7 @@ import com.google.gwt.user.client.ui.ScrollPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IWindow; | |||
public final class DebugConsole extends IWindow implements Console { | |||
public final class IDebugConsole extends IWindow implements Console { | |||
/** | |||
* Builds number. For example 0-custom_tag in 5.0.0-custom_tag. | |||
@@ -34,7 +34,7 @@ public final class DebugConsole extends IWindow implements Console { | |||
private final Panel panel; | |||
public DebugConsole(ApplicationConnection client, | |||
public IDebugConsole(ApplicationConnection client, | |||
ApplicationConfiguration cnf) { | |||
super(); | |||
this.client = client; | |||
@@ -62,8 +62,7 @@ public final class DebugConsole extends IWindow implements Console { | |||
private void minimize() { | |||
// TODO stack to bottom (create window manager of some sort) | |||
setPixelSize(60, 60); | |||
setPopupPosition(Window.getClientWidth() | |||
- 142, 0); | |||
setPopupPosition(Window.getClientWidth() - 142, 0); | |||
} | |||
/* | |||
@@ -79,7 +78,8 @@ public final class DebugConsole extends IWindow implements Console { | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* @see com.itmill.toolkit.terminal.gwt.client.Console#error(java.lang.String) | |||
* @see | |||
* com.itmill.toolkit.terminal.gwt.client.Console#error(java.lang.String) | |||
*/ | |||
public void error(String msg) { | |||
panel.add((new HTML(msg))); | |||
@@ -89,7 +89,9 @@ public final class DebugConsole extends IWindow implements Console { | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* @see com.itmill.toolkit.terminal.gwt.client.Console#printObject(java.lang.Object) | |||
* @see | |||
* com.itmill.toolkit.terminal.gwt.client.Console#printObject(java.lang. | |||
* Object) | |||
*/ | |||
public void printObject(Object msg) { | |||
panel.add((new Label(msg.toString()))); | |||
@@ -98,7 +100,9 @@ public final class DebugConsole extends IWindow implements Console { | |||
/* | |||
* (non-Javadoc) | |||
* | |||
* @see com.itmill.toolkit.terminal.gwt.client.Console#dirUIDL(com.itmill.toolkit.terminal.gwt.client.UIDL) | |||
* @see | |||
* com.itmill.toolkit.terminal.gwt.client.Console#dirUIDL(com.itmill.toolkit | |||
* .terminal.gwt.client.UIDL) | |||
*/ | |||
public void dirUIDL(UIDL u) { | |||
panel.add(u.print_r()); |
@@ -10,12 +10,12 @@ import com.google.gwt.user.client.DOM; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.ToolkitOverlay; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IToolkitOverlay; | |||
public class ErrorMessage extends FlowPanel { | |||
public class IErrorMessage extends FlowPanel { | |||
public static final String CLASSNAME = "i-errormessage"; | |||
public ErrorMessage() { | |||
public IErrorMessage() { | |||
super(); | |||
setStyleName(CLASSNAME); | |||
} | |||
@@ -34,7 +34,7 @@ public class ErrorMessage extends FlowPanel { | |||
final UIDL.XML xml = (UIDL.XML) child; | |||
add(new HTML(xml.getXMLAsString())); | |||
} else { | |||
final ErrorMessage childError = new ErrorMessage(); | |||
final IErrorMessage childError = new IErrorMessage(); | |||
add(childError); | |||
childError.updateFromUIDL((UIDL) child); | |||
} | |||
@@ -48,9 +48,9 @@ public class ErrorMessage extends FlowPanel { | |||
* @param indicatorElement | |||
*/ | |||
public void showAt(Element indicatorElement) { | |||
ToolkitOverlay errorContainer = (ToolkitOverlay) getParent(); | |||
IToolkitOverlay errorContainer = (IToolkitOverlay) getParent(); | |||
if (errorContainer == null) { | |||
errorContainer = new ToolkitOverlay(); | |||
errorContainer = new IToolkitOverlay(); | |||
errorContainer.setWidget(this); | |||
} | |||
errorContainer.setPopupPosition(DOM.getAbsoluteLeft(indicatorElement) | |||
@@ -65,7 +65,7 @@ public class ErrorMessage extends FlowPanel { | |||
} | |||
public void hide() { | |||
final ToolkitOverlay errorContainer = (ToolkitOverlay) getParent(); | |||
final IToolkitOverlay errorContainer = (IToolkitOverlay) getParent(); | |||
if (errorContainer != null) { | |||
errorContainer.hide(); | |||
} |
@@ -9,26 +9,26 @@ import com.google.gwt.user.client.Event; | |||
import com.google.gwt.user.client.Timer; | |||
import com.google.gwt.user.client.Window; | |||
import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.ToolkitOverlay; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.IToolkitOverlay; | |||
/** | |||
* TODO open for extension | |||
*/ | |||
public class Tooltip extends ToolkitOverlay { | |||
public class ITooltip extends IToolkitOverlay { | |||
private static final String CLASSNAME = "i-tooltip"; | |||
private static final int MARGIN = 4; | |||
public static final int TOOLTIP_EVENTS = Event.ONKEYDOWN | |||
| Event.ONMOUSEOVER | Event.ONMOUSEOUT | Event.ONMOUSEMOVE | |||
| Event.ONCLICK; | |||
protected static final int MAX_WIDTH = 500; | |||
ErrorMessage em = new ErrorMessage(); | |||
IErrorMessage em = new IErrorMessage(); | |||
Element description = DOM.createDiv(); | |||
private Paintable tooltipOwner; | |||
private boolean closing = false; | |||
private boolean opening = false; | |||
private ApplicationConnection ac; | |||
public Tooltip(ApplicationConnection client) { | |||
public ITooltip(ApplicationConnection client) { | |||
super(false, false, true); | |||
ac = client; | |||
setStyleName(CLASSNAME); | |||
@@ -151,7 +151,7 @@ public class Tooltip extends ToolkitOverlay { | |||
public void handleTooltipEvent(Event event, Paintable owner) { | |||
final int type = DOM.eventGetType(event); | |||
if ((Tooltip.TOOLTIP_EVENTS & type) == type) { | |||
if ((ITooltip.TOOLTIP_EVENTS & type) == type) { | |||
if (type == Event.ONMOUSEOVER) { | |||
showTooltip(owner, event); | |||
} else if (type == Event.ONMOUSEMOVE) { |
@@ -237,12 +237,12 @@ public class UIDL { | |||
return s; | |||
} | |||
public UIDLBrowser print_r() { | |||
return new UIDLBrowser(); | |||
public IUIDLBrowser print_r() { | |||
return new IUIDLBrowser(); | |||
} | |||
private class UIDLBrowser extends Tree { | |||
public UIDLBrowser() { | |||
private class IUIDLBrowser extends Tree { | |||
public IUIDLBrowser() { | |||
DOM.setStyleAttribute(getElement(), "position", ""); | |||
@@ -254,7 +254,7 @@ public class UIDL { | |||
public void onTreeItemStateChanged(TreeItem item) { | |||
if (item == root) { | |||
removeItem(root); | |||
UIDLBrowser.this.removeTreeListener(this); | |||
IUIDLBrowser.this.removeTreeListener(this); | |||
addItem(dir()); | |||
final Iterator it = treeItemIterator(); | |||
while (it.hasNext()) { |
@@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
@@ -167,7 +167,7 @@ public class IAccordion extends ITabsheetBase implements | |||
*/ | |||
protected class StackItem extends ComplexPanel implements ClickListener { | |||
private Caption caption; | |||
private ICaption caption; | |||
private boolean open = false; | |||
private Element content = DOM.createDiv(); | |||
private Element captionNode = DOM.createDiv(); | |||
@@ -175,7 +175,7 @@ public class IAccordion extends ITabsheetBase implements | |||
public StackItem(UIDL tabUidl) { | |||
setElement(DOM.createDiv()); | |||
caption = new Caption(null, client); | |||
caption = new ICaption(null, client); | |||
caption.addClickListener(this); | |||
super.add(caption, captionNode); | |||
DOM.appendChild(captionNode, caption.getElement()); |
@@ -13,7 +13,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
public class IButton extends Button implements Paintable { | |||
@@ -48,7 +48,7 @@ public class IButton extends Button implements Paintable { | |||
client.updateVariable(id, "state", true, true); | |||
} | |||
}); | |||
sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
} | |||
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { |
@@ -22,7 +22,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.DateTimeService; | |||
import com.itmill.toolkit.terminal.gwt.client.LocaleService; | |||
public class CalendarPanel extends FlexTable implements MouseListener, | |||
public class ICalendarPanel extends FlexTable implements MouseListener, | |||
ClickListener { | |||
private final IDateField datefield; | |||
@@ -35,7 +35,7 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
private IEventButton nextMonth; | |||
private Time time; | |||
private ITime time; | |||
private Date minDate = null; | |||
@@ -49,14 +49,14 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
/* Needed to identify locale changes */ | |||
private String locale = LocaleService.getDefaultLocale(); | |||
public CalendarPanel(IDateField parent) { | |||
public ICalendarPanel(IDateField parent) { | |||
datefield = parent; | |||
setStyleName(IDateField.CLASSNAME + "-calendarpanel"); | |||
// buildCalendar(true); | |||
addTableListener(new DateClickListener(this)); | |||
} | |||
public CalendarPanel(IDateField parent, Date min, Date max) { | |||
public ICalendarPanel(IDateField parent, Date min, Date max) { | |||
datefield = parent; | |||
setStyleName(IDateField.CLASSNAME + "-calendarpanel"); | |||
// buildCalendar(true); | |||
@@ -236,7 +236,7 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
private void buildTime(boolean forceRedraw) { | |||
if (time == null) { | |||
time = new Time(datefield); | |||
time = new ITime(datefield); | |||
setText(8, 0, ""); // Add new row | |||
getFlexCellFormatter().setColSpan(8, 0, 7); | |||
setWidget(8, 0, time); | |||
@@ -247,7 +247,7 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
/** | |||
* | |||
* @param forceRedraw | |||
* Build all from scratch, in case of e.g. locale changes | |||
* Build all from scratch, in case of e.g. locale changes | |||
*/ | |||
public void updateCalendar() { | |||
// Locale and resolution changes force a complete redraw | |||
@@ -382,9 +382,9 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
private class DateClickListener implements TableListener { | |||
private final CalendarPanel cal; | |||
private final ICalendarPanel cal; | |||
public DateClickListener(CalendarPanel panel) { | |||
public DateClickListener(ICalendarPanel panel) { | |||
cal = panel; | |||
} | |||
@@ -433,7 +433,7 @@ public class CalendarPanel extends FlexTable implements MouseListener, | |||
if (datefield instanceof ITextualDate | |||
&& resolution < IDateField.RESOLUTION_HOUR) { | |||
((ToolkitOverlay) getParent()).hide(); | |||
((IToolkitOverlay) getParent()).hide(); | |||
} else { | |||
updateCalendar(); | |||
} |
@@ -11,7 +11,7 @@ import com.google.gwt.user.client.ui.ClickListener; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
public class ICheckBox extends com.google.gwt.user.client.ui.CheckBox implements | |||
@@ -43,7 +43,7 @@ public class ICheckBox extends com.google.gwt.user.client.ui.CheckBox implements | |||
} | |||
}); | |||
sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
} | |||
public void updateFromUIDL(UIDL uidl, ApplicationConnection client) { |
@@ -9,7 +9,7 @@ import com.google.gwt.user.client.ui.MenuBar; | |||
import com.google.gwt.user.client.ui.MenuItem; | |||
import com.google.gwt.user.client.ui.PopupPanel; | |||
public class ContextMenu extends ToolkitOverlay { | |||
public class IContextMenu extends IToolkitOverlay { | |||
private ActionOwner actionOwner; | |||
@@ -24,9 +24,9 @@ public class ContextMenu extends ToolkitOverlay { | |||
* should exists. Request an instance via client.getContextMenu(); | |||
* | |||
* @param cli | |||
* to be set as an owner of menu | |||
* to be set as an owner of menu | |||
*/ | |||
public ContextMenu() { | |||
public IContextMenu() { | |||
super(true, false, true); | |||
setWidget(menu); | |||
setStyleName("i-contextmenu"); | |||
@@ -62,8 +62,8 @@ public class ContextMenu extends ToolkitOverlay { | |||
// mac FF gets bad width due GWT popups overflow hacks, | |||
// re-determine width | |||
offsetWidth = menu.getOffsetWidth(); | |||
int left = ContextMenu.this.left; | |||
int top = ContextMenu.this.top; | |||
int left = IContextMenu.this.left; | |||
int top = IContextMenu.this.top; | |||
if (offsetWidth + left > Window.getClientWidth()) { | |||
left = left - offsetWidth; | |||
if (left < 0) { | |||
@@ -97,21 +97,18 @@ public class ContextMenu extends ToolkitOverlay { | |||
public void onPopupClosed(PopupPanel sender, boolean autoClosed) { | |||
super.onPopupClosed(sender, autoClosed); | |||
ContextMenu.this.hide(); | |||
hide(); | |||
} | |||
/*public void onBrowserEvent(Event event) { | |||
// Remove current selection when mouse leaves | |||
if (DOM.eventGetType(event) == Event.ONMOUSEOUT) { | |||
Element to = DOM.eventGetToElement(event); | |||
if (!DOM.isOrHasChild(getElement(), to)) { | |||
DOM.setElementProperty( | |||
super.getSelectedItem().getElement(), "className", | |||
super.getSelectedItem().getStylePrimaryName()); | |||
} | |||
} | |||
super.onBrowserEvent(event); | |||
}*/ | |||
/* | |||
* public void onBrowserEvent(Event event) { // Remove current selection | |||
* when mouse leaves if (DOM.eventGetType(event) == Event.ONMOUSEOUT) { | |||
* Element to = DOM.eventGetToElement(event); if | |||
* (!DOM.isOrHasChild(getElement(), to)) { DOM.setElementProperty( | |||
* super.getSelectedItem().getElement(), "className", | |||
* super.getSelectedItem().getStylePrimaryName()); } } | |||
* | |||
* super.onBrowserEvent(event); } | |||
*/ | |||
} | |||
} |
@@ -14,8 +14,8 @@ import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.CaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
@@ -348,13 +348,13 @@ public class ICustomLayout extends ComplexPanel implements Paintable, | |||
/** Update caption for given widget */ | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
CaptionWrapper wrapper = (CaptionWrapper) widgetToCaptionWrapper | |||
ICaptionWrapper wrapper = (ICaptionWrapper) widgetToCaptionWrapper | |||
.get(component); | |||
if (Caption.isNeeded(uidl)) { | |||
if (ICaption.isNeeded(uidl)) { | |||
if (wrapper == null) { | |||
final String loc = getLocation((Widget) component); | |||
super.remove((Widget) component); | |||
wrapper = new CaptionWrapper(component, client); | |||
wrapper = new ICaptionWrapper(component, client); | |||
super.add(wrapper, (Element) locationToElement.get(loc)); | |||
widgetToCaptionWrapper.put(component, wrapper); | |||
} | |||
@@ -389,7 +389,7 @@ public class ICustomLayout extends ComplexPanel implements Paintable, | |||
if (location != null) { | |||
locationToWidget.remove(location); | |||
} | |||
final CaptionWrapper cw = (CaptionWrapper) widgetToCaptionWrapper | |||
final ICaptionWrapper cw = (ICaptionWrapper) widgetToCaptionWrapper | |||
.get(w); | |||
if (cw != null) { | |||
widgetToCaptionWrapper.remove(w); |
@@ -13,7 +13,7 @@ import com.itmill.toolkit.terminal.gwt.client.ClientExceptionHandler; | |||
import com.itmill.toolkit.terminal.gwt.client.DateTimeService; | |||
import com.itmill.toolkit.terminal.gwt.client.LocaleNotLoadedException; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
public class IDateField extends FlowPanel implements Paintable, Field { | |||
@@ -51,7 +51,7 @@ public class IDateField extends FlowPanel implements Paintable, Field { | |||
public IDateField() { | |||
setStyleName(CLASSNAME); | |||
dts = new DateTimeService(); | |||
sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
} | |||
public void onBrowserEvent(Event event) { |
@@ -9,11 +9,11 @@ import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
public class IDateFieldCalendar extends IDateField { | |||
private final CalendarPanel date; | |||
private final ICalendarPanel date; | |||
public IDateFieldCalendar() { | |||
super(); | |||
date = new CalendarPanel(this); | |||
date = new ICalendarPanel(this); | |||
add(date); | |||
} | |||
@@ -18,7 +18,7 @@ import com.google.gwt.user.client.ui.UIObject; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
@@ -504,8 +504,8 @@ public class IExpandLayout extends ComplexPanel implements | |||
} | |||
protected void insert(Widget w, int beforeIndex) { | |||
if (w instanceof Caption) { | |||
final Caption c = (Caption) w; | |||
if (w instanceof ICaption) { | |||
final ICaption c = (ICaption) w; | |||
// captions go into same container element as their | |||
// owners | |||
final Element container = DOM.getParent(((UIObject) c.getOwner()) | |||
@@ -528,7 +528,7 @@ public class IExpandLayout extends ComplexPanel implements | |||
final WidgetWrapper ww = getWidgetWrapperFor(w); | |||
final boolean removed = super.remove(w); | |||
if (removed) { | |||
if (!(w instanceof Caption)) { | |||
if (!(w instanceof ICaption)) { | |||
DOM.removeChild(childContainer, ww.getElement()); | |||
} | |||
return true; | |||
@@ -537,7 +537,7 @@ public class IExpandLayout extends ComplexPanel implements | |||
} | |||
public void removeCaption(Widget w) { | |||
final Caption c = (Caption) componentToCaption.get(w); | |||
final ICaption c = (ICaption) componentToCaption.get(w); | |||
if (c != null) { | |||
this.remove(c); | |||
componentToCaption.remove(w); | |||
@@ -545,7 +545,7 @@ public class IExpandLayout extends ComplexPanel implements | |||
} | |||
public boolean removePaintable(Paintable p) { | |||
final Caption c = (Caption) componentToCaption.get(p); | |||
final ICaption c = (ICaption) componentToCaption.get(p); | |||
if (c != null) { | |||
componentToCaption.remove(c); | |||
remove(c); | |||
@@ -559,7 +559,7 @@ public class IExpandLayout extends ComplexPanel implements | |||
public void replaceChildComponent(Widget from, Widget to) { | |||
client.unregisterPaintable((Paintable) from); | |||
final Caption c = (Caption) componentToCaption.get(from); | |||
final ICaption c = (ICaption) componentToCaption.get(from); | |||
if (c != null) { | |||
remove(c); | |||
componentToCaption.remove(c); | |||
@@ -573,12 +573,12 @@ public class IExpandLayout extends ComplexPanel implements | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
Caption c = (Caption) componentToCaption.get(component); | |||
ICaption c = (ICaption) componentToCaption.get(component); | |||
if (Caption.isNeeded(uidl)) { | |||
if (ICaption.isNeeded(uidl)) { | |||
if (c == null) { | |||
final int index = getWidgetIndex((Widget) component); | |||
c = new Caption(component, client); | |||
c = new ICaption(component, client); | |||
insert(c, index); | |||
componentToCaption.put(component, c); | |||
} |
@@ -30,7 +30,7 @@ import com.google.gwt.user.client.ui.SuggestOracle.Suggestion; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Focusable; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
@@ -88,7 +88,7 @@ public class IFilterSelect extends Composite implements Paintable, Field, | |||
* @author mattitahvonen | |||
* | |||
*/ | |||
public class SuggestionPopup extends ToolkitOverlay implements | |||
public class SuggestionPopup extends IToolkitOverlay implements | |||
PositionCallback, PopupListener { | |||
private static final int EXTRASPACE = 8; | |||
@@ -481,7 +481,7 @@ public class IFilterSelect extends Composite implements Paintable, Field, | |||
public IFilterSelect() { | |||
selectedItemIcon.setVisible(false); | |||
panel.add(selectedItemIcon); | |||
tb.sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
tb.sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
panel.add(tb); | |||
panel.add(popupOpener); | |||
initWidget(panel); |
@@ -11,7 +11,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.ErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.IErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
@@ -27,7 +27,7 @@ public class IForm extends ComplexPanel implements Paintable, | |||
private Element errorIndicatorElement = DOM.createDiv(); | |||
private Element desc = DOM.createDiv(); | |||
private Icon icon; | |||
private ErrorMessage errorMessage = new ErrorMessage(); | |||
private IErrorMessage errorMessage = new IErrorMessage(); | |||
private Element fieldContainer = DOM.createDiv(); | |||
@@ -21,7 +21,7 @@ import com.google.gwt.user.client.ui.HasHorizontalAlignment.HorizontalAlignmentC | |||
import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.CaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
@@ -210,13 +210,13 @@ public class IGridLayout extends SimplePanel implements Paintable, Container, | |||
formatter.setAlignment(row, column, ha, va); | |||
final Paintable child = client.getPaintable(u); | |||
CaptionWrapper wr; | |||
ICaptionWrapper wr; | |||
if (widgetToCaptionWrapper.containsKey(child)) { | |||
wr = (CaptionWrapper) widgetToCaptionWrapper | |||
wr = (ICaptionWrapper) widgetToCaptionWrapper | |||
.get(child); | |||
oldWidgetWrappers.remove(wr); | |||
} else { | |||
wr = new CaptionWrapper(child, client); | |||
wr = new ICaptionWrapper(child, client); | |||
widgetToCaptionWrapper.put(child, wr); | |||
} | |||
@@ -240,7 +240,7 @@ public class IGridLayout extends SimplePanel implements Paintable, Container, | |||
// loop oldWidgetWrappers that where not re-attached and unregister | |||
// them | |||
for (final Iterator it = oldWidgetWrappers.iterator(); it.hasNext();) { | |||
final CaptionWrapper w = (CaptionWrapper) it.next(); | |||
final ICaptionWrapper w = (ICaptionWrapper) it.next(); | |||
client.unregisterPaintable(w.getPaintable()); | |||
widgetToCaptionWrapper.remove(w.getPaintable()); | |||
} | |||
@@ -281,7 +281,7 @@ public class IGridLayout extends SimplePanel implements Paintable, Container, | |||
} | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
final CaptionWrapper wrapper = (CaptionWrapper) widgetToCaptionWrapper | |||
final ICaptionWrapper wrapper = (ICaptionWrapper) widgetToCaptionWrapper | |||
.get(component); | |||
wrapper.updateCaption(uidl); | |||
} |
@@ -12,7 +12,7 @@ import com.google.gwt.user.client.ui.ClickListener; | |||
import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.ErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.IErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
@@ -42,7 +42,7 @@ public class ILink extends HTML implements Paintable, ClickListener { | |||
private final Element captionElement = DOM.createSpan(); | |||
private ErrorMessage errorMessage; | |||
private IErrorMessage errorMessage; | |||
private Icon icon; | |||
@@ -101,7 +101,7 @@ public class ILink extends HTML implements Paintable, ClickListener { | |||
} | |||
DOM.insertChild(getElement(), errorIndicatorElement, 0); | |||
if (errorMessage == null) { | |||
errorMessage = new ErrorMessage(); | |||
errorMessage = new IErrorMessage(); | |||
} | |||
errorMessage.updateFromUIDL(errorUidl); | |||
@@ -12,7 +12,7 @@ import com.google.gwt.user.client.ui.ListBox; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
public class IListSelect extends IOptionGroupBase { | |||
@@ -110,7 +110,7 @@ class TooltipListBox extends ListBox { | |||
TooltipListBox(boolean isMultiselect) { | |||
super(isMultiselect); | |||
sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
} | |||
public void setClient(ApplicationConnection client) { |
@@ -43,7 +43,7 @@ public class IMenuBar extends Widget implements Paintable, PopupListener { | |||
boolean subMenu; | |||
ArrayList items; | |||
Element containerElement; | |||
ToolkitOverlay popup; | |||
IToolkitOverlay popup; | |||
IMenuBar visibleChildMenu; | |||
IMenuBar parentMenu; | |||
CustomMenuItem selected; | |||
@@ -443,7 +443,7 @@ public class IMenuBar extends Widget implements Paintable, PopupListener { | |||
* @param item | |||
*/ | |||
public void showChildMenu(CustomMenuItem item) { | |||
popup = new ToolkitOverlay(true, false, true); | |||
popup = new IToolkitOverlay(true, false, true); | |||
popup.setWidget(item.getSubMenu()); | |||
popup.addPopupListener(this); | |||
@@ -16,7 +16,7 @@ import com.google.gwt.user.client.ui.HTML; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
public class Notification extends ToolkitOverlay { | |||
public class INotification extends IToolkitOverlay { | |||
public static final int CENTERED = 1; | |||
public static final int CENTERED_TOP = 2; | |||
@@ -47,18 +47,18 @@ public class Notification extends ToolkitOverlay { | |||
private ArrayList listeners; | |||
public Notification() { | |||
public INotification() { | |||
setStylePrimaryName(STYLENAME); | |||
sinkEvents(Event.ONCLICK); | |||
DOM.setStyleAttribute(getElement(), "zIndex", "" + Z_INDEX_BASE); | |||
} | |||
public Notification(int delayMsec) { | |||
public INotification(int delayMsec) { | |||
this(); | |||
this.delayMsec = delayMsec; | |||
} | |||
public Notification(int delayMsec, int fadeMsec, int startOpacity) { | |||
public INotification(int delayMsec, int fadeMsec, int startOpacity) { | |||
this(delayMsec); | |||
this.fadeMsec = fadeMsec; | |||
this.startOpacity = startOpacity; |
@@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.Panel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
@@ -634,7 +634,7 @@ public class IOrderedLayout extends Panel implements Container, | |||
Element clipperDiv; | |||
/** Caption element when used. */ | |||
Caption caption = null; | |||
ICaption caption = null; | |||
/** | |||
* Last set pixel height for the wrapper. -1 if vertical clipping is not | |||
@@ -854,13 +854,13 @@ public class IOrderedLayout extends Panel implements Container, | |||
final Element captionWrapper = getElementWrappingWidgetAndCaption(); | |||
// The widget needs caption | |||
if (Caption.isNeeded(uidl)) { | |||
if (ICaption.isNeeded(uidl)) { | |||
// If the caption element is missing, create it | |||
boolean justAdded = false; | |||
if (caption == null) { | |||
justAdded = true; | |||
caption = new Caption(paintable, client); | |||
caption = new ICaption(paintable, client); | |||
} | |||
// Update caption contents |
@@ -12,7 +12,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.ErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.IErrorMessage; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
@@ -38,7 +38,7 @@ public class IPanel extends SimplePanel implements Paintable, | |||
private Element errorIndicatorElement; | |||
private ErrorMessage errorMessage; | |||
private IErrorMessage errorMessage; | |||
private String height; | |||
@@ -200,7 +200,7 @@ public class IPanel extends SimplePanel implements Paintable, | |||
} | |||
DOM.insertBefore(captionNode, errorIndicatorElement, captionText); | |||
if (errorMessage == null) { | |||
errorMessage = new ErrorMessage(); | |||
errorMessage = new IErrorMessage(); | |||
} | |||
errorMessage.updateFromUIDL(errorUidl); | |||
@@ -22,9 +22,9 @@ public class IPopupCalendar extends ITextualDate implements Paintable, Field, | |||
private final Button calendarToggle; | |||
private final CalendarPanel calendar; | |||
private final ICalendarPanel calendar; | |||
private final ToolkitOverlay popup; | |||
private final IToolkitOverlay popup; | |||
private boolean open = false; | |||
public IPopupCalendar() { | |||
@@ -36,8 +36,8 @@ public class IPopupCalendar extends ITextualDate implements Paintable, Field, | |||
calendarToggle.addClickListener(this); | |||
add(calendarToggle); | |||
calendar = new CalendarPanel(this); | |||
popup = new ToolkitOverlay(true, true, true); | |||
calendar = new ICalendarPanel(this); | |||
popup = new IToolkitOverlay(true, true, true); | |||
popup.setStyleName(IDateField.CLASSNAME + "-popup"); | |||
popup.setWidget(calendar); | |||
popup.addPopupListener(this); |
@@ -16,8 +16,8 @@ import com.google.gwt.user.client.ui.PopupPanel; | |||
import com.google.gwt.user.client.ui.RootPanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.CaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaptionWrapper; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
@@ -196,11 +196,11 @@ public class IPopupView extends HTML implements Paintable, Container { | |||
} | |||
}-*/; | |||
private class CustomPopup extends ToolkitOverlay implements Container { | |||
private class CustomPopup extends IToolkitOverlay implements Container { | |||
private Paintable popupComponentPaintable = null; | |||
private Widget popupComponentWidget = null; | |||
private CaptionWrapper captionWrapper = null; | |||
private ICaptionWrapper captionWrapper = null; | |||
private boolean hasHadMouseOver = false; | |||
private Set activeChildren; | |||
@@ -288,11 +288,11 @@ public class IPopupView extends HTML implements Paintable, Container { | |||
} | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
if (Caption.isNeeded(uidl)) { | |||
if (ICaption.isNeeded(uidl)) { | |||
if (captionWrapper != null) { | |||
captionWrapper.updateCaption(uidl); | |||
} else { | |||
captionWrapper = new CaptionWrapper(component, client); | |||
captionWrapper = new ICaptionWrapper(component, client); | |||
setWidget(captionWrapper); | |||
captionWrapper.updateCaption(uidl); | |||
} |
@@ -17,7 +17,7 @@ import com.google.gwt.user.client.ui.ComplexPanel; | |||
import com.google.gwt.user.client.ui.Label; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
@@ -53,7 +53,7 @@ public class ITabsheet extends ITabsheetBase implements | |||
return getWidgetCount(); | |||
} | |||
public void addTab(Caption c) { | |||
public void addTab(ICaption c) { | |||
Element td = DOM.createTD(); | |||
setStyleName(td, CLASSNAME + "-tabitemcell"); | |||
@@ -90,15 +90,15 @@ public class ITabsheet extends ITabsheetBase implements | |||
} | |||
public boolean remove(Widget w) { | |||
((Caption) w).removeClickListener(this); | |||
((ICaption) w).removeClickListener(this); | |||
return super.remove(w); | |||
} | |||
public Caption getTab(int index) { | |||
public ICaption getTab(int index) { | |||
if (index >= getWidgetCount()) { | |||
return null; | |||
} | |||
return (Caption) getWidget(index); | |||
return (ICaption) getWidget(index); | |||
} | |||
} | |||
@@ -285,9 +285,9 @@ public class ITabsheet extends ITabsheetBase implements | |||
} | |||
protected void renderTab(final UIDL tabUidl, int index, boolean selected) { | |||
Caption c = tb.getTab(index); | |||
ICaption c = tb.getTab(index); | |||
if (c == null) { | |||
c = new Caption(null, client); | |||
c = new ICaption(null, client); | |||
tb.addTab(c); | |||
} | |||
c.updateCaption(tabUidl); | |||
@@ -468,7 +468,7 @@ public class ITabsheet extends ITabsheetBase implements | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
int i = tp.getWidgetIndex((Widget) component); | |||
Caption c = (Caption) captions.get("" + i); | |||
ICaption c = (ICaption) captions.get("" + i); | |||
c.updateCaption(uidl); | |||
} | |||
} |
@@ -14,7 +14,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.Tooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.ITooltip; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
@@ -55,7 +55,7 @@ public class ITextField extends TextBoxBase implements Paintable, Field, | |||
setStyleName(CLASSNAME); | |||
addChangeListener(this); | |||
addFocusListener(this); | |||
sinkEvents(Tooltip.TOOLTIP_EVENTS); | |||
sinkEvents(ITooltip.TOOLTIP_EVENTS); | |||
} | |||
public void onBrowserEvent(Event event) { |
@@ -11,7 +11,7 @@ import com.google.gwt.user.client.ui.FlowPanel; | |||
import com.google.gwt.user.client.ui.ListBox; | |||
import com.google.gwt.user.client.ui.Widget; | |||
public class Time extends FlowPanel implements ChangeListener { | |||
public class ITime extends FlowPanel implements ChangeListener { | |||
private final IDateField datefield; | |||
@@ -29,7 +29,7 @@ public class Time extends FlowPanel implements ChangeListener { | |||
private boolean readonly; | |||
public Time(IDateField parent) { | |||
public ITime(IDateField parent) { | |||
super(); | |||
datefield = parent; | |||
setStyleName(IDateField.CLASSNAME + "-time"); |
@@ -17,28 +17,28 @@ import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
* temporary float over other components like context menus etc. This is to deal | |||
* stacking order correctly with IWindow objects. | |||
*/ | |||
public class ToolkitOverlay extends PopupPanel { | |||
public class IToolkitOverlay extends PopupPanel { | |||
public static final int Z_INDEX = 20000; | |||
private Shadow shadow; | |||
public ToolkitOverlay() { | |||
public IToolkitOverlay() { | |||
super(); | |||
adjustZIndex(); | |||
} | |||
public ToolkitOverlay(boolean autoHide) { | |||
public IToolkitOverlay(boolean autoHide) { | |||
super(autoHide); | |||
adjustZIndex(); | |||
} | |||
public ToolkitOverlay(boolean autoHide, boolean modal) { | |||
public IToolkitOverlay(boolean autoHide, boolean modal) { | |||
super(autoHide, modal); | |||
adjustZIndex(); | |||
} | |||
public ToolkitOverlay(boolean autoHide, boolean modal, boolean showShadow) { | |||
public IToolkitOverlay(boolean autoHide, boolean modal, boolean showShadow) { | |||
super(autoHide, modal); | |||
if (showShadow) { | |||
shadow = new Shadow(); | |||
@@ -107,7 +107,7 @@ public class ToolkitOverlay extends PopupPanel { | |||
public void updateSizeAndPosition() { | |||
// Calculate proper z-index | |||
String zIndex = DOM.getStyleAttribute(ToolkitOverlay.this | |||
String zIndex = DOM.getStyleAttribute(IToolkitOverlay.this | |||
.getElement(), "zIndex"); | |||
if (zIndex == null) { | |||
zIndex = "" + Z_INDEX; | |||
@@ -116,13 +116,13 @@ public class ToolkitOverlay extends PopupPanel { | |||
// Calculate position and size | |||
if (BrowserInfo.get().isIE()) { | |||
// Shake IE | |||
ToolkitOverlay.this.getOffsetHeight(); | |||
ToolkitOverlay.this.getOffsetWidth(); | |||
IToolkitOverlay.this.getOffsetHeight(); | |||
IToolkitOverlay.this.getOffsetWidth(); | |||
} | |||
int x = ToolkitOverlay.this.getAbsoluteLeft() - left; | |||
int y = ToolkitOverlay.this.getAbsoluteTop() - top; | |||
int width = ToolkitOverlay.this.getOffsetWidth() + left + right; | |||
int height = ToolkitOverlay.this.getOffsetHeight() + top + bottom; | |||
int x = IToolkitOverlay.this.getAbsoluteLeft() - left; | |||
int y = IToolkitOverlay.this.getAbsoluteTop() - top; | |||
int width = IToolkitOverlay.this.getOffsetWidth() + left + right; | |||
int height = IToolkitOverlay.this.getOffsetHeight() + top + bottom; | |||
if (width < 0) { | |||
width = 0; | |||
} | |||
@@ -144,7 +144,7 @@ public class ToolkitOverlay extends PopupPanel { | |||
this.right = right; | |||
this.bottom = bottom; | |||
this.left = left; | |||
if (ToolkitOverlay.this.isAttached()) { | |||
if (IToolkitOverlay.this.isAttached()) { | |||
updateSizeAndPosition(); | |||
} | |||
} |
@@ -210,7 +210,7 @@ public class IView extends SimplePanel implements Paintable, | |||
final int position = notification | |||
.getIntAttribute("position"); | |||
final int delay = notification.getIntAttribute("delay"); | |||
new Notification(delay).show(html, position, style); | |||
new INotification(delay).show(html, position, style); | |||
} | |||
} | |||
} |
@@ -361,7 +361,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { | |||
final int position = notification | |||
.getIntAttribute("position"); | |||
final int delay = notification.getIntAttribute("delay"); | |||
new Notification(delay).show(html, position, style); | |||
new INotification(delay).show(html, position, style); | |||
} | |||
} | |||
} | |||
@@ -490,7 +490,7 @@ public class IWindow extends PopupPanel implements Paintable, ScrollListener { | |||
DOM.setStyleAttribute(draggingCurtain, "width", "100%"); | |||
DOM.setStyleAttribute(draggingCurtain, "height", "100%"); | |||
DOM.setStyleAttribute(draggingCurtain, "zIndex", "" | |||
+ ToolkitOverlay.Z_INDEX); | |||
+ IToolkitOverlay.Z_INDEX); | |||
DOM.appendChild(RootPanel.getBodyElement(), draggingCurtain); | |||
} else if (!show && draggingCurtain != null) { |
@@ -42,12 +42,9 @@ import com.google.gwt.user.client.ui.Widget; | |||
* <img class='gallery' src='MenuBar.png'/> | |||
* </p> | |||
* | |||
* <h3>CSS Style Rules</h3> | |||
* <ul class='css'> | |||
* <li>.gwt-MenuBar { the menu bar itself }</li> | |||
* <li>.gwt-MenuBar .gwt-MenuItem { menu items }</li> | |||
* <li>.gwt-MenuBar .gwt-MenuItem-selected { selected menu items }</li> | |||
* </ul> | |||
* <h3>CSS Style Rules</h3> <ul class='css'> <li>.gwt-MenuBar { the menu bar | |||
* itself }</li> <li>.gwt-MenuBar .gwt-MenuItem { menu items }</li> <li> | |||
* .gwt-MenuBar .gwt-MenuItem-selected { selected menu items }</li> </ul> | |||
* | |||
* <p> | |||
* <h3>Example</h3> | |||
@@ -78,7 +75,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* Creates an empty menu bar. | |||
* | |||
* @param vertical | |||
* <code>true</code> to orient the menu bar vertically | |||
* <code>true</code> to orient the menu bar vertically | |||
*/ | |||
public MenuBar(boolean vertical) { | |||
super(); | |||
@@ -106,7 +103,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* Adds a menu item to the bar. | |||
* | |||
* @param item | |||
* the item to be added | |||
* the item to be added | |||
*/ | |||
public void addItem(MenuItem item) { | |||
Element tr; | |||
@@ -129,11 +126,11 @@ public class MenuBar extends Widget implements PopupListener { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param asHTML | |||
* <code>true</code> to treat the specified text as html | |||
* <code>true</code> to treat the specified text as html | |||
* @param cmd | |||
* the command to be fired | |||
* the command to be fired | |||
* @return the {@link MenuItem} object created | |||
*/ | |||
public MenuItem addItem(String text, boolean asHTML, Command cmd) { | |||
@@ -147,11 +144,11 @@ public class MenuBar extends Widget implements PopupListener { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param asHTML | |||
* <code>true</code> to treat the specified text as html | |||
* <code>true</code> to treat the specified text as html | |||
* @param popup | |||
* the menu to be cascaded from it | |||
* the menu to be cascaded from it | |||
* @return the {@link MenuItem} object created | |||
*/ | |||
public MenuItem addItem(String text, boolean asHTML, MenuBar popup) { | |||
@@ -165,9 +162,9 @@ public class MenuBar extends Widget implements PopupListener { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param cmd | |||
* the command to be fired | |||
* the command to be fired | |||
* @return the {@link MenuItem} object created | |||
*/ | |||
public MenuItem addItem(String text, Command cmd) { | |||
@@ -181,9 +178,9 @@ public class MenuBar extends Widget implements PopupListener { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param popup | |||
* the menu to be cascaded from it | |||
* the menu to be cascaded from it | |||
* @return the {@link MenuItem} object created | |||
*/ | |||
public MenuItem addItem(String text, MenuBar popup) { | |||
@@ -259,7 +256,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* Removes the specified menu item from the bar. | |||
* | |||
* @param item | |||
* the item to be removed | |||
* the item to be removed | |||
*/ | |||
public void removeItem(MenuItem item) { | |||
final int idx = items.indexOf(item); | |||
@@ -277,7 +274,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
* moved over it. | |||
* | |||
* @param autoOpen | |||
* <code>true</code> to cause child menus to auto-open | |||
* <code>true</code> to cause child menus to auto-open | |||
*/ | |||
public void setAutoOpen(boolean autoOpen) { | |||
this.autoOpen = autoOpen; | |||
@@ -340,8 +337,8 @@ public class MenuBar extends Widget implements PopupListener { | |||
* fired. Popups associated with other items will be hidden. | |||
* | |||
* @param item the item whose popup is to be shown. @param fireCommand | |||
* <code>true</code> if the item's command should be fired, <code>false</code> | |||
* otherwise. | |||
* <code>true</code> if the item's command should be fired, | |||
* <code>false</code> otherwise. | |||
*/ | |||
void doItemAction(final MenuItem item, boolean fireCommand) { | |||
// If the given item is already showing its menu, we're done. | |||
@@ -376,7 +373,7 @@ public class MenuBar extends Widget implements PopupListener { | |||
// Create a new popup for this item, and position it next to | |||
// the item (below if this is a horizontal menu bar, to the | |||
// right if it's a vertical bar). | |||
popup = new ToolkitOverlay(true) { | |||
popup = new IToolkitOverlay(true) { | |||
{ | |||
setWidget(item.getSubMenu()); | |||
item.getSubMenu().onShow(); |
@@ -45,9 +45,9 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* Constructs a new menu item that fires a command when it is selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param cmd | |||
* the command to be fired when it is selected | |||
* the command to be fired when it is selected | |||
*/ | |||
public MenuItem(String text, Command cmd) { | |||
this(text, false); | |||
@@ -58,11 +58,11 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* Constructs a new menu item that fires a command when it is selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param asHTML | |||
* <code>true</code> to treat the specified text as html | |||
* <code>true</code> to treat the specified text as html | |||
* @param cmd | |||
* the command to be fired when it is selected | |||
* the command to be fired when it is selected | |||
*/ | |||
public MenuItem(String text, boolean asHTML, Command cmd) { | |||
this(text, asHTML); | |||
@@ -74,9 +74,9 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param subMenu | |||
* the sub-menu to be displayed when it is selected | |||
* the sub-menu to be displayed when it is selected | |||
*/ | |||
public MenuItem(String text, MenuBar subMenu) { | |||
this(text, false); | |||
@@ -88,11 +88,11 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* selected. | |||
* | |||
* @param text | |||
* the item's text | |||
* the item's text | |||
* @param asHTML | |||
* <code>true</code> to treat the specified text as html | |||
* <code>true</code> to treat the specified text as html | |||
* @param subMenu | |||
* the sub-menu to be displayed when it is selected | |||
* the sub-menu to be displayed when it is selected | |||
*/ | |||
public MenuItem(String text, boolean asHTML, MenuBar subMenu) { | |||
this(text, asHTML); | |||
@@ -150,7 +150,7 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* Sets the command associated with this item. | |||
* | |||
* @param cmd | |||
* the command to be associated with this item | |||
* the command to be associated with this item | |||
*/ | |||
public void setCommand(Command cmd) { | |||
command = cmd; | |||
@@ -164,7 +164,7 @@ public class MenuItem extends UIObject implements HasHTML { | |||
* Sets the sub-menu associated with this item. | |||
* | |||
* @param subMenu | |||
* this item's new sub-menu | |||
* this item's new sub-menu | |||
*/ | |||
public void setSubMenu(MenuBar subMenu) { | |||
this.subMenu = subMenu; |
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.ui.Composite; | |||
import com.google.gwt.user.client.ui.SimplePanel; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.BrowserInfo; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.ContainerResizedListener; | |||
import com.itmill.toolkit.terminal.gwt.client.Util; | |||
import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo; | |||
@@ -20,7 +20,8 @@ import com.itmill.toolkit.terminal.gwt.client.ui.AlignmentInfo; | |||
* GridLayout and OrderedLayout. Supports size, margins, spacing, but has bit | |||
* expensive layout function. | |||
*/ | |||
public class AbsoluteGrid extends Composite implements ContainerResizedListener { | |||
public class IAbsoluteGrid extends Composite implements | |||
ContainerResizedListener { | |||
protected HashMap cells = new HashMap(); | |||
@@ -38,15 +39,15 @@ public class AbsoluteGrid extends Composite implements ContainerResizedListener | |||
private int offsetHeight; | |||
public AbsoluteGrid() { | |||
public IAbsoluteGrid() { | |||
ap = new AbsolutePanel(); | |||
initWidget(ap); | |||
} | |||
public AbsoluteGridCell getCell(int col, int row) { | |||
AbsoluteGridCell p = (AbsoluteGridCell) cells.get(col + "." + row); | |||
public IAbsoluteGridCell getCell(int col, int row) { | |||
IAbsoluteGridCell p = (IAbsoluteGridCell) cells.get(col + "." + row); | |||
if (p == null) { | |||
p = new AbsoluteGridCell(col, row); | |||
p = new IAbsoluteGridCell(col, row); | |||
cells.put(col + "." + row, p); | |||
ap.add(p); | |||
} | |||
@@ -109,7 +110,7 @@ public class AbsoluteGrid extends Composite implements ContainerResizedListener | |||
* TODO contains Caption (which is a widget) in a very bad way, cannot be | |||
* simple panel | |||
*/ | |||
public class AbsoluteGridCell extends SimplePanel { | |||
public class IAbsoluteGridCell extends SimplePanel { | |||
int rowIndex; | |||
int colIndex; | |||
@@ -117,11 +118,11 @@ public class AbsoluteGrid extends Composite implements ContainerResizedListener | |||
int rowSpan = 1; | |||
private Element container = DOM.createDiv(); | |||
private Caption caption; | |||
private ICaption caption; | |||
private AlignmentInfo alignmentInfo = new AlignmentInfo( | |||
AlignmentInfo.ALIGNMENT_TOP + AlignmentInfo.ALIGNMENT_LEFT); | |||
AbsoluteGridCell(int colIndex, int rowIndex) { | |||
IAbsoluteGridCell(int colIndex, int rowIndex) { | |||
super(); | |||
if (BrowserInfo.get().isIE6()) { | |||
DOM.setStyleAttribute(getElement(), "overflow", "hidden"); | |||
@@ -224,11 +225,11 @@ public class AbsoluteGrid extends Composite implements ContainerResizedListener | |||
return (caption == null) ? 0 : caption.getOffsetHeight(); | |||
} | |||
public Caption getCaption() { | |||
public ICaption getCaption() { | |||
return caption; | |||
} | |||
public void setCaption(Caption newCaption) { | |||
public void setCaption(ICaption newCaption) { | |||
// TODO check for existing, shouldn't happen though | |||
caption = newCaption; | |||
DOM.insertChild(getElement(), caption.getElement(), 0); | |||
@@ -277,7 +278,7 @@ public class AbsoluteGrid extends Composite implements ContainerResizedListener | |||
} | |||
if (sizeChanged) { | |||
for (Iterator it = cells.values().iterator(); it.hasNext();) { | |||
AbsoluteGridCell cell = (AbsoluteGridCell) it.next(); | |||
IAbsoluteGridCell cell = (IAbsoluteGridCell) it.next(); | |||
cell.render(); | |||
cell.vAling(); | |||
} |
@@ -10,7 +10,7 @@ import com.google.gwt.user.client.DeferredCommand; | |||
import com.google.gwt.user.client.Element; | |||
import com.google.gwt.user.client.ui.Widget; | |||
import com.itmill.toolkit.terminal.gwt.client.ApplicationConnection; | |||
import com.itmill.toolkit.terminal.gwt.client.Caption; | |||
import com.itmill.toolkit.terminal.gwt.client.ICaption; | |||
import com.itmill.toolkit.terminal.gwt.client.Container; | |||
import com.itmill.toolkit.terminal.gwt.client.Paintable; | |||
import com.itmill.toolkit.terminal.gwt.client.UIDL; | |||
@@ -22,7 +22,7 @@ import com.itmill.toolkit.terminal.gwt.client.ui.MarginInfo; | |||
* All cell's will be equally sized. | |||
* | |||
*/ | |||
public class ISizeableGridLayout extends AbsoluteGrid implements Paintable, | |||
public class ISizeableGridLayout extends IAbsoluteGrid implements Paintable, | |||
Container { | |||
public static final String CLASSNAME = "i-gridlayout"; | |||
private int spacing; | |||
@@ -113,7 +113,7 @@ public class ISizeableGridLayout extends AbsoluteGrid implements Paintable, | |||
final UIDL u = c.getChildUIDL(0); | |||
if (u != null) { | |||
final Paintable child = client.getPaintable(u); | |||
AbsoluteGridCell cell = getCell(column, row); | |||
IAbsoluteGridCell cell = getCell(column, row); | |||
paintableToCellMap.put(child, cell); | |||
cell.rowSpan = rowSpan; | |||
cell.colSpan = colSpan; | |||
@@ -141,7 +141,7 @@ public class ISizeableGridLayout extends AbsoluteGrid implements Paintable, | |||
// loop oldWidgetWrappers that where not re-attached and unregister them | |||
for (final Iterator it = oldCells.iterator(); it.hasNext();) { | |||
final AbsoluteGridCell w = (AbsoluteGridCell) it.next(); | |||
final IAbsoluteGridCell w = (IAbsoluteGridCell) it.next(); | |||
client.unregisterPaintable((Paintable) w.getWidget()); | |||
w.removeFromParent(); | |||
paintableToCellMap.remove(w.getWidget()); | |||
@@ -182,11 +182,11 @@ public class ISizeableGridLayout extends AbsoluteGrid implements Paintable, | |||
} | |||
public void updateCaption(Paintable component, UIDL uidl) { | |||
AbsoluteGridCell cell = (AbsoluteGridCell) paintableToCellMap | |||
IAbsoluteGridCell cell = (IAbsoluteGridCell) paintableToCellMap | |||
.get(component); | |||
Caption c = cell.getCaption(); | |||
ICaption c = cell.getCaption(); | |||
if (c == null) { | |||
c = new Caption(component, client); | |||
c = new ICaption(component, client); | |||
cell.setCaption(c); | |||
} | |||
c.updateCaption(uidl); |
@@ -38,7 +38,7 @@ public class IRichTextArea extends Composite implements Paintable, Field, | |||
private RichTextArea rta = new RichTextArea(); | |||
private RichTextToolbar formatter = new RichTextToolbar(rta); | |||
private IRichTextToolbar formatter = new IRichTextToolbar(rta); | |||
private HTML html = new HTML(); | |||
@@ -37,7 +37,7 @@ import com.google.gwt.user.client.ui.Widget; | |||
* for all rich text formatting, dynamically displayed only for the available | |||
* functionality. | |||
*/ | |||
public class RichTextToolbar extends Composite { | |||
public class IRichTextToolbar extends Composite { | |||
/** | |||
* This {@link ImageBundle} is used for all the button icons. Using an image | |||
@@ -360,9 +360,9 @@ public class RichTextToolbar extends Composite { | |||
* Creates a new toolbar that drives the given rich text area. | |||
* | |||
* @param richText | |||
* the rich text area to be controlled | |||
* the rich text area to be controlled | |||
*/ | |||
public RichTextToolbar(RichTextArea richText) { | |||
public IRichTextToolbar(RichTextArea richText) { | |||
this.richText = richText; | |||
basic = richText.getBasicFormatter(); | |||
extended = richText.getExtendedFormatter(); |