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.dimad.gwt.control.text.FontRichTextToolbar.java

License:Apache License

/**
 * Creates a new toolbar that drives the given rich text area.
 * //from   w  w  w  .j  ava2  s . c o m
 * @param richText
 *            the rich text area to be controlled
 */
public FontRichTextToolbar(RichTextArea richText) {
    try {
        this.richText = richText;
        this.extended = richText.getExtendedFormatter();

        outer.add(topPanel);
        topPanel.setWidth("100%");

        initWidget(outer);
        setStyleName("gwt-RichTextToolbar");
        richText.addStyleName("hasRichTextToolbar");

        topPanel.add(fonts = createFontList());
        topPanel.add(fontSizes = createFontSizes());

        topPanel.add(bold = createToggleButton(images.bold(), strings.bold()));
        topPanel.add(italic = createToggleButton(images.italic(), strings.italic()));
        topPanel.add(underline = createToggleButton(images.underline(), strings.underline()));
        topPanel.add(strikethrough = createToggleButton(images.strikeThrough(), strings.strikeThrough()));

        topPanel.add(foreColors = createColorList("Foreground"));

        // We only use these handlers for updating status, so don't hook them up
        // unless at least basic editing is supported.
        richText.addKeyUpHandler(handler);
        richText.addClickHandler(handler);
    } catch (Exception e) {
        Window.alert("FontRichTextToolbar: ex=" + e);
    }
}

From source file:com.dimad.gwt.control.text.FontRichTextToolbar.java

License:Apache License

public void initialize(Map<String, String> defaultValues) {
    try {/*from w  w w.  ja v  a 2  s  .  c  o  m*/
        fonts.setValue(defaultValues.get(IRichTextEventListener.FONT_NAME));
        extended.setFontName(fonts.getValue().toString());
        fontSizes.setValue(defaultValues.get(IRichTextEventListener.FONT_SIZE));
        extended.setFontSize(fontSizesConstants[fontSizes.getSelectedIndex()]);
        fontStyle = new LinkedList<String>(
                Arrays.asList(defaultValues.get(IRichTextEventListener.FONT_STYLE).toLowerCase().split(";")));
        bold.setDown(defaultValues.get(IRichTextEventListener.FONT_STYLE).toLowerCase()
                .contains(IRichTextEventListener.FONT_STYLE_BOLD));
        italic.setDown(defaultValues.get(IRichTextEventListener.FONT_STYLE).toLowerCase()
                .contains(IRichTextEventListener.FONT_STYLE_ITALIC));
        underline.setDown(defaultValues.get(IRichTextEventListener.FONT_STYLE).toLowerCase()
                .contains(IRichTextEventListener.FONT_STYLE_UNDERLINE));
        strikethrough.setDown(defaultValues.get(IRichTextEventListener.FONT_STYLE).toLowerCase()
                .contains(IRichTextEventListener.FONT_STYLE_STRIKETHROUGH));
        foreColors.setValue(defaultValues.get(IRichTextEventListener.FOREGROUND_COLOR));
        extended.setForeColor(foreColors.getValue(foreColors.getSelectedIndex()));
    } catch (Exception e) {
        Window.alert("FontRichTextToolbar.initialize: ex=" + e);
    }
}

From source file:com.dimad.map.executor.client.Main.java

License:Apache License

public Main() {
    super();//from   ww  w .  j a  v a  2s  . c  o m
    try {
        constants = GWT.create(MainConstants.class);
        loginService = GWT.create(ILoginService.class);
        GWT.log("Gwt sanatel started");
    } catch (Throwable e) {
        GWT.log("Could not start application", e);
        Window.alert(e.getMessage());
    }
}

From source file:com.dimad.map.executor.client.Main.java

License:Apache License

@Override
public void onModuleLoad() {
    try {//www . ja  v a2  s . com
        GWT.log("Loading module ...");
        mainPanel = new MainPanel(this).buildPanel();

        Window.enableScrolling(true);
        Window.setMargin("0px");
        Window.setTitle(constants.applicationTitle());

        RootPanel.get().add(mainPanel);

        redraw();
        //disable();
        GWT.log("Module loaded");
    } catch (Throwable e) {
        GWT.log("Could not start application", e);
        Window.alert(e.getMessage());
    }
}

From source file:com.dimad.map.executor.client.Main.java

