gwt.material.design.client.constants.IconType Java Examples

The following examples show how to use gwt.material.design.client.constants.IconType. 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: 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 #2
Source File: MaterialAutoComplete.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
@Override
public MaterialChip getChip(Suggestion suggestion) {
    final MaterialChip chip = new MaterialChip();

    String imageChip = suggestion.getDisplayString();
    String textChip = imageChip;

    String s = "<img src=\"";
    if (imageChip.contains(s)) {
        int ix = imageChip.indexOf(s) + s.length();
        imageChip = imageChip.substring(ix, imageChip.indexOf("\"", ix + 1));
        chip.setUrl(imageChip);
        textChip = textChip.replaceAll("[<](/)?img[^>]*[>]", "");
    }
    chip.setText(textChip);
    chip.setIconType(IconType.CLOSE);

    return chip;
}
 
Example #3
Source File: MaterialRatingTest.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
protected void testRatingUpdate(Integer value, int maxRating, MaterialRating rating) {
    rating.setMaxRating(maxRating);
    rating.setValue(value);
    assertEquals(maxRating, rating.getMaxRating());
    assertEquals(value, rating.getValue());
    for (Widget w : rating) {
        assertTrue(w instanceof MaterialIcon);
        MaterialIcon icon = (MaterialIcon) w;
        if (rating.getWidgetIndex(w) < value) {
            assertEquals(IconType.FAVORITE, icon.getIconType());
            assertTrue(icon.getElement().hasClassName(AddinsCssName.MATERIAL_RATING_SELECTED));
        } else {
            assertEquals(IconType.FAVORITE_BORDER, icon.getIconType());
            assertTrue(icon.getElement().hasClassName(AddinsCssName.MATERIAL_RATING_UNSELECTED));
        }
    }
    checkValueChangeEvent(rating, 5, 2);
}
 
Example #4
Source File: MaterialRatingTest.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
public void testStructure() {
    // UiBinder
    // given
    MaterialRating rating = getWidget();

    // when / then
    final int MAX_RATING = rating.getMaxRating();
    assertEquals(5, MAX_RATING);
    IconType selectedIcon = rating.getSelectedRatingIcon();
    IconType unselectedIcon = rating.getUnselectedRatingIcon();
    assertEquals(IconType.STAR, selectedIcon);
    assertEquals(IconType.STAR_BORDER, unselectedIcon);
    assertEquals(rating.getWidgetCount(), MAX_RATING);
    for (Widget w : rating) {
        assertTrue(w instanceof MaterialIcon);
        MaterialIcon icon = (MaterialIcon) w;
        assertEquals(IconType.STAR_BORDER, icon.getIconType());
    }
}
 
Example #5
Source File: LoadingStateTest.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
public void testStructure() {
    LoadingStatePanel statePanel = getWidget();

    // By Default Loading State Panel must be invisible by default
    assertFalse(statePanel.isVisible());
    assertTrue(statePanel.getElement().hasClassName(IncubatorCssName.LOADING_STATE));
    // Check widget structure
    assertTrue(statePanel.getWidget(0) instanceof MaterialIcon);
    MaterialIcon icon = (MaterialIcon) statePanel.getWidget(0);
    statePanel.setIcon(IconType.POLYMER);
    assertEquals(statePanel.getIcon(), icon);

    final String TITLE = "title";
    final String DESCRIPTION = "description";
    assertTrue(statePanel.getWidget(1) instanceof MaterialLabel);
    MaterialLabel title = (MaterialLabel) statePanel.getWidget(1);
    statePanel.setTitle(TITLE);
    assertTrue(title.getElement().hasClassName(CssName.TITLE));
    assertEquals(title.getText(), TITLE);

    assertTrue(statePanel.getWidget(2) instanceof MaterialLabel);
    MaterialLabel description = (MaterialLabel) statePanel.getWidget(2);
    statePanel.setDescription(DESCRIPTION);
    assertTrue(description.getElement().hasClassName(AddinsCssName.DESCRIPTION));
    assertEquals(description.getText(), DESCRIPTION);
}
 
Example #6
Source File: AlertTest.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
public void testStructure() {
    Alert alert = getWidget();

    final String TEXT = "text";
    final IconType ICON = IconType.AC_UNIT;
    // Check Structure
    assertEquals(alert.getWidgetCount(), 2);
    assertTrue(alert.getWidget(0) instanceof MaterialIcon);
    assertTrue(alert.getWidget(1) instanceof MaterialLabel);
    // Check setText()
    alert.setText(TEXT);
    assertEquals(alert.getText(), TEXT);
    // Check setIconType()
    alert.setIconType(ICON);
    assertEquals(alert.getIcon().getIconType(), ICON);
}
 
