Java Code Examples for com.google.gwt.user.client.ui.ScrollPanel#add()

The following examples show how to use com.google.gwt.user.client.ui.ScrollPanel#add() . 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 File: HistorySearch.java    From document-management-system with GNU General Public License v2.0 6 votes vote down vote up
/**
 * 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 2
Source File: Echoes.java    From jolie with GNU Lesser General Public License v2.1 6 votes vote down vote up
private void createLyricsDialog()
{
	lyricsDialog = new DialogBox();
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setHeight( "100%" );
	vPanel.setHorizontalAlignment( VerticalPanel.ALIGN_CENTER );
	vPanel.setVerticalAlignment( VerticalPanel.ALIGN_MIDDLE );
	lyricsDialog.add( vPanel );
	
	lyrics = new HTML();
	ScrollPanel scrollPanel = new ScrollPanel();
	scrollPanel.setWidth( "300px" );
	scrollPanel.setHeight( "250px" );
	scrollPanel.add( lyrics );
	vPanel.add( scrollPanel );
	
	Button close = new NativeButton( "Close" );
	close.addClickListener( new ClickListener() {
		public void onClick( Widget arg0 ) {
			lyricsDialog.hide();
		}
	} );
	vPanel.add( close );
}
 
Example 3
Source File: StdPanel.java    From EasyML with 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 4
Source File: InfoPanel.java    From geomajas-gwt2-quickstart-application with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Init the info panel.
 */
private void initInfoPanel() {

	infoPopupPanel.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanel());

	HTMLPanel infoPopupPanelWrapper = new HTMLPanel("");

	closeInfoPopupPanelButton.addStyleName(ApplicationResource.INSTANCE.css().closePopupPanelButton());
	closeInfoPopupPanelButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			infoPopupPanel.hide();
			ApplicationService.getInstance().setTooltipShowingAllowed(true);
		}
	});

	HTMLPanel closeInfoButtonContainer = new HTMLPanel("");
	closeInfoButtonContainer.addStyleName(ApplicationResource.INSTANCE.css().popupPanelHeader());
	Label infoTitle = new Label(msg.infoPanelTitle());
	closeInfoButtonContainer.add(infoTitle);
	closeInfoButtonContainer.add(closeInfoPopupPanelButton);
	infoPopupPanelWrapper.add(closeInfoButtonContainer);

	infoPopupPanelContent = new HTMLPanel("");
	infoPopupPanelContent.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanelContent());

	ScrollPanel infoPopupPanelScroll = new ScrollPanel();
	infoPopupPanelScroll.addStyleName(ApplicationResource.INSTANCE.css().infoPopupPanelScroll());
	infoPopupPanelScroll.add(infoPopupPanelContent);

	infoPopupPanelWrapper.add(infoPopupPanelScroll);

	infoPopupPanel.add(infoPopupPanelWrapper);

	infoPopupPanel.hide();
}
 
Example 5
Source File: DeploymentBrowseContentView.java    From core with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Override
public Widget createWidget() {

    ScrollPanel scroller = new ScrollPanel();
    panel.setStyleName("browse-content");
    scroller.add(panel);
    return scroller.asWidget();
}
 
