Java Code Examples for com.google.gwt.user.client.ui.ScrollPanel

The following examples show how to use com.google.gwt.user.client.ui.ScrollPanel. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: core   Source File: PortsView.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
public Widget asWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("fill-layout-width");

    StaticHelpPanel helpPanel = new StaticHelpPanel(Console.CONSTANTS.portDescription());
    layout.add(helpPanel.asWidget());

    socketTable = new SocketTable();
    DefaultCellTable tableWidget = socketTable.asWidget();
    ScrollPanel scroll = new ScrollPanel(tableWidget);
    layout.add(scroll);

    DefaultPager pager = new DefaultPager();
    pager.setDisplay(tableWidget);

    layout.add(pager);
    return layout;
}
 
Example 2
/**
 * WorkflowManager
 */
public WorkflowManager() {
	workflowGraph = new Image();
	scrollGraphPanel = new ScrollPanel(workflowGraph);
	toolbar = new TabToolbarWorkflow(this);
	workflowTable = new WorkflowTable(this);
	workflowDetailTable = new WorkflowDetailTable();
	vPanel = new VerticalPanel();
	vPanel.add(toolbar); // Always visible

	toolbar.setHeight("" + TOOLBAR_HEADER + "px");
	toolbar.setWidth("100%");
	vPanel.setCellHeight(toolbar, "" + TOOLBAR_HEADER + "px");

	initWidget(vPanel);
}
 
Example 3
/**
 * HistorySearch
 */
public HistorySearch() {
	stackPanel = new StackLayoutPanel(Unit.PX);
	searchSaved = new SearchSaved();
	userNews = new UserNews();
	scrollSearchSavedPanel = new ScrollPanel();
	scrollUserNewsSavedPanel = new ScrollPanel();

	scrollSearchSavedPanel.addStyleName("okm-PanelSelected");
	scrollUserNewsSavedPanel.addStyleName("okm-PanelSelected");

	scrollSearchSavedPanel.add(searchSaved);
	scrollSearchSavedPanel.setSize("100%", "100%");

	scrollUserNewsSavedPanel.add(userNews);
	scrollUserNewsSavedPanel.setSize("100%", "100%");

	stackPanel.add(scrollSearchSavedPanel, Util.createHeaderHTML("img/icon/stackpanel/find.gif", Main.i18n("leftpanel.label.stored.search")), true, 22);
	stackPanel.add(scrollUserNewsSavedPanel, Util.createHeaderHTML("img/icon/news.gif", Main.i18n("leftpanel.label.user.search")), true, 22);

	stackPanel.showWidget(0);
	stackPanel.setStyleName("okm-StackPanel");
	stackPanel.addStyleName("okm-DisableSelect");
	initWidget(stackPanel);
}
 
Example 4
Source Project: unitime   Source File: CourseFinderMultipleCourses.java    License: Apache License 2.0 6 votes vote down vote up
@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.addStyleName("course-info");
		iCourseDetailsTabBar.addTab(detail.getName(), true);
		Character ch = UniTimeHeaderPanel.guessAccessKey(detail.getName());
		if (ch != null)
			iTabAccessKeys.put(ch, tabIndex);
		tabIndex++;
	}
	selectLastTab();
}
 
Example 5
Source Project: unitime   Source File: FlowForm.java    License: Apache License 2.0 6 votes vote down vote up
public int addRow(Widget header, Widget... widgets) {
	if (header.getElement().getId() == null || header.getElement().getId().isEmpty())
		header.getElement().setId(DOM.createUniqueId());
	P head = new P(DOM.createSpan(), "header-cell");
	head.add(header);
	add(head);
	for (Widget widget: widgets) {
		P body = new P(DOM.createSpan(), "content-cell");
		add(body);
		if (widget instanceof UniTimeTable) {
			ScrollPanel scroll = new ScrollPanel(widget);
			scroll.addStyleName("scroll");
			body.add(scroll);
		} else {
			body.add(widget);
		}
	}
	if (widgets.length > 0) {
		if (widgets[0] instanceof UniTimeWidget)
			Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widgets[0]).getWidget().getElement(), Id.of(header.getElement()));
		else
			Roles.getTextboxRole().setAriaLabelledbyProperty(widgets[0].getElement(), Id.of(header.getElement()));			
	}
	return getWidgetCount() - widgets.length;
}
 
