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.edgenius.wiki.gwt.client.widgets.Popup.java

License:Open Source License

public Popup(UIObject target, boolean moveOutAutoHide, boolean singletonShowup, boolean hasBackground) {
    super(true);/*from   ww w  . j  av  a  2  s .c  om*/
    this.target = target;
    this.singletonShowup = singletonShowup;
    if (hasBackground) {
        this.background = new PopupPanel();
        topc = new FlowPanel();
        centrec = new FlowPanel();
        bottomc = new FlowPanel();
        centre = new FlowPanel();

        FlowPanel topl = new FlowPanel();
        topl.setStyleName("xstl");
        topc.setStyleName("xstc");
        FlowPanel topr = new FlowPanel();
        topr.setStyleName("xstr");
        FlowPanel top = new FlowPanel();
        top.setStyleName("xst");
        top.add(topl);
        top.add(topc);
        top.add(topr);

        FlowPanel centrel = new FlowPanel();
        centrel.setStyleName("xscl");
        centrec.setStyleName("xscc");
        FlowPanel centrer = new FlowPanel();
        centrer.setStyleName("xscr");
        centre.setStyleName("xsc");
        centre.add(centrel);
        centre.add(centrec);
        centre.add(centrer);

        FlowPanel bottoml = new FlowPanel();
        bottoml.setStyleName("xsbl");
        bottomc.setStyleName("xsbc");
        FlowPanel bottomr = new FlowPanel();
        bottomr.setStyleName("xsbr");
        FlowPanel bottom = new FlowPanel();
        bottom.setStyleName("xsb");
        bottom.add(bottoml);
        bottom.add(bottomc);
        bottom.add(bottomr);

        FlowPanel shadowPanel = new FlowPanel();
        shadowPanel.add(top);
        shadowPanel.add(centre);
        shadowPanel.add(bottom);

        background.setStyleName("x-shadow");
        background.add(shadowPanel);
    }
    this.setStyleName(Css.POPUP);
    this.addCloseHandler(this);

    if (moveOutAutoHide) {
        if (target instanceof HasMouseOutHandlers && target instanceof HasMouseOverHandlers) {
            sinkEvents(Event.ONMOUSEOUT);
            sinkEvents(Event.ONMOUSEOVER);
            this.addMouseOverHandler(this);
            this.addMouseOutHandler(this);
            ((HasMouseOutHandlers) target).addMouseOutHandler(this);
            ((HasMouseOverHandlers) target).addMouseOverHandler(this);
        } else {
            if (Log.isDebugEnabled()) {
                Window.alert("Moveout auto hide target must implement MouseOutHandler and MouseOverHandler");
                Log.error("Moveout auto hide target must implement MouseOutHandler and MouseOverHandler");
            }
        }
    }
}

From source file:com.eduworks.gwt.client.ui.handler.DragDropHandler.java

License:Apache License

public void handleError(File file, Throwable t) {
    String errorDesc = t.getMessage();
    Window.alert("File loading error for file: " + file.getName() + "\n" + errorDesc);
}

From source file:com.eduworks.russel.ds.client.handler.ESBSearchHandler.java

License:Apache License

/**
 * buildTile0 Initiates a tile in the Alfresco results panel.
 * @param searchTermPacket ESBPacket Alfresco search results
 * @param index int Index in the search results for the tile to be created
 * @param objPanel String Name of target panel for the tile
 * @param td Element Container for the tile
 *//* ww w .  jav  a2 s .  c  om*/
