• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java MaterialToast类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中gwt.material.design.client.ui.MaterialToast的典型用法代码示例。如果您正苦于以下问题:Java MaterialToast类的具体用法?Java MaterialToast怎么用?Java MaterialToast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MaterialToast类属于gwt.material.design.client.ui包,在下文中一共展示了MaterialToast类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onDateSubmit

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Override
public void onDateSubmit(Date startDate, Date endDate, String account) {

    DateTimeFormat fmt = DateTimeFormat.getFormat("/yyyy/M/d");

    if (startDate.getTime() > endDate.getTime()) {

        MaterialToast.fireToast("Whoops! Invalid date range.", 1000);
    } else {
        String fromDate = fmt.format(startDate);
        String toDate = fmt.format(endDate);
        String dateRange = fromDate + toDate;

        clientFactory.getEventBus().fireEvent(new DateSubmitEvent(dateRange, startDate, endDate, account));
    }

}
 
开发者ID:WSDOT,项目名称:social-analytics,代码行数:18,代码来源:AnalyticsActivity.java


示例2: OverlayView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
OverlayView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    ThemeManager.register(overlay, ThemeManager.LIGHTER_SHADE);
    ThemeManager.register(btnCloseOverlay, ThemeManager.DARKER_SHADE);

    ThemeManager.register(overlayEvents, ThemeManager.LIGHTER_SHADE);
    ThemeManager.register(btnCloseOverlayEvents, ThemeManager.DARKER_SHADE);

    btnOpenOverlay.addClickHandler(clickEvent -> overlay.open(btnOpenOverlay));
    btnCloseOverlay.addClickHandler(e -> overlay.close());

    overlayEvents.addOpenHandler(openEvent -> MaterialToast.fireToast("Overlay Opened"));
    overlayEvents.addCloseHandler(closeEvent -> MaterialToast.fireToast("Overlay Closed"));

    btnOpenOverlayEvents.addClickHandler(clickEvent -> overlayEvents.open(btnOpenOverlayEvents));
    btnCloseOverlayEvents.addClickHandler(e -> overlayEvents.close());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:19,代码来源:OverlayView.java


示例3: onModuleLoad

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Override
public void onModuleLoad() {

	GWT.setUncaughtExceptionHandler(new GWT.UncaughtExceptionHandler() {
		public void onUncaughtException(Throwable e) {
			Log.log(Level.SEVERE, e.getMessage(), e);
			MaterialToast.fireToast("Unknown error, please reload application");
		}
	});

	Theme.bundle();	// inject

   	workPanel = new SimplePanel();
   	workPanel.setSize("100%", "100%");

	ActivityMapper activityMapper = new MentorActivityMapper();
	ActivityManager activityManager = new ActivityManager(activityMapper, MentorBus.get());
	activityManager.setDisplay(workPanel);

	Element loader = Document.get().getElementById("loader");
	if (loader != null)
		loader.removeFromParent();
	
	RootPanel.get().add(workPanel, 0, 0);

       Places.handler().handleCurrentHistory();	// goes to the place represented on URL, else default place

}
 
开发者ID:vsite-hr,项目名称:mentor,代码行数:29,代码来源:Mentor.java