Example 6
Source File: MonitorView.java    From EasyML with Apache License 2.0 4 votes vote down vote up
@Override
public Widget createMainLayout() {
	SplitLayoutPanel splitLayout = new SplitLayoutPanel();


	StackLayoutPanel stack = new StackLayoutPanel(Unit.EM);
	stack.setStyleName("sp");
	ScrollPanel leftcrp = new ScrollPanel();
	leftcrp.setSize("100%", "100%");
	VerticalPanel vPanel = new VerticalPanel();
	vPanel.setWidth("100%");

	programTree = ProgramTreeLoader.load(AppController.email);
	datasetTree = DatasetTreeLoader.load(AppController.email);
	jobTree = JobTreeLoader.load(AppController.email);
	resultTree = new SearchTree();
	initTabPanel();
	DisclosurePanel distackleft = new DisclosureStackPanel("Search")
	.asWidget();
	searchGrid = new SearchGrid(programTree,datasetTree,jobTree,resultTree);
	distackleft.setContent(searchGrid);
	SimplePanel tabSimPanel = new SimplePanel();
	tabSimPanel.add(tabPanel);

	vPanel.add(tabSimPanel);
	vPanel.add(distackleft);
	leftcrp.add(vPanel);
	stack.add(leftcrp, "", 0);

	StackLayoutPanel stackright = new StackLayoutPanel(Unit.EM);
	stackright.setStyleName("sp");
	DisclosurePanel distackright1 = new DisclosureStackPanel(Constants.studioUIMsg.jobPanelTitle())
	.asWidget();
	DisclosurePanel distackright2 = new DisclosureStackPanel(Constants.studioUIMsg.modulePanelTitle())
	.asWidget();
	ScrollPanel scvp = new ScrollPanel();
	VerticalPanel verticalPanel = new VerticalPanel();
	verticalPanel.setWidth("100%");

	HorizontalPanel btnPanel = new HorizontalPanel();
	historyBtn.removeStyleName("gwt-Button");
	historyBtn.addStyleName("history-button-style");
	submitBtn.setEnabled( false );
	submitBtn.removeStyleName("gwt-Button");
	submitBtn.addStyleName("button-style");
	clearBtn.removeStyleName("gwt-Button");
	clearBtn.addStyleName("button-style");
	cloneBtn.removeStyleName("gwt-Button");
	cloneBtn.addStyleName("button-style");
	refreshBtn.removeStyleName("gwt-Button");
	refreshBtn.addStyleName("button-style");
	stopBtn.removeStyleName("gwt-Button");
	stopBtn.addStyleName("button-style");

	btnPanel.add(historyBtn);
	btnPanel.add(new HTML("  "));
	btnPanel.add(submitBtn);
	btnPanel.add(new HTML("  "));
	btnPanel.add(clearBtn);
	btnPanel.add(new HTML("  "));
	btnPanel.add(cloneBtn);
	btnPanel.add(new HTML("  "));
	btnPanel.add(stopBtn);
	btnPanel.add(new HTML("  "));
	btnPanel.add(refreshBtn);


	btnPanel2.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
	btnPanel2.add(btnPanel);
	btnPanel2.addStyleName("btnPanel");

	splitLayout.addWest(stack, 200);

	jobDescGrid = new MonitorJobDescGrid();

	distackright1.setContent(jobDescGrid);
	distackright2.setContent(propPanel);
	verticalPanel.add(distackright1);
	verticalPanel.add(distackright2);
	scvp.add(verticalPanel);
	stackright.add(scvp, "", 0);
	splitLayout.addEast(stackright, 287);

	// Use different controllers in different classes
	setController(new MonitorController(Constants.CONTROLLER_WIDTH,
			Constants.CONTROLLER_HEIGHT));
	rebuiltLayoutPanel(getController());
	splitLayout.add(layoutPanel);

	return splitLayout;
}
 
Example 7
Source File: PreviewPopupPanel.java    From EasyML with Apache License 2.0 4 votes vote down vote up
/**
 * Initialize
 * 
 * @param path  Result root address
 */
protected void init(String path) {
	this.setSize("650px", "400px");
	this.setGlassEnabled(true);
	this.setModal(true);
	closeButton.setSize("10px", "10px");
	closeButton.setStyleName("closebtn");
	closeButton.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent event) {
			PreviewPopupPanel.this.hide();
		}
	});
	VerticalPanel verticalPanel = new VerticalPanel();
	verticalPanel.add(closeButton);
	verticalPanel.setCellHeight(closeButton, "13px");
	verticalPanel.setStyleName("vpanel");
	desc.setStyleName("popupTitle");
	verticalPanel.add(desc);
	verticalPanel.setCellHeight(desc, "30px");

	HorizontalPanel hPanel = new HorizontalPanel();
	savebtn.setStyleName("popupsavebtn");
	savebtn.setVisible(false);
	refreshBtn.setStyleName("popuprefreshbtn");
	refreshBtn.setVisible(false);
	uploadSubmitButton.setVisible(false);
	hPanel.add(uploadSubmitButton);
	hPanel.add(savebtn);
	hPanel.add(refreshBtn);
	hPanel.setCellVerticalAlignment(uploadSubmitButton,
			HasVerticalAlignment.ALIGN_BOTTOM);

	tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
	tabPanel.setSize("650px", "355px");
	dirPanel = new HorizontalPanel();
	resultDirTree = PopupRetDirTreeLoad.load(path);
	resultDirTree.getRoot().setState(false);
	ScrollPanel dirScrollPanel = new ScrollPanel();
	dirScrollPanel.add(resultDirTree);
	dirScrollPanel.setAlwaysShowScrollBars(true);
	dirScrollPanel.setSize("300px", "320px");

	VerticalPanel fileViewPanel = new VerticalPanel();
	fileLabel.setText("Please select a file to view!");
	fileLabel.setStyleName("popupFileSelectName");
	fileViewPanel.add(fileLabel);
	fileTextArea.setStyleName("popupMsg");
	fileTextArea.setSize("342px", "298px");
	fileTextArea.getElement().setAttribute("wrap", "off");    
	fileTextArea.setReadOnly(true);
	fileViewPanel.add(fileTextArea);
	dirPanel.add(dirScrollPanel);
	dirPanel.add(fileViewPanel);
	tabPanel.add(dirPanel,"Results directory");

	AbsolutePanel bottomPanel = new AbsolutePanel(); 
	bottomPanel.setSize("650px", "360px");
	bottomPanel.add(tabPanel, 0, 0);
	bottomPanel.add(hPanel,460,3);

	fileSizeLabel.setStyleName("popupFileSelectName");
	verticalPanel.add(bottomPanel); 
	verticalPanel.add(fileSizeLabel);
	this.add(verticalPanel);
	this.setStyleName("loading_container");
}
 
