Java Code Examples for gwt.material.design.client.ui.MaterialColumn#add()

The following examples show how to use gwt.material.design.client.ui.MaterialColumn#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: IconsView.java    From gwt-material-demo with Apache License 2.0 6 votes vote down vote up
protected void getAllIcons() {
    for (IconType i : IconType.values()) {
        MaterialColumn column = new MaterialColumn(4, 3, 2);
        column.setTextAlign(TextAlign.CENTER);
        column.setPadding(40);
        MaterialIcon icon = new MaterialIcon();
        icon.setIconSize(IconSize.MEDIUM);
        icon.setIconType(i);

        MaterialLabel label = new MaterialLabel();
        label.setFontSize("0.8em");
        label.setText(i.name().toUpperCase());

        column.add(icon);
        column.add(label);
        iconsRow.add(column);
    }
}
 
Example 2
Source File: LanguageSelectorItem.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
@Override
protected void onLoad() {
    super.onLoad();

    MaterialColumn imageColumn = new MaterialColumn(4,4,4);
    imageColumn.add(image);

    MaterialColumn nameColumn = new MaterialColumn(8,8,8);
    label.setTextColor(Color.BLACK);
    nameColumn.setPadding(0);
    nameColumn.setTextAlign(TextAlign.LEFT);
    nameColumn.add(label);

    if (language.getImage() != null) {
        add(imageColumn);
    }

    if (language.getName() != null) {
        add(nameColumn);
    }
}
 
Example 3
Source File: Footer.java    From lumongo with Apache License 2.0 5 votes vote down vote up
public Footer() {

		setBackgroundColor(Color.GREY_DARKEN_2);

		MaterialRow row = new MaterialRow();
		MaterialColumn leftColumn = new MaterialColumn(12, 6, 6);
		MaterialColumn rightColumn = new MaterialColumn(12, 6, 6);
		row.add(leftColumn);
		row.add(rightColumn);
		add(row);

		setType(FooterType.FIXED);
		MaterialLabel label = new MaterialLabel("LuMongo is distributed under a commercially friendly Apache Software license");
		label.setTextColor(Color.WHITE);
		label.setMarginTop(15);
		leftColumn.add(label);

		MaterialButton chatButton = new MaterialButton("Chat with Us");
		chatButton.setMarginTop(10);
		chatButton.setMarginLeft(20);
		chatButton.setFloat(Style.Float.RIGHT);
		chatButton.setIconType(IconType.CHAT_BUBBLE);
		chatButton.addClickHandler(clickEvent -> Window
				.open("https://gitter.im/lumongo/lumongo?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge", "_blank",
						"menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1"));
		rightColumn.add(chatButton);

		MaterialButton sourceButton = new MaterialButton("Source");
		sourceButton.setMarginTop(10);
		sourceButton.setIconType(IconType.CODE);
		sourceButton.setFloat(Style.Float.RIGHT);
		sourceButton.addClickHandler(
				clickEvent -> Window.open("https://github.com/lumongo/lumongo", "_blank", "menubar=1,status=1,toolbar=1,scrollbars=1,resizable=1"));
		rightColumn.add(sourceButton);

	}
 
Example 4
Source File: CustomTabPanel.java    From lumongo with Apache License 2.0 5 votes vote down vote up
public CustomTabPanel(TabType tabType) {

		materialTab = new MaterialTab();
		materialTab.setType(tabType);
		materialTab.setBackgroundColor(Color.GREY_DARKEN_1);
		materialTab.setTextColor(Color.GREY_DARKEN_1);
		materialTab.setIndicatorColor(Color.AMBER);

		mainColumn = new MaterialColumn();
		mainColumn.setGrid("s12");
		mainColumn.add(materialTab);

		add(mainColumn);

	}
 
Example 5
Source File: CustomTabPanel.java    From lumongo with Apache License 2.0 5 votes vote down vote up
public void createAndAddTabPane(String id, Widget widget) {
	MaterialColumn materialColumn = new MaterialColumn();
	materialColumn.setId(id);
	materialColumn.setGrid("s12");
	materialColumn.add(widget);
	materialColumn.setBackgroundColor(Color.WHITE);

	mainColumn.add(materialColumn);

}
 
Example 6
Source File: HomeView.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public void drawSplashPage(InstanceInfo instanceInfo) {
	clear();

	MaterialRow row = new MaterialRow();
	add(row);

	{
		MaterialColumn infoColumn = new MaterialColumn();
		infoColumn.setGrid("s12 m6");
		row.add(infoColumn);

		MaterialCard infoCard = new MaterialCard();
		MaterialCardContent infoContent = new MaterialCardContent();
		infoCard.add(infoContent);
		infoColumn.add(infoCard);

		MaterialCardTitle infoCardTitle = new MaterialCardTitle();
		infoCardTitle.setText("Basic Info");
		infoContent.add(infoCardTitle);

		MaterialLabel lumongoVersionLabel = new MaterialLabel("LuMongo Version: " + instanceInfo.getLumongoVersion());
		MaterialLabel luceneVersionLabel = new MaterialLabel("Lucene Version: " + instanceInfo.getLuceneVersion());
		MaterialLabel lumongoMemoryLabel = new MaterialLabel("LuMongo Memory: " + instanceInfo.getLumongoMemory());
		MaterialLabel jvmFreeMemoryLabel = new MaterialLabel("JVM Free Memory: " + instanceInfo.getJvmFreeMemory());
		MaterialLabel jvmMaxMemoryLabel = new MaterialLabel("JVM Max Memory: " + instanceInfo.getJvmMaxMemoryMB());
		MaterialLabel jvmTotalMemoryLabel = new MaterialLabel("JVM Total Memory: " + instanceInfo.getJvmTotalMemoryMB());
		MaterialLabel jvmUsedMemoryLabel = new MaterialLabel("JVM Used Memory: " + instanceInfo.getJvmUsedMemory());

		infoContent.add(lumongoVersionLabel);
		infoContent.add(luceneVersionLabel);
		infoContent.add(lumongoMemoryLabel);
		infoContent.add(jvmFreeMemoryLabel);
		infoContent.add(jvmMaxMemoryLabel);
		infoContent.add(jvmTotalMemoryLabel);
		infoContent.add(jvmUsedMemoryLabel);
	}

	{
		MaterialColumn chartColumn = new MaterialColumn(12, 6, 6);
		MaterialCard card = new MaterialCard();

		Map<String, Serializable> data = new HashMap<>();
		for (IndexInfo indexInfo : instanceInfo.getIndexes()) {
			data.put(indexInfo.getName(), indexInfo.getTotalDocs());
		}
		Scheduler.get().scheduleDeferred(() -> {
			Highcharts chart = PieChart.getBuilder().setChartTitle("Index Info").setHeight(400).setData(data).setYAxisAllowDecimals(false).build();
			card.add(chart);
			chartColumn.add(card);
			row.add(chartColumn);
		});

	}

}