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

The following examples show how to use com.google.gwt.user.client.ui.ScrollPanel#setSize() . 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: 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 3
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 4
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 5
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);
}
 
Example 6
Source File: StatDialog.java    From swellrt with Apache License 2.0 4 votes vote down vote up
public StatDialog() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  popup = PopupFactory.createPopup(
      Document.get().getElementById("app"), new CenterPopupPositioner(), chrome, true);
  htmlPanel = new HTMLPanel("");
  htmlPanel.addDomHandler(new ClickHandler(){

    @Override
    public void onClick(ClickEvent event) {
      Element e = event.getNativeEvent().getEventTarget().cast();
      if (e.getTagName().toLowerCase().equals("a")) {
        event.preventDefault();
        if (isClient) {
          if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
            Timing.setEnabled(!Timing.isEnabled());
            showClientStatistic();
          } else if (ID_CLEAR.equals(e.getId())) {
            Timing.clearStatistics();
            showClientStatistic();
          }
        } else {
          String href = e.getPropertyString("href");
          int index = href.lastIndexOf('/');
          if (index != -1) {
            showUrl(StatService.STAT_URL + href.substring(index+1));
          }
        }
      }
    }
  }, ClickEvent.getType());

  ScrollPanel scroll = new ScrollPanel(htmlPanel);
  scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
          RootPanel.get().getOffsetHeight()-200 + "px");
  targetButton = new DialogBox.DialogButton("", new Command() {

    @Override
    public void execute() {
      if (isClient) {
        showServerStatistic();
      } else {
        showClientStatistic();
      }
    }
  });
  exitButton = new DialogBox.DialogButton("Exit", new Command() {

    @Override
    public void execute() {
      popup.hide();
    }
  });
  DialogBox.create(popup, "", scroll,
      new DialogBox.DialogButton[] { targetButton, exitButton });
}
 
Example 7
Source File: StatDialog.java    From incubator-retired-wave with Apache License 2.0 4 votes vote down vote up
public StatDialog() {
  PopupChrome chrome = PopupChromeFactory.createPopupChrome();
  popup = PopupFactory.createPopup(
      Document.get().getElementById("app"), new CenterPopupPositioner(), chrome, true);
  htmlPanel = new HTMLPanel("");
  htmlPanel.addDomHandler(new ClickHandler(){

    @Override
    public void onClick(ClickEvent event) {
      Element e = event.getNativeEvent().getEventTarget().cast();
      if (e.getTagName().toLowerCase().equals("a")) {
        event.preventDefault();
        if (isClient) {
          if (ID_ENABLE.equals(e.getId()) || ID_DISABLE.equals(e.getId())) {
            Timing.setEnabled(!Timing.isEnabled());
            showClientStatistic();
          } else if (ID_CLEAR.equals(e.getId())) {
            Timing.clearStatistics();
            showClientStatistic();
          }
        } else {
          String href = e.getPropertyString("href");
          int index = href.lastIndexOf('/');
          if (index != -1) {
            showUrl(StatService.STAT_URL + href.substring(index+1));
          }
        }
      }
    }
  }, ClickEvent.getType());

  ScrollPanel scroll = new ScrollPanel(htmlPanel);
  scroll.setSize(RootPanel.get().getOffsetWidth()-100 + "px",
          RootPanel.get().getOffsetHeight()-200 + "px");
  targetButton = new DialogBox.DialogButton("", new Command() {

    @Override
    public void execute() {
      if (isClient) {
        showServerStatistic();
      } else {
        showClientStatistic();
      }
    }
  });
  exitButton = new DialogBox.DialogButton("Exit", new Command() {

    @Override
    public void execute() {
      popup.hide();
    }
  });
  DialogBox.create(popup, "", scroll,
      new DialogBox.DialogButton[] { targetButton, exitButton });
}