/** * Override this method to specify that an element other than the root element * be the container for the panel's child widget. This can be useful when you * want to create a simple panel that decorates its contents. * * Note that this method continues to return the * {@link com.google.gwt.user.client.Element} class defined in the * <code>User</code> module to maintain backwards compatibility. * * @return the element to be used as the panel's container */ protected com.google.gwt.user.client.Element getContainerElement() { return getElement(); } }
@Override protected void onUpdate(double progress) { int scrollHeight = curPanel.contentWrapper.getElement().getPropertyInt("scrollHeight"); int height = (int) (progress * scrollHeight); if (!opening) { height = scrollHeight - height; } height = Math.max(height, 1); curPanel.contentWrapper.getElement().getStyle().setProperty("height", height + "px"); curPanel.contentWrapper.getElement().getStyle().setProperty("width", "auto"); } }
@Override protected void onComplete() { if (!opening) { curPanel.contentWrapper.setVisible(false); } curPanel.contentWrapper.getElement().getStyle().setProperty("height", "auto"); curPanel = null; }
/** * Clear the width of the tables in this widget, which causes them to fill the * available width. * * <p> * The table width is not the same as the width of this widget. If the tables * are narrower than this widget, there will be a gap between the table and * the edge of the widget. If the tables are wider than this widget, a * horizontal scrollbar will appear so the user can scroll horizontally. * </p> * * @see #setMinimumTableWidth(double, Unit) * @see #setTableWidth(double, Unit) */ public void clearTableWidth() { tableHeaderContainer.getElement().getStyle().clearWidth(); tableFooterContainer.getElement().getStyle().clearWidth(); tableDataContainer.getStyle().clearWidth(); }
/** * Set the minimum width of the tables in this widget. If the widget become * narrower than the minimum width, a horizontal scrollbar will appear so the * user can scroll horizontally. * * <p> * Note that this method is not supported in IE6 and earlier versions of IE. * </p> * * @param value the width * @param unit the unit of the width * @see #setTableWidth(double, Unit) */ public void setMinimumTableWidth(double value, Unit unit) { /* * The min-width style attribute doesn't apply to tables, so we set the * min-width of the element that contains the table instead. The table width * is fixed at 100%. */ tableHeaderContainer.getElement().getStyle().setProperty("minWidth", value, unit); tableFooterContainer.getElement().getStyle().setProperty("minWidth", value, unit); tableDataContainer.getStyle().setProperty("minWidth", value, unit); }
/** * Creates an empty DisclosurePanel that is initially closed. */ public DisclosurePanel() { initWidget(mainPanel); mainPanel.add(header); mainPanel.add(contentWrapper); contentWrapper.getElement().getStyle().setProperty("padding", "0px"); contentWrapper.getElement().getStyle().setProperty("overflow", "hidden"); setStyleName(STYLENAME_DEFAULT); setContentDisplay(false); }
tableHeaderContainer.getElement().getStyle().setWidth(value, unit); tableFooterContainer.getElement().getStyle().setWidth(value, unit); tableDataContainer.getStyle().setWidth(value, unit);
/** * Gets the specified tab's HTML. * * @param index the index of the tab whose HTML is to be retrieved * @return the tab's HTML */ public String getTabHTML(int index) { if (index >= getTabCount()) { return null; } ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1); SimplePanel focusablePanel = delPanel.getFocusablePanel(); Widget widget = focusablePanel.getWidget(); if (widget instanceof HTML) { return ((HTML) widget).getHTML(); } else if (widget instanceof Label) { return ((Label) widget).getText(); } else { // This will be a focusable panel holding a user-supplied widget. return focusablePanel.getElement().getParentElement().getInnerHTML(); } }
/** * 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 */ protected void insertTabWidget(Widget widget, int beforeIndex) { checkInsertBeforeTabIndex(beforeIndex); ClickDelegatePanel delWidget = new ClickDelegatePanel(widget); delWidget.setStyleName(STYLENAME_DEFAULT); // Add a11y role "tab" SimplePanel focusablePanel = delWidget.getFocusablePanel(); Roles.getTabRole().set(focusablePanel.getElement()); panel.insert(delWidget, beforeIndex + 1); setStyleName(DOM.getParent(delWidget.getElement()), STYLENAME_DEFAULT + "-wrapper", true); }
@Override protected void onStart() { content.getElement().getStyle().setOverflow(Overflow.HIDDEN); super.onStart(); }
public void setPresentationsMenu(Widget presentationsMenu) { if (_delegate.presentationsMenu != presentationsMenu) { Style presentationsIconStyle = ((CubaScrollTableHead) tHead).presentationsEditIcon.getElement().getStyle(); if (presentationsMenu == null) { presentationsIconStyle.setDisplay(Style.Display.NONE); } else { presentationsIconStyle.setDisplay(Style.Display.BLOCK); } } _delegate.presentationsMenu = presentationsMenu; }
@Override protected int getIconsOffsetWidth() { Style presentationsIconStyle = presentationsEditIcon.getElement().getStyle(); if ("none".equals(presentationsIconStyle.getDisplay())) { return super.getIconsOffsetWidth(); } ComputedStyle cs = new ComputedStyle(presentationsEditIcon.getElement()); double right = cs.getDoubleProperty("right"); return (int) Math.ceil(right + cs.getWidth()); }
@Override protected int getIconsOffsetWidth() { Style presentationsIconStyle = presentationsEditIcon.getElement().getStyle(); if ("none".equals(presentationsIconStyle.getDisplay())) { return super.getIconsOffsetWidth(); } ComputedStyle cs = new ComputedStyle(presentationsEditIcon.getElement()); double right = cs.getDoubleProperty("right"); return (int) Math.ceil(right + cs.getWidth()); }
/** * Creates an empty DisclosurePanel that is initially closed. */ public DisclosurePanel() { initWidget(mainPanel); mainPanel.add(header); mainPanel.add(contentWrapper); contentWrapper.getElement().getStyle().setProperty("padding", "0px"); contentWrapper.getElement().getStyle().setProperty("overflow", "hidden"); setStyleName(STYLENAME_DEFAULT); setContentDisplay(false); }
private void positionZoomHandle() { int index = viewPort.getResolutionCount() - viewPort.getResolutionIndex(viewPort.getResolution()) - 1; int handleY = getBaseTop() + ZOOMBUTTON_SIZE + 1 + (index * ZOOMSTEP_HEIGHT); int handleX = getBaseLeft(); zoomHandle.getElement().getStyle().setLeft(handleX, Unit.PX); zoomHandle.getElement().getStyle().setTop(handleY, Unit.PX); handleDragStartY = handleY; }
tableHeaderScroller = tableHeaderContainer.getElement().getParentElement(); headerPanel.setFooterWidget(tableFooterContainer); tableFooterScroller = tableFooterContainer.getElement().getParentElement();
@Override protected void onComplete() { super.onComplete(); content.setVisible(isExpanding); content.getElement().getStyle().setOverflow(Overflow.VISIBLE); content.setHeight("100%"); } }
public static SimplePanel createDrape() { SimplePanel drapePanel = new SimplePanel(); Style drapeStyle = drapePanel.getElement().getStyle(); drapeStyle.setProperty("position", "absolute"); drapeStyle.setProperty("top", "0px"); drapeStyle.setProperty("left", "0px"); drapePanel.setWidth("100%"); drapePanel.setHeight("100%"); drapePanel.setStyleName("WSWindowPanel-drape"); Effects.setOpacity(drapePanel.getElement(), 20); return drapePanel; }
@Override protected void onStart() { super.onStart(); DOM.setStyleAttribute(curPanel.content.getElement(), "overflow", "hidden"); if (opening) { curPanel.content.setVisible(true); // Special treatment on the visible case to ensure LazyPanel works curPanel.content.setVisible(true); } }
public CubaTreeTableTableHead() { Element iconElement = presentationsEditIcon.getElement(); iconElement.setClassName("c-table-prefs-icon"); iconElement.getStyle().setDisplay(Style.Display.NONE); Element columnSelector = (Element) getElement().getLastChild(); DOM.insertChild(getElement(), iconElement, DOM.getChildIndex(getElement(), columnSelector)); DOM.sinkEvents(iconElement, Event.ONCLICK); }