本文整理了Java中com.vaadin.ui.Window.showNotification()
方法的一些代码示例,展示了Window.showNotification()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Window.showNotification()
方法的具体详情如下:
包路径:com.vaadin.ui.Window
类名称:Window
方法名:showNotification
暂无
代码示例来源:origin: apache/ace
/**
* Shows an error message on screen.
*
* @param aTitle
* the title of the error message;
* @param aMessage
* the error message itself.
*/
final void showErrorNotification(final String aTitle, final String aMessage) {
getParent().showNotification(aTitle, aMessage, Notification.TYPE_ERROR_MESSAGE);
}
代码示例来源:origin: apache/ace
/** Shows a warning messsage on screen. */
private void showWarningNotification(final String aTitle, final String aMessage) {
getParent().showNotification(aTitle, aMessage, Notification.TYPE_WARNING_MESSAGE);
}
}
代码示例来源:origin: apache/ace
protected void showError(String title, String message, Exception e) {
StringBuilder sb = new StringBuilder("<br/>");
sb.append(message);
if (e.getMessage() != null) {
sb.append("<br/>").append(e.getMessage());
}
else {
sb.append("<br/>unknown error!");
}
log(LOG_ERROR, message, e);
getWindow().showNotification(title, sb.toString(), Notification.TYPE_ERROR_MESSAGE);
}
代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin
public void buttonClick(ClickEvent event) {
try {
m_admin.commit();
}
catch (IOException e) {
getMainWindow().showNotification(
"Commit failed",
"Failed to commit the changes to the server.<br />" +
"Reason: " + e.getMessage(),
Notification.TYPE_ERROR_MESSAGE);
}
}
});
代码示例来源:origin: org.aperteworkflow/gui-commons
public void onThrowable(Throwable e) {
logger.log(Level.SEVERE, e.getMessage(), e);
if (e instanceof TaskAlreadyCompletedException) {
VaadinUtility.errorNotification(this, i18NSource, i18NSource.getMessage("task.already.completed"));
}
else {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
e.printStackTrace(new PrintStream(baos));
getMainWindow().showNotification(VaadinUtility.validationNotification(i18NSource.getMessage("process-tool.exception.occurred"),
getMessage(e.getMessage())));
}
}
代码示例来源:origin: apache/ace
public void buttonClick(Button.ClickEvent event) {
try {
handleItemRemoveObject(event.getButton().getData());
}
catch (Exception e) {
// ACE-246: notify user when the removal failed!
getWindow().showNotification("Failed to remove item!", "<br/>Reason: " + e.getMessage(), Notification.TYPE_ERROR_MESSAGE);
}
}
});
代码示例来源:origin: org.aperteworkflow/base-widgets
private void showInfoNotification(String message) {
getApplication().getMainWindow().showNotification(getLocalizedMessage(message),
Window.Notification.TYPE_HUMANIZED_MESSAGE);
}
代码示例来源:origin: org.aperteworkflow/base-widgets
private void showInfoNotification(String message) {
getApplication().getMainWindow().showNotification(getLocalizedMessage(message),
Window.Notification.TYPE_HUMANIZED_MESSAGE);
}
代码示例来源:origin: org.aperteworkflow/base-widgets
private void showWarningNotification(String code, String message) {
getApplication().getMainWindow().showNotification(getLocalizedMessage(code) + nvl(message),
Window.Notification.TYPE_WARNING_MESSAGE);
}
代码示例来源:origin: org.aperteworkflow/gui-commons
public static void validationNotification(Application application, I18NSource messageSource, String errorMessage) {
Notification notification = new Notification(messageSource.getMessage("process.data.data-error"),
"<br/>" + errorMessage,
Notification.TYPE_ERROR_MESSAGE);
notification.setStyleName("invalid");
application.getMainWindow().showNotification(notification);
}
代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin
public void uploadFailed(FailedEvent event) {
getMainWindow().showNotification(
"Upload artifact failed",
"File " + event.getFilename() + "<br />could not be uploaded to the server.<br />" +
"Reason: " + event.getReason().getMessage(),
Notification.TYPE_ERROR_MESSAGE);
m_log.log(LogService.LOG_ERROR, "Upload of " + event.getFilename() + " size " + event.getLength() + " type " + event.getMIMEType() + " failed.", event.getReason());
}
});
代码示例来源:origin: org.aperteworkflow/gui-commons
public static void informationNotification(Application application, String message, int delay) {
Notification notification = new Notification("<b>" + message + "</b>", TYPE_HUMANIZED_MESSAGE);
notification.setPosition(POSITION_CENTERED);
notification.setDelayMsec(delay);
application.getMainWindow().showNotification(notification);
}
代码示例来源:origin: org.aperteworkflow/base-widgets
private void showWarningNotification(String code, String message) {
getApplication().getMainWindow().showNotification(getLocalizedMessage(code) + nvl(message),
Window.Notification.TYPE_WARNING_MESSAGE);
}
代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin
public void show() {
if (getParent() != null) {
// window is already showing
m_main.getWindow().showNotification("Window is already open");
} else {
// Open the subwindow by adding it to the parent
// window
m_main.getWindow().addWindow(this);
}
setRelevantFocus();
}
代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin
private void showAddArtifactDialog(final Window main) {
final AddArtifactWindow featureWindow = new AddArtifactWindow(main);
if (featureWindow.getParent() != null) {
// window is already showing
main.getWindow().showNotification("Window is already open");
}
else {
// Open the subwindow by adding it to the parent
// window
main.getWindow().addWindow(featureWindow);
}
}
代码示例来源:origin: org.aperteworkflow/gui-commons
public static void errorNotification(Application application, I18NSource messageSource, String message) {
Notification notification = new Notification(messageSource.getMessage("notification.error"),
"<br/><b>" + message + "</b>", TYPE_ERROR_MESSAGE);
notification.setPosition(POSITION_CENTERED);
notification.setStyleName("error");
application.getMainWindow().showNotification(notification);
}
代码示例来源:origin: org.apache.ace/org.apache.ace.webui.vaadin
public void show() {
if (getParent() != null) {
// window is already showing
m_main.getWindow().showNotification("Window is already open");
} else {
// Open the subwindow by adding it to the parent
// window
m_main.getWindow().addWindow(this);
}
setRelevantFocus();
}
代码示例来源:origin: apache/ace
@Override
public void buttonClick(ClickEvent event) {
event.getButton().setEnabled(false);
try {
getArtifactRepository().remove(rp);
m_artifactsTable.removeItem(rp.getDefinition());
}
catch (Exception e) {
getParent().showNotification("Failed to delete resource", "Reason: <br/>" + e.getMessage(), Notification.TYPE_ERROR_MESSAGE);
}
}
});
代码示例来源:origin: org.activiti/activiti-explorer
protected void handleFormSubmit(FormPropertiesEvent event) {
formService.submitStartFormData(processDefinition.getId(), event.getFormProperties());
// Show notification
ExplorerApp.get().getMainWindow().showNotification(MessageFormat.format(
i18nManager.getMessage(Messages.PROCESS_STARTED_NOTIFICATION), getProcessDisplayName(processDefinition)));
initProcessDefinitionInfo();
}
protected void handleFormCancel(FormPropertiesEvent event) {
代码示例来源:origin: org.aperteworkflow/editor
@Override
public void save() {
if (!propertiesPanel.getPropertiesForm().isValid()) {
GenericEditorApplication.getCurrent()
.getMainWindow().showNotification(VaadinUtility.validationNotification("Validation error", "Correct data"));
return;
}
String json = getJsonToSave();
application.getJsHelper().postAndRedirectStep(url, json);
}
内容来源于网络,如有侵权,请联系作者删除!