示例4: addOrRemoveFavouriteCamera

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
private void addOrRemoveFavouriteCamera(Integer id) {
    Set<Integer> selectedCameras = getUserFavouriteCameras();
    if (selectedCameras.contains(id)) {
        selectedCameras.remove(id);
        MaterialToast.fireToast(Texts.CAMERA_REMOVED);
    } else {
        selectedCameras.add(id);
        MaterialToast.fireToast(Texts.CAMERA_ADDED);
    }
    userSettings.storeFavouriteCameras(selectedCameras);
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:12,代码来源:Settings.java


示例5: onMapTypeChange

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@SuppressWarnings("unused")
private void onMapTypeChange(@Observes FavouritesModify modifyEvent) {
    FavouritesModify.ModificationType modificationType = modifyEvent.getModificationType();
    if (modificationType == FavouritesModify.ModificationType.REMOVE_ALL) {
        removeAllFavourites();
        MaterialToast.fireToast(Texts.FAVOURITES_REMOVED);
    }
    if (modificationType == FavouritesModify.ModificationType.RESTORE_DEFAULT) {
        restoreDefaultFavourites();
        MaterialToast.fireToast(Texts.FAVOURITES_DEFAULTED);
    }
}
 
开发者ID:baldram,项目名称:tristar-eye,代码行数:13,代码来源:Settings.java


示例6: onCallback

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("btnAnimateCallback")
void onCallback(ClickEvent e) {
    MaterialAnimation animation = new MaterialAnimation();
    animation.setDelay(0);
    animation.setDuration(1000);
    animation.transition(Transition.FLIPINX);
    animation.animate(iconCallback, () -> {
        MaterialToast.fireToast("Animation is finished");
    });
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:11,代码来源:CoreAnimationsView.java


示例7: onDeselectItem

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("btnDeselectItem")
void onDeselectItem(ClickEvent e) {
    if (docTree.getSelectedItem() == null) {
        MaterialToast.fireToast("You must select an item first.");
    } else {
        MaterialToast.fireToast("Item " + docTree.getSelectedItem().getText() + " was deselected.");
        docTree.deselectSelectedItem();
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:10,代码来源:TreeView.java


示例8: onGetValue

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("getValue")
void onGetValue(ClickEvent e) {
    String value = clearRichEditor.getValue();
    if (value.isEmpty()) {
        value = "Empty";
    }
    MaterialToast.fireToast(value);
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:RichEditorView.java


示例9: ScrollFireView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
ScrollFireView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));

    MaterialScrollfire.apply(panel.getElement(), () -> {
        MaterialToast.fireToast("Toasted");
    });
    MaterialScrollfire.apply(listContainer.getElement(), () -> new MaterialAnimation().transition(Transition.SHOW_STAGGERED_LIST).animate(listContainer));
    MaterialScrollfire.apply(image.getElement(), () -> new MaterialAnimation().transition(Transition.FADE_IN_IMAGE).animate(image));

}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:12,代码来源:ScrollFireView.java


示例10: onSelectionFileDropdown

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@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());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:MenuBarView.java


示例11: onSelectionMode

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("dpMode")
void onSelectionMode(SelectionEvent<Widget> selection) {
    for(Widget w : dpMode.getItems()){
        if(w instanceof MaterialCheckBox){
            ((MaterialCheckBox) w).setValue(false);
        }
    }
    if(selection.getSelectedItem() instanceof MaterialCheckBox){
        ((MaterialCheckBox) selection.getSelectedItem()).setValue(true);
        MaterialToast.fireToast("Checked : " + ((MaterialCheckBox) selection.getSelectedItem()).getText());
    }
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:13,代码来源:MenuBarView.java


示例12: CutOutsView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
CutOutsView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    ThemeManager.register(cutout);
    cutout.addCloseHandler(closeEvent -> {
        MaterialToast.fireToast("Close Event Fired");
    });

    cutout.addOpenHandler(openEvent -> {
        MaterialToast.fireToast("Open Event Fired");
    });
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:13,代码来源:CutOutsView.java


示例13: WindowView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
WindowView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    ThemeManager.register(headerPanel);
    ThemeManager.register(tabsPanel);
    window.addOpenHandler(event -> MaterialToast.fireToast("Opened : " + window.getTitle()));
    window.addCloseHandler(event -> MaterialToast.fireToast("Closed : " + window.getTitle()));
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:WindowView.java


示例14: PickersView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
PickersView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));

    dpLimit.setDateMin(new Date(117, 0, 1));
    dpLimit.setDateMax(new Date(117, 0, 15));
    // Events on date picker
    dpEvents.addOpenHandler(event -> {
        if(event.getTarget().getValue() != null){
            MaterialToast.fireToast("Opened Date Picker " + event.getTarget().getValue());
        }else{
            MaterialToast.fireToast("Opened Date Picker" );
        }
    });
    dpEvents.addCloseHandler(event -> MaterialToast.fireToast("Closed Date Picker with value " + event.getTarget().getValue()));
    dpEvents.addValueChangeHandler(event -> MaterialToast.fireToast("Date Selected " + event.getValue()));

    dpOpenClose.addOpenHandler(event -> {
        if(event.getTarget().getValue() != null){
            MaterialToast.fireToast("Opened Date Picker " + event.getTarget().getValue());
        } else {
            MaterialToast.fireToast("Opened Date Picker" );
        }
    });
    dpOpenClose.addCloseHandler(event -> MaterialToast.fireToast("Closed Date Picker with value " + event.getTarget().getValue()));
    dpOpenClose.addValueChangeHandler(event -> {
        MaterialToast.fireToast("Date Selected " + event.getValue());
        dpOpenClose.close();
    });

    dpAutoClose.addValueChangeHandler(event -> {
        MaterialToast.fireToast("Date Selected " + event.getValue());
    });

    dpBirthdate.setDate(new Date(50, 1, 1));

    initLanguage();
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:39,代码来源:PickersView.java