protected void buildTile0(Record r, int index, int screenPosition, String objPanel, Element td) {
    FileRecord fr = (FileRecord) r;
    Vector<String> iDs = null;

    if ((td != null) && (searchType.equals(RECENT_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x", new HTML(templates.getObjectPanelWidget().getText()),
                false);
    else if (searchType.equals(COLLECTION_TYPE) || searchType.equals(FLR_TYPE)
            || searchType.equals(SEARCH_TYPE))
        iDs = PageAssembler.inject(objPanel, "x", new HTML(templates.getSearchPanelWidget().getText()), false);
    else if (searchType.equals(PROJECT_TYPE))
        iDs = PageAssembler.inject(objPanel, "x",
                new HTML(templates.getEPSSProjectObjectPanelWidget().getText()), false);
    else if ((td != null) && (searchType.equals(ASSET_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSAssetObjectPanelWidget().getText()), false);
    else if ((td != null) && (searchType.equals(NOTES_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSNoteAssetObjectWidget().getText()), false);
    else if ((td != null) && (searchType.equals(STRATEGY_TYPE))) {
        Window.alert("handling a strategy search");
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSAssetObjectPanelWidget().getText()), false);
    }
    String idPrefix = iDs.firstElement().substring(0, iDs.firstElement().indexOf("-"));
    tileHandlers.add(new TileHandler(this, idPrefix, searchType, fr));
}

From source file:com.eduworks.russel.ui.client.handler.ESBSearchHandler.java

License:Apache License

/**
 * buildTile0 Initiates a tile in the Alfresco results panel.
 * @param searchTermPacket ESBPacket Alfresco search results
 * @param index int Index in the search results for the tile to be created
 * @param objPanel String Name of target panel for the tile
 * @param td Element Container for the tile
 * @return TileHandler//from  w ww.ja  v a2 s .  c o  m
 */
protected TileHandler buildTile0(final RUSSELFileRecord r, int screenPosition, String objPanel, Element td) {
    Vector<String> iDs = null;

    if ((td != null) && (searchType.equals(RECENT_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x", new HTML(templates.getObjectPanelWidget().getText()),
                false);
    else if (searchType.equals(COLLECTION_TYPE) || searchType.equals(SEARCH_TYPE)
            || searchType.equals(RusselApi.FLR_TYPE))
        iDs = PageAssembler.inject(objPanel, "x", new HTML(templates.getSearchPanelWidget().getText()), false);
    else if (searchType.equals(PROJECT_TYPE))
        iDs = PageAssembler.inject(objPanel, "x",
                new HTML(templates.getEPSSProjectObjectPanelWidget().getText()), false);
    else if ((td != null) && (searchType.equals(ASSET_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSAssetObjectPanelWidget().getText()), false);
    else if ((td != null) && (searchType.equals(NOTES_TYPE)))
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSNoteAssetObjectWidget().getText()), false);
    else if ((td != null) && (searchType.equals(STRATEGY_TYPE))) {
        Window.alert("handling a strategy search");
        iDs = PageAssembler.inject(td.getId(), "x",
                new HTML(templates.getEPSSAssetObjectPanelWidget().getText()), false);
    }
    String idPrefix = iDs.firstElement().substring(0, iDs.firstElement().indexOf("-"));
    TileHandler th = new TileHandler(this, idPrefix, searchType, r);
    tileHandlers.add(th);
    return th;
}

From source file:com.eduworks.russel.ui.client.pagebuilder.screen.EPSSEditScreen.java

License:Apache License

/**
 * display Renders the EPSS Edit screen using appropriate templates and assigns handlers
 *///w  w w . j a  v a  2s.  c o m
@Override
public void display() {
    PageAssembler.ready(new HTML(templates().getEPSSEdit().getText()));
    PageAssembler.buildContents();
    populateTemplate();
    assetSearchHandler = new ESBSearchHandler();

    assetSearchHandler.hook("r-projectAssetSearch", "epssAssetPanel", ESBSearchHandler.ASSET_TYPE);

    PageAssembler.attachHandler("epssExportButton", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            RootPanel.get("epssDownloadArea").clear();
        }
    });

    PageAssembler.attachHandler("epssUpdate", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            saveProject0();
        }
    });

    PageAssembler.attachHandler("epssCancel", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            dispatcher().loadFeatureScreen(FeatureScreen.PROJECTS_TYPE);
        }
    });

    PageAssembler.attachHandler("epssSaveProperties", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            saveProject0();
            PageAssembler.closePopup("projectProperties");
        }
    });

    PageAssembler.attachHandler("epssCancelProperties", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            fillPropData0();
            PageAssembler.closePopup("projectProperties");
        }
    });

    PageAssembler.attachHandler("epssCloseProperties", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            fillPropData0();
            PageAssembler.closePopup("projectProperties");
        }
    });

    PageAssembler.attachHandler("epssSaveAs", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Window.alert(Constants.INCOMPLETE_FEATURE_MESSAGE);
        }
    });

    for (int sectionIndex = 1; sectionIndex <= pfmNow.projectSections.size(); sectionIndex++) {
        final int lockedSectionIndex = sectionIndex;
        PageAssembler.attachHandler("section" + lockedSectionIndex, Event.ONCLICK, new EventCallback() {
            @Override
            public void onEvent(Event event) {
                fillSectionNotes0("section" + lockedSectionIndex, lockedSectionIndex - 1);
            }
        });
    }

    PageAssembler.attachHandler("epssExportSCORM", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            saveProject0();
            EPSSPackBuilder epb = new EPSSPackBuilder(pfmNow);
            FormPanel fp = ((FormPanel) PageAssembler.elementToWidget("epssExportSCORMForm",
                    PageAssembler.FORM));
            fp.setAction(RusselApi.getESBActionURL("exportToZip"));
            fp.setMethod(CommunicationHub.POST);
            fp.setEncoding(FormPanel.ENCODING_MULTIPART);
            ESBPacket postData = epb.buildPackIE();
            postData.put("sessionId", RusselApi.sessionId);
            ((Hidden) PageAssembler.elementToWidget("epssExportSCORMPayload", PageAssembler.HIDDEN))
                    .setValue(postData.toString());
            fp.addSubmitHandler(new SubmitHandler() {
                @Override
                public void onSubmit(SubmitEvent event) {
                    StatusWindowHandler.createMessage(
                            StatusWindowHandler
                                    .getZipExportMessageDone(pfmNow.projectTitle.replaceAll(" ", "_") + ".zip"),
                            StatusRecord.ALERT_SUCCESS);
                    RootPanel.get("epssDownloadArea").clear();
                    PageAssembler.closePopup("exportProjectModal");
                }
            });
            fp.submit();
            RootPanel.get("epssDownloadArea").add(new Image("images/orbit/loading.gif"));
        }
    });

    PageAssembler.attachHandler("epssActiveAddAsset", Event.ONCHANGE, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            addAssetTrigger();
        }
    });

    PageAssembler.attachHandler("epssActiveRemoveAsset", Event.ONCHANGE, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            removeAssetTrigger();
        }
    });

    fillData0();
}

