import com.google.gwt.user.client.Event;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
public class Caption extends HTML {
if(errorIndicatorElement == null) {
errorIndicatorElement = DOM.createDiv();
- DOM.setAttribute(errorIndicatorElement, "className", "i-errorindicator");
+ DOM.setElementProperty(errorIndicatorElement, "className", "i-errorindicator");
DOM.insertChild(getElement(), errorIndicatorElement, 0);
}
if(uidl.hasAttribute("description")) {
if(captionText != null) {
- DOM.setAttribute(captionText, "title", uidl.getStringAttribute("description"));
+ DOM.setElementProperty(captionText, "title", uidl.getStringAttribute("description"));
} else {
setTitle(uidl.getStringAttribute("description"));
}
case Event.ONMOUSEOUT:
hideErrorMessage();
break;
+ case Event.ONCLICK:
+ ApplicationConnection.getConsole().
+ log(DOM.getInnerHTML(errorMessage.getElement()));
default:
break;
}
}
errorContainer.setPopupPosition(
DOM.getAbsoluteLeft(errorIndicatorElement) +
- 2*DOM.getIntAttribute(errorIndicatorElement, "offsetHeight"),
+ 2*DOM.getElementPropertyInt(errorIndicatorElement, "offsetHeight"),
DOM.getAbsoluteTop(errorIndicatorElement) +
- 2*DOM.getIntAttribute(errorIndicatorElement, "offsetHeight"));
+ 2*DOM.getElementPropertyInt(errorIndicatorElement, "offsetHeight"));
errorContainer.show();
}
}
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Label;
import com.itmill.toolkit.terminal.gwt.client.ui.IWindow;
private void minimize() {
// TODO stack to bottom (create window manager of some sort)
setPixelSize(60, 60);
- setPopupPosition(Window.getClientWidth() - 66, Window.getClientHeight() - 66);
+ setPopupPosition(Window.getClientWidth() - 80, Window.getClientHeight() - 80);
}
/* (non-Javadoc)
* @see com.itmill.toolkit.terminal.gwt.client.Console#log(java.lang.String)
*/
public void log(String msg) {
- panel.add(new Label(msg));
+ panel.add(new HTML(msg));
System.out.println(msg);
}
* @see com.itmill.toolkit.terminal.gwt.client.Console#error(java.lang.String)
*/
public void error(String msg) {
- panel.add((new Label(msg)));
+ panel.add((new HTML(msg)));
System.out.println(msg);
}
tHead.setHorizontalScrollPosition(scrollLeft);
firstRowInViewPort = (int) Math.ceil( scrollTop / (double) tBody.getRowHeight() );
- client.console.log("At scrolltop: " + scrollTop + " At row " + firstRowInViewPort);
+ ApplicationConnection.getConsole()
+ .log("At scrolltop: " + scrollTop + " At row " + firstRowInViewPort);
int postLimit = (int) (firstRowInViewPort + pageLength + pageLength*CACHE_REACT_RATE);
if(postLimit > totalRows -1 )
if(firstRowInViewPort - pageLength*CACHE_RATE > lastRendered ||
firstRowInViewPort + pageLength + pageLength*CACHE_RATE < firstRendered ) {
// need a totally new set
- client.console.log("Table: need a totally new set");
+ ApplicationConnection.getConsole().log("Table: need a totally new set");
rowRequestHandler.setReqFirstRow((int) (firstRowInViewPort - pageLength*CACHE_RATE));
rowRequestHandler.setReqRows((int) (2*CACHE_RATE*pageLength + pageLength));
rowRequestHandler.deferRowFetch();
}
if(preLimit < firstRendered ) {
// need some rows to the beginning of the rendered area
- client.console.log("Table: need some rows to the beginning of the rendered area");
+ ApplicationConnection.getConsole().log("Table: need some rows to the beginning of the rendered area");
rowRequestHandler.setReqFirstRow((int) (firstRowInViewPort - pageLength*CACHE_RATE));
rowRequestHandler.setReqRows(firstRendered - rowRequestHandler.getReqFirstRow());
rowRequestHandler.deferRowFetch();
}
if(postLimit > lastRendered) {
// need some rows to the end of the rendered area
- client.console.log("need some rows to the end of the rendered area");
+ ApplicationConnection.getConsole().log("need some rows to the end of the rendered area");
rowRequestHandler.setReqFirstRow(lastRendered + 1);
rowRequestHandler.setReqRows((int) ((firstRowInViewPort + pageLength + pageLength*CACHE_RATE) - lastRendered));
rowRequestHandler.deferRowFetch();
}
private void announceScrollPosition() {
- client.console.log(""+firstRowInViewPort);
+ ApplicationConnection.getConsole().log(""+firstRowInViewPort);
if(scrollPositionElement == null) {
scrollPositionElement = DOM.createDiv();
DOM.setElementProperty(scrollPositionElement, "className", "i-table-scrollposition");
}
public void run() {
- client.console.log("Getting " + reqRows + " rows from " + reqFirstRow);
+ ApplicationConnection.getConsole().log("Getting " + reqRows + " rows from " + reqFirstRow);
client.updateVariable(paintableId, "firstvisible", firstRowInViewPort, false);
client.updateVariable(paintableId, "reqfirstrow", reqFirstRow, false);
client.updateVariable(paintableId, "reqrows", reqRows, true);
protected void handleCaptionEvent(Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONMOUSEDOWN:
- client.console.log("HeaderCaption: mouse down");
+ ApplicationConnection.getConsole().log("HeaderCaption: mouse down");
if(columnReordering) {
dragging = true;
moved = false;
colIndex = getColIndexByKey(cid);
DOM.setCapture(getElement());
this.headerX = tHead.getAbsoluteLeft();
- client.console.log("HeaderCaption: Caption set to capture mouse events");
+ ApplicationConnection.getConsole().log("HeaderCaption: Caption set to capture mouse events");
DOM.eventPreventDefault(event); // prevent selecting text
}
break;
case Event.ONMOUSEUP:
- client.console.log("HeaderCaption: mouseUP");
+ ApplicationConnection.getConsole().log("HeaderCaption: mouseUP");
if(columnReordering) {
dragging = false;
DOM.releaseCapture(getElement());
- client.console.log("HeaderCaption: Stopped column reordering");
+ ApplicationConnection.getConsole().log("HeaderCaption: Stopped column reordering");
if(moved) {
hideFloatingCopy();
tHead.removeSlotFocus();
break;
case Event.ONMOUSEMOVE:
if (dragging) {
- client.console.log("HeaderCaption: Dragging column, optimal index...");
+ ApplicationConnection.getConsole().log("HeaderCaption: Dragging column, optimal index...");
if(!moved) {
createFloatingCopy();
moved = true;
tHead.focusSlot(closestSlot);
updateFloatingCopysPosition(x, -1);
- client.console.log(""+closestSlot);
+ ApplicationConnection.getConsole().log(""+closestSlot);
}
break;
default:
fixSpacers();
} else {
// sorted or column reordering changed
- client.console.log("Bad update" + firstIndex + "/"+ rows);
+ ApplicationConnection.getConsole().log("Bad update" + firstIndex + "/"+ rows);
}
}
switch (DOM.eventGetType(event)) {
case Event.ONCLICK:
if((CLASSNAME+"-cell-content").equals(s)) {
- client.console.log("Row click");
+ ApplicationConnection.getConsole().log("Row click");
if(selectMode > ITable.SELECT_MODE_NONE) {
toggleSelection();
client.updateVariable(paintableId, "selected", selectedRowKeys.toArray(), immediate);
}
public void showContextMenu(Event event) {
- client.console.log("Context menu");
+ ApplicationConnection.getConsole().log("Context menu");
if(actionKeys != null) {
int left = DOM.eventGetClientX(event);
int top = DOM.eventGetClientY(event);