本文整理匯總了Java中com.vaadin.navigator.ViewChangeListener.ViewChangeEvent方法的典型用法代碼示例。如果您正苦於以下問題:Java ViewChangeListener.ViewChangeEvent方法的具體用法?Java ViewChangeListener.ViewChangeEvent怎麽用?Java ViewChangeListener.ViewChangeEvent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.navigator.ViewChangeListener
的用法示例。
在下文中一共展示了ViewChangeListener.ViewChangeEvent方法的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 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);
}
}
}
示例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 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);
}
}
}
示例8: 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());
}
示例9: 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);
}
}
示例10: 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);
}
}
示例11: enter
import com.vaadin.navigator.ViewChangeListener; //導入方法依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
Label errorLabel = new Label("エラーが発生しました。");
errorLabel.setStyleName(ValoTheme.LABEL_FAILURE);
VaadinSession session = VaadinSession.getCurrent();
String paramMessage = (String) session.getAttribute(PARAM_MESSAGE);
if (paramMessage != null) {
addComponent(new Label(paramMessage));
}
session.setAttribute(PARAM_MESSAGE, null);
Throwable paramThrowable = (Throwable) session.getAttribute(PARAM_THROWABLE);
if (paramThrowable != null) {
addComponent(new Label(throwable2html(paramThrowable), ContentMode.HTML));
}
session.setAttribute(PARAM_THROWABLE, null);
log.error(paramMessage, paramThrowable);
if (paramThrowable instanceof AuthenticationException) {
Button loginButton = new Button("ログイン", click -> getUI().getNavigator().navigateTo(LoginView.VIEW_NAME));
addComponent(loginButton);
setComponentAlignment(loginButton, Alignment.MIDDLE_CENTER);
}
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例12: enter
import com.vaadin.navigator.ViewChangeListener; //導入方法依賴的package包/類
@Override
public void enter(final ViewChangeListener.ViewChangeEvent event)
{
final String parameters = event.getParameters();
final String[] parameterArray = parameters.split("/");
label.setValue("Parameters: " + String.join(", ", parameterArray));
}
示例13: enter
import com.vaadin.navigator.ViewChangeListener; //導入方法依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
final TextField name = new TextField();
name.setCaption("Type your name here:");
Button button = new Button("Click Me");
button.addClickListener(e -> addComponent(new Label("Thanks " + name.getValue() + ", it works!")));
addComponents(name, button);
}
示例14: enter
import com.vaadin.navigator.ViewChangeListener; //導入方法依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
presenter.setView(this);
bindPatientNameField();
fillDoctorsGridLayout(presenter.getAllDoctors());
resetPatient();
}
開發者ID:mrts,項目名稱:vaadin-javaee-clinic-patient-queue-example,代碼行數:8,代碼來源:RegistrationKioskViewImpl.java
示例15: enter
import com.vaadin.navigator.ViewChangeListener; //導入方法依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent viewChangeEvent) {
doctorNameLabel.setValue(presenter.getDoctorName());
doctorsOfficeNameLabel.setValue("Doctor's office #" + presenter.getDoctorOffice());
logoutButton.addClickListener(e -> presenter.logout());
callInButton.addClickListener(e -> selectedRegistration.ifPresent(registration -> {
presenter.callInPatient(registration);
registrationDataProvider.refreshItem(registration);
}));
callInButton.setEnabled(false);
registeredPatientsGrid.addColumn(registration -> registration.getPatient().getName())
.setCaption("Patient");
registeredPatientsGrid.addColumn(registration -> registration.getPatient().getId())
.setCaption("Number");
registeredPatientsGrid.addColumn(registration -> registration.getStatus()).setCaption("Status");
registeredPatientsGrid.addSelectionListener(patientSelectionEvent -> {
selectedRegistration = patientSelectionEvent.getFirstSelectedItem();
callInButton.setEnabled(true);
});
resetDataProvider();
broadcaster.register(this);
}