public Widget draw() { // main panel VerticalPanel vp = new VerticalPanel(); vp.getElement().setAttribute("style", "padding-top: 5px;"); vp.setSize("100%", "100%"); FindAllPublicationSystems call = new FindAllPublicationSystems(); call.setCheckable(false); CellTable<PublicationSystem> table = call.getTable(); table.addStyleName("perun-table"); ScrollPanel sp = new ScrollPanel(); sp.add(table); sp.addStyleName("perun-tableScrollPanel"); vp.add(sp); // resize perun table to correct size on screen session.getUiElements().resizeSmallTabPanel(sp, 350, this); this.contentWidget.setWidget(vp); return getWidget(); }
public Widget draw() { VerticalPanel vp = new VerticalPanel(); vp.getElement().setAttribute("style", "padding-top: 5px;"); vp.setSize("100%", "100%"); FindAllAuthors callback = new FindAllAuthors(); CellTable<Author> table = callback.getTable( new FieldUpdater<Author, String>() { public void update(int index, Author object, String value) { if (session.isPerunAdmin()) { session.getTabManager().addTab(new UsersPublicationsTabItem(object.getId())); } } }); table.addStyleName("perun-table"); ScrollPanel sp = new ScrollPanel(); sp.add(table); sp.addStyleName("perun-tableScrollPanel"); vp.add(sp); // resize perun table to correct size on screen session.getUiElements().resizeSmallTabPanel(sp, 350, this); this.contentWidget.setWidget(vp); return getWidget(); }
private void showEmptyContentIfNoData(int dataSize) { if (dataSize == 0) { root.setWidget(noContentLabel); } else { root.setWidget(transUnitTable); } }
public void setWidget(Widget w) { // If there is already a widget, remove it. if (child != null) sp.remove(child); // Add the widget to the center of the cell. if (w != null) sp.setWidget(w); child = w; }
public void setAlgebraView(final AlgebraViewW av) { if (av != aview) { if (aview != null && simplep != null) { simplep.remove(aview); algebrap.remove(simplep); } simplep = new SimplePanel(aview = av); algebrap.add(simplep); simplep.addStyleName("algebraSimpleP"); algebrap.addStyleName("algebraPanel"); algebrap.addDomHandler( new ClickHandler() { public void onClick(ClickEvent event) { int bt = simplep.getAbsoluteTop() + simplep.getOffsetHeight(); if (event.getClientY() > bt) { app.getSelectionManager().clearSelectedGeos(); av.resetItems(true); } ; } }, ClickEvent.getType()); } }
public void run(final RootPanel rp, final String nick) { if (Cookies.getCookie(nick) == null) Cookies.setCookie(nick, "" + 0); cl.setPageSize(500); final Button sendMessage = new Button( "sendMessage", new ClickHandler() { public void onClick(ClickEvent event) { if (!message.getText().equals("")) { new Post().postJson(SERVERURL, nick.toString(), message.getText()); message.setText(""); } } }); rp.get("mainDiv2").setVisible(true); message.getElement().setAttribute("placeholder", "Introduce your message"); message.getElement().setAttribute("id", "message"); cl.getElement().setAttribute("id", "chatBox"); sendMessage.getElement().setAttribute("id", "sendMessage"); sendMessage.setText("Send"); vp.getElement().setAttribute("id", "verticalPanel"); hp.getElement().setAttribute("id", "horizontalPanel"); panel.getElement().setAttribute("id", "scroller"); hp.add(message); hp.add(sendMessage); panel.add(cl); vp.add(panel); vp.add(hp); rp.get("mainDiv2").add(vp); Timer t = new Timer() { @Override public void run() { getMessages(); if (chatList != null && Integer.parseInt(Cookies.getCookie(nick)) < chatList.size()) { cl.setRowCount(chatList.size() + 1, true); cl.setRowData( Integer.parseInt(Cookies.getCookie(nick)), chatList.subList(Integer.parseInt(Cookies.getCookie(nick)), chatList.size())); panel.setVerticalScrollPosition(panel.getMaximumVerticalScrollPosition() - 1); Cookies.setCookie(nick, "" + chatList.size()); } } }; t.scheduleRepeating(1000); }
public MoveTerm() { super(true); this.setText(constants.conceptMove()); panel.setWidth("400px"); panel.add(getWarningWidget("Preferred Term cannot be moved !!!")); addWidget(panel); }
public ListDialogBox(List<String> strings) { ScrollPanel sPanel = new ScrollPanel(); VerticalPanel vPanel = new VerticalPanel(); vPanel.add(new HTML("<br>")); if (strings != null) { for (String s : strings) { vPanel.add(new Label(s)); } } Button close = new Button("close"); close.addClickHandler(crosshandler); vPanel.add(new HTML("<br>")); vPanel.add(new HTML("<hr>")); vPanel.add(new HTML("<br>")); vPanel.add(close); sPanel.setVisible(true); sPanel.add(vPanel); this.add(sPanel); this.setText("RAW data from DB"); }
private void refreshWidgets() { this.artifactEditor = new ArtifactEditor(asset, null); this.ruleViewer = new RuleViewer( asset, this.editEvent, this.closeCommand, this.checkedInCommand, this.archiveCommand, this.isHistoricalReadOnly, actionToolbarButtonsConfigurationProvider, ruleViewerSettings); this.actionToolBar = this.ruleViewer.getActionToolbar(); VerticalPanel vp = new VerticalPanel(); vp.add(this.actionToolBar); TabPanel tPanel = new TabPanel(); tPanel.setWidth("100%"); ScrollPanel pnl = new ScrollPanel(); pnl.add(this.artifactEditor); tPanel.add(pnl, "Attributes"); // tPanel.selectTab(0); pnl = new ScrollPanel(); // pnl1.setWidth("100%"); pnl.add(this.ruleViewer); tPanel.add(pnl, "Edit"); tPanel.selectTab(1); vp.add(tPanel); initWidget(vp); }
@UiHandler("tagScrollPanel") public void dragFollowingScrollPanel(ScrollEvent event) { if (tagScrollPanel.getVerticalScrollPosition() == tagScrollPanel.getMaximumVerticalScrollPosition() && totalResourceCount < totalHintCount) { String profileUserUserId = AppClientFactory.getPlaceManager().getRequestParameter("id", null); AppClientFactory.getInjector() .getUserService() .getResourcesByTag( tagId, Integer.toString(totalResourceCount), limit, profileUserUserId, new SimpleAsyncCallback<List<UserTagsResourceDO>>() { @Override public void onSuccess(List<UserTagsResourceDO> result) { if (result.size() > 0) { totalResourceCount = totalResourceCount + result.size(); for (int i = 0; i < result.size(); i++) { ProfileUserTagsResourceWidget profileUserTagsResourceWidget = new ProfileUserTagsResourceWidget(result.get(i)); userTagsResourceContainerConatiner.add(profileUserTagsResourceWidget); } } } }); } }
/** This will show a popup of error messages in compilation. */ public static void showBuilderErrors(BuilderResult[] results) { FormStylePopup pop = new FormStylePopup("images/package_builder.png", "Validation results"); if (results == null || results.length == 0) { pop.addRow(new HTML("<img src='images/tick_green.gif'/><i>Item validated.</i>")); } else { FlexTable errTable = new FlexTable(); errTable.setStyleName("build-Results"); for (int i = 0; i < results.length; i++) { int row = i; final BuilderResult res = results[i]; errTable.setWidget(row, 0, new Image("images/error.gif")); if (res.assetFormat.equals("package")) { errTable.setText(row, 1, "[package configuration problem] " + res.message); } else { errTable.setText(row, 1, "[" + res.assetName + "] " + res.message); } } ScrollPanel scroll = new ScrollPanel(errTable); // scroll.setAlwaysShowScrollBars(true); // scroll.setSize("100%","25em"); scroll.setWidth("100%"); // scroll.setScrollPosition( 100 ); // errTable.setWidth( "60%" ); pop.addRow(scroll); // pop.setWidth( "70%" ); // pop.setHeight( "50%" ); } pop.show(); LoadingPopup.close(); }
/** Popup the view source dialog, showing the given content. */ public static void showSource(final String content, String name) { Constants constants = GWT.create(Constants.class); int windowWidth = Window.getClientWidth() / 2; int windowHeight = Window.getClientHeight() / 2; final FormStylePopup pop = new FormStylePopup(images.viewSource(), constants.ViewingSourceFor0(name), windowWidth); String[] rows = content.split("\n"); FlexTable table = new FlexTable(); for (int i = 0; i < rows.length; i++) { table.setHTML(i, 0, "<span style='color:grey;'>" + (i + 1) + ".</span>"); table.setHTML(i, 1, "<span style='color:green;' >|</span>"); table.setHTML(i, 2, addSyntaxHilights(rows[i])); } ScrollPanel scrollPanel = new ScrollPanel(table); scrollPanel.setHeight(windowHeight + "px"); scrollPanel.setWidth(windowWidth + "px"); pop.addRow(scrollPanel); LoadingPopup.close(); pop.show(); }
/** * Skeleton of content creation * * @return */ protected Widget buildContent() { ScrollPanel uiContent = new ScrollPanel(); uiContent.setWidget(buildStepContent()); uiContent.setStylePrimaryName("blockContent"); uiContent.setSize("600px", "300px"); return uiContent; }
@Override protected Widget onInitialization() { setHeight100(); lockInfo = new LockInfoWidget(); HeaderWidget header = new HeaderWidget(); sidebar = new SwitcherWidget(true); workarea.setStyleName("Workspace-body-center-content"); ScrollPanel workareaScroller = new ScrollPanel(Gwt.createDiv("Workspace-body-center-content", workarea)); workareaScroller.getElement().setId("workarea-scroller"); workareaScroller.setHeight("100%"); workarea.setScrollPanel(workareaScroller); FlowPanel body = new FlowPanel(); body.setStyleName("Workspace-body"); body.add(Gwt.createDiv("Workspace-body-west", sidebar)); body.add(Gwt.createDiv("Workspace-body-center", workareaScroller)); FlowPanel workspace = Gwt.createFlowPanel(Gwt.createDiv("Workspace-header", header), body); workspace.setStyleName("Workspace"); locker = new LockWidget(workspace); return new FullscreenPanel(locker); }
private void resizeScrollPanel() { int width = Window.getClientWidth() - 20; String height = (Window.getClientHeight() - 60) + "px"; treeScrollPanel.setWidth(Math.round(width * 0.2) + "px"); treeScrollPanel.setHeight(height); explorerScrollPanel.setWidth(Math.round(width * 0.8) + "px"); explorerScrollPanel.setHeight(height); }
public MoveTerm(TermObject tObj) { super(constants.buttonOk(), constants.buttonCancel()); this.tObj = tObj; this.setText(constants.conceptMove()); panel.setWidth("500px"); panel.setHeight("350px"); addWidget(panel); initLayout(); }
public void onModuleLoad() { final ScrollPanel contentPanel = new ScrollPanel(); contentPanel.setStyleName("content_panel"); RoundedPanel roundedContentPanel = new RoundedPanel(contentPanel, RoundedPanel.ALL, 5); roundedContentPanel.setStyleName("rounded_content_panel"); MenuBar menuBar = createMenuBar(contentPanel); RoundedPanel roundedMenuBar = new RoundedPanel(menuBar, RoundedPanel.ALL, 5); RootPanel.get().add(roundedMenuBar); RootPanel.get().add(roundedContentPanel); }
@Override public void setWidget(IsWidget w) { // Activity manager may give w=null to clear/kill the view first // Then assign the next view // like DeckLayoutPanel.setWidget() can receive null to clear all children container.clear(); if (w != null) { container.add(w); } }
public void setAlgebraView(AlgebraViewW av) { if (av != aview) { if (aview != null && simplep != null) { simplep.remove(aview); algebrap.remove(simplep); } simplep = new SimplePanel(aview = av); algebrap.add(simplep); } }
public void scrollToCursor(ScrollPanel scrollPanel, int paddingVert, int paddingHoriz) { DomUtils.ensureVisibleVert( scrollPanel.getElement(), widget_.getEditor().getRenderer().getCursorElement(), paddingVert); DomUtils.ensureVisibleHoriz( scrollPanel.getElement(), widget_.getEditor().getRenderer().getCursorElement(), paddingHoriz, paddingHoriz, false); }
@Override protected Widget loadComponent() { if (algebrap == null) { algebrap = new ScrollPanel(); // temporarily algebrap.setSize("100%", "100%"); algebrap.setAlwaysShowScrollBars(false); } if (app != null) { // force loading the algebra view, // as loadComponent should only load when needed setAlgebraView((AlgebraViewW) app.getAlgebraView()); aview.setInputPanel(); } return algebrap; }
private void resetScrollHandler() { if (isPaused) { if (scrollHandler != null) scrollHandler.removeHandler(); scrollHandler = null; return; } else if (scrollHandler != null) { return; } scrollHandler = scroller.addScrollHandler( new ScrollHandler() { @Override public void onScroll(ScrollEvent event) { Scheduler.get() .scheduleDeferred( new ScheduledCommand() { @Override public void execute() { if (isPaused) return; int newPosition = scroller.getVerticalScrollPosition(); if (lastPosition > newPosition) { isTemplePaused = true; } else if (newPosition == scroller.getMaximumVerticalScrollPosition()) { isTemplePaused = false; } lastPosition = newPosition; } }); } }); }
@Override public void onLog(final String log) { final int row = getRowCount(); table.setHTML(row, 0, log); updateCellStyle(row, LogParser.getLevel(log), LogParser.isTraceLine(log)); if (!isPaused && !isTemplePaused) scroller.scrollToBottom(); }
@Override public void setCourseDetails(CourseFinderCourseDetails... details) { iDetails = details; int tabIndex = 0; for (CourseFinderCourseDetails detail : iDetails) { ScrollPanel panel = new ScrollPanel(detail.asWidget()); panel.setStyleName("unitime-ScrollPanel-inner"); panel.getElement().getStyle().setWidth(780, Unit.PX); panel.getElement().getStyle().setHeight(200, Unit.PX); iCourseDetailsTabPanel.add(panel, detail.getName(), true); Character ch = UniTimeHeaderPanel.guessAccessKey(detail.getName()); if (ch != null) iTabAccessKeys.put(ch, tabIndex); tabIndex++; } selectLastTab(); }
/** * Sets the width of the window (used by minimise and maximise buttons). If store is true, store * this setting as the proper size. If false, the window is being minimised or maximised, so the * old dimensions should be saved to undo it later on. * * @param w Width * @param store If true, store the new height setting */ public void setWidth(int w, boolean store) { if (store) width = w; String str = Integer.toString(w) + "px"; setWidth(str); sp.setWidth(str); dock.setWidth(Integer.toString(w - 5) + "px"); }
public boolean remove(Widget w) { if (child != w) { return false; } sp.remove(w); return true; }
/** Construct a new {@link ShowMorePagerPanel}. */ public ShowMorePagerPanel(Category category) { this.category = category; init(); // Handle scroll events. scrollable.addScrollHandler( new ScrollHandler() { public void onScroll(ScrollEvent event) { // If scrolling up, ignore the event. int oldScrollPos = lastScrollPos; lastScrollPos = scrollable.getScrollPosition(); if (oldScrollPos >= lastScrollPos) { return; } HasRows display = getDisplay(); if (display == null) { return; } int maxScrollTop = scrollable.getWidget().getOffsetHeight() - scrollable.getOffsetHeight(); if (lastScrollPos >= maxScrollTop) { // We are near the end, so increase the page size. int newPageSize = Math.min( display.getVisibleRange().getLength() + incrementSize, display.getRowCount()); display.setVisibleRange(0, newPageSize); } } }); }
public ChildrenGadget(Manager _manager) { super(_manager); childPanel = new VerticalPanel(); childPanel.addStyleName("H-ChildDisplay"); // PEND awkward. we'd really like to set scroll.setMaxHeight(), // but that doesn't exist. setting it in all cases leads to excess space scroll = new ScrollPanel(childPanel); scroll.setAlwaysShowScrollBars(false); scroll.setHeight(MAX_HEIGHT + "px"); initWidget(scroll); }
public void output(String text, String color) { DivElement div = Document.get().createDivElement(); div.setInnerText(text); div.setAttribute("style", "color:" + color); messages.getElement().appendChild(div); scrollPanel.scrollToBottom(); }
public int load(Topic topic) { super.load(topic); childPanel.clear(); int childCount = 0; for (Iterator iterator = topic.getInstances().iterator(); iterator.hasNext(); ) { TopicTypeConnector conn = (TopicTypeConnector) iterator.next(); Topic child = conn.getTopic(); if (manager.isEdittable() || child.isPublicVisible()) { childPanel.add(new TopicLink(child)); } childCount++; } if (childCount < 1) { childPanel.add(new Label(" ")); } int scrollH = childCount * HEIGHT_PER_ENTRY; scrollH = (scrollH < MAX_HEIGHT) ? scrollH : MAX_HEIGHT; scroll.setHeight(scrollH + "px"); System.out.println("ChildGadg scroll heigh " + scrollH); return childCount; }