本文整理汇总了Java中org.kaaproject.avro.ui.gwt.client.widget.AlertPanel类的典型用法代码示例。如果您正苦于以下问题:Java AlertPanel类的具体用法?Java AlertPanel怎么用?Java AlertPanel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AlertPanel类属于org.kaaproject.avro.ui.gwt.client.widget包,在下文中一共展示了AlertPanel类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BaseViewImpl
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
public BaseViewImpl(boolean useDetailsPanel) {
errorPanel = new AlertPanel(Type.ERROR);
sandboxStyle = Utils.sandboxStyle;
avroUiStyle = Utils.avroUiStyle;
initWidget(createAndBindUi());
setTitle(getViewTitle());
if (useDetailsPanel) {
detailsPanel = new VerticalPanel();
detailsPanel.setWidth("100%");
detailsPanel.addStyleName(sandboxStyle.contentPanel());
ScrollPanel scroll = new ScrollPanel();
scroll.setWidth("100%");
scroll.add(detailsPanel);
centerPanel.setWidget(scroll);
}
initCenterPanel();
clearError();
}
示例2: BaseListViewImpl
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new BaseListViewImpl.
*/
public BaseListViewImpl(boolean editable) {
this.editable = editable;
initAddButton();
errorPanel = new AlertPanel(Type.ERROR);
kaaAdminStyle = Utils.kaaAdminStyle;
avroUiStyle = Utils.avroUiStyle;
initWidget(createAndBindUi());
grid = createGrid();
dockPanel.add(grid);
titleLabel.setText(titleString());
addButton.setVisible(editable);
clearError();
}
示例3: MainViewImpl
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
public MainViewImpl() {
errorPanel = new AlertPanel(Type.ERROR);
infoPanel = new AlertPanel(Type.INFO);
avroUiSandboxStyle = Utils.avroUiSandboxStyle;
initWidget(uiBinder.createAndBindUi(this));
detailsTable.setWidth("95%");
detailsTable.getElement().getStyle().setPaddingTop(0, Unit.PX);
detailsTable.setCellPadding(0);
detailsTable.getColumnFormatter().setWidth(0, "50%");
detailsTable.getColumnFormatter().setWidth(1, "50%");
detailsTable.getFlexCellFormatter().setColSpan(0, 0, 2);
schemaConstructorView = new FormConstructorViewImpl();
CaptionPanel schemaConstructorPanel = new CaptionPanel(Utils.constants.schemaConstructor());
schemaConstructorPanel.add(schemaConstructorView);
detailsTable.setWidget(1, 0, schemaConstructorPanel);
recordConstructorView = new FormConstructorViewImpl();
CaptionPanel recordConstructorPanel = new CaptionPanel(Utils.constants.recordConstructor());
recordConstructorPanel.add(recordConstructorView);
detailsTable.setWidget(1, 1, recordConstructorPanel);
clearMessages();
}
示例4: ConfirmDialog
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
public ConfirmDialog(ConfirmListener listener, String title, String question) {
super(false, true);
setTitle(title);
this.listener = listener;
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
AlertPanel questionLabel = new AlertPanel(AlertPanel.Type.WARNING);
questionLabel.setMessage(question);
dialogContents.add(questionLabel);
noButton = new Button(Utils.constants.no(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
ConfirmDialog.this.listener.onNo();
}
});
yesButton = new Button(Utils.constants.yes(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
ConfirmDialog.this.listener.onYes();
}
});
addButton(yesButton);
addButton(noButton);
}
示例5: MessageDialog
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new MessageDialog.
*/
public MessageDialog(Listener listener, AlertPanel.Type type, String title, String message) {
super(false, true);
setTitle(title);
this.listener = listener;
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
AlertPanel messageLabel = new AlertPanel(type);
messageLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP);
messageLabel.getElement().getStyle().setProperty("maxHeight", "400px");
messageLabel.getElement().getStyle()
.setProperty("maxWidth", Window.getClientWidth() * 2 / 3 + "px");
messageLabel.getElement().getStyle().setOverflowY(Overflow.AUTO);
messageLabel.setMessage(message);
dialogContents.add(messageLabel);
okButton = new Button(Utils.constants.ok(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
addButton(okButton);
this.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (MessageDialog.this.listener != null) {
MessageDialog.this.listener.onOk();
}
}
});
}
示例6: showMessageDialog
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Show message dialog.
*/
public static MessageDialog showMessageDialog(Listener listener,
AlertPanel.Type type,
String title,
String message) {
MessageDialog dialog = new MessageDialog(listener, type, title, message);
dialog.center();
dialog.show();
return dialog;
}
示例7: handleException
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Exception handler.
*/
public static void handleException(Throwable caught,
HasErrorMessage hasErrorMessage,
ErrorMessageCustomizer errorMessageCustomizer) {
boolean handled = false;
if (caught instanceof StatusCodeException) {
StatusCodeException sce = (StatusCodeException) caught;
if (sce.getStatusCode() == Response.SC_UNAUTHORIZED) {
onUnauthorized();
handled = true;
} else if (sce.getStatusCode() == 0) {
handleNetworkConnectionError();
handled = true;
}
} else if (caught instanceof IncompatibleRemoteServiceException) {
MessageDialog.showMessageDialog(AlertPanel.Type.ERROR, constants.incompatibleRemoteService(),
messages.incompatibleRemoteService());
handled = true;
}
if (!handled) {
String message = parseErrorMessage(caught, errorMessageCustomizer);
String[] lines = message.split("\r\n|\r|\n");
if (lines.length > 1 || (lines.length == 1 && lines[0].length() >= MAX_ERROR_LINE_LENGTH)) {
MessageDialog.showMessageDialog(AlertPanel.Type.ERROR, constants.errorTitle(), message);
} else {
hasErrorMessage.setErrorMessage(message);
}
}
}
示例8: LoginView
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new LoginView.
*/
public LoginView() {
errorPanel = new AlertPanel(Type.ERROR);
infoPanel = new AlertPanel(Type.INFO);
kaaAdminStyle = Utils.kaaAdminStyle;
initWidget(uiBinder.createAndBindUi(this));
loginTitle.getElement().setInnerSafeHtml(
SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle()));
usernameBox = new TextBox();
usernameBox.setName("j_username");
usernameBox.setWidth("100%");
passwordBox = new PasswordTextBox();
passwordBox.setName("j_password");
passwordBox.setWidth("100%");
Label loginLabel = new Label(Utils.constants.username());
loginTable.setWidget(0, 0, loginLabel);
loginTable.setWidget(0, 1, usernameBox);
Label passwordLabel = new Label(Utils.constants.password());
loginTable.setWidget(1, 0, passwordLabel);
loginTable.setWidget(1, 1, passwordBox);
forgotPasswordLabel = new Label(Utils.constants.forgotPassword());
forgotPasswordLabel.addStyleName(Utils.kaaAdminStyle.linkLabel());
loginTable.setWidget(2, 0, forgotPasswordLabel);
loginTable.getFlexCellFormatter().setWidth(0, 0, "130px");
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setColSpan(2, 0, 2);
loginButton = new Button(Utils.constants.login());
loginButton.addStyleName(Utils.kaaAdminStyle.loginButton());
loginTable.setWidget(3, 2, loginButton);
loginButton.getElement().getStyle().setMarginTop(15, Unit.PX);
loginForm.setWidget(loginTable);
loginForm.setAction("");
}
示例9: BaseDetailsViewImpl
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new BaseDetailsViewImpl.
*/
public BaseDetailsViewImpl(boolean create, boolean editable) {
this.create = create;
this.editable = editable;
errorPanel = new AlertPanel(Type.ERROR);
kaaAdminStyle = Utils.kaaAdminStyle;
avroUiStyle = Utils.avroUiStyle;
initWidget(uiBinder.createAndBindUi(this));
constructTopPanel();
getTitileLabelWidget().setText(Utils.constants.title());
getSaveButtonWidget().setText(Utils.constants.save());
getCancelButtonWidget().setText(Utils.constants.cancel());
requiredFieldsNoteLabel.getElement().setInnerSafeHtml(
SafeHtmlUtils.fromSafeConstant(Utils.messages
.requiredFieldsNote(Utils.avroUiStyle
.requiredField())));
if (create) {
getTitileLabelWidget().setText(getCreateTitle());
getCancelButtonWidget().setVisible(true);
} else {
getTitileLabelWidget().setText(getViewTitle());
getBackButtonPanelWidget().setVisible(true);
}
subTitleLabel.setText(getSubTitle());
updateSaveButton(false, false);
detailsTable.getColumnFormatter().setWidth(0, "200px");
detailsTable.getColumnFormatter().setWidth(1, "300px");
if (!create) {
detailsTable.getColumnFormatter().setWidth(2, "300px");
}
getSaveButtonWidget().addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
updateSaveButton(false, false);
hasChanged = false;
}
});
getSaveButtonWidget().setVisible(editable);
requiredFieldsNoteLabel.setVisible(editable);
initDetailsTable();
clearError();
}
示例10: AddTopicDialog
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new AddTopicDialog.
*/
public AddTopicDialog(String endpointGroupId, List<TopicDto> topics) {
super(false, true);
this.endpointGroupId = endpointGroupId;
setWidth("500px");
setTitle(Utils.constants.addTopicToEp());
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
errorPanel = new AlertPanel(AlertPanel.Type.ERROR);
errorPanel.setVisible(false);
dialogContents.add(errorPanel);
FlexTable table = new FlexTable();
table.setCellSpacing(6);
Widget label = new Label(Utils.constants.selectNotificationTopics());
label.addStyleName(Utils.avroUiStyle.requiredField());
topic = new TopicListBox();
topic.setWidth("200px");
topic.setAcceptableValues(topics);
topic.addValueChangeHandler(this);
table.setWidget(0, 0, label);
table.setWidget(0, 1, topic);
table.getCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
dialogContents.add(table);
addButton = new Button(Utils.constants.add(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
performAdd();
}
});
Button closeButton = new Button(Utils.constants.close(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
}
});
addButton(addButton);
addButton(closeButton);
addButton.setEnabled(false);
}
示例11: ChangePasswordDialog
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
/**
* Instantiates a new ChangePasswordDialog.
*/
public ChangePasswordDialog(final Listener listener, String username, String message) {
super(false, true);
this.username = username;
setWidth("500px");
setTitle(Utils.constants.changePassword());
VerticalPanel dialogContents = new VerticalPanel();
dialogContents.setSpacing(4);
setWidget(dialogContents);
errorPanel = new AlertPanel(AlertPanel.Type.ERROR);
errorPanel.setVisible(false);
dialogContents.add(errorPanel);
if (message != null) {
AlertPanel warningPanel = new AlertPanel(AlertPanel.Type.WARNING);
warningPanel.setMessage(message);
dialogContents.add(warningPanel);
}
FlexTable table = new FlexTable();
table.setCellSpacing(6);
int row = 0;
Widget label = new Label(Utils.constants.oldPassword());
label.addStyleName(REQUIRED);
oldPassword = new ExtendedPasswordTextBox();
table.setWidget(row, 0, label);
table.setWidget(row, 1, oldPassword);
InputChangeHandler handler = new InputChangeHandler(listener);
oldPassword.addInputHandler(handler);
oldPassword.addKeyDownHandler(handler);
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
row++;
label = new Label(Utils.constants.newPassword());
label.addStyleName(REQUIRED);
newPassword = new ExtendedPasswordTextBox();
table.setWidget(row, 0, label);
table.setWidget(row, 1, newPassword);
newPassword.addInputHandler(handler);
newPassword.addKeyDownHandler(handler);
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
row++;
label = new Label(Utils.constants.newPasswordAgain());
label.addStyleName(REQUIRED);
newPasswordAgain = new ExtendedPasswordTextBox();
table.setWidget(row, 0, label);
table.setWidget(row, 1, newPasswordAgain);
newPasswordAgain.addInputHandler(handler);
newPasswordAgain.addKeyDownHandler(handler);
table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
dialogContents.add(table);
changePasswordButton = new Button(Utils.constants.changePassword(), handler);
Button cancelButton = new Button(Utils.constants.cancel(), new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
hide();
listener.onCancel();
}
});
addButton(changePasswordButton);
addButton(cancelButton);
changePasswordButton.setEnabled(false);
}
示例12: handleNetworkConnectionError
import org.kaaproject.avro.ui.gwt.client.widget.AlertPanel; //导入依赖的package包/类
public static void handleNetworkConnectionError() {
MessageDialog.showMessageDialog(AlertPanel.Type.ERROR, constants.serverIsUnreachable(),
messages.serverIsUnreacheableMessage());
}