gwt.material.design.client.ui.MaterialLink Java Examples

The following examples show how to use gwt.material.design.client.ui.MaterialLink. 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: FilterQueryWidget.java    From lumongo with Apache License 2.0 6 votes vote down vote up
public FilterQueryWidget() {
	addStyleName(MainResources.GSS.searchBox());

	textBox = new TextBox();
	textBox.setStyleName(MainResources.GSS.searchBoxInput());

	add(textBox);

	plusButton = new MaterialLink();
	plusButton.setIconType(IconType.ADD);
	plusButton.setIconColor(Color.WHITE);
	add(plusButton);

	minusButton = new MaterialLink();
	minusButton.setIconType(IconType.REMOVE);
	minusButton.setIconColor(Color.WHITE);

	add(minusButton);

}
 
Example #2
Source File: MaterialMenuBarTest.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
public void testStructure() {
    // given
    MaterialMenuBar menuBar = getWidget(false);

    // when / then
    final String ACTIVATOR = "dp-activator";
    MaterialLink link = new MaterialLink();
    MaterialDropDown dropDown = new MaterialDropDown();
    link.setActivates(ACTIVATOR);
    dropDown.setActivator(ACTIVATOR);
    menuBar.add(link);
    menuBar.add(dropDown);
    assertEquals(ACTIVATOR, link.getActivates());
    assertEquals(ACTIVATOR, dropDown.getActivator());
    assertEquals(link, menuBar.getWidget(0));
    assertEquals(dropDown, menuBar.getWidget(1));
}
 
Example #3
Source File: CustomTextBox.java    From lumongo with Apache License 2.0 6 votes vote down vote up
public CustomTextBox(boolean hasButton) {
	addStyleName(MainResources.GSS.searchBox());

	textBox = new TextBox();
	textBox.setStyleName(MainResources.GSS.searchBoxInput());

	add(textBox);

	if (hasButton) {
		button = new MaterialLink();
		button.setIconType(IconType.SEARCH);
		button.setIconColor(Color.WHITE);
		add(button);
	}

}
 
Example #4
Source File: QueryOptionsView.java    From lumongo with Apache License 2.0 5 votes vote down vote up
private void createFieldNameCollapsible(IndexInfo indexInfo) {
	MaterialCollapsibleItem item = new MaterialCollapsibleItem();
	item.setVisible(false);
	fieldItems.put(indexInfo.getName(), item);

	MaterialCollapsibleHeader header = new MaterialCollapsibleHeader();
	header.setBackgroundColor(Color.GREY_LIGHTEN_1);
	MaterialLink link = new MaterialLink("'" + indexInfo.getName() + "' fields");
	link.setTextColor(Color.WHITE);
	header.add(link);

	MaterialCollapsibleBody body = new MaterialCollapsibleBody();
	body.setPaddingTop(0);
	body.setBackgroundColor(Color.WHITE);

	CustomTabPanel tabPanel = new CustomTabPanel(TabType.DEFAULT);
	tabPanel.setMarginLeft(-40);
	tabPanel.setMarginRight(-40);

	String qfTabId = UIUtil.getRandomId();
	MaterialTabItem qfTabItem = tabPanel.createAndAddTabListItem("QF", "#" + qfTabId);
	tabPanel.createAndAddTabPane(qfTabId, new FieldsDiv(indexInfo.getQfList(), uiQueryObject.getQueryFields()));
	header.addClickHandler(clickEvent -> qfTabItem.selectTab());

	String flTabId = UIUtil.getRandomId();
	tabPanel.createAndAddTabListItem("FL", "#" + flTabId);
	tabPanel.createAndAddTabPane(flTabId, new FieldsDiv(indexInfo.getFlList(), uiQueryObject.getDisplayFields()));

	String facetsTabId = UIUtil.getRandomId();
	tabPanel.createAndAddTabListItem("Facets", "#" + facetsTabId);
	tabPanel.createAndAddTabPane(facetsTabId, new FieldsDiv(indexInfo.getFacetList(), uiQueryObject.getFacets()));

	body.add(tabPanel);

	item.add(header);
	item.add(body);

	fieldNameCollapsible.add(item);
}
 
Example #5
Source File: MenuBarView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@UiHandler({"dpFile", "dpNew", "dpView", "dpEdit", "dpFormat"})
void onSelectionFileDropdown(SelectionEvent<Widget> selection) {
    if(selection.getSelectedItem() instanceof MaterialLink){
        MaterialToast.fireToast("Triggered : " + ((MaterialLink)selection.getSelectedItem()).getText());
    }else if(selection.getSelectedItem() instanceof MaterialCheckBox){
        MaterialToast.fireToast("Checked : " + ((MaterialCheckBox)selection.getSelectedItem()).getText());
    }
}
 