示例15: NavBarView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
NavBarView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    navSection.addSelectionHandler(selectionEvent -> MaterialToast.fireToast(selectionEvent.getSelectedItem() + " Selected Index"));

    typePanel.add(new DemoImagePanel(new DemoImageDTO("Default NavBar", "Provides a non-fixed navbar. Good for blogs.",
            "http://i.imgur.com/rGx7XRW.gif",
            generateDemoLink("default"),
            generateSource("navbardefault/DefaultNavBarView.ui.xml"))));

    typePanel.add(new DemoImagePanel(new DemoImageDTO("Fixed NavBar", "By setting layoutPosition='FIXED', your navbar will be fixed on top when scrolling through the content.",
            "http://i.imgur.com/muYAAjl.gif",
            generateDemoLink("fixed"),
            generateSource("navbarfixed/FixedNavBarView.ui.xml"))));

    typePanel.add(new DemoImagePanel(new DemoImageDTO("Tall NavBar", "You can easily adjust the navbar's height to make it tall by height='200px',",
            "http://i.imgur.com/dtUsHRd.gif",
            generateDemoLink("tall"),
            generateSource("navbartall/TallNavBarView.ui.xml"))));

    typePanel.add(new DemoImagePanel(new DemoImageDTO("Extended NavBar", "Using MaterialNavContent - you can easily attached any component for the extension of your MaterialNavBar",
            "http://i.imgur.com/bUYC6qs.png",
            generateDemoLink("extend"),
            generateSource("navbarextend/ExtendNavBarView.ui.xml"))));


    typePanel.add(new DemoImagePanel(new DemoImageDTO("Tabs in NavBar", "You can easily add tabs for secondary navigation on MaterialNavBar by attaching it on MaterialNavContent",
            "http://i.imgur.com/7c3AGBs.png",
            generateDemoLink("tab"),
            generateSource("navbartab/TabNavBarView.ui.xml"))));

    typePanel.add(new DemoImagePanel(new DemoImageDTO("Shrinkable NavBar", "Provides a delightful scrolling effect when expanding or shrinking the navbar.",
            "http://i.imgur.com/tHUDgqB.gif",
            generateDemoLink("shrink"),
            generateSource("navbarshrink/ShrinkNavBarView.ui.xml"))));
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:37,代码来源:NavBarView.java