Example #7
Source File: MaterialChipTest.java    From gwt-material with Apache License 2.0 6 votes vote down vote up
public void testStructure() {
    // given
    final String TEXT = "text";
    MaterialChip chip = getWidget();

    // when / then
    chip.setText(TEXT);
    assertEquals(TEXT, chip.getText());
    assertEquals(TEXT, chip.getChipLabel().getText());

    // given
    final IconType icon = IconType.POLYMER;

    // when / then
    chip.setIconType(icon);
    chip.setIconColor(Color.RED);
    assertEquals(icon, chip.getIcon().getIconType());
    assertEquals(Color.RED, chip.getIconColor());

    assertEquals(chip.getChipLabel(), chip.getWidget(0));
    assertEquals(chip.getIcon(), chip.getWidget(1));
}
 
Example #8
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 #9
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 #10
Source File: Alert.java    From gwt-material-addins with Apache License 2.0 6 votes vote down vote up
@Override
public void setType(AlertType alertType) {
    getCssTypeMixin().setType(alertType);
    switch (alertType) {
        case ERROR:
            setIconType(IconType.WARNING);
            break;
        case INFORMATION:
            setIconType(IconType.INFO);
            break;
        case WARNING:
            setIconType(IconType.WARNING);
            break;
        default:
            break;
    }
}
 
Example #11
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 #12
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 #13
Source File: MaterialIconMorphTest.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
protected MaterialIconMorph createWidget() {
    MaterialIconMorph iconMorph = new MaterialIconMorph();
    MaterialIcon icon1 = new MaterialIcon();
    icon1.setIconType(IconType.POLYMER);
    MaterialIcon icon2 = new MaterialIcon();
    icon2.setIconType(IconType.AC_UNIT);
    iconMorph.add(icon1);
    iconMorph.add(icon2);
    return iconMorph;
}
 
Example #14
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 #15
Source File: CustomerCollapsible.java    From gwt-material-patterns with Apache License 2.0 5 votes vote down vote up
public CustomerCollapsible(UserDTO dto, GoogleContactsView googleContactsView) {
    initWidget(uiBinder.createAndBindUi(this));
    this.dto = dto;
    this.googleContactsView = googleContactsView;
    lblName.setText(dto.getName());
    lblEmail.setText(dto.getEmail());
    lblPosition.setText(dto.getPosition().getValue());
    imgUser.setUrl(dto.getPicture());
    if(dto.isStarred()){
        iconStar.setIconType(IconType.STAR);
    }
}
 
Example #16
Source File: DataHelper.java    From gwt-material-patterns with Apache License 2.0 5 votes vote down vote up
/**
 * Get all drives for GDrive Pattern
 * @return
 */
public static List<DriveDTO> getAllDrives() {
    List<DriveDTO> list = new ArrayList<>();
    list.add(new DriveDTO(IconType.FOLDER, "File 1", "https://s3.amazonaws.com/uifaces/faces/twitter/stevedesigner/128.jpg", "Luis Hoppe", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER_SHARED, "File 2", "https://s3.amazonaws.com/uifaces/faces/twitter/yassiryahya/128.jpg", "Irwin Mueller", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER, "File 3", "https://s3.amazonaws.com/uifaces/faces/twitter/lebinoclard/128.jpg", "Levin Card", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER_SHARED, "File 4", "https://s3.amazonaws.com/uifaces/faces/twitter/lmjabreu/128.jpg", "Dr. Cassie Keeling", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER_SHARED, "File 5", "https://s3.amazonaws.com/uifaces/faces/twitter/ariil/128.jpg", "Madelynn Schamberger", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER, "File 6", "https://s3.amazonaws.com/uifaces/faces/twitter/devankoshal/128.jpg", "Dominique Schmidt", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER, "File 7", "https://s3.amazonaws.com/uifaces/faces/twitter/karthipanraj/128.jpg", "Rowland Heller", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER_SHARED, "File 8", "https://s3.amazonaws.com/uifaces/faces/twitter/GavicoInd/128.jpg", "Quincy Schimmel", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER_SHARED, "File 9", "https://s3.amazonaws.com/uifaces/faces/twitter/roybarberuk/128.jpg", "Tierra VonRueden", "March 3, 2016"));
    list.add(new DriveDTO(IconType.FOLDER, "File 10", "https://s3.amazonaws.com/uifaces/faces/twitter/tonymillion/128.jpg", "Clint Heller", "March 3, 2016"));
    return list;
}
 
Example #17
Source File: DriveDTO.java    From gwt-material-patterns with Apache License 2.0 5 votes vote down vote up
public DriveDTO(IconType icon, String fileName, String ownerImage, String owner, String date) {
    this.icon = icon;
    this.fileName = fileName;
    this.ownerImage = ownerImage;
    this.owner = owner;
    this.date = date;
}
 