Example 6
Source Project: unitime   Source File: SimpleForm.java    License: Apache License 2.0 6 votes vote down vote up
public int addRow(Widget header, Widget widget, int colSpan) {
	header.addStyleName("label-cell");
	int row = getRowCount();
	setWidget(row, 0, header);
	getCellFormatter().setStyleName(row, 0, "label-td");
	if (widget instanceof HasMobileScroll) {
		ScrollPanel scroll = new ScrollPanel(widget);
		scroll.addStyleName("table-cell");
		setWidget(row, 1, scroll);
		getCellFormatter().setStyleName(row, 1, "table-td");
	} else {
		widget.addStyleName("widget-cell");
		setWidget(row, 1, widget);
		getCellFormatter().setStyleName(row, 1, "widget-td");
	}
	if (colSpan != 1)
		getFlexCellFormatter().setColSpan(row, 1, colSpan);
	if (header.getElement().getId() == null || header.getElement().getId().isEmpty())
		header.getElement().setId(DOM.createUniqueId());
	if (widget instanceof UniTimeWidget)
		Roles.getTextboxRole().setAriaLabelledbyProperty(((UniTimeWidget)widget).getWidget().getElement(), Id.of(header.getElement()));
	else
		Roles.getTextboxRole().setAriaLabelledbyProperty(widget.getElement(), Id.of(header.getElement()));
	return row;
}
 
Example 7
Source Project: unitime   Source File: CourseFinderCourses.java    License: Apache License 2.0 6 votes vote down vote up
@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.addStyleName("course-info");
		iCourseDetailsTabBar.addTab(detail.getName(), true);
		Character ch = UniTimeHeaderPanel.guessAccessKey(detail.getName());
		if (ch != null)
			iTabAccessKeys.put(ch, tabIndex);
		tabIndex++;
	}
	selectLastTab();
}
 
Example 8
Source Project: lumongo   Source File: QueryView.java    License: Apache License 2.0 6 votes vote down vote up
public QueryView() {
	splitPanel = new MaterialSplitPanel();
	splitPanel.setHeight(Window.getClientHeight() - 102 + "px");
	splitPanel.setBarPosition(25);
	leftPanel = new MaterialPanel();
	leftPanel.setBackgroundColor(Color.WHITE);
	leftPanel.setGrid("s6 l3");
	leftScrollPanel = new ScrollPanel();
	leftScrollPanel.setHeight(Window.getClientHeight() - 130 + "px");

	rightPanel = new MaterialPanel();
	rightPanel.setBackgroundColor(Color.GREY_LIGHTEN_2);
	rightPanel.setGrid("s6 l9");
	rightScrollPanel = new ScrollPanel();
	rightScrollPanel.setHeight(Window.getClientHeight() - 130 + "px");

	splitPanel.add(leftPanel);
	splitPanel.add(rightPanel);

	add(splitPanel);
}
 
Example 9
@Override
public Widget asWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("window-content");
    SafeHtmlBuilder builder = new SafeHtmlBuilder();
    builder.append(Console.MESSAGES.access_control_provider());
    layout.add(new HTML(builder.toSafeHtml()));

    DialogueOptions options = new DialogueOptions(
            Console.CONSTANTS.common_label_done(),
            event -> presenter.closeWindow(),
            Console.CONSTANTS.common_label_cancel(),
            event -> presenter.closeWindow()
    );
    options.showCancel(false);
    return new WindowContentBuilder(new ScrollPanel(layout), options).build();
}
 
Example 10
@Override
public void setPreview(final SafeHtml html) {

    if(locked) return;

    if (
            (contentCanvas.getWidgetCount()>0  && !contentCanvas.getElement().hasAttribute("presenter-view"))
                    || (contentCanvas.getWidgetCount() ==0)
            ) {

            contentCanvas.clear();
            contentCanvas.add(new ScrollPanel(new HTML(html)));
            contentCanvas.getElement().removeAttribute("presenter-view");

    }
}
 
Example 11
public ScrollPanel getViewAsScrollPanel() {
	scrollPanel.addScrollHandler(new ScrollHandler() {
		@Override
		public void onScroll(ScrollEvent event) {
			unsynchronizedShapes();
		}
	});
	return scrollPanel;
}
 
Example 12
Source Project: EasyML   Source File: DiagramController.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the controller diagram. Use this constructor to start your
 * diagram. A code sample is : <br/>
 * <br/>
 * <code>
 * DiagramController controller = new DiagramController(400,400);<br/>
 * RootPanel.get().add(controller.getView());
 * </code> <br/>
 */
public DiagramController(int canvasWidth, int canvasHeight) {

	this.canvasWidth = canvasWidth;
	this.canvasHeight = canvasHeight;
	this.backgroundCanvas = new BackgroundCanvas(canvasWidth, canvasHeight);
	this.topCanvas = new MultiBrowserDiagramCanvas(canvasWidth, canvasHeight);
	this.connfactory = CommonConnectionFactory.singleton;
	initWidgetPanel(topCanvas);

	dragController = new PickupDragController(getView(), true);
	dragController.setBehaviorMultipleSelection(true);

	this.registerDragController(dragController);

	LinksClientBundle.INSTANCE.css().ensureInjected();
	initEventHandler(widgetPanel);

	timer.scheduleRepeating(refreshRate);
	frameTimer.scheduleRepeating(70);

	scrollPanel = new ScrollPanel(getView());

	//Block the browser's menu
	ContextMenu.disableBrowserContextMenu(widgetPanel.asWidget().getElement());
	ContextMenu.disableBrowserContextMenu(topCanvas.asWidget().getElement());
}
 