From source file:com.eduworks.russel.ui.client.pagebuilder.screen.HomeScreen.java

License:Apache License

/**
 * display Renders the RUSSEL home screen using appropriate templates and sets up handlers
 *//*  ww w . j  a  v  a 2  s  .  c  o m*/
public void display() {
    ((Label) PageAssembler.elementToWidget("r-menuUserName", PageAssembler.LABEL)).setText(RusselApi.username);

    PageAssembler.ready(new HTML(Russel.htmlTemplates.getMenuBar().getText()));
    PageAssembler.ready(new HTML(Russel.htmlTemplates.getObjectPanel().getText()));
    PageAssembler.buildContents();
    PageAssembler.inject("flowContainer", "x", new HTML(Russel.htmlTemplates.getDetailModal().getText()), true);
    PageAssembler.inject("objDetailPanelWidget", "x", new HTML(Russel.htmlTemplates.getDetailPanel().getText()),
            true);

    DOM.getElementById("r-menuWorkspace").getParentElement().addClassName("active");
    DOM.getElementById("r-menuCollections").getParentElement().removeClassName("active");
    DOM.getElementById("r-menuProjects").getParentElement().removeClassName("active");

    PageAssembler.attachHandler("r-uploadContentTile", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new EditScreen(), true);
        }
    });

    PageAssembler.attachHandler("r-projectsTile", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.PROJECTS_TYPE), true);
        }
    });

    PageAssembler.attachHandler("r-menuProjects", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.PROJECTS_TYPE), true);
        }
    });

    PageAssembler.attachHandler("r-menuCollections", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.COLLECTIONS_TYPE), true);
        }
    });

    PageAssembler.attachHandler("r-collectionsTile", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new FeatureScreen(FeatureScreen.COLLECTIONS_TYPE), true);
        }
    });

    PageAssembler.attachHandler("r-manageUsersTile", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new UserScreen(), true);
        }
    });

    PageAssembler.attachHandler("r-groupTile", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new GroupScreen(), true);
        }
    });

    PageAssembler.attachHandler("r-menuHelp", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            String help = PageAssembler.getHelp();
            if (help != null && help != "")
                Window.open(PageAssembler.getHelp(), "_blank", null);
            else
                Window.alert("Help has not been configured for this installation of RUSSEL.");
        }
    });

    ((TextBox) PageAssembler.elementToWidget("r-menuSearchBar", PageAssembler.TEXT)).setFocus(true);

    ash.hookAndClear("r-menuSearchBar", "searchObjectPanelScroll", SearchHandler.TYPE_RECENT);
    Date currentDate = new Date();
    Date pastDate = new Date();
    pastDate.setDate(pastDate.getDate() - 10);
    ash.query(RUSSELFileRecord.UPDATED_DATE + ":[" + pastDate.getTime() + " TO " + currentDate.getTime() + "]");

    PageAssembler.attachHandler("r-menuSearchBar", Event.ONKEYUP, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new SearchScreen(SearchHandler.TYPE_SEARCH), true);
        }
    });

    PageAssembler.attachHandler("r-objectEditSelected", Event.ONCLICK, new EventCallback() {
        @Override
        public void onEvent(Event event) {
            Russel.screen.loadScreen(new EditScreen(ash.getSelected()), true);
        }
    });
}

