Java Code Examples for gwt.material.design.client.constants.IconType
The following examples show how to use
gwt.material.design.client.constants.IconType. These examples are extracted from open source projects.
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 Project: gwt-material Source File: MaterialChipTest.java License: Apache License 2.0 | 6 votes |
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 2
Source Project: gwt-material-demo Source File: IconsView.java License: Apache License 2.0 | 6 votes |
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 3
Source Project: gwt-material-addins Source File: Alert.java License: Apache License 2.0 | 6 votes |
@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 4
Source Project: gwt-material-addins Source File: MaterialAutoComplete.java License: Apache License 2.0 | 6 votes |
@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 5
Source Project: gwt-material-addins Source File: AlertTest.java License: Apache License 2.0 | 6 votes |
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 6
Source Project: gwt-material-addins Source File: LoadingStateTest.java License: Apache License 2.0 | 6 votes |
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 7
Source Project: gwt-material-addins Source File: MaterialRatingTest.java License: Apache License 2.0 | 6 votes |
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 8
Source Project: gwt-material-addins Source File: MaterialRatingTest.java License: Apache License 2.0 | 6 votes |
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 9
Source Project: lumongo Source File: CustomTextBox.java License: Apache License 2.0 | 6 votes |
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 10
Source Project: lumongo Source File: FilterQueryWidget.java License: Apache License 2.0 | 6 votes |
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 11
Source Project: gwt-material-patterns Source File: DataHelper.java License: Apache License 2.0 | 5 votes |
/** * 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 12
Source Project: gwt-material-patterns Source File: DataHelper.java License: Apache License 2.0 | 5 votes |
/** * 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 13
Source Project: gwt-material-patterns Source File: DriveDTO.java License: Apache License 2.0 | 5 votes |
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 14
Source Project: gwt-material-patterns Source File: CustomerCollapsible.java License: Apache License 2.0 | 5 votes |
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 15
Source Project: gwt-material Source File: MaterialHelpBlock.java License: Apache License 2.0 | 5 votes |
@Override public void setIconType(IconType iconType) { icon.setIconType(iconType); if (!icon.isAttached()) { insert(icon, 0); } }
Example 16
Source Project: gwt-material-demo Source File: StandardDataTableView.java License: Apache License 2.0 | 5 votes |
@Override protected void render(TableSubHeader subheader, int column) { super.render(subheader, column); subheader.setOpenIcon(IconType.FOLDER_OPEN); subheader.setCloseIcon(IconType.FOLDER); }
Example 17
Source Project: gwt-material-demo Source File: FrozenDataTableView.java License: Apache License 2.0 | 5 votes |
@Override protected void render(TableSubHeader subheader, int column) { super.render(subheader, column); subheader.setOpenIcon(IconType.FOLDER_OPEN); subheader.setCloseIcon(IconType.FOLDER); }
Example 18
Source Project: gwt-material-demo Source File: HelperView.java License: Apache License 2.0 | 5 votes |
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 19
Source Project: gwt-material-demo Source File: HelperView.java License: Apache License 2.0 | 5 votes |
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 20
Source Project: gwt-material-demo Source File: TreeView.java License: Apache License 2.0 | 5 votes |
@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 21
Source Project: gwt-material-demo Source File: MediaView.java License: Apache License 2.0 | 5 votes |
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 22
Source Project: gwt-material-demo Source File: ExternalLibrary.java License: Apache License 2.0 | 5 votes |
@Override protected void onLoad() { super.onLoad(); externalLink.setIconType(IconType.LANGUAGE); add(externalLink); }
Example 23
Source Project: gwt-material-addins Source File: LoadingStatePanel.java License: Apache License 2.0 | 5 votes |
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 24
Source Project: gwt-material-addins Source File: PreviousArrow.java License: Apache License 2.0 | 5 votes |
@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 25
Source Project: gwt-material-addins Source File: NextArrow.java License: Apache License 2.0 | 5 votes |
@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 26
Source Project: gwt-material-addins Source File: MaterialWindow.java License: Apache License 2.0 | 5 votes |
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 27
Source Project: gwt-material-addins Source File: MaterialCutoutTest.java License: Apache License 2.0 | 5 votes |
@Override protected MaterialCutOut createWidget() { // given MaterialCutOut cutOut = new MaterialCutOut(); target = new MaterialIcon(IconType.POLYMER); RootPanel.get().add(target); // when cutOut.setTarget(target); // then assertEquals(target.getElement(), cutOut.getTargetElement()); return cutOut; }
Example 28
Source Project: gwt-material-addins Source File: MaterialRatingTest.java License: Apache License 2.0 | 5 votes |
public void testValue() { // UiBinder // given MaterialRating rating = getWidget(); // Determine the number of selected icons vs. unselected ones rating.setSelectedRatingIcon(IconType.FAVORITE); rating.setUnselectedRatingIcon(IconType.FAVORITE_BORDER); testRatingUpdate(3, rating.getMaxRating(), rating); // Update on value(3) , maxrating(default - 5) // Check value and max rating combination to test whether designated icons are applied testRatingUpdate(5, 5, rating); testRatingUpdate(5, 10, rating); }
Example 29
Source Project: gwt-material-addins Source File: MaterialIconMorphTest.java License: Apache License 2.0 | 5 votes |
@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 30
Source Project: gwt-material-addins Source File: MaterialWindowTest.java License: Apache License 2.0 | 5 votes |
public void testMaximizeAndClose() { // UiBinder // given MaterialWindow window = getWidget(); // when / then final boolean[] isOpenFired = {false}; boolean[] isCloseFired = {false}; // when / then window.setEnabled(true); assertTrue(window.isEnabled()); window.addOpenHandler(openEvent -> isOpenFired[0] = true); window.open(); window.addCloseHandler(closeEvent -> isCloseFired[0] = true); window.close(); assertTrue(isOpenFired[0]); assertTrue(isCloseFired[0]); assertEquals(IconType.CHECK_BOX_OUTLINE_BLANK, window.getIconMaximize().getIconType()); assertFalse(window.getElement().hasClassName(AddinsCssName.MAXIMIZE)); window.setMaximize(true); assertEquals(IconType.FILTER_NONE, window.getIconMaximize().getIconType()); window.open(); assertTrue(window.isMaximized()); assertTrue(window.getElement().hasClassName(AddinsCssName.MAXIMIZE)); }