List of usage examples for com.google.gwt.user.client Window addResizeHandler
public static HandlerRegistration addResizeHandler(ResizeHandler handler)
From source file:org.ednovo.gooru.client.mvp.gshelf.lessondetails.LessonInfoView.java
License:Open Source License
/** * Class constructor/*from ww w . j a v a 2 s . c o m*/ * @param eventBus {@link EventBus} */ @Inject public LessonInfoView() { setWidget(uiBinder.createAndBindUi(this)); lessonInfo.getElement().setId("pnlLessonInfo"); lessonInfo.getElement().setAttribute("style", "min-height:" + Window.getClientHeight() + "px"); lblErrorMessage.setText("Please Enter Valid Lesson Name"); lblErrorMessage.setVisible(false); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { lessonInfo.getElement().setAttribute("style", "min-height:" + Window.getClientHeight() + "px"); } }); getAddStandards(); taxonomyBtn.addClickHandler(new OnClickTaxonomy()); taxonomyToggleBtn.addClickHandler(new OnClickTaxonomy()); Event.addNativePreviewHandler(new NativePreviewHandler() { @Override public void onPreviewNativeEvent(NativePreviewEvent event) { hideDropDown(event); } }); btnStandardsBrowse.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (!standardsDropListValues.getElement().getAttribute("style") .equalsIgnoreCase("display:block;")) { standardsDropListValues.getElement().setAttribute("style", "display:block;"); } else { standardsDropListValues.getElement().removeAttribute("style"); } } }); lessonTitle.getElement().setPropertyString("placeholder", i18n.GL3365()); lessonTitle.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { SetStyleForProfanity.SetStyleForProfanityForTextBox(lessonTitle, lblErrorMessage, false); } }); lessonTitle.addKeyUpHandler(new TitleKeyUpHandler()); lessonTitle.addKeyPressHandler(new KeyPressHandler() { @Override public void onKeyPress(KeyPressEvent event) { lessonTitle.getElement().getStyle().clearBackgroundColor(); lessonTitle.getElement().getStyle().setBorderColor("#ccc"); lblErrorMessage.setVisible(false); } }); lessonNamePpanel.setText(i18n.GL3478()); }
From source file:org.ednovo.gooru.client.util.ScrollPopupShareUtil.java
License:Open Source License
public static void ScrollPopupUtilWidget(Widget widget) { widgetContainer = widget;/*w w w . j a v a 2s . c o m*/ setAddTagesPopupOnResize(); Window.addResizeHandler(new ResizeEvent()); }
From source file:org.ednovo.gooru.client.util.ScrollPopupUtil.java
License:Open Source License
public static void ScrollPopupUtilWidget(Widget widget, boolean val) { widgetContainer = widget;/* w ww.ja va 2 s . c om*/ isFromAddtags = val; setAddTagesPopupOnResize(isFromAddtags); Window.addResizeHandler(new ResizeEvent()); }
From source file:org.freemedsoftware.gwt.client.widget.SchedulerWidget.java
License:Open Source License
public SchedulerWidget() { super(moduleName); ////////////Applying stored configurations//////////////// int startHour = 10; int endHour = 18; int intervalsPerHour = 4; show24HourClock = false;/*from w ww . j ava 2 s . c om*/ int intervalHeight = 50; if (Util.getProgramMode() == ProgramMode.JSONRPC) { startHour = CurrentState.getSystemConfig("calshr") != null ? Integer.parseInt(CurrentState.getSystemConfig("calshr")) : startHour; endHour = CurrentState.getSystemConfig("calehr") != null ? Integer.parseInt(CurrentState.getSystemConfig("calehr")) : endHour; intervalsPerHour = CurrentState.getSystemConfig("calinterval") != null ? (60 / Integer.parseInt(CurrentState.getSystemConfig("calinterval"))) : intervalsPerHour; intervalHeight = CurrentState.getSystemConfig("calintervalheight") != null ? Integer.parseInt(CurrentState.getSystemConfig("calintervalheight")) : intervalHeight; show24HourClock = CurrentState.getSystemConfig("calshow24hourclock") != null ? (Integer.parseInt(CurrentState.getSystemConfig("calshow24hourclock")) == 1) : show24HourClock; } StringPanelRenderer panelRenderer = new StringPanelRenderer(); panelRenderer.setStartHour(startHour); panelRenderer.setEndHour(endHour); panelRenderer.setIntervalsPerHour(intervalsPerHour); panelRenderer.setShow24HourClock(show24HourClock); panelRenderer.setIntervalHeight(intervalHeight); ////////////End configurations//////////////// filterModulesAndMethods.put("ProviderModule", "GetDailyAppointmentsRange"); filterModulesAndMethods.put("ProviderGroups", "GetDailyAppointmentsRangeByProviderGroup"); SELECTED_MODULE = "ProviderModule"; eventCacheController = new EventCacheController(); multiPanel = new MultiView(eventCacheController, panelRenderer); panel.setWidth("100%"); final HorizontalPanel loadingContainer = new HorizontalPanel(); loadingContainer.add(new Image("resources/images/loading.gif")); loadingContainer.add(new HTML("<h3>" + "Loading" + "</h3>")); loadingDialog.setStylePrimaryName(SchedulerCss.EVENT_DIALOG); loadingDialog.setWidget(loadingContainer); loadingDialog.hide(); final VerticalPanel headerArea = new VerticalPanel(); headerArea.setWidth("100%"); final HorizontalPanel fields = new HorizontalPanel(); fields.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); fields.setWidth("100%"); headerArea.add(fields); panel.add(headerArea, DockPanel.NORTH); /* * fields.add(label); fields.setCellHeight(label, "50%"); */ final HorizontalPanel filterPanel = new HorizontalPanel(); fields.add(filterPanel); // fields.setCellWidth(filterPanel, "50%"); Label selectFilterLabel = new Label(_("Filter by") + " :"); selectFilterLabel.setStyleName(AppConstants.STYLE_LABEL_LARGE_BOLD); filterPanel.add(selectFilterLabel); final CustomListBox selectFilter = new CustomListBox(); selectFilter.addItem(_("Provider"), "ProviderModule"); selectFilter.addItem(_("Provider Groups"), "ProviderGroups"); selectFilter.addChangeHandler(new ChangeHandler() { @Override public void onChange(ChangeEvent arg0) { SELECTED_MODULE = selectFilter.getStoredValue(); filterModule.setModuleName(SELECTED_MODULE); filterModule.setValue(0); } }); filterPanel.add(selectFilter); filterModule.setModuleName("ProviderModule"); filterModule.setWidth("300px"); filterModule.addValueChangeHandler(new ValueChangeHandler<Integer>() { @Override public void onValueChange(ValueChangeEvent<Integer> event) { Integer val = ((SupportModuleWidget) event.getSource()).getValue(); // Log.debug("Patient value = " + val.toString()); try { if (val.compareTo(new Integer(0)) != 0) { multiPanel.clearData(); eventCacheController.getEventsForRange(multiPanel.getCurrent().getFirstDateLogical(), multiPanel.getCurrent().getLastDateLogical(), val, filterModulesAndMethods.get(SELECTED_MODULE), multiPanel, true); } } catch (Exception e) { // Don't do anything if no patient is declared GWT.log("Caught exception", e); } } }); filterPanel.add(filterModule); CustomButton clearButton = new CustomButton(_("Clear"), AppConstants.ICON_CLEAR); clearButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { filterModule.setValue(0); eventCacheController.getEventsForRange(multiPanel.getCurrent().getFirstDateLogical(), multiPanel.getCurrent().getLastDateLogical(), multiPanel, true); } }); filterPanel.add(clearButton); final HorizontalPanel fields2Panel = new HorizontalPanel(); fields2Panel.setSpacing(5); CustomButton showPicker = new CustomButton(_("Jump")); fields2Panel.add(showPicker); if (CurrentState.isActionAllowed(blockSlotsModuleName, AppConstants.SHOW)) { CustomButton showBlockSlots = new CustomButton(_("Block Slots")); showBlockSlots.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { BlockTimeSlotPopup blockTimeSlotPopup = new BlockTimeSlotPopup(); blockTimeSlotPopup.show(); blockTimeSlotPopup.center(); } }); fields2Panel.add(showBlockSlots); } headerArea.add(fields2Panel); final VerticalPanel posPanel = new VerticalPanel(); posPanel.setVisible(false); posPanel.setWidth("100%"); HorizontalPanel pickerHolder = new HorizontalPanel(); pickerHolder.add(posPanel); pickerHolder.add(multiPanel); showPicker.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent arg0) { posPanel.setVisible(!posPanel.isVisible()); if (posPanel.isVisible()) multiPanel.setPixelSize((Window.getClientWidth() * 78) / 100, (Window.getClientHeight() * 70) / 100); else multiPanel.setPixelSize((Window.getClientWidth() * 87) / 100, (Window.getClientHeight() * 70) / 100); } }); HTML space = new HTML(""); posPanel.add(space); space.setHeight("40px"); posPanel.add(navigator); // navigator.setVisible(false); // pickerHolder.setCellWidth(posPanel, "200px"); pickerHolder.setVerticalAlignment(VerticalPanel.ALIGN_TOP); pickerHolder.setCellWidth(multiPanel, "100%"); multiPanel.setWidth("100%"); multiPanel.setPixelSize((Window.getClientWidth() * 87) / 100, (Window.getClientHeight() * 300) / 100); // posPanel.setWidth("200px"); panel.add(pickerHolder, DockPanel.CENTER); pickerHolder.setWidth("100%"); onWindowResized(-1, Window.getClientHeight()); panel.setStyleName("whiteForDemo"); multiPanel.addDateListener(this); navigator.addDateListener(this); Window.addResizeHandler(this); multiPanel.scrollToHour(7); initWidget(panel); }
From source file:org.geomajas.quickstart.gwt2.client.widget.layer.LayerLegend.java
License:Open Source License
/** * Default constructor.// ww w .j av a2s.c o m */ public LayerLegend() { UIBINDER.createAndBindUi(this); ApplicationResource.INSTANCE.css().ensureInjected(); this.mapPresenter = ApplicationService.getInstance().getMapPresenter(); layerLegendPanel.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { ApplicationService.getInstance().setTooltipShowingAllowed(false); } }, MouseOverEvent.getType()); layerLegendPanel.addDomHandler(new MouseOutHandler() { @Override public void onMouseOut(MouseOutEvent event) { ApplicationService.getInstance().setTooltipShowingAllowed(true); } }, MouseOutEvent.getType()); Window.addResizeHandler(new BrowserResizedHandler()); initLayerLegend(); }
From source file:org.glom.web.client.ui.details.SingleLineText.java
License:Open Source License
@Override protected void onLoad() { setNewWidth();/*from ww w .j a v a2s .co m*/ getElement().getStyle().setProperty("whiteSpace", "nowrap"); resizeHandlerReg = Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(final ResizeEvent event) { setNewWidth(); } }); }
From source file:org.gss_project.gss.web.client.GSS.java
License:Open Source License
@Override public void onModuleLoad() { // Initialize the singleton before calling the constructors of the // various widgets that might call GSS.get(). singleton = this; parseUserCredentials();//from w w w. ja va 2s .c o m topPanel = new TopPanel(GSS.images); topPanel.setWidth("100%"); messagePanel.setWidth("100%"); messagePanel.setVisible(false); search = new Search(images); searchStatus.add(search, DockPanel.WEST); searchStatus.add(userDetailsPanel, DockPanel.EAST); searchStatus.setCellHorizontalAlignment(userDetailsPanel, HasHorizontalAlignment.ALIGN_RIGHT); searchStatus.setCellVerticalAlignment(search, HasVerticalAlignment.ALIGN_MIDDLE); searchStatus.setCellVerticalAlignment(userDetailsPanel, HasVerticalAlignment.ALIGN_MIDDLE); searchStatus.setWidth("100%"); fileList = new FileList(images); searchResults = new SearchResults(images); // Inner contains the various lists. inner.sinkEvents(Event.ONCONTEXTMENU); inner.setAnimationEnabled(true); inner.getTabBar().addStyleName("gss-MainTabBar"); inner.getDeckPanel().addStyleName("gss-MainTabPanelBottom"); inner.add(fileList, createHeaderHTML(AbstractImagePrototype.create(images.folders()), "Files"), true); inner.add(groups, createHeaderHTML(AbstractImagePrototype.create(images.groups()), "Groups"), true); inner.add(searchResults, createHeaderHTML(AbstractImagePrototype.create(images.search()), "Search Results"), true); //inner.add(new CellTreeView(images), createHeaderHTML(AbstractImagePrototype.create(images.search()), "Cell tree sample"), true); inner.setWidth("100%"); inner.selectTab(0); inner.addSelectionHandler(new SelectionHandler<Integer>() { @Override public void onSelection(SelectionEvent<Integer> event) { int tabIndex = event.getSelectedItem(); // TreeItem treeItem = GSS.get().getFolders().getCurrent(); switch (tabIndex) { case 0: // Files tab selected //fileList.clearSelectedRows(); fileList.updateCurrentlyShowingStats(); break; case 1: // Groups tab selected groups.updateCurrentlyShowingStats(); updateHistory("Groups"); break; case 2: // Search tab selected searchResults.clearSelectedRows(); searchResults.updateCurrentlyShowingStats(); updateHistory("Search"); break; } } }); // If the application starts with no history token, redirect to a new "Files" state String initToken = History.getToken(); if (initToken.length() == 0) History.newItem("Files"); // Add history listener to handle any history events History.addValueChangeHandler(new ValueChangeHandler<String>() { @Override public void onValueChange(ValueChangeEvent<String> event) { String tokenInput = event.getValue(); String historyToken = handleSpecialFolderNames(tokenInput); try { if (historyToken.equals("Search")) inner.selectTab(2); else if (historyToken.equals("Groups")) inner.selectTab(1); else if (historyToken.equals("Files") || historyToken.length() == 0) inner.selectTab(0); else { /*TODO: CELLTREE PopupTree popupTree = GSS.get().getFolders().getPopupTree(); TreeItem treeObj = GSS.get().getFolders().getPopupTree().getTreeItem(historyToken); SelectionEvent.fire(popupTree, treeObj); */ } } catch (IndexOutOfBoundsException e) { inner.selectTab(0); } } }); // Add the left and right panels to the split panel. splitPanel.setLeftWidget(treeView); splitPanel.setRightWidget(inner); splitPanel.setSplitPosition("25%"); splitPanel.setSize("100%", "100%"); splitPanel.addStyleName("gss-splitPanel"); // Create a dock panel that will contain the menu bar at the top, // the shortcuts to the left, the status bar at the bottom and the // right panel taking the rest. VerticalPanel outer = new VerticalPanel(); outer.add(topPanel); outer.add(searchStatus); outer.add(messagePanel); outer.add(splitPanel); outer.add(statusPanel); outer.setWidth("100%"); outer.setCellHorizontalAlignment(messagePanel, HasHorizontalAlignment.ALIGN_CENTER); outer.setSpacing(4); // Hook the window resize event, so that we can adjust the UI. Window.addResizeHandler(this); // Clear out the window's built-in margin, because we want to take // advantage of the entire client area. Window.setMargin("0px"); // Finally, add the outer panel to the RootPanel, so that it will be // displayed. RootPanel.get().add(outer); // Call the window resized handler to get the initial sizes setup. Doing // this in a deferred command causes it to occur after all widgets' // sizes have been computed by the browser. DeferredCommand.addCommand(new Command() { @Override public void execute() { onWindowResized(Window.getClientHeight()); } }); }
From source file:org.gwt.dynamic.module.bar.client.demo.CircleCollisionPane.java
License:MIT License
public CircleCollisionPane() { initWidget(uiBinder.createAndBindUi(this)); LOG.info("CircleCollisionPane: instantiated"); Window.addResizeHandler(new ResizeHandler() { Timer resizeTimer = new Timer() { @Override/* w w w . j a v a 2 s. com*/ public void run() { pause(); gameScene = null; reset(); } }; @Override public void onResize(ResizeEvent event) { resizeTimer.cancel(); resizeTimer.schedule(300); } }); }
From source file:org.gwt.dynamic.module.gwtp.client.application.roles.RolesView.java
License:MIT License
@Inject public RolesView(final Binder binder) { initWidget(binder.createAndBindUi(this)); Window.addResizeHandler(new ResizeHandler() { Timer resizeTimer = new Timer() { @Override// w w w.ja v a 2 s . c o m public void run() { update(); } }; @Override public void onResize(ResizeEvent event) { resizeTimer.cancel(); resizeTimer.schedule(300); } }); LOG.info("RolesView: instantiated"); }
From source file:org.gwtlib.client.table.ui.Table.java
License:Apache License
protected Table(ColumnLayout layout, boolean initWidget) { super(Style.SINGLE_SELECT); _layout = layout;/*from w w w . j a v a 2 s .c o m*/ _cache = new RowsCache(); _listeners = new ArrayList<TableListener>(); _table = new FlexTable(); _table.setCellSpacing(0); _table.setCellSpacing(0); _table.setSize("100%", "auto"); _scroll = new ScrollPanel(_table); _panel = new FlexTable(); _panel.setCellSpacing(0); _panel.setCellPadding(0); _panel.setWidget(0, 0, _scroll); _panel.getRowFormatter().setVerticalAlign(0, HasVerticalAlignment.ALIGN_TOP); _panel.getFlexCellFormatter().addStyleName(0, 0, "scroll-cell"); if (initWidget) initWidget(_panel); _table.setStylePrimaryName(STYLE); initOptimalSize(); Window.addResizeHandler(new ResizeHandler() { @Override public void onResize(ResizeEvent event) { initOptimalSize(); } }); _table.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { HTMLTable.Cell cell = _table.getCellForEvent(event); if (cell != null) { int row = cell.getRowIndex(); int col = cell.getCellIndex(); GWT.log("onCellClicked " + row + "," + col, null); fireCellClickedEvent(row, col); int c = toActualColumnPos(col); Column column = _layout.getColumn(c); if (row == 0) { if (column.isSortable()) { sort(c, column.getSortDirection() != Column.Sort.ASCENDING); } } else { Row r = _cache.getRow(_begin + row - 1); if (r != null) { fireCellClickedEvent(r, column); fireRowClickedEvent(r); } } } } }); }