Example 13
Source Project: EasyML   Source File: DiagramController.java    License: Apache License 2.0 5 votes vote down vote up
public DiagramController(int canvasWidth, int canvasHeight, int frameWidth,
		int frameHeight) {
	this(canvasWidth, canvasHeight);
	scrollPanel = new ScrollPanel(getView());
	scrollPanel.setWidth(frameWidth-30 + "px");
	scrollPanel.setHeight(frameHeight + "px");

}
 
Example 14
Source Project: EasyML   Source File: DiagramController.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the widget panel according to the canvas.
 * 
 * @param canvas
 */
protected void initWidgetPanel(final DiagramCanvas canvas) {
	widgetPanel = new AbsolutePanel();
	widgetPanel.getElement().getStyle().setWidth(canvas.getWidth(), Unit.PX);
	widgetPanel.getElement().getStyle().setHeight(canvas.getHeight(), Unit.PX);
	widgetPanel.add(canvas.asWidget());

	this.svgPanel = new SVGPanel();
	widgetPanel.add(svgPanel);
	focusPanel.add(widgetPanel);
	scrollPanel = new ScrollPanel(widgetPanel);

}
 
Example 15
Source Project: EasyML   Source File: DiagramController.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Get the scroll panel in the drawing cavcas.
 * @return
 */
public ScrollPanel getViewAsScrollPanel() {
	scrollPanel.addScrollHandler(new ScrollHandler() {
		@Override
		public void onScroll(ScrollEvent event) {
		}
	});
	return scrollPanel;
}
 
Example 16
Source Project: EasyML   Source File: StdPanel.java    License: Apache License 2.0 5 votes vote down vote up
protected void init(String msg, String title) {
	this.setTitle("stdErr");
	this.setGlassEnabled(true);

	HTML closeButton = new HTML("X");
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");
	closeButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			StdPanel.this.hide();
		}
	});

	ScrollPanel scvp = new ScrollPanel();
	VerticalPanel verticalPanel = new VerticalPanel();

	verticalPanel.add(closeButton);
	verticalPanel.setCellHeight(closeButton, "30px");
	verticalPanel.setStyleName("vpanel");
	HTML desc = new HTML(title);
	desc.setStyleName("popupTitle");
	verticalPanel.add(desc);
	verticalPanel.setCellHeight(desc, "30px");

	TextArea label = new TextArea();
	label.setText(msg);
	label.setReadOnly(true);
	label.setSize("650px", "400px");
	verticalPanel.add(label);
	scvp.add(verticalPanel);
	this.add(scvp);
	this.setStyleName("loading_container");
	this.center();
	this.show();
}
 
Example 17
Source Project: calendar-component   Source File: WeekGrid.java    License: Apache License 2.0 5 votes vote down vote up
private void setVerticalScroll(boolean isVerticalScrollEnabled) {
    if (isVerticalScrollEnabled && !(isVerticalScrollable())) {
        verticalScrollEnabled = true;
        horizontalScrollEnabled = false;
        wrapper.remove(content);

        final ScrollPanel scrollPanel = new ScrollPanel();
        scrollPanel.setStylePrimaryName("v-calendar-week-wrapper");
        scrollPanel.setWidget(content);

        scrollPanel.addScrollHandler(event -> {
            if (calendar.getScrollListener() != null) {
                int vScrollPos = scrollPanel.getVerticalScrollPosition();
                calendar.getScrollListener().scroll(vScrollPos);

                if (vScrollPos > 1) {
                    content.addStyleName("scrolled");
                } else {
                    content.removeStyleName("scrolled");
                }
            }
        });

        setWidget(scrollPanel);
        wrapper = scrollPanel;

    } else if (!isVerticalScrollEnabled && (isVerticalScrollable())) {
        verticalScrollEnabled = false;
        horizontalScrollEnabled = false;
        wrapper.remove(content);

        SimplePanel simplePanel = new SimplePanel();
        simplePanel.setStylePrimaryName("v-calendar-week-wrapper");
        simplePanel.setWidget(content);

        setWidget(simplePanel);
        wrapper = simplePanel;
    }
}
 
Example 18
/**
 * TabDocumentWiki
 */
public TabDocumentWiki() {
	title = GeneralComunicator.i18nExtension("wiki.title");
	wikiManager = new WikiManager(false);
	scrollPanel = new ScrollPanel(wikiManager);

	initWidget(scrollPanel);
}
 