Example #18
Source File: DataHelper.java    From gwt-material-patterns with Apache License 2.0 5 votes vote down vote up
/**
 * Get all inbox for GInbox Patter
 * @return
 */
public static List<InboxDTO> getAllTodayInbox() {
    List<InboxDTO> list = new ArrayList<>();

    // Children
    List<InboxDTO> children = new ArrayList<>();
    children.add(new InboxDTO("https://lh5.googleusercontent.com/-SWaCREsCOUQ/AAAAAAAAAAI/AAAAAAAAAAA/0B6hSKehnxg/w28-h28/photo.jpg", "Paypal", "John Doe, how to receive important PayPal messages in your inbox", "black"));
    children.add(new InboxDTO("https://lh5.googleusercontent.com/-SWaCREsCOUQ/AAAAAAAAAAI/AAAAAAAAAAA/0B6hSKehnxg/w28-h28/photo.jpg", "Paypal", "John Doe, how to receive important PayPal messages in your inbox", "black"));
    children.add(new InboxDTO("https://lh5.googleusercontent.com/-SWaCREsCOUQ/AAAAAAAAAAI/AAAAAAAAAAA/0B6hSKehnxg/w28-h28/photo.jpg", "Paypal", "John Doe, how to receive important PayPal messages in your inbox", "black"));

    InboxDTO promos = new InboxDTO(IconType.LOCAL_OFFER, "Promos", "Paypal, LAZADA, CashCashPinoy, Dribble, Inbox by Inbox", "blue lighten-2");
    promos.setChildren(children);
    list.add(promos);

    InboxDTO updates = new InboxDTO(IconType.FLAG, "Updates", "Wattpad, Code Fights, Job Central, Gitter Notifications", "deep-orange");
    updates.setChildren(children);
    list.add(updates);

    InboxDTO finance = new InboxDTO(IconType.POLL, "Finance", "Globe Telecom, Paypal, China Bank", "green");
    finance.setChildren(children);
    list.add(finance);

    InboxDTO purchase = new InboxDTO(IconType.LOCAL_GROCERY_STORE, "Purchase", "Lazada, Starbucks, Sony", "brown");
    purchase.setChildren(children);
    list.add(purchase);

    return list;
}
 
Example #19
Source File: LoadingStatePanel.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void setState(State state, String title, String description) {
    this.state = state;
    setTitle(title);
    setDescription(description);
    setVisible(true);
    if (isAnimation()) {
        new MaterialAnimation().transition(Transition.BOUNCEIN).animate(icon);
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(lblTitle);
        new MaterialAnimation().transition(Transition.BOUNCEINUP).animate(lblDescription);
    }
    if (state == State.LOADING) {
        icon.setIconType(IconType.LOOP);
        icon.setBackgroundColor(Color.WHITE);
        icon.setIconColor(Color.BLACK);
        LoadingEvent.fire(this);
        loader.show();

    } else if (state == State.SUCCESS) {
        loader.hide();
        icon.setIconType(IconType.CHECK);
        icon.setBackgroundColor(Color.BLUE);
        icon.setIconColor(Color.WHITE);

        SuccessEvent.fire(this);
    } else if (state == State.ERROR) {
        loader.hide();
        icon.setIconType(IconType.ERROR);
        icon.setBackgroundColor(Color.RED);
        icon.setIconColor(Color.WHITE);

        ErrorEvent.fire(this);
    }
}
 
Example #20
Source File: MaterialWindow.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
public void setMaximize(boolean maximize) {
    getMaximizeMixin().setOn(maximize);
    if (getMaximizeMixin().isOn()) {
        iconMaximize.setIconType(IconType.FILTER_NONE);
    } else {
        iconMaximize.setIconType(IconType.CHECK_BOX_OUTLINE_BLANK);
    }
}
 
Example #21
Source File: NextArrow.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
protected void onLoad() {
    super.onLoad();

    setIconType(IconType.KEYBOARD_ARROW_RIGHT);
    setType(ButtonType.FLOATING);
    setWaves(WavesType.DEFAULT);
    setText("Next");
    addStyleName(AddinsCssName.CAROUSEL_NEXT_ARROW);
    setId(DOM.createUniqueId());
}
 
Example #22
Source File: MaterialHelpBlock.java    From gwt-material with Apache License 2.0 5 votes vote down vote up
@Override
public void setIconType(IconType iconType) {
    icon.setIconType(iconType);

    if (!icon.isAttached()) {
        insert(icon, 0);
    }
}
 