示例16: FABView

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@Inject
FABView(Binder uiBinder) {
    initWidget(uiBinder.createAndBindUi(this));
    btnFABEvent.addOpenHandler(openEvent -> MaterialToast.fireToast("Opened Default FAB"));
    btnFABEvent.addCloseHandler(closeEvent -> MaterialToast.fireToast("Closed Default FAB"));
    btnClickOnlyFABEvent.addOpenHandler(openEvent -> MaterialToast.fireToast("Opened Click Only FAB"));
    btnClickOnlyFABEvent.addCloseHandler(closeEvent -> MaterialToast.fireToast("Closed Click Only FAB"));
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:9,代码来源:FABView.java


示例17: loadTheme

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
public static void loadTheme(ThemeLoader.ThemeBundle themeBundle) {
    ThemeLoader.loadAsync(themeBundle, new ThemeLoader.ThemeAsyncCallback() {
        @Override
        public void onSuccess(int resourceCount) {
            if (themeBundle == ThemeAmber.INSTANCE) {
                setColor(Color.AMBER, Color.AMBER_DARKEN_3, Color.AMBER_LIGHTEN_2);
            } else if (themeBundle == ThemeBlue.INSTANCE) {
                setColor(Color.BLUE, Color.BLUE_DARKEN_3, Color.BLUE_LIGHTEN_2);
            } else if (themeBundle == ThemeBrown.INSTANCE) {
                setColor(Color.BROWN, Color.BROWN_DARKEN_3, Color.BROWN_LIGHTEN_2);
            } else if (themeBundle == ThemeGreen.INSTANCE) {
                setColor(Color.GREEN, Color.GREEN_DARKEN_3, Color.GREEN_LIGHTEN_2);
            } else if (themeBundle == ThemeGrey.INSTANCE) {
                setColor(Color.GREY, Color.GREY_DARKEN_3, Color.GREY_LIGHTEN_2);
            } else if (themeBundle == ThemeOrange.INSTANCE) {
                setColor(Color.ORANGE, Color.ORANGE_DARKEN_3, Color.ORANGE_LIGHTEN_2);
            } else if (themeBundle == ThemePink.INSTANCE) {
                setColor(Color.PINK, Color.PINK_DARKEN_3, Color.PINK_LIGHTEN_2);
            } else if (themeBundle == ThemePurple.INSTANCE) {
                setColor(Color.PURPLE, Color.PURPLE_DARKEN_3, Color.PURPLE_LIGHTEN_2);
            } else if (themeBundle == ThemeRed.INSTANCE) {
                setColor(Color.RED, Color.RED_DARKEN_3, Color.RED_LIGHTEN_2);
            } else if (themeBundle == ThemeYellow.INSTANCE) {
                setColor(Color.YELLOW, Color.YELLOW_DARKEN_3, Color.YELLOW_LIGHTEN_2);
            }
        }

        @Override
        public void onFailure(Throwable reason) {
            MaterialToast.fireToast(reason.getMessage());
        }
    });
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:34,代码来源:ThemeManager.java


示例18: onSwipeRight

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("swipeablePanel")
void onSwipeRight(SwipeRightEvent<Widget> e) {
    MaterialLabel label = (MaterialLabel) e.getTarget();
    MaterialToast.fireToast(label.getText() + " swiped right");
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:6,代码来源:SwipeableView.java


示例19: onSwipeLeft

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("swipeablePanel")
void onSwipeLeft(SwipeLeftEvent<Widget> e) {
    MaterialLabel label = (MaterialLabel) e.getTarget();
    MaterialToast.fireToast(label.getText() + " swiped left");
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:6,代码来源:SwipeableView.java


示例20: onGetHTML

import gwt.material.design.client.ui.MaterialToast; //导入依赖的package包/类
@UiHandler("btnGetHTML")
void onGetHTML(ClickEvent e) {
    MaterialToast.fireToast(richEditor.getHTML());
}
 
开发者ID:GwtMaterialDesign,项目名称:gwt-material-demo,代码行数:5,代码来源:RichEditorView.java



注:本文中的gwt.material.design.client.ui.MaterialToast类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java DefaultPermissionFactory类代码示例发布时间:2022-05-22
下一篇:
Java InjectionPoint类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap