Refine search
public PreloaderCallback getPreloaderCallback () { final Panel preloaderPanel = new VerticalPanel(); preloaderPanel.setStyleName("gdx-preloader"); final Image logo = new Image(GWT.getModuleBaseURL() + "logo.png"); logo.setStyleName("logo"); preloaderPanel.add(logo); final Panel meterPanel = new SimplePanel(); meterPanel.setStyleName("gdx-meter"); meterPanel.addStyleName("red"); final InlineHTML meter = new InlineHTML(); final Style meterStyle = meter.getElement().getStyle(); meterStyle.setWidth(0, Unit.PCT); meterPanel.add(meter); preloaderPanel.add(meterPanel); getRootPanel().add(preloaderPanel); return new PreloaderCallback() { @Override public void error (String file) { System.out.println("error: " + file); } @Override public void update (PreloaderState state) { meterStyle.setWidth(100f * state.getProgress(), Unit.PCT); } }; }
/** * Sets a tab's text contents. * * @param index the index of the tab whose text is to be set * @param text the object's new text */ public void setTabText(int index, String text) { assert (index >= 0) && (index < getTabCount()) : "Tab index out of bounds"; ClickDelegatePanel delPanel = (ClickDelegatePanel) panel.getWidget(index + 1); SimplePanel focusablePanel = delPanel.getFocusablePanel(); // It is not safe to check if the current widget is an instanceof Label and // reuse it here because HTML is an instanceof Label. Leaving an HTML would // throw off the results of getTabHTML(int). focusablePanel.setWidget(new Label(text, false)); }
/** * Constructs a ValueBoxEditorDecorator using a {@link ValueBoxBase} * widget and a {@link ValueBoxEditor} editor. * * @param widget the widget * @param editor the editor */ public ValueBoxEditorDecorator(ValueBoxBase<T> widget, ValueBoxEditor<T> editor) { this(); contents.add(widget); this.editor = editor; }
private void init() { final SimplePanel emptyPanel = new SimplePanel(); navContent = new CustomDeckLayoutPanel(); navContent.setAnimationVertical(false); final Label back = new Label(OPEN); back.setStyleName(kaaAdminStyle.bNavLabel()); appHeader.setSize("100%", "60px"); footerPanel.getElement().setInnerHTML(Utils.messages.footerMessage(Version.PROJECT_VERSION)); back.addClickHandler(new ClickHandler() {
public void setWidget(IsWidget w) { setWidget(asWidgetOrNull(w)); }
public WorkPanel() { setElement(vPanel.getElement()); vPanel.setWidth("100%"); SimplePanel title = new SimplePanel(); vPanel.add(title); vPanel.add(mainPanel); title.setHeight("25px"); vPanel.setCellHeight(title, "25px"); titleLabel.setStyleName("WS-WorkPanel-title-label"); title.setStyleName("WS-WorkPanel-title"); vPanel.setStyleName("WS-WorkPanel-area"); titleInternal.add(titleLabel); title.setWidget(titleInternal); getElement().getStyle().setProperty("overflow", "scroll"); }
/** * 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 Widget getCharacteristics() { characteristicsPanel = new VerticalPanel(); characteristicsTables = new ArrayList<FlexTable>(); final HorizontalPanel toolbar = new HorizontalPanel(); btnAddCharacteristic = new Button(GuidedScoreCardConstants.INSTANCE.addCharacteristic(), new ClickHandler() { public void onClick(ClickEvent event) { addCharacteristic(null); } }); toolbar.add(btnAddCharacteristic); toolbar.setHeight("24"); characteristicsPanel.add(toolbar); final SimplePanel gapPanel = new SimplePanel(); gapPanel.add(new HTML("<br/>")); characteristicsPanel.add(gapPanel); return characteristicsPanel; }
@Override protected void onComplete() { if (!opening) { curPanel.contentWrapper.setVisible(false); } curPanel.contentWrapper.getElement().getStyle().setProperty("height", "auto"); curPanel = null; }
@Override public void reset() { // resetName(); categoriesPanel.clear(); categoriesList = new CategoriesList(resources); categoriesPanel.add(categoriesList); com.google.gwt.dom.client.Style style = categoriesList.getElement().getStyle(); style.setWidth(100, com.google.gwt.dom.client.Style.Unit.PCT); style.setHeight(100, com.google.gwt.dom.client.Style.Unit.PCT); style.setPosition(com.google.gwt.dom.client.Style.Position.RELATIVE); descriptionArea.getElement().setInnerHTML(""); configurationArea.getElement().setInnerText(""); }
@Override protected void onComplete() { super.onComplete(); content.setVisible(isExpanding); content.getElement().getStyle().setOverflow(Overflow.VISIBLE); content.setHeight("100%"); } }
/** * Create title widget that contains notification title. * * @return {@link SimplePanel} as title wrapper */ private SimplePanel createTitleWidget() { SimplePanel titleWrapper = new SimplePanel(); Label titleLabel = new Label(); titleWrapper.add(titleLabel); titleWrapper.setStyleName(resources.notificationCss().notificationPopupTitleWrapper()); titleWrapper.ensureDebugId(TITLE_DBG_ID + notification.getId()); return titleWrapper; }
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 public void updateProgressBar(ProgressReport progressor) { String label = isNullOrEmpty(progressor.getSubTask()) ? progressor.getStatus() : progressor.getSubTask(); operationLabel.setText(label); int totalWork = progressor.getTotalWork(); if (totalWork > 0) { double percent = ((double) progressor.getWorkDone() / progressor.getTotalWork()); progress.getElement().getStyle().setWidth(percent * 100, PCT); } }
@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"); } }
private void showBackdrop() { if(backdrop == null) { backdrop = new SimplePanel(); RootPanel.get().add(backdrop); } backdrop.setStyleName("modal-backdrop fade in"); backdrop.getElement().getStyle().setDisplay(Style.Display.BLOCK); }
tableHeaderContainer = new SimplePanel(tableHeader); tableFooterContainer = new SimplePanel(tableFooter); tableHeaderScroller = tableHeaderContainer.getElement().getParentElement(); headerPanel.setFooterWidget(tableFooterContainer); tableFooterScroller = tableFooterContainer.getElement().getParentElement(); tableHeaderScroller.getStyle().setOverflow(Overflow.HIDDEN); tableFooterScroller.getStyle().setOverflow(Overflow.HIDDEN); tableDataScroller.setHeight("100%"); headerPanel.setContentWidget(tableDataScroller); tableDataContainer = tableData.getElement().getParentElement(); tableDataContainer.getStyle().setDisplay(Display.BLOCK);
/** * 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); }
tableHeaderContainer.getElement().getStyle().setWidth(value, unit); tableFooterContainer.getElement().getStyle().setWidth(value, unit); tableDataContainer.getStyle().setWidth(value, unit);