Example usage for com.google.gwt.user.client Window alert

List of usage examples for com.google.gwt.user.client Window alert

Introduction

In this page you can find the example usage for com.google.gwt.user.client Window alert.

Prototype

public static void alert(String msg) 

Source Link

Usage

From source file:com.agnie.gwt.common.client.widget.SuggestionBox.java

License:Open Source License

public SuggestionBox() {
    container = (HTMLPanel) uiBinder.createAndBindUi(this);
    initWidget(container);//from   w ww.java2s . co  m
    list.setVisible(false);

    Label label = new Label(I18.messages.noData());
    list.setEmptyListWidget(label);

    dp.addDataDisplay(list);

    search.addKeyPressHandler(new KeyPressHandler() {

        @Override
        public void onKeyPress(KeyPressEvent event) {
            list.setVisible(true);
        }
    });

    list.setKeyboardSelectionPolicy(KeyboardSelectionPolicy.ENABLED);

    // Add a selection model to handle user selection.
    final SingleSelectionModel<String> selectionModel = new SingleSelectionModel<String>();
    list.setSelectionModel(selectionModel);
    selectionModel.addSelectionChangeHandler(new SelectionChangeEvent.Handler() {
        public void onSelectionChange(SelectionChangeEvent event) {
            String selected = selectionModel.getSelectedObject();
            if (selected != null) {
                Window.alert("You selected: " + selected);
            }
        }
    });

}

From source file:com.agnie.useradmin.landing.client.presenter.LandingPresenter.java

License:Open Source License

@Override
public boolean go() {
    super.go();/*from  w w  w  .  j ava 2  s.co  m*/
    RootPanel contentPanel = clientFactory.getRootPanelFactory().getContentPanel();
    contentPanel.clear();
    // Menu is getting added here
    Menu menu = viewFactory.getMenu();
    ListMenu listMenu = viewFactory.getListMenu();
    if (checkPermission(Permissions.CREATE_APPLICATION)) {
        listMenu.getTabbarPan().add(menu);
    }

    // BreadCrumbPanel getting populated here
    BreadCrumbPanel breadCrumbPanel = viewFactory.getBreadCrumbPanel();
    breadCrumbPanel.clear();
    breadCrumbPanel.addBreadCrumb(I18.messages.userHome());

    Image help = viewFactory.getHelpImage();
    HTMLPanel helpBreadCrumbPanel = viewFactory.getHelpBreadCrumbPanel();
    helpBreadCrumbPanel.clear();
    helpBreadCrumbPanel.add(breadCrumbPanel);
    helpBreadCrumbPanel.add(help);

    HTMLPanel centerPanel = viewFactory.getCenterContentPanel();
    centerPanel.clear();
    centerPanel.add(listMenu);
    messagePanel.addStyleName("message-pan-landing");
    centerPanel.add(messagePanel);
    centerPanel.add(helpBreadCrumbPanel);
    final LandingView view = viewFactory.getLandingView();
    view.clearLandingView();
    centerPanel.add(view);
    contentPanel.add(centerPanel);

    ApplicationManagerRequest amr = clientFactory.getRequestFactory().applicationManager();
    amr.getRegisteredApps().fire(new Receiver<List<ApplicationPx>>() {

        @Override
        public void onSuccess(List<ApplicationPx> response) {
            if (response != null && response.size() > 0) {
                view.setAppList(response);
            }
        }

        @Override
        public void onFailure(ServerFailure error) {
            Window.alert("There is some error in GettingRegApp" + error.getExceptionType());
        }
    });
    return true;
}

From source file:com.agnie.useradmin.landing.client.presenter.shared.ui.ListMenu.java

License:Open Source License

public ListMenu() {
    initWidget(uiBinder.createAndBindUi(this));
    searchPan.add(searchBox);// w w w  .  ja  v  a 2s  .com
    searchBox.addSearchImgClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            Window.alert("do you searching for " + searchBox.getValue());
        }
    });
}

From source file:com.agnie.useradmin.landing.client.ui.ApplicationWidget.java

License:Open Source License

/**
 * ToSetAppWidget commands on rightClickMenu
 * //w ww  . j a  v a2 s .co m
 * @param domainI
 * @param domUrlI
 * @param isAdmin
 */
private void setAppWidgetCommands(final String domainI, final String domUrlI, boolean isAdmin) {
    /* ContextMenu related code starts here */
    this.contextMenu.hide();
    this.contextMenu.setAutoHideEnabled(true);
    addDomHandler(this, ContextMenuEvent.getType());

    Command open = new Command() {

        @Override
        public void execute() {
            hideMenuPan();
            if (domUrlI != null) {

                Window.open(uaurlGenerator.getApplicationUrl(domUrlI, params), "_blank", null);
            } else {
                Window.alert("Sorry opening application is failed");
            }
        }
    };
    openItem = new MenuItem("Open", true, open);
    popupMenuBar1To3.addItem(openItem);

    Command manage = new Command() {

        @Override
        public void execute() {
            hideMenuPan();
            GWT.log("In appWidget manage");
            if (domainI != null) {
                Window.open(uaurlGenerator.getAppManageUrl(domainI, params), "_blank", null);
            }
        }
    };
    manageItem = new MenuItem("Manage ", true, manage);
    if (isAdmin) {
        popupMenuBar1To3.addItem(manageItem);
    }

    popupMenuBar1To3.setVisible(true);
    contextMenu.container.add(popupMenuBar1To3);

}

