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

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

Introduction

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

Prototype

public static boolean confirm(String msg) 

Source Link

Usage

From source file:org.apache.hupa.client.activity.LabelListActivity.java

License:Apache License

private void bindTo(final EventBus eventBus) {
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x2_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x20x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x20x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x3_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f");
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1");
    this.registerHandler(display.getDelete().addClickHandler(new ClickHandler() {
        @Override/*from  ww  w  .  j  a v  a 2s.co m*/
        public void onClick(ClickEvent event) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x3_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x2_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x20x0");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x1");
            if (Window.confirm("Are you sure?")) {
                InstrumentationLoggerProvider.get().instrument(
                        "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x10x00x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x10x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x10x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x00x00x10x10x1208950cc0x30x00x10x00x00x00x0");
                eventBus.fireEvent(new DeleteFolderEvent());
            }
        }
    }));
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x0");
    eventBus.addHandler(DeleteFolderEvent.TYPE, new DeleteFolderEventHandler() {
        @Override
        public void onDeleteFolderEvent(DeleteFolderEvent event) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x3_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x2_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x20x0");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x30x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x10x00x00x1bb16f9ca0x30x00x0");
            deleteSelected();
        }
    });
    InstrumentationLoggerProvider.get().instrument(
            "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x2_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x0");
    eventBus.addHandler(RefreshLabelListEvent.TYPE, new RefreshLabelListEventHandler() {
        @Override
        public void onRefreshEvent(RefreshLabelListEvent event) {
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x1_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x2_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x3_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x20x0");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f");
            InstrumentationLoggerProvider.get().instrument(
                    "org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x30x00x0_____org_apache_hupa_client_activity_LabelListActivity_java0x0c18a6e00da82389f0x30x20x00x00x13314012f0x30x0");
            display.refresh();
        }
    });
}

From source file:org.bonitasoft.console.client.view.CaseListConfigurationEditionPanel.java

License:Open Source License

/**
 * @param aColumn/*  w  w  w.  ja  va  2s . c  o m*/
 * @return
 */
private ListBox buildListBoxColumnSelection(final Integer anIndex) {
    final ListBox theListBox = new ListBox();
    theListBox.addItem("");
    for (Columns theColumn : Columns.values()) {
        theListBox.addItem(LocaleUtil.getColumnTitle(theColumn), theColumn.name());
    }

    theListBox.addChangeHandler(new ChangeHandler() {

        public void onChange(ChangeEvent aEvent) {
            if (theListBox.getSelectedIndex() > -1) {
                final String theColumnName = theListBox.getValue(theListBox.getSelectedIndex());
                try {
                    if ("".equals(theColumnName)) {
                        myNewConfiguration.setColumnIndex(null, anIndex);
                    } else {
                        Columns theColumn = Columns.valueOf(theColumnName);
                        final int theCurrentPosition = myNewConfiguration.getColumnIndex(theColumn);
                        if (theCurrentPosition >= 0) {
                            boolean mustContinue = Window
                                    .confirm(patterns.caseListConfigurationColumnIndexConflictsWith(
                                            String.valueOf(theCurrentPosition + 1)));
                            if (mustContinue) {
                                myNewConfiguration.setColumnIndex(theColumn, anIndex);
                                myColumnIndexSelectors.get(theCurrentPosition).setSelectedIndex(0);
                            } else {
                                theColumn = myNewConfiguration.getColumnAt(anIndex);
                                if (theColumn != null) {
                                    myColumnIndexSelectors.get(anIndex)
                                            .setSelectedIndex(theColumn.ordinal() + 1);
                                } else {
                                    myColumnIndexSelectors.get(anIndex).setSelectedIndex(0);
                                }
                            }
                        } else {
                            myNewConfiguration.setColumnIndex(theColumn, anIndex);
                        }
                    }

                } catch (Exception e) {
                    GWT.log("Unable to update the column index", e);
                }
            }
        }
    });

    return theListBox;
}

From source file:org.cruxframework.crux.core.clientoffline.ApplicationCacheDefaultUIHandlerImpl.java

License:Apache License

@Override
public void confirmReloadPage() {
    if (Window.confirm(messages.requestUpdate())) {
        Screen.reload();
    }
}

From source file:org.datacleaner.monitor.dashboard.widgets.DashboardGroupPanel.java

License:Open Source License