Example 8
Source File: MessageStack.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
/**
 * MessageStack
 */
public MessageStack() {
	status = new Status();
	status.setStyleName("okm-StatusPopup");

	stackPanel = new ExtendedStackPanel();
	proposedSubscriptionReceived = new ProposedSubscriptionReceivedStack();
	proposedQueryReceived = new ProposedQueryReceivedStack();
	messageReceived = new MessageReceivedStack();
	messageSent = new MessageSentStack();
	scrollProposeSubscriptionReceivedPanel = new ScrollPanel();
	scrollProposeQueryReceivedPanel = new ScrollPanel();
	scrollMessageReceivedPanel = new ScrollPanel();
	scrollMessageSentPanel = new ScrollPanel();

	scrollProposeSubscriptionReceivedPanel.addStyleName("okm-PanelSelected");
	scrollProposeQueryReceivedPanel.addStyleName("okm-PanelSelected");
	scrollMessageReceivedPanel.addStyleName("okm-PanelSelected");
	scrollMessageSentPanel.addStyleName("okm-PanelSelected");

	scrollProposeSubscriptionReceivedPanel.add(proposedSubscriptionReceived);
	scrollProposeQueryReceivedPanel.add(proposedQueryReceived);
	scrollMessageReceivedPanel.add(messageReceived);
	scrollMessageSentPanel.add(messageSent);
	scrollProposeSubscriptionReceivedPanel.setSize("100%", "100%");
	scrollProposeQueryReceivedPanel.setSize("100%", "100%");
	scrollMessageSentPanel.setSize("100%", "100%");
	// Mandatory can not be a resource bundle due IE problem !
	stackPanel.add(scrollProposeSubscriptionReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/propose_subscription.png",
			GeneralComunicator.i18nExtension("messaging.label.propose")), true, UIDesktopConstants.STACK_HEIGHT);
	stackPanel.add(scrollProposeQueryReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/share_query.gif",
			GeneralComunicator.i18nExtension("messaging.label.share.query")), true, UIDesktopConstants.STACK_HEIGHT);
	stackPanel.add(scrollMessageReceivedPanel, UtilComunicator.createHeaderHTML("img/icon/actions/message_received.png",
			GeneralComunicator.i18nExtension("messaging.label.message.received")), true, UIDesktopConstants.STACK_HEIGHT);
	stackPanel.add(scrollMessageSentPanel, UtilComunicator.createHeaderHTML("img/icon/actions/message.png",
			GeneralComunicator.i18nExtension("messaging.label.message.sent")), true, UIDesktopConstants.STACK_HEIGHT);

	stackPanel.showWidget(0);
	stackPanel.setStartUpFinished();

	stackPanel.setStyleName("okm-StackPanel");
	stackPanel.addStyleName("okm-DisableSelect");
	initWidget(stackPanel);
}
 
