List of usage examples for com.google.gwt.user.client.ui Widget setSize
public void setSize(String width, String height)
From source file:cc.alcina.framework.gwt.client.util.WidgetUtils.java
License:Apache License
public static void copySize(Widget from, Widget to) { to.setSize(from.getOffsetWidth() + "px", from.getOffsetHeight() + "px"); }
From source file:co.fxl.gui.gwt.GWTFlowPanel.java
License:Open Source License
@Override public IFlowPanel addSpace(int pixel) { Widget p = new AbsolutePanel(); p.setSize(pixel + "px", "1px"); container.widget.add(p);/*ww w .j a v a2 s. c om*/ return this; }
From source file:co.fxl.gui.gwt.GWTHorizontalPanel.java
License:Open Source License
@Override public IHorizontalPanel addSpace(int pixel) { if (pixel == 0) return this; Widget p = new AbsolutePanel(); p.setSize(pixel + "px", "1px"); container.widget.add(p);/*www . j a v a 2 s.com*/ return this; }
From source file:co.fxl.gui.gwt.GWTVerticalPanel.java
License:Open Source License
@Override public IVerticalPanel addSpace(int pixel) { if (pixel == 0) return this; Widget p = new AbsolutePanel(); p.setSize("1px", pixel + "px"); container.widget.add(p);//from www .j a v a 2 s . c o m return this; }
From source file:com.google.appinventor.client.editor.simple.components.MockWrapper.java
License:Open Source License
/** * Sets the widget that is wrapped by the wrapper. *//*from w w w. j av a 2 s.co m*/ protected final void initWrapper(Widget wrappedWidget) { // The wrapped widget should always fill up the wrapper. wrappedWidget.setSize("100%", "100%"); wrapper.setWidget(wrappedWidget); initComponent(wrapper); }
From source file:com.google.code.p.gwtchismes.client.GWTCHelper.java
License:Apache License
/** * Maximize a widget to fill all the document * @param widget//from www . j a va 2 s .c o m */ public static void maximizeWidget(Widget widget) { if (widget == null) return; int w = Math.max(getClientWidth(), Math.max(getWindowScrollWidth(), RootPanel.get().getOffsetWidth())); int h = Math.max(getClientHeight(), Math.max(getWindowScrollHeight(), RootPanel.get().getOffsetHeight())); // h = Math.max(h, Window.getClientHeight()); // h += Window.getScrollTop(); widget.setSize(w + "px", h + "px"); }
From source file:com.ikon.frontend.client.widget.toolbar.ToolBar.java
License:Open Source License
/** * Create html scanner applet code/*from ww w . j ava2s . c om*/ */ public void setScannerApplet(String sessionId, String path) { if (Util.isJREInstalled()) { Widget scannerApplet = RootPanel.get("scannerApplet"); scannerApplet.setSize("1", "1"); panel.add(scannerApplet); scannerApplet.getElement().setInnerHTML( "<applet code=\"com.ikon.applet.Scanner\" name=\"Scanner\" width=\"1\" height=\"1\" mayscript archive=\"../scanner.jar\">" + "<param name=\"sessionId\" value=\"" + sessionId + "\">" + "<param name=\"path\" value=\"" + path + "\">" + "<param name=\"lang\" value=\"" + Main.get().getLang() + "\">" + "</applet>"); } else { Main.get().showError("setScannerApplet", new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMBrowser, ErrorCode.CAUSE_Configuration), "JRE support not detected in your browser")); } }
From source file:com.ikon.frontend.client.widget.toolbar.ToolBar.java
License:Open Source License
/** * Create html uploader applet code//from w w w.j av a2s. co m */ public void setUploaderApplet(String sessionId, String path) { if (Util.isJREInstalled()) { Widget uploaderApplet = RootPanel.get("uploaderApplet"); uploaderApplet.setSize("1", "1"); panel.add(uploaderApplet); uploaderApplet.getElement().setInnerHTML( "<applet code=\"com.ikon.applet.Uploader\" name=\"Uploader\" width=\"1\" height=\"1\" mayscript archive=\"../uploader.jar\">" + "<param name=\"sessionId\" value=\"" + sessionId + "\">" + "<param name=\"path\" value=\"" + path + "\">" + "<param name=\"lang\" value=\"" + Main.get().getLang() + "\">" + "</applet>"); } else { Main.get().showError("setUploaderApplet", new OKMException(ErrorCode.get(ErrorCode.ORIGIN_OKMBrowser, ErrorCode.CAUSE_Configuration), "JRE support not detected in your browser")); } }
From source file:com.ksyzt.gwt.client.ui.richeditor.RichTextToolbar.java
License:Open Source License
/** * Show popup.// w w w . j a v a 2 s .c o m * * @param attacheElement the attache element * @param w the w */ private void showPopup(Widget attacheElement, Widget w) { back_widget = attacheElement; if (w == null) { w = new HTMLPanel(""); w.setSize("100px", "100px"); m_ap_content.clear(); m_ap_content.add(w); } else { m_ap_content.clear(); m_ap_content.add(w); } m_ap_content.setVisible(true); m_ap_shadow.setVisible(true); m_ap_line.setVisible(true); int aleft = attacheElement.getAbsoluteLeft(); int atop = attacheElement.getAbsoluteTop(); int aw = attacheElement.getOffsetWidth(); int ah = attacheElement.getOffsetHeight(); int width = m_ap_content.getOffsetWidth(); int height = m_ap_content.getOffsetHeight(); int lbx = aleft; int lby = atop + ah; int rbx = lbx + aw; int rby = lby; Style style = m_ap_content.getElement().getStyle(); style.setLeft(rbx - width, Unit.PX); style.setTop(lby - 1, Unit.PX); style = m_ap_shadow.getElement().getStyle(); style.setLeft(rbx - width + 3, Unit.PX); style.setTop(lby + 2, Unit.PX); style.setWidth(width, Unit.PX); style.setHeight(height, Unit.PX); style = m_ap_line.getElement().getStyle(); style.setLeft(lbx + 1, Unit.PX); style.setTop(lby - 1, Unit.PX); style.setWidth(aw - 2, Unit.PX); back_css = attacheElement.getStyleName(); attacheElement.setStyleName("toolbar_over"); m_ap_content.getElement().focus(); m_b_show_popup = true; }
From source file:com.openkm.frontend.client.widget.toolbar.ToolBar.java
License:Open Source License
/** * Create html scanner applet code// w w w .ja va2 s .c o m */ public void setScannerApplet(String sessionId, String path) { Widget scannerApplet = RootPanel.get("scannerApplet"); scannerApplet.setSize("1", "1"); scannerApplet.getElement().setInnerHTML( "<applet code=\"com.openkm.applet.Scanner\" name=\"Scanner\" width=\"1\" height=\"1\" mayscript archive=\"../scanner.jar\">" + "<param name=\"sessionId\" value=\"" + sessionId + "\">" + "<param name=\"path\" value=\"" + path + "\">" + "<param name=\"lang\" value=\"" + Main.get().getLang() + "\">" + "</applet>"); }