本文整理匯總了Java中com.vaadin.navigator.ViewChangeListener類的典型用法代碼示例。如果您正苦於以下問題:Java ViewChangeListener類的具體用法?Java ViewChangeListener怎麽用?Java ViewChangeListener使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ViewChangeListener類屬於com.vaadin.navigator包,在下文中一共展示了ViewChangeListener類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
if (!isLoggedIn()) {
getUI().getNavigator().navigateTo(LoginView.VIEW_NAME);
return;
}
addComponent(new HeadingLabel("會員名簿", VaadinIcons.BULLETS));
printAllMembers();
Button homeButton = new Button("會員メニュー", click -> getUI().getNavigator().navigateTo(MenuView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.USER);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例2: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("ログアウト確認", VaadinIcons.INFO_CIRCLE));
addComponent(new Label("ログアウトします。"));
HorizontalLayout buttonArea = new HorizontalLayout();
buttonArea.setSpacing(true);
addComponent(buttonArea);
setComponentAlignment(buttonArea, Alignment.MIDDLE_CENTER);
Button cancelButton = new Button("キャンセル", click -> getUI().getNavigator().navigateTo(MenuView.VIEW_NAME));
buttonArea.addComponent(cancelButton);
Button logoutButton = new Button("ログアウト", click -> {
membershipService.logout();
getUI().getNavigator().navigateTo(FrontView.VIEW_NAME);
});
logoutButton.setIcon(VaadinIcons.SIGN_OUT);
logoutButton.setStyleName(ValoTheme.BUTTON_PRIMARY);
buttonArea.addComponent(logoutButton);
}
示例3: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("參加登録完了", VaadinIcons.CHECK));
addComponent(new Label("參加登録が完了し、確認メールを送信しました。"));
Label addressLabel = new Label("しばらく待ってもメールが來ない場合は、お手數ですが " + appReply + " までご連絡ください。");
addressLabel.setCaption("お願い");
addressLabel.setIcon(VaadinIcons.LIGHTBULB);
addComponent(addressLabel);
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.HOME);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例4: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("パスワードリセット要求送信完了", VaadinIcons.INFO_CIRCLE));
addComponent(new Label("入力された E-mail アドレスへパスワードリセットの案內メールを送信しました。"));
Label addressLabel = new Label("しばらく待ってもメールが來ない場合は、お手數ですが " + appReply + " までご連絡ください。");
addressLabel.setCaption("お願い");
addressLabel.setIcon(VaadinIcons.LIGHTBULB);
addComponent(addressLabel);
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.HOME);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例5: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("パスワードリセット"));
// パスパラメーターを取得
String token = Stream.of(event.getParameters().split("/")).filter(s -> !s.isEmpty()).findFirst().orElse("");
if (token.isEmpty()) {
printRequestSection();
return;
}
try {
PasswordResetRequest request = attendanceService.getPasswordResetRequest(token);
printResetSection(request);
} catch (IllegalArgumentException e) {
log.info("トークン検証失敗", e);
ErrorView.show("無効なパラメーターです。", null);
}
}
示例6: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
super.enter(event);
String parameters = event.getParameters();
if (!StringUtils.isEmpty(parameters)) {
Map<String, String> paramMap = ViewUtil.stringToMap(parameters);
try {
Long daiId = Long.parseLong(paramMap.get(ViewUtil.DAI_ID_PARAM_KEY));
LOG.info("Entered DAI View with Id:" + daiId);
this.parentTable.setValue(null);
this.parentTable.select(daiId);
this.parentTable.setCurrentPageFirstItemIndex(getParentContainer().indexOfId(daiId));
} catch (NumberFormatException ne) {
LOG.warn("Invalid Parameters for DAI View. " + parameters);
}
}
}
示例7: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
super.enter(event);
String parameters = event.getParameters();
if (!StringUtils.isEmpty(parameters)) {
Map<String, String> paramMap = ViewUtil.stringToMap(parameters);
try {
Long mcId = Long.parseLong(paramMap.get(ViewUtil.MC_ID_PARAM_KEY));
log.info("Entered MC View with Id:" + mcId);
this.parentTable.select(mcId);
this.parentTable.setCurrentPageFirstItemIndex(getParentContainer().indexOfId(mcId));
} catch (NumberFormatException ne) {
log.warn("Invalid Parameters for MC View. " + parameters);
}
}
}
示例8: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
super.enter(event);
String parameters = event.getParameters();
if (!StringUtils.isEmpty(parameters)) {
Map<String, String> paramMap = ViewUtil.stringToMap(parameters);
try {
Long jobId = Long.parseLong(paramMap.get(ViewUtil.JOB_ID_PARAM_KEY));
log.info("Entered Job View with Id:" + jobId);
this.parentTable.select(jobId);
this.parentTable.setCurrentPageFirstItemIndex(getParentContainer().indexOfId(jobId));
} catch (NumberFormatException ne) {
log.warn("Invalid Parameters for Job View. " + parameters);
}
}
}
示例9: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
super.enter(event);
String parameters = event.getParameters();
if (!StringUtils.isEmpty(parameters)) {
Map<String, String> paramMap = ViewUtil.stringToMap(parameters);
try {
Long alertId = Long.parseLong(paramMap.get(ViewUtil.ALERT_ID_PARAM_KEY));
log.info("Entered Alert View with Id:" + alertId);
this.parentTable.setValue(null);
this.parentTable.select(alertId);
this.parentTable.setCurrentPageFirstItemIndex(getParentContainer().indexOfId(alertId));
} catch (NumberFormatException ne) {
log.warn("Invalid Parameters for Alert View. " + parameters);
}
}
}
示例10: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
super.enter(viewChangeEvent);
log.info("{} viewed order list", getCurrentUser());
String likeFilter = "%" + "" + "%";
list.lazyLoadFrom(
(firstRow, asc, sortProperty) -> repository.findByOrderIdLikeIgnoreCaseOrderByIdDesc(
likeFilter,
new PageRequest(
firstRow / PAGESIZE,
PAGESIZE,
asc ? Sort.Direction.ASC : Sort.Direction.DESC,
sortProperty == null ? "id" : sortProperty
)
),
() -> (int) repository.countByOrderIdLikeOrderByIdDesc(likeFilter),
PAGESIZE);
}
示例11: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
super.enter(viewChangeEvent);
String parameters = viewChangeEvent.getParameters();
if (parameters == null || parameters.equals("")) {
txtSearch.clear();
attendeeBeanList.removeAllItems();
} else {
String searchString = viewChangeEvent.getParameters();
tblResult.clear();
if (txtSearch.getValue() != null && !txtSearch.getValue().equals(searchString)) {
txtSearch.setValue(searchString);
}
handler.searchFor(searchString);
}
txtSearch.addValueChangeListener((Property.ValueChangeListener) valueChangeEvent -> search());
}
示例12: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
super.enter(viewChangeEvent);
String parameters = viewChangeEvent.getParameters();
if (parameters != null && !parameters.trim().equals("")) {
Integer badgeId;
try {
badgeId = Integer.parseInt(parameters);
handler.showBadge(this, badgeId);
} catch (NumberFormatException ex) {
notifyError("Badge ID must be integer: " + parameters);
}
} else {
// Create new badge type
handler.showBadge(this, null);
}
}
示例13: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
checkDeveloperMode();
try {
if (!Objects.equals(event.getOldView(), event.getNewView())) {
viewUrl = event.getViewName();
viewDefinition = HybridbpmUI.getDashboardAPI().getViewDefinitionByUrl(viewUrl);
tabSheet.removeSelectedTabChangeListener(this);
createTabs();
tabSheet.addSelectedTabChangeListener(this);
}
if (event.getParameters() != null && !event.getParameters().trim().isEmpty()) {
openDashboardTab(event.getParameters());
} else {
TabDefinition td = ((DashboardTab) tabSheet.getTab(0).getComponent()).getTabDefinition();
HybridbpmUI.getCurrent().getHybridbpmNavigator().navigateTo(viewUrl + "/" + td.getId());
}
} catch (Exception e) {
logger.log(Level.SEVERE, e.getMessage(), e);
}
}
示例14: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
removeAllComponents();
setMargin(new MMarginInfo(false, true));
add(new Header("Employee analysis").setHeaderLevel(2));
List<Employee> employeeData = service.findAll();
add(ageDistribution(employeeData));
add(salaryDistribution(employeeData));
//final Component funnel = createStatusFunnel(employeeData);
final Component gender = genderDistribution(employeeData);
//if (ScreenSize.getScreenSize() == ScreenSize.SMALL) {
//addComponents(funnel, gender);
addComponents(gender);
// } else {
// //addComponent(new MHorizontalLayout(funnel, gender).withFullWidth());
// }
}
示例15: enter
import com.vaadin.navigator.ViewChangeListener; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
worldMap.removeAllComponents();
LOpenStreetMapLayer osm = new LOpenStreetMapLayer();
osm.setDetectRetina(true);
worldMap.addComponent(osm);
for (final Customer customer : service.findAll()) {
if(customer.getLocation() != null) {
LMarker marker = new LMarker(customer.getLocation());
marker.addClickListener(new LeafletClickListener() {
@Override
public void onClick(LeafletClickEvent event) {
Notification.show(
"Customer: " + customer.getFirstName() + " " + customer.
getLastName());
}
});
worldMap.addComponent(marker);
}
}
worldMap.zoomToContent();
}