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

The following examples show how to use com.google.gwt.user.client.ui.ScrollPanel#setStyleName() . 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: CourseFinderMultipleCourses.java    From unitime with 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 2
Source File: CourseFinderCourses.java    From unitime with 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 3
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 4
Source File: TimeGrid.java    From unitime with Apache License 2.0 4 votes vote down vote up
public TimeGrid(ColorProvider color, int nrDays, int width, boolean print, int start, int end) {
	iColor = color;
	iNrDays = nrDays;
	iCellWidth = width / iNrDays;
	iStart = start;
	iEnd = end;
	iPrint = print;
	
	iContainer = new P("unitime-TimeGrid");
	iContainer.setSize(40 + iNrDays * iCellWidth, iPrint ? 25 + 50 * (iEnd - iStart) : 575);
	
	iHeader = new P("calendar-header");
	iHeader.setWidth(iNrDays * iCellWidth);

	iDock = new P("calendar-dock");
	iDock.setHeight(50 * (iEnd - iStart) + 5);
	
	iPanel = new P("calendar-panel");
	iPanel.setSize(iNrDays * iCellWidth + 5, 50 * (iEnd - iStart));
	iTimes = new P("calendar-times");
	iTimes.setHeight(50 * (iEnd - iStart));

	if (CONSTANTS.allowCalendarExport() && !iPrint) {
		iCalendar = new ImageLink();
		iCalendar.setImage(new Image(RESOURCES.calendar()));
		iCalendar.setTarget(null);
		iCalendar.setTitle(MESSAGES.exportICalendar());
		iCalendar.addStyleName("calendar");
		iContainer.add(iCalendar);
	}
	
	for (int i = 0; i < iNrDays; i++) {
		P sp = new P("header-time-interval");
		sp.setWidth(iCellWidth);
		sp.setText(CONSTANTS.longDays()[i]);
		iHeader.add(sp, i * iCellWidth, 0);
	}
	
	iGrid = new P("calendar-grid");
	
	iWorkingHours = new P("working-hours");
	iWorkingHours.setSize(iCellWidth * 5, 500);
	iGrid.add(iWorkingHours, 0, 375 - (50 * iStart));
	
	for (int i = iStart; i < iEnd; i++) {
		
		//create major interval
		iTimeIntervals[i][0] = new P("major-time-interval");
		iGrid.add(iTimeIntervals[i][0], 0, 50 * (i - iStart));

		iTimeIntervals[i][2] = new P("dummy-time-interval");
		iTimeIntervals[i][2].setText(CONSTANTS.useAmPm() ? (i == 0 ? "12am": i <= 11 ? i + "am" : i == 12 ? "12pm" : (i-12) + "pm") : String.valueOf(i));
		iTimes.add(iTimeIntervals[i][2], 0, 50 * (i - iStart));

		iTimeIntervals[i][1] = new P("minor-time-interval");
		iGrid.add(iTimeIntervals[i][1], 0, 50 * (i - iStart) + 25);
		
		iTimeIntervals[i][3] = new P("dummy-time-interval");
		iTimes.add(iTimeIntervals[i][3], 0, 50 * (i - iStart) + 25);
	}

	for (int day = 0; day < iNrDays; day++) {
		iSeparators[day] = new P("day-separator");
		iGrid.add(iSeparators[day], iCellWidth * day, 0);
	}
	P lastSeparator = new P("day-separator");
	lastSeparator.getElement().getStyle().setRight(0, Unit.PX);
	lastSeparator.getElement().getStyle().setTop(0, Unit.PX);
	lastSeparator.getElement().getStyle().setPosition(Position.ABSOLUTE);
	iGrid.add(lastSeparator);
	
       iPanel.add(iGrid, 0, 0);
       
       iDock.add(iTimes, 0, 0);
       iDock.add(iPanel, 30, 0);
       
       iContainer.add(iHeader, 30, 0);
   	// iContainer.add(iDock, 0, 20);

       if (!iPrint) {
   		iScrollPanel = new ScrollPanel(iDock);
       	iScrollPanel.setStyleName("calendar-scroll");
       	iContainer.add(iScrollPanel, 0, 20);
       } else {
       	iContainer.add(iDock, 0, 20);
       }

   	// iScrollPanel.setWidth(String.valueOf(iNrDays * iCellWidth + 30 + (iPrint ? 5 : ToolBox.getScrollBarWidth())));

       initWidget(iContainer);
}
 
Example 5
Source File: CellBrowser.java    From consulo with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new {@link TreeNodeImpl} and append it to the end of the
 * LayoutPanel.
 *
 * @param <C> the data type of the children
 * @param nodeInfo the info about the node
 * @param value the value of the open node
 */
private <C> TreeNode appendTreeNode(final NodeInfo<C> nodeInfo, Object value) {
  // Create the list view.
  final int level = treeNodes.size();
  final BrowserCellList<C> view = createDisplay(nodeInfo, level);

  // Create a pager and wrap the components in a scrollable container. Set the
  // tabIndex to -1 so the user can tab between lists without going through
  // the scrollable.
  ScrollPanel scrollable = new ScrollPanel();
  scrollable.getElement().setTabIndex(-1);
  final Widget pager = createPager(view);
  if (pager != null) {
    FlowPanel flowPanel = new FlowPanel();
    flowPanel.add(view);
    flowPanel.add(pager);
    scrollable.setWidget(flowPanel);
  } else {
    scrollable.setWidget(view);
  }
  scrollable.setStyleName(style.cellBrowserColumn());
  if (level == 0) {
    scrollable.addStyleName(style.cellBrowserFirstColumn());
  }

  // Create a TreeNode.
  TreeNodeImpl<C> treeNode = new TreeNodeImpl<C>(nodeInfo, value, view, scrollable);
  treeNodes.add(treeNode);

  /*
   * Attach the view to the selection model and node info. Nullify the default
   * selection manager because it is provided by the node info.
   */
  view.setSelectionModel(nodeInfo.getSelectionModel(), null);
  nodeInfo.setDataDisplay(view);

  // Add the view to the LayoutPanel.
  SplitLayoutPanel splitPanel = getSplitLayoutPanel();
  splitPanel.insertLineStart(scrollable, defaultWidth, null);
  splitPanel.setWidgetMinSize(scrollable, minWidth);
  splitPanel.forceLayout();

  // Scroll to the right.
  animation.scrollToEnd();
  return treeNode;
}