License:Apache License

@Override
public void invertState() {
    try {//from   ww w . j  av  a2 s  . c  o m
        DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "wait");
        for (String key : elements.keySet()) {
            UIObject uiObject = elements.get(key);
            if (uiObject != null && uiObject instanceof IRedraw) {
                ((IRedraw) uiObject).invertState();
            }
        }
        DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "default");
    } catch (Exception e) {
        Window.alert("Main.redraw " + e.getMessage());
    }
}

From source file:com.dimad.map.executor.client.Main.java

License:Apache License

@Override
public void redraw() {
    try {// w  w  w.j  a v  a  2  s  . com
        DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "wait");
        for (String key : elements.keySet()) {
            UIObject uiObject = elements.get(key);
            if (uiObject != null && uiObject instanceof IRedraw) {
                ((IRedraw) uiObject).redraw();
            }
        }
        DOM.setStyleAttribute(RootPanel.get().getElement(), "cursor", "default");
    } catch (Exception e) {
        Window.alert("Main.redraw " + e.getMessage());
    }
}

From source file:com.dimdim.conference.ui.common.client.list.ListPanel.java

License:Open Source License

protected void showPageSection(VerticalPanel sectionPanel, int start, int num, boolean hideAllFirst) {
    //      Window.alert("Showing page:"+start+"-"+num);
    /*/*from w  w w. ja  va  2  s .  c  om*/
    if (hideAllFirst)
    {
       for (int i=0; i<size; i++)
       {
    Widget w = sectionPanel.getWidget(i);
    //            Window.alert("Showing widget:"+w);
    w.removeStyleName("list-entry-panel-gap");
    w.setVisible(false);
       }
    }
    */
    //   First remove the entries from the scrollable section.
    int size = sectionPanel.getWidgetCount();
    //      Window.alert("Number of visible panels -- "+size);
    for (int i = size - 1; i >= 0; i--) {
        try {
            sectionPanel.remove(i);
        } catch (Exception e) {
            Window.alert(e.getMessage());
        }
    }

    //   Now add the panels from the panels vector into the display panel
    //   Here i<size
    //      int maxScrollable = this.getNumberOfScrollableEntries();
    size = this.scrollablePanels.size();
    for (int i = 0; i < size; i++) {
        //         Window.alert("Panel -- "+i);
        ListEntryPanel lep = (ListEntryPanel) this.scrollablePanels.elementAt(i);
        if (i < start) {
            //            Window.alert("Setting panel non visible");
            lep.setPanelVisible(false);
        } else if (i < start + num) {
            //            Window.alert("Settng panel visible");
            lep.setPanelVisible(true);
            this.scrollableEntriesPanel.add(lep);
            this.scrollableEntriesPanel.setCellWidth(lep, "100%");
        } else {
            //            Window.alert("Setting panel non visible");
            lep.setPanelVisible(false);
        }
    }
    /*
    for (int i=start; i<start+maxScrollable && i<start+num && i<size; i++)
    {
       ListEntryPanel lep = (ListEntryPanel)this.scrollablePanels.elementAt(i);
    //         Window.alert("Showing widget:"+w);
    //         w.addStyleName("list-entry-panel-gap");
       this.scrollableEntriesPanel.add(lep);
       this.scrollableEntriesPanel.setCellWidth(lep,"100%");
    }
    */
}

From source file:com.dimdim.conference.ui.envcheck.client.command.DmFlashMovie.java

License:Open Source License

/**
 * //w w w  .j a  va 2 s. c o m
   // <![CDATA[
   var so = new SWFObject(movieUrl, id2, height, width, version, color);
   so.write(elementId);
   // ]]>
 *
 */
public void show() {
    //      Element elem = DOM.getElementById(id);
    try {
        // modifing to support flash 9 and above...
        this.startMovie(m_contentDiv, swfUrl, name, height, width, "6", color);
    } catch (Exception e) {
        Window.alert(e.getMessage());
    }
}

From source file:com.dimdim.conference.ui.envcheck.client.main.EnvChecksSummaryPanel.java

License:Open Source License