Example 9
Source File: Navigator.java    From document-management-system with GNU General Public License v2.0 4 votes vote down vote up
public Navigator() {
	stackPanel = new ExtendedStackPanel();
	scrollTaxonomyPanel = new ExtendedScrollPanel();
	scrollTaxonomyPanel.setSize("100%", "100%");
	scrollCategoriesPanel = new ScrollPanel();
	scrollCategoriesPanel.setSize("100%", "100%");
	scrollMetadataPanel = new ScrollPanel();
	scrollMetadataPanel.setSize("100%", "100%");
	scrollThesaurusPanel = new ScrollPanel();
	scrollThesaurusPanel.setSize("100%", "100%");
	scrollTrashPanel = new ScrollPanel();
	scrollTrashPanel.setSize("100%", "100%");
	scrollTemplatePanel = new ExtendedScrollPanel();
	scrollTemplatePanel.setSize("100%", "100%");
	scrollPersonalPanel = new ExtendedScrollPanel();
	scrollPersonalPanel.setSize("100%", "100%");
	scrollMailPanel = new ExtendedScrollPanel();
	scrollMailPanel.setSize("100%", "100%");
	verticalTaxonomyPanel = new VerticalPanel();
	verticalTaxonomyPanel.setSize("100%", "100%");
	verticalCategoriesPanel = new VerticalPanel();
	verticalCategoriesPanel.setSize("100%", "100%");
	verticalMetadataPanel = new VerticalPanel();
	verticalMetadataPanel.setSize("100%", "100%");
	verticalThesaurusPanel = new VerticalPanel();
	verticalThesaurusPanel.setSize("100%", "100%");
	verticalTrashPanel = new VerticalPanel();
	verticalTrashPanel.setSize("100%", "100%");
	verticalTemplatePanel = new VerticalPanel();
	verticalTemplatePanel.setSize("100%", "100%");
	verticalMyDocumentsPanel = new VerticalPanel();
	verticalMyDocumentsPanel.setSize("100%", "100%");
	verticalMailPanel = new VerticalPanel();
	verticalMailPanel.setSize("100%", "100%");

	status = new Status();
	status.setStyleName("okm-StatusPopup");
	trashTree = new TrashTree();
	trashTree.setSize("100%", "100%");
	templateTree = new TemplateTree();
	templateTree.setSize("100%", "100%");
	mailTree = new MailTree();
	mailTree.setSize("100%", "100%");
	personalTree = new PersonalTree();
	personalTree.setSize("100%", "100%");
	thesaurusTree = new ThesaurusTree();
	thesaurusTree.setSize("100%", "100%");
	metadataTree = new MetadataTree();
	metadataTree.setSize("100%", "100%");
	categoriesTree = new CategoriesTree();
	categoriesTree.setSize("100%", "100%");
	taxonomyTree = new TaxonomyTree();
	taxonomyTree.setSize("100%", "100%");

	verticalTaxonomyPanel.add(taxonomyTree);
	scrollTaxonomyPanel.add(verticalTaxonomyPanel);
	verticalCategoriesPanel.add(categoriesTree);
	scrollCategoriesPanel.add(verticalCategoriesPanel);
	verticalMetadataPanel.add(metadataTree);
	scrollMetadataPanel.add(verticalMetadataPanel);
	verticalThesaurusPanel.add(thesaurusTree);
	scrollThesaurusPanel.add(verticalThesaurusPanel);
	verticalTrashPanel.add(trashTree);
	scrollTrashPanel.add(verticalTrashPanel);
	scrollTrashPanel.addStyleName("okm-DisableSelect"); // Disables drag and drop browser text selection
	verticalTemplatePanel.add(templateTree);
	scrollTemplatePanel.add(verticalTemplatePanel);
	verticalMyDocumentsPanel.add(personalTree);
	scrollPersonalPanel.add(verticalMyDocumentsPanel);
	verticalMailPanel.add(mailTree);
	scrollMailPanel.add(verticalMailPanel);

	scrollTaxonomyPanel.setStyleName("okm-Background-White");
	scrollCategoriesPanel.setStyleName("okm-Background-White");
	scrollMetadataPanel.setStyleName("okm-Background-White");
	scrollThesaurusPanel.setStyleName("okm-Background-White");
	scrollTrashPanel.setStyleName("okm-Background-White");
	scrollTemplatePanel.setStyleName("okm-Background-White");
	scrollPersonalPanel.setStyleName("okm-Background-White");
	scrollMailPanel.setStyleName("okm-Background-White");

	stackPanel.setStyleName("okm-StackPanel");

	initWidget(stackPanel);
}