Example 19
/**
 * TabFolderWiki
 */
public TabFolderWiki() {
	title = GeneralComunicator.i18nExtension("wiki.title");
	wikiManager = new WikiManager(false);
	scrollPanel = new ScrollPanel(wikiManager);

	initWidget(scrollPanel);
}
 
Example 20
/**
 * TabMailWiki
 */
public TabMailWiki() {
	title = GeneralComunicator.i18nExtension("wiki.title");
	wikiManager = new WikiManager(false);
	scrollPanel = new ScrollPanel(wikiManager);

	initWidget(scrollPanel);
}
 
Example 21
public TabDocumentStapling() {
	title = GeneralComunicator.i18nExtension("stapling.tab.document.title");

	vPanel = new VerticalPanel();
	scrollPanel = new ScrollPanel(vPanel);
	table = new FlexTable();
	vPanel.add(table);


	initWidget(scrollPanel);
}
 
Example 22
public TabFolderStapling() {
	title = GeneralComunicator.i18nExtension("stapling.tab.folder.title");

	vPanel = new VerticalPanel();
	scrollPanel = new ScrollPanel(vPanel);
	table = new FlexTable();
	vPanel.add(table);


	initWidget(scrollPanel);
}
 
Example 23
public TabMailStapling() {
	title = GeneralComunicator.i18nExtension("stapling.tab.mail.title");

	vPanel = new VerticalPanel();
	scrollPanel = new ScrollPanel(vPanel);
	table = new FlexTable();
	vPanel.add(table);


	initWidget(scrollPanel);
}
 
Example 24
/**
 * TabDocumentForum
 */
public TabDocumentForum() {
	title = GeneralComunicator.i18nExtension("forum.tab.title");
	topicManager = new TopicManager();
	topicManager.setForumId(ForumScrollTable.FORUM_DOCUMENT_DISCUSSION_ID);
	scrollPanel = new ScrollPanel(topicManager);

	initWidget(scrollPanel);
}
 
Example 25
/**
 * TabDocumentForum
 */
public TabMailForum() {
	title = GeneralComunicator.i18nExtension("forum.tab.title");
	topicManager = new TopicManager();
	topicManager.setForumId(ForumScrollTable.FORUM_DOCUMENT_DISCUSSION_ID);
	scrollPanel = new ScrollPanel(topicManager);

	initWidget(scrollPanel);
}
 
Example 26
/**
 * TabFolderForum
 */
public TabFolderForum() {
	title = GeneralComunicator.i18nExtension("forum.tab.title");
	topicManager = new TopicManager();
	topicManager.setForumId(ForumScrollTable.FORUM_DOCUMENT_DISCUSSION_ID);
	scrollPanel = new ScrollPanel(topicManager);

	initWidget(scrollPanel);
}
 
Example 27
/**
 * TabDocumentWorkflow
 */
public TabFolderWorkflow() {
	title = GeneralComunicator.i18nExtension("workflow.tab.title");
	workflowManager = new WorkflowManager();
	scrollPanel = new ScrollPanel(workflowManager);
	initWidget(scrollPanel);
}
 
Example 28
/**
 * TabDocumentWorkflow
 */
public TabDocumentWorkflow() {
	title = GeneralComunicator.i18nExtension("workflow.tab.title");
	workflowManager = new WorkflowManager();
	scrollPanel = new ScrollPanel(workflowManager);
	initWidget(scrollPanel);
}
 
Example 29
/**
 * TabMailWorkflow
 */
public TabMailWorkflow() {
	title = GeneralComunicator.i18nExtension("workflow.tab.title");
	workflowManager = new WorkflowManager();
	scrollPanel = new ScrollPanel(workflowManager);
	initWidget(scrollPanel);
}
 
Example 30
/**
 * SearchMetadata
 */
public SearchMetadata(HasPropertyHandler propertyHandler) {
	formManager = new FormManager(propertyHandler, null);
	table = new FlexTable();
	scrollPanel = new ScrollPanel(table);

	// Table padding and spacing properties
	formManager.getTable().setCellPadding(2);
	formManager.getTable().setCellSpacing(2);

	groupPopup = new GroupPopup();
	groupPopup.setWidth("300px");
	groupPopup.setHeight("125px");
	groupPopup.setStyleName("okm-Popup");
	groupPopup.addStyleName("okm-DisableSelect");

	addGroup = new Button(Main.i18n("search.add.property.group"), new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			groupPopup.show(UIDockPanelConstants.SEARCH);
		}
	});

	table.setWidget(0, 0, addGroup);
	table.setWidget(1, 0, formManager.getTable());

	addGroup.setStyleName("okm-AddButton");
	addGroup.addStyleName("okm-NoWrap");

	initWidget(scrollPanel);
}