private void prepareCheckResultPanel(HorizontalPanel row, PNGImage okImage, PNGImage errorImage,
        Label commentLabel, String comment) {
    row.add(okImage);/*  www.  ja v  a 2s  . c  o  m*/
    row.setCellHorizontalAlignment(okImage, HorizontalPanel.ALIGN_LEFT);
    row.setCellVerticalAlignment(okImage, VerticalPanel.ALIGN_MIDDLE);

    row.add(errorImage);
    row.setCellHorizontalAlignment(errorImage, HorizontalPanel.ALIGN_LEFT);
    row.setCellVerticalAlignment(errorImage, VerticalPanel.ALIGN_MIDDLE);

    commentLabel.setText(comment);
    commentLabel.setStyleName("common-text");
    commentLabel.addStyleName("env-check-result-comment");
    row.add(commentLabel);
    row.setCellWidth(commentLabel, "100%");
    row.setCellHorizontalAlignment(commentLabel, HorizontalPanel.ALIGN_LEFT);
    row.setCellVerticalAlignment(commentLabel, VerticalPanel.ALIGN_MIDDLE);
    Window.alert("commentLabel = " + commentLabel);
    this.basePanel.add(row);
    row.setStyleName("env-check-result-row");
    row.setVisible(false);
}

From source file:com.dimdim.conference.ui.layout.client.main.NewLayout.java

License:Open Source License

protected void loadConsole() {
    DebugPanel.getDebugPanel().addDebugMessage("Initializing Console");
    //   Now once the environment i initialized the client model can be
    //   created which depends on it.

    //      String getEventsURL = ConferenceGlobals.webappRoot+
    //         "GetEvents.action?sessionKey="+ConferenceGlobals.sessionKey;
    String getEventsURL = ConferenceGlobals.webappRoot + "GetEvents.action?sessionKey="
            + ConferenceGlobals.sessionKey;
    String serverPingURL = ConferenceGlobals.webappRoot + "PingServer.action";
    ClientModel.createClientModel();//from  www.  j  a va 2  s  .  c om
    DebugPanel.getDebugPanel().addDebugMessage("Client model creation complete");

    Window.setMargin("0px");

    try {
        UIRosterEntry currentUser = ClientModel.getClientModel().getRosterModel().getCurrentUser();
        fullPanel = new ConsoleFullPanel(this, currentUser);
        //RootPanel.get("MainConsole").remove(this.lmm);
        //RootPanel.get("MainConsole").add(fullPanel);

        //RootPanel.get("MainConsole").add(fullPanel.getTopPanel())
        //this.meetingAssistent = new MeetingAssistentDialog(this.workspaceClickListener);
    } catch (Exception e) {
        Window.alert(e.getMessage());
    }
    DebugPanel.getDebugPanel().addDebugMessage("Fetching initial data");
    ClientModel.getClientModel().getClientStateModel().addListener(this.fullPanel.getMiddlePanel());
    ClientModel.getClientModel().getRosterModel()
            .addListener(this.fullPanel.getMiddlePanel().getRosterModelListener());

    UIParams uiParams = UIParams.getUIParams();
    EventsJsonHandler eventsHandler = EventsJsonHandler.getHandler();
    eventsHandler.setEventsTracker(DebugPanel.getDebugPanel());
    gerth = new GetEventResponseTextHandler(eventsHandler, uiParams.getRegularEventPollIntervalMillis(),
            uiParams.getMaxEventPollErrors());
    gerth.setServerPingURL(serverPingURL);
    eventsReadingTimer = new JSONurlReadingTimer(getEventsURL, getConfKey(),
            uiParams.getInitialEventPollDelayMillis(), gerth);
    gerth.setServerStatusListener(this.eventsReadingTimer);
    eventsReadingTimer.start();

    Window.addWindowResizeListener(this);
    DeferredCommand.add(new Command() {
        public void execute() {
            onWindowResized(Window.getClientWidth(), Window.getClientHeight());
            continueLoading();
        }
    });

    ClientModel.getClientModel().getRosterModel().reportConsoleLoaded();

    //      ConsoleDataReader dataReader = new ConsoleDataReader(this);
    //      dataReader.readConsoleData();
    DebugPanel.getDebugPanel().addDebugMessage("Console initialization complete.");
    showConsole();

    //      linking meeting assistant dialog listener
    meetingAssistent = new MeetingAssistentDialog(fullPanel.getMiddlePanel().getLeftPanel());
    fullPanel.getTopPanel().getLinksPanel().getAssistantLabel().addClickListener(this);
}