本文整理汇总了Java中gwt.material.design.client.ui.MaterialToast类的典型用法代码示例。如果您正苦于以下问题:Java MaterialToast类的具体用法?Java MaterialToast怎么用?Java MaterialToast使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MaterialToast类属于gwt.material.design.client.ui包,在下文中一共展示了MaterialToast类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
}
示例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());
}
示例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
}
示例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);
}
示例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);
}
}
示例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");
});
}
示例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();
}
}
示例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);
}
示例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));
}
示例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());
}
}
示例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());
}
}
示例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");
});
}
示例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()));
}
示例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();
}
示例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"))));
}