gwt.material.design.client.ui.html.Div Java Examples

The following examples show how to use gwt.material.design.client.ui.html.Div. 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: MaterialParallaxTest.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
public void testMultipleParallax() {
    // given
    MaterialParallax parallax = getWidget();

    // when / then
    for (int i = 1; i <= 5; i++) {
        MaterialImage image = new MaterialImage();
        parallax.add(image);
        assertTrue(parallax.getWidget(0) instanceof Div);
        Div div = (Div) parallax.getWidget(0);
        assertNotNull(div.getWidget(i - 1));
        assertTrue(div.getWidget(i - 1) instanceof MaterialImage);
    }
}
 
Example #2
Source File: LumongoUI.java    From lumongo with Apache License 2.0 5 votes vote down vote up
@Override
public void onModuleLoad() {

	MainResources.INSTANCE.mainGSS().ensureInjected();
	HighlighterInjector.inject();
	HighChartsInjector highChartsInjector = new HighChartsInjector() {
		@Override
		public void onload() {

			Div div = new Div();

			header = new Header();
			Main main = createBaseView();
			footer = new Footer();

			div.add(header);
			div.add(main);
			div.add(footer);

			PlaceHandler placeHandler = new PlaceHandler(LumongoUI.this);
			placeHandler.init();

			RootPanel.get().add(div);
		}
	};
	highChartsInjector.inject();

}
 
Example #3
Source File: MaterialStepperTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void testStructure() {
    // UiBinder
    // given
    MaterialWidget stepper = getWidget();

    // when / then
    steps.forEach(step -> {
        int i = steps.indexOf(step) + 1;

        assertEquals(i, step.getStep());
        assertEquals(step.getWidget(0), step.getHeader());
        Div conCircle = step.getHeader();

        assertEquals(step.getWidget(1), step.getDivLine());
        Div conBody = step.getConBody();

        assertEquals(step.getAxis(), Axis.HORIZONTAL);
        assertEquals(step.getDivCircle(), conCircle.getWidget(0));
        assertEquals(step.getDivTitle(), conCircle.getWidget(1));
        assertEquals(step.getDivDescription(), conCircle.getWidget(2));

        step.setAxis(Axis.VERTICAL);
        assertEquals(step.getDivTitle(), conBody.getWidget(0));
        assertEquals(step.getDivDescription(), conBody.getWidget(1));
        assertEquals(step.getDivCircle(), conCircle.getWidget(0));
        assertEquals(step.getDivLine(), conCircle.getWidget(1));
    });

    assertEquals(stepper.getWidgetCount(), 5);
}
 
Example #4
Source File: MaterialEmptyStateTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void testStructure() {
    // UiBinder
    // given
    MaterialEmptyState emptyState = getWidget(true);

    // when / then
    final String TITLE = "title";
    final String DESCRIPTION = "description";
    final IconType ICON = IconType.POLL;

    // when
    emptyState.setTitle(TITLE);
    emptyState.setDescription(DESCRIPTION);
    emptyState.setIconType(ICON);

    // then
    assertTrue(emptyState.getElement().hasClassName(AddinsCssName.EMPTY_STATE));
    assertTrue(emptyState.getElement().hasClassName(CssName.VALIGN_WRAPPER));
    assertEquals(1, emptyState.getWidgetCount());
    assertEquals(emptyState.getContainer(), emptyState.getWidget(0));

    // given
    Div container = emptyState.getContainer();

    // when / then
    assertEquals(1, container.getWidgetCount());
    assertTrue(container.getElement().hasClassName(CssName.VALIGN));
    assertTrue(container.getElement().hasClassName(CssName.CENTER));
    assertTrue(container.getWidget(0) instanceof MaterialTitle);
    MaterialTitle title = (MaterialTitle) container.getWidget(0);
    assertEquals(TITLE, title.getHeader().getText());
    assertEquals(DESCRIPTION, title.getParagraph().getText());
    assertTrue(title.getWidget(0) instanceof MaterialIcon);
    MaterialIcon icon = (MaterialIcon) title.getWidget(0);
    assertEquals(ICON, icon.getIconType());
}
 
Example #5
Source File: GroupToggleButtonTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void testStructure() {
    GroupToggleButton<Integer> groupToggleButton = getWidget();

    assertEquals(groupToggleButton.getLabel(), groupToggleButton.getWidget(0));
    assertEquals(groupToggleButton.getWrapper(), groupToggleButton.getWidget(1));
    assertEquals(groupToggleButton.getErrorLabel(), groupToggleButton.getWidget(2));

    Div wrapper = groupToggleButton.getWrapper();
    assertTrue(wrapper.getElement().hasClassName(IncubatorCssName.WRAPPER));
    assertEquals(NUMBER_ITEMS, wrapper.getChildren().size());

    assertTrue(wrapper.getWidget(0) instanceof ToggleButton);

    checkToggleButton((ToggleButton) wrapper.getWidget(0), groupToggleButton);
}
 
Example #6
Source File: MaterialParallaxTest.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
public void testStructure() {
    // given / when
    MaterialParallax parallax = getWidget();

    // then
    assertNotNull(parallax.getWidget(0));
    assertTrue(parallax.getWidget(0) instanceof Div);
    assertTrue(parallax.getWidget(0).getElement().hasClassName(CssName.PARALLAX));
}
 
Example #7
Source File: MaterialNavBarTest.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
public void testStructure() {
    // given
    MaterialNavBar navBar = getWidget();
    Div navWrapper = navBar.getNavWrapper();
    MaterialLink navMenu = navBar.getNavMenu();
    MaterialNavContent navContent = (MaterialNavContent) navWrapper.getWidget(1);

    // when / then
    assertNotNull(navBar.getWidget(0));
    assertTrue(navBar.getWidget(0) instanceof Div);
    assertEquals(navBar.getNavWrapper(), navBar.getWidget(0));
    assertTrue(navWrapper.getElement().hasClassName(CssName.NAV_WRAPPER));
    assertEquals(navWrapper.getWidget(0), navBar.getNavMenu());
    assertTrue(navMenu.getElement().hasClassName(CssName.BUTTON_COLLAPSE));
    assertTrue(navMenu.isCircle());
    assertEquals("2.7em", navMenu.getFontSize());
    assertEquals(64, navMenu.getWidth());
    assertEquals(WavesType.LIGHT, navMenu.getWaves());
    assertEquals(TextAlign.CENTER, navMenu.getTextAlign());
    assertNotNull(navWrapper.getWidget(0));
    assertTrue(navWrapper.getWidget(1) instanceof MaterialNavContent);
    assertTrue(navContent.getElement().hasClassName(CssName.NAV_CONTENT));
    MaterialLabel label = new MaterialLabel();
    navContent.add(label);
    assertEquals(label, navContent.getWidget(0));
    navBar.clear();
    assertEquals(0, navWrapper.getChildren().size());
}
 
Example #8
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getDivTitle() {
    return divTitle;
}
 
Example #9
Source File: MaterialEmptyState.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getContainer() {
    return container;
}
 
Example #10
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getHeader() {
    return header;
}
 
Example #11
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getConBody() {
    return conBody;
}
 
Example #12
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getDivCircle() {
    return divCircle;
}
 
Example #13
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getDivLine() {
    return divLine;
}
 
Example #14
Source File: QueryOptionsView.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public QueryOptionsView(UIQueryResults uiQueryResults) {
	setMargin(15);
	setPadding(10);

	uiQueryObject = uiQueryResults.getUiQueryObject();
	if (uiQueryObject == null) {
		uiQueryObject = new UIQueryObject();
	}

	if (!uiQueryResults.getJsonDocs().isEmpty()) {
		MaterialBadge resultsBadge = new MaterialBadge("Total Results: " + NumberFormat.getFormat("#,##0").format(uiQueryResults.getTotalResults()));
		add(resultsBadge);
		add(new Br());
	}

	MaterialButton executeButton = new MaterialButton("Execute", IconType.SEARCH);
	executeButton.addClickHandler(clickEvent -> runSearch());
	executeButton.setMarginRight(2);
	add(executeButton);

	MaterialButton resetButton = new MaterialButton("Reset", IconType.REFRESH);
	resetButton.addClickHandler(clickEvent -> MainController.get().goTo(new QueryPlace(null)));
	add(resetButton);

	MaterialListBox indexesListBox = new MaterialListBox();
	indexesListBox.setMultipleSelect(true);
	Option selectOneIndexOption = new Option("Select Indexes");
	selectOneIndexOption.setDisabled(true);
	indexesListBox.add(selectOneIndexOption);

	fieldNameCollapsible = new MaterialCollapsible();
	fieldNameCollapsible.setAccordion(false);
	for (IndexInfo indexInfo : uiQueryResults.getIndexes()) {
		createFieldNameCollapsible(indexInfo);

		Option option = new Option(indexInfo.getName());
		if (uiQueryObject.getIndexNames().contains(indexInfo.getName())) {
			option.setSelected(true);
			fieldItems.get(indexInfo.getName()).setVisible(true);
		}
		indexesListBox.add(option);
	}
	indexesListBox.addValueChangeHandler(valueChangeEvent -> {
		for (String indexName : fieldItems.keySet()) {
			fieldItems.get(indexName).setVisible(false);
		}
		for (String itemsSelected : indexesListBox.getItemsSelected()) {
			uiQueryObject.getIndexNames().add(itemsSelected);
			fieldItems.get(itemsSelected).setVisible(true);
		}
	});

	add(indexesListBox);
	add(fieldNameCollapsible);

	CustomTextBox searchBox = new CustomTextBox(true);
	searchBox.setPlaceHolder("q=*:*");
	searchBox.setValue(uiQueryObject.getQuery());
	searchBox.addKeyUpHandler(clickEvent -> {
		if (clickEvent.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
			uiQueryObject.setQuery(searchBox.getValue());
			runSearch();
		}
	});

	searchBox.getButton().setTitle("Execute Query");
	searchBox.getButton().addClickHandler(clickEvent -> {
		uiQueryObject.setQuery(searchBox.getValue());
		runSearch();
	});

	add(searchBox);

	CustomTextBox rowsIntegerBox = new CustomTextBox();
	rowsIntegerBox.setPlaceHolder("rows (defaults to 10)");
	if (uiQueryObject != null && uiQueryObject.getRows() != 10) {
		rowsIntegerBox.setValue(uiQueryObject.getRows() + "");
	}
	rowsIntegerBox.getTextBox().addChangeHandler(changeEvent -> uiQueryObject.setRows(Integer.valueOf(rowsIntegerBox.getValue())));
	rowsIntegerBox.addKeyUpHandler(clickEvent -> {
		if (clickEvent.getNativeKeyCode() == KeyCodes.KEY_ENTER) {
			runSearch();
		}
	});

	add(rowsIntegerBox);

	filterQueryDiv = new Div();
	if (!uiQueryObject.getFilterQueries().isEmpty()) {
		for (String fq : uiQueryObject.getFilterQueries()) {
			createFilterQueryWidget(fq);
		}
	}
	else {
		createFilterQueryWidget(null);
	}

	add(filterQueryDiv);

}
 
Example #15
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getDivDescription() {
    return divDescription;
}
 
Example #16
Source File: MaterialStep.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getDivBody() {
    return divBody;
}
 
Example #17
Source File: MaterialFooterCopyright.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getContainer() {
    return container;
}
 
Example #18
Source File: GroupToggleButton.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public Div getWrapper() {
    return wrapper;
}
 
Example #19
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getGapPatch() {
    return gapPatch;
}
 
Example #20
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getCircle3() {
    return circle3;
}
 
Example #21
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getCircle2() {
    return circle2;
}
 
Example #22
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getCircle1() {
    return circle1;
}
 
Example #23
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getCircleClipperRight() {
    return circleClipperRight;
}
 
Example #24
Source File: MaterialSpinner.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getCircleClipperLeft() {
    return circleClipperLeft;
}
 
Example #25
Source File: MaterialProgress.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
protected ColorsMixin<Div> getFillColorMixin() {
    if (fillColorMixin == null) {
        fillColorMixin = new ColorsMixin<>(fillContainer);
    }
    return fillColorMixin;
}
 
Example #26
Source File: MaterialProgress.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getFillContainer() {
    return fillContainer;
}
 
Example #27
Source File: MaterialNavBrand.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getContainer() {
    return container;
}
 
Example #28
Source File: MaterialParallax.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getContainer() {
    return container;
}
 
Example #29
Source File: MaterialNavBar.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getNavWrapper() {
    return navWrapper;
}
 
Example #30
Source File: MaterialSplashScreen.java    From gwt-material with Apache License 2.0 4 votes vote down vote up
public Div getContainer() {
    return container;
}