Example #6
Source File: DialogsView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@UiHandler("btnToastAction")
void onToastAction(ClickEvent e) {
    MaterialLink link = new MaterialLink("UNDO");
    link.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            MaterialToast.fireToast("UNDO DONE");
        }
    });
    new MaterialToast(link).toast("Item Deleted");
}
 
Example #7
Source File: MaterialPopupMenuTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
protected MaterialPopupMenu createWidget() {
    MaterialPopupMenu popupMenu = new MaterialPopupMenu();
    for (int i = 1; i <= 5; i++) {
        MaterialLink link = new MaterialLink();
        popupMenu.add(link);
    }
    return popupMenu;
}
 
Example #8
Source File: CustomTabPanel.java    From lumongo with Apache License 2.0 5 votes vote down vote up
public MaterialTabItem createAndAddTabListItem(String tabName, String dataTarget) {
	MaterialTabItem tabItem = new MaterialTabItem();
	tabItem.setGrid("s4");
	tabItem.setWaves(WavesType.YELLOW);

	MaterialLink materialLink = new MaterialLink(tabName);
	materialLink.setHref(dataTarget);
	tabItem.add(materialLink);

	materialTab.add(tabItem);

	return tabItem;
}
 
Example #9
Source File: CustomTabPanel.java    From lumongo with Apache License 2.0 5 votes vote down vote up
public MaterialTabItem createAndAddTabListItem(IconType iconType, String title, String dataTarget) {
	MaterialTabItem tabItem = new MaterialTabItem();
	tabItem.setWaves(WavesType.YELLOW);
	tabItem.setGrid("s4");

	MaterialLink materialLink = new MaterialLink(iconType);
	materialLink.setHref(dataTarget);
	materialLink.setText(title);
	materialLink.setTextColor(Color.WHITE);
	tabItem.add(materialLink);

	materialTab.add(tabItem);

	return tabItem;
}
 
Example #10
Source File: Header.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public Header() {

		MaterialNavBar navBar = new MaterialNavBar();
		navBar.setActivates("sideNav");
		navBar.setType(NavBarType.FIXED);
		navBar.setWidth("100%");
		navBar.setBackgroundColor(Color.GREY_DARKEN_2);

		MaterialNavSection navSection = new MaterialNavSection();
		navSection.setTextAlign(TextAlign.RIGHT);

		navBar.add(navSection);

		sideNav = new MaterialSideNav(SideNavType.PUSH);
		sideNav.setWidth("60");
		sideNav.setId("sideNav");
		sideNav.setBackgroundColor(Color.GREY_LIGHTEN_3);
		sideNav.setCloseOnClick(true);
		sideNav.setType(SideNavType.PUSH);
		MaterialNavBrand navBrand = new MaterialNavBrand();
		navBrand.add(new MaterialImage(MainResources.INSTANCE.logo()));
		navBrand.setHref("#");
		navBrand.addClickHandler(clickEvent -> sideNav.hide());
		sideNav.add(navBrand);

		{
			MaterialLink overView = new MaterialLink(IconType.INFO);
			overView.setTitle("Overview");
			overView.addClickHandler(clickEvent -> MainController.get().goTo(new HomePlace()));
			sideNav.add(overView);
		}

		{
			MaterialLink indexes = new MaterialLink(IconType.SEARCH);
			indexes.setTitle("Query");
			indexes.addClickHandler(clickEvent -> MainController.get().goTo(new QueryPlace(null)));
			sideNav.add(indexes);
		}

		add(navBar);
		add(sideNav);

	}
 
Example #11
Source File: FilterQueryWidget.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public MaterialLink getMinusButton() {
	return minusButton;
}
 
Example #12
Source File: FilterQueryWidget.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public MaterialLink getPlusButton() {
	return plusButton;
}
 
Example #13
Source File: CustomTextBox.java    From lumongo with Apache License 2.0 4 votes vote down vote up
public MaterialLink getButton() {
	return button;
}
 
Example #14
Source File: HelloWorldView.java    From gwt-boot-samples with Apache License 2.0 4 votes vote down vote up
@UiHandler("foodDropDown")
void handleDropdown(SelectionEvent<Widget> callback) {
	MaterialToast.fireToast(
			"Selected : " + ((MaterialLink) callback.getSelectedItem())
					.getText());
}
 
Example #15
Source File: MaterialWindow.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public MaterialLink getLabelTitle() {
    return labelTitle;
}
 
Example #16
Source File: LanguageSelectorItem.java    From gwt-material-addins with Apache License 2.0 4 votes vote down vote up
public MaterialLink getLabel() {
    return label;
}
 
Example #17
Source File: DropdownView.java    From gwt-material-demo with Apache License 2.0 4 votes vote down vote up
@UiHandler("dropdown")
void onDropdown(SelectionEvent<Widget> callback){
    MaterialToast.fireToast("Selected : " + ((MaterialLink)callback.getSelectedItem()).getText());
}
 
Example #18
Source File: DropdownItemRenderer.java    From gwt-material with Apache License 2.0 votes vote down vote up
MaterialLink render(T object);