public DashboardGroupPanel(DashboardServiceAsync service, TenantIdentifier tenant, DashboardGroup group,
        boolean isDashboardEditor, boolean displayInfomercial) {
    super();/* ww  w .  java 2s  .  co m*/
    _tenant = tenant;
    _service = service;
    _group = group;
    _isDashboardEditor = isDashboardEditor;
    _dashboardWidgetCount = 0;

    addStyleName("DashboardGroupPanel");

    _removeGroupButton = DCButtons.dangerButton("glyphicon-minus", "Remove this group");
    _removeGroupButton.setVisible(false);
    _removeGroupButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            final boolean confirmation = Window.confirm("Are you sure you wish to remove this group?");
            if (confirmation) {
                _service.removeDashboardGroup(_tenant, _group, new DCAsyncCallback<Boolean>() {
                    @Override
                    public void onSuccess(Boolean result) {
                        if (result != null && result.booleanValue()) {
                            Window.Location.reload();
                        } else {
                            Window.alert("Failed to remove group. Please check server logs for details.");
                        }
                    }
                });
            }
        }
    });

    final Button newTimelineButton;
    if (displayInfomercial && group == null) {
        // this is the "default" group
        add(new HeadingLabel("Welcome"));
        _welcomePanel = new WelcomePanel();
        newTimelineButton = _welcomePanel.getNewTimelineButton();
        add(_welcomePanel);
    } else {
        if (group == null) {
            group = new DashboardGroup(null);
        }
        add(new HeadingLabel(group.getName()));

        if (group.getDescription() != null) {
            add(new Label(group.getDescription()));
        }

        _welcomePanel = null;
        newTimelineButton = DCButtons.defaultButton("glyphicon-plus", "New timeline chart");

        final ButtonPanel buttonPanel = new ButtonPanel(false);
        buttonPanel.add(newTimelineButton);
        buttonPanel.add(_removeGroupButton);
        add(buttonPanel);
    }

    newTimelineButton.setVisible(_isDashboardEditor);
    newTimelineButton.addClickHandler(new CreateTimelineHandler(_service, _tenant, this));

    _service.getTimelines(_tenant, _group, new DCAsyncCallback<List<TimelineIdentifier>>() {
        @Override
        public void onSuccess(List<TimelineIdentifier> result) {
            for (TimelineIdentifier identifier : result) {
                addTimelinePanel(identifier);
            }

            if (_dashboardWidgetCount == 0 && _group != null && !_group.isDefaultGroup()) {
                _removeGroupButton.setVisible(true);
            }
        }
    });
}

From source file:org.datacleaner.monitor.dashboard.widgets.TimelinePanel.java

License:Open Source License

public TimelinePanel(TenantIdentifier tenant, DashboardServiceAsync service,
        TimelineIdentifier timelineIdentifier, DashboardGroupPanel timelineGroupPanel,
        boolean isDashboardEditor) {
    super();/*from   www  . j  ava 2s .c  o  m*/
    _tenant = tenant;
    _service = service;
    _timelineIdentifier = timelineIdentifier;
    _timelineGroupPanel = timelineGroupPanel;
    _isDashboardEditor = isDashboardEditor;
    _header = new HeadingLabel("");

    _loadingIndicator = new LoadingIndicator();
    _loadingIndicator.setHeight((DefaultVAxisOption.DEFAULT_HEIGHT + 4) + "px");

    _saveButton = DCButtons.defaultButton("glyphicon-save", null);
    _saveButton.setVisible(isDashboardEditor);
    _saveButton.setTitle("Save timeline");
    _saveButton.addClickHandler(new SaveTimelineClickHandler(_service, _tenant, this));

    if (_timelineIdentifier != null) {
        // initially does not make sense to save an (unchanged) and
        // identifyable timeline.
        setTimelineDefinitionUnchanged();
    }

    _deleteButton = DCButtons.dangerButton("glyphicon-minus", null);
    _deleteButton.setVisible(isDashboardEditor);
    _deleteButton.setTitle("Delete timeline");
    _deleteButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            final boolean confirmation = Window.confirm("Are you sure you wish to delete this timeline?");
            if (confirmation) {
                if (_timelineIdentifier != null) {
                    _service.removeTimeline(_tenant, _timelineIdentifier, new DCAsyncCallback<Boolean>() {
                        @Override
                        public void onSuccess(Boolean result) {
                            // do nothing
                        }
                    });
                }
                _timelineGroupPanel.removeTimelinePanel(TimelinePanel.this);
            }
        }
    });

    addStyleName("TimelinePanel");
    add(createButtonPanel());
    updateHeader();
    setLoading();

    if (_timelineIdentifier != null) {
        _service.getTimelineDefinition(_tenant, _timelineIdentifier, new DCAsyncCallback<TimelineDefinition>() {
            @Override
            public void onSuccess(final TimelineDefinition definition) {
                setTimelineDefinition(definition);
            }
        });
    }
}