From source file:com.emitrom.flash4j.spas.client.core.runtime.SpasEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    if (Flash.isInstalled()) {
        Spas.init(new StartHandler() {
            @Override//from   w w  w  .j a  v  a 2  s .  c o m
            public void onStart() {
                onLoad();
            }
        });
    } else if (!Flash.isInstalled()) {
        Window.alert(Flash.FLASH_NOT_INSTALLED);
    }

}

From source file:com.emitrom.flash4j.starling.client.core.runtime.StarlingEntryPoint.java

License:Apache License

@Override
public void onModuleLoad() {
    if (Flash.isInstalled() && Flash.isMinorAtLeast(StarlingPlatform.MINOR_REQUIRED_FLASH_VERSION)) {
        StarlingPlatform.init(new StartHandler() {
            @Override//  w w w.j  a v  a 2  s.c  o m
            public void onStart() {
                Starling.start();
                onLoad();
            }
        });
    } else if (Flash.isInstalled() && !Flash.isMinorAtLeast(StarlingPlatform.MINOR_REQUIRED_FLASH_VERSION)) {
        Window.alert(StarlingPlatform.FLASH_INSTALLED_BUT_WRONG_VERSION);
    } else if (!Flash.isInstalled()) {
        Window.alert(Flash.FLASH_NOT_INSTALLED);
    }
}

From source file:com.emitrom.pilot.core.formfactor.client.ResourceInjector.java

License:Apache License

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

        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.emp.client.application.add.HomePagePresenter.java

License:Apache License

@Override
protected void onBind() {
    super.onBind();
    //adding the clickhandler for the add  button
    getView().getButton().addClickHandler(new ClickHandler() {

        @Override/*from  w  ww  .  j  a  va 2s . c om*/
        public void onClick(ClickEvent event) {

            //call the Employee constructor to set the values into the Employee object
            Employee emp = new Employee(Integer.parseInt(getView().getEmpIdTextBox().getText()),
                    getView().getEmpNameTextBox().getText(),
                    Integer.parseInt(getView().getEmpAgeTextBox().getText()),
                    Long.parseLong(getView().getEmpPhoneTextBox().getText()),
                    getView().getEmpAddressTextBox().getText());
            Window.alert("employee details added to the list");
            //add the employee object into the list
            empdb.addEmpData(emp);
            Window.alert("the no. of employees are" + empdb.getEmployeeCount());

        }
    });

}