Example #23
Source File: PreviousArrow.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
@Override
protected void onLoad() {
    super.onLoad();

    setIconType(IconType.KEYBOARD_ARROW_LEFT);
    setType(ButtonType.FLOATING);
    setWaves(WavesType.DEFAULT);
    setText("Previous");
    addStyleName(AddinsCssName.CAROUSEL_PREV_ARROW);
    setId(DOM.createUniqueId());
}
 
Example #24
Source File: StandardDataTableView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Override
protected void render(TableSubHeader subheader, int column) {
    super.render(subheader, column);

    subheader.setOpenIcon(IconType.FOLDER_OPEN);
    subheader.setCloseIcon(IconType.FOLDER);
}
 
Example #25
Source File: FrozenDataTableView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Override
protected void render(TableSubHeader subheader, int column) {
    super.render(subheader, column);

    subheader.setOpenIcon(IconType.FOLDER_OPEN);
    subheader.setCloseIcon(IconType.FOLDER);
}
 
Example #26
Source File: HelperView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
protected void detectViewPort() {
    ViewPort.when(Resolution.MOBILE_SMALL).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Mobile Small");
        lblViewPort.setIconType(IconType.PHONE_ANDROID);
    });

    ViewPort.when(Resolution.MOBILE_MEDIUM).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Mobile Medium");
        lblViewPort.setIconType(IconType.PHONE_ANDROID);
    });

    ViewPort.when(Resolution.MOBILE_LARGE).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Mobile Large");
        lblViewPort.setIconType(IconType.PHONE_ANDROID);
    });

    ViewPort.when(Resolution.TABLET).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Tablet");
        lblViewPort.setIconType(IconType.TABLET_ANDROID);
    });

    ViewPort.when(Resolution.LAPTOP).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Laptop");
        lblViewPort.setIconType(IconType.LAPTOP);
    });

    ViewPort.when(Resolution.LAPTOP_LARGE).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Laptop Large");
        lblViewPort.setIconType(IconType.LAPTOP);
    });

    ViewPort.when(Resolution.LAPTOP_4K).then(viewPortChange -> {
        lblViewPort.setText("ViewPort : Laptop 4K");
        lblViewPort.setIconType(IconType.LAPTOP);
    });
}
 
Example #27
Source File: HelperView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
protected void setupScrolling() {
    scrollHelper.setContainer(container);

    $(container).on("scroll", (e, param1) -> {

        if (scrollHelper.isInViewPort(target)) {
            scrollScope.setText("Visible inside the ViewPort");
            scrollScope.setIconType(IconType.VISIBILITY);
        } else {
            scrollScope.setText("Out of ViewPort Scope");
            scrollScope.setIconType(IconType.VISIBILITY_OFF);
        }
        return false;
    });
}
 
Example #28
Source File: TreeView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@UiHandler("btnFinish")
void onFinishDialog(ClickEvent e) {
    MaterialTreeItem item = new MaterialTreeItem();
    item.setText(txtName.getText());
    item.setIconType(IconType.FOLDER);
    item.setIconColor(Color.BLUE);
    docTree.getSelectedItem().addItem(item);
    MaterialPathAnimator.reverseAnimate(btnAdd.getElement(), addOverlay.getElement());
}
 
Example #29
Source File: MediaView.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
private void setFullscreen(boolean fullscreen) {
    slider.setFullscreen(fullscreen);

    if(fullscreen) {
        slider.getElement().getStyle().setPosition(Style.Position.FIXED);
        slider.getElement().getStyle().setZIndex(9998);
        slider.setHeight("100%");

        fullscreenBtn.getElement().getStyle().setPosition(Style.Position.FIXED);
        fullscreenBtn.getElement().getStyle().setZIndex(9999);
        fullscreenBtn.getElement().getStyle().setBottom(0, Style.Unit.PX);
        fullscreenBtn.getElement().getStyle().setLeft(0, Style.Unit.PX);
        fullscreenBtn.setIconType(IconType.FULLSCREEN_EXIT);
        fullscreenBtn.setText("Close Fullscreen");
    } else {
        slider.getElement().getStyle().clearPosition();
        slider.getElement().getStyle().clearZIndex();
        slider.getElement().getStyle().clearHeight();

        fullscreenBtn.getElement().getStyle().clearPosition();
        fullscreenBtn.getElement().getStyle().clearZIndex();
        fullscreenBtn.getElement().getStyle().clearBottom();
        fullscreenBtn.getElement().getStyle().clearLeft();
        fullscreenBtn.setIconType(IconType.FULLSCREEN);
        fullscreenBtn.setText("Fullscreen Slider");
    }
}
 
Example #30
Source File: ExternalLibrary.java    From gwt-material-demo with Apache License 2.0 5 votes vote down vote up
@Override
protected void onLoad() {
    super.onLoad();

    externalLink.setIconType(IconType.LANGUAGE);
    add(externalLink);
}