From source file:org.datacleaner.monitor.scheduling.command.DeleteJobCommand.java

License:Open Source License

@Override
public void execute() {
    _morePopup.hide();//  w  w w  . ja  va  2  s. c om
    boolean delete = Window.confirm("Are you sure you want to delete the job '" + _job.getName()
            + "' and related schedule, results and timelines.");
    if (delete) {
        final String url = Urls.createRepositoryUrl(_tenant, "jobs/" + _job.getName() + ".delete");
        final DCRequestBuilder requestBuilder = new DCRequestBuilder(RequestBuilder.POST, url);
        requestBuilder.setHeader("Content-Type", "application/json");
        requestBuilder.send("", new DCRequestCallback() {
            @Override
            protected void onSuccess(Request request, Response response) {
                Window.Location.reload();
            }
        });
    }
}

From source file:org.daxplore.presenter.admin.view.PrefixDisplayViewImpl.java

License:Open Source License

@UiHandler("uploadButton")
protected void uploadClick(ClickEvent e) {
    boolean doUpload = Window.confirm("Are you sure you want to upload a new file, replacing all old data?");
    if (doUpload) {
        uploadForm.submit();/*ww w .  j  a v  a 2  s  . c  om*/
    }
}

From source file:org.daxplore.presenter.admin.view.PrefixDisplayViewImpl.java

License:Open Source License

/**
 * {@inheritDoc}/*from   w  w  w .jav a2  s . c  o m*/
 */
@Override
public boolean promptDeleteConfirmation(String prefix) {
    return Window.confirm("Are you sure you want to delete the prefix '" + prefix
            + "'.\n\nThis will also remove all data and information that belongs to it.");
}

From source file:org.drools.brms.client.admin.BackupManager.java

License:Apache License

private Widget newImportWidget() {

    final FormPanel uploadFormPanel = new FormPanel();
    uploadFormPanel.setAction(GWT.getModuleBaseURL() + "backup");
    uploadFormPanel.setEncoding(FormPanel.ENCODING_MULTIPART);
    uploadFormPanel.setMethod(FormPanel.METHOD_POST);

    HorizontalPanel panel = new HorizontalPanel();
    uploadFormPanel.setWidget(panel);//from  ww w . j  ava2  s .c o m

    final FileUpload upload = new FileUpload();
    upload.setName(HTMLFileManagerFields.FILE_UPLOAD_FIELD_NAME_IMPORT);
    panel.add(upload);

    panel.add(new Label("import:"));
    ImageButton ok = new ImageButton("images/upload.gif");
    ok.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
            doImportFile(uploadFormPanel);
        }

        private void doImportFile(final FormPanel uploadFormPanel) {
            if (Window.confirm("Are you sure you want to import? this will erase any content in the "
                    + "repository currently?")) {
                LoadingPopup.showMessage("Importing repository, please wait, as this could take some time...");
                uploadFormPanel.submit();
            }
        }
    });

    panel.add(ok);

    uploadFormPanel.addFormHandler(new FormHandler() {
        public void onSubmitComplete(FormSubmitCompleteEvent event) {
            if (event.getResults().indexOf("OK") > -1) {
                Window.alert(
                        "Rules repository imported successfully. Please refresh your browser (F5) to show the new content. ");
            } else {
                ErrorPopup.showMessage(
                        "Unable to import into the repository. Consult the server logs for error messages.");
            }
            LoadingPopup.close();
        }

        public void onSubmit(FormSubmitEvent event) {
            if (upload.getFilename().length() == 0) {
                Window.alert("You did not specify an exported repository filename !");
                event.setCancelled(true);
            } else if (!upload.getFilename().endsWith(".xml")) {
                Window.alert("Please specify a valid repository xml file.");
                event.setCancelled(true);
            }

        }
    });

    return uploadFormPanel;
}

From source file:org.drools.brms.client.admin.CategoryManager.java

License:Apache License

private void deleteSelected() {
    if (Window.confirm("Are you sure you want to delete category: " + explorer.getSelectedPath())) {
        RepositoryServiceFactory.getService().removeCategory(explorer.getSelectedPath(), new GenericCallback() {

            public void onSuccess(Object data) {
                explorer.refresh();/*from   w w w.  j av a2 s  .co m*/
            }

        });
    }
}