From source file:com.agnie.useradmin.login.client.Login.java

License:Open Source License

@Override
public void onModuleLoad() {
    clearAppLoader();//from w w w.  ja v a2s .c o  m
    final String domain = LoginQSProcessor.getDomain();
    if (domain != null && !domain.isEmpty()) {
        AuthenticateServiceAsync authService = platformFactory.getInjector().getClientFactory()
                .getAuthenticateService();
        authService.getApplicationDetails(domain, new AsyncCallback<Application>() {

            @Override
            public void onSuccess(Application result) {
                if (result != null) {
                    ApplicationProvider appProvider = platformFactory.getInjector().getApplicationProvider();
                    platformFactory.getInjector().getCommonViewFactory().getHeaderView()
                            .setHeaderImg(result.getIconURL());
                    appProvider.set(result);
                    loadApplications();
                } else {
                    Window.alert("Invalid domain '" + domain + "'");
                }

            }

            @Override
            public void onFailure(Throwable caught) {
                // TODO Auto-generated method stub

            }
        });

    } else {
        // If domain is not specified then default domain will be used hence there won't be any issues.
        loadApplications();
    }
}

From source file:com.agnie.useradmin.login.client.ui.DeskLoginView.java

License:Open Source License

@Override
public void initLabels() {
    Application app = applicationProvider.get();
    if (app == null) {
        Window.alert("There is something wrong");
    }//w w  w .  j  av  a 2s  .  com
    // if (app.getDetailsURL() != null && !app.getDetailsURL().isEmpty()) {
    // appInfoFrame.setUrl(app.getDetailsURL());
    // }
    loginmsg.setInnerText(messages.loginmsg(app.getDomain()));
}

From source file:com.ait.lienzo.ks.client.views.components.RectangleClickViewComponent.java

License:Open Source License

public RectangleClickViewComponent() {
    final Layer layer = new Layer();

    int newXPosition = 0, positionX = 10;

    int newYPosition = 0, positionY = 10;

    int c = 0;//ww  w.  ja va  2  s  . co  m

    for (int i = 1; i <= 50; i++) {
        for (int j = 1; j <= 50; j++) {
            final Rectangle rectangle = new Rectangle(12.5, 12.5);

            rectangle.setX(positionX + newXPosition).setY(positionY + newYPosition);

            final String bgcolor = Color.getRandomHexColor();

            c++;

            rectangle.setFillColor(bgcolor);

            try {
                layer.add(rectangle);
            } catch (Exception e) {
                Window.alert("OOPS " + c + " " + e.getMessage());

                return;
            }
            rectangle.addNodeMouseClickHandler(new NodeMouseClickHandler() {
                @Override
                public void onNodeMouseClick(NodeMouseClickEvent event) {
                    getLienzoPanel().setBackgroundColor(bgcolor);
                }
            });
            newXPosition += 15;
        }
        newYPosition += 15;

        newXPosition = 0;
    }
    getLienzoPanel().setBackgroundColor(ColorName.WHITE);

    getLienzoPanel().add(layer);

    getWorkingContainer().add(getLienzoPanel());
}

From source file:com.ait.toolkit.application.client.ResourceInjector.java

License:Open Source License

/**
 * Loads a javascript file base on the file url
 *///from  w w  w.j a v  a2s.  co m
public void inject() {
    if (this.cssUrl != null) {
        loadCss(this.cssUrl);
    }
    if (this.jsUrl != null) {

        scriptElement = ScriptInjector.fromUrl(this.jsUrl).setCallback(new Callback<Void, Exception>() {
            @Override
            public void onSuccess(Void result) {
                if (ResourceInjector.this.callBack != null) {
                    ResourceInjector.this.callBack.onJsLoaded();
                }
            }

            @Override
            public void onFailure(Exception reason) {
                Window.alert(reason.getMessage() + " for link " + jsUrl);
            }
        }).setWindow(ScriptInjector.TOP_WINDOW).inject();

    }
}

From source file:com.ait.toolkit.clientio.canvg.client.CanVg.java

License:Open Source License

public CanVg(String svgContent, String width, String height) {
    surface = Canvas.createIfSupported();
    if (surface == null) {
        Window.alert(unsupportedBrowser);
        return;//from   w w  w  . j  a  va  2s. c  o  m
    }
    this.initWidget(surface);
    elementId = IdGenerator.generateId();
    html = svgContent;
    surface.getElement().setId(elementId);
    surface.setWidth(width);
    surface.setHeight(height);
    this.getElement().getStyle().setPosition(Position.ABSOLUTE);
    this.getElement().getStyle().setLeft(position, Unit.PX);
    this.getElement().getStyle().setRight(position, Unit.PX);
    RootPanel.get().add(this);
    createContent(elementId, html);
    getBase64();
}

From source file:com.ait.toolkit.clientio.client.eventhandling.DefaultClientIOInitHandler.java

License:Open Source License

@Override
public void onInitError() {
    Window.alert("Flash seems to not be installed");
}