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:com.risevision.ui.client.presentation.PresentationLayoutWidget.java

License:Open Source License

private void doActionDelete() {
    if (Window.confirm("Are you sure you want to delete this placeholder?")) {
        PlaceholderInfo placeholder = getSelectedPlaceholder();

        if (placeholder != null) {
            placeholder.setDeleted(true);

            fixPlaceholderOrder(placeholder);
            bindData();//w  w  w  .  j a  va 2  s.co m
        }
    }
}

From source file:com.risevision.ui.client.presentation.PresentationManageWidget.java

License:Open Source License

private void doActionDelete() {
    if (Window.confirm("Are you sure you want to delete this presentation?")) {
        deletePresentationRPC();
    }
}

From source file:com.risevision.ui.client.schedule.ScheduleItemGridWidget.java

License:Open Source License

public void onClick(ClickEvent event) {
    Object sender = event.getSource();
    PlaylistItemInfo item;/* w w w . java2  s  . c  o  m*/
    int rowIndex;
    if (sender instanceof Anchor) {
        Anchor b = (Anchor) sender;
        String keyString = actionMap.get(b);

        if (keyString != null && !keyString.isEmpty()) {
            currentCommand = RiseUtils.strToInt(keyString.substring(0, 1), -1);
            currentKey = keyString.substring(1);

            if (currentCommand == ACTION_SELECT) {
                rowIndex = RiseUtils.strToInt(currentKey, 0);
                item = getPlayListItems().get(rowIndex);
                itemManageWidget.show(item, onPlayListItemChanged);
            }

            if (currentCommand == ACTION_ADD) {
                item = new PlaylistItemInfo("New Item");
                itemManageWidget.show(item, true, 0, onPlayListItemChanged);
            }

            if (currentCommand == ACTION_INSERT) {
                item = new PlaylistItemInfo("New Item");
                rowIndex = RiseUtils.strToInt(currentKey, 0);
                itemManageWidget.show(item, true, rowIndex, onPlayListItemChanged);
                updateTable();
            }

            if (currentCommand == ACTION_DELETE) {
                if (Window.confirm("Are you sure you want to delete this item?")) {
                    rowIndex = RiseUtils.strToInt(currentKey, 0);
                    getPlayListItems().remove(rowIndex);
                    fixScheduleItemsId();
                    //                  setListChanged(true);
                    updateTable();
                }
            }

            if (currentCommand == ACTION_MOVEUP) {
                if (getPlayListItems().size() > 1) {
                    rowIndex = RiseUtils.strToInt(currentKey, 0);
                    if (rowIndex > 0) {
                        item = getPlayListItems().get(rowIndex);
                        getPlayListItems().remove(rowIndex);
                        getPlayListItems().add(rowIndex - 1, item);
                        fixScheduleItemsId();
                        //                     setListChanged(true);
                        updateTable();
                    }
                }
            }

            if (currentCommand == ACTION_MOVEDOWN) {
                if (getPlayListItems().size() > 1) {
                    rowIndex = RiseUtils.strToInt(currentKey, 0);
                    if (rowIndex < (getPlayListItems().size() - 1)) {
                        item = getPlayListItems().get(rowIndex);
                        getPlayListItems().remove(rowIndex);
                        getPlayListItems().add(rowIndex + 1, item);
                        fixScheduleItemsId();
                        //                     setListChanged(true);
                        updateTable();
                    }
                }
            }
        }
    }
}

From source file:com.risevision.ui.client.schedule.ScheduleManageWidget.java

License:Open Source License

private void doActionDelete() {
    if (Window.confirm("Are you sure you want to delete this schedule?")) {
        deleteData();
    }
}

From source file:com.softlink.finance.client.view.desktop.DesktopRequestDetailView.java

License:Apache License

@UiHandler("approve")
void onApproveClick(ClickEvent event) {
    if (Window.confirm("Are you sure to want to approve this request?"))
        if (listener != null) {
            //              listener.onUpdateUserLog();
            if (savecomment.equals("") == false)
                listener.onApprovedRequest(savecomment);
            else//from w ww  .j a v  a2  s. c  o  m
                listener.onApprovedRequest(comment.getText());
        }
}

From source file:com.softlink.finance.client.view.desktop.DesktopRequestDetailView.java

License:Apache License

@UiHandler("deny")
void onDenyClick(ClickEvent event) {
    if (Window.confirm("Are you sure to want to deny this request?"))
        if (listener != null) {
            //              listener.onUpdateUserLog();
            if (savecomment.equals("") == false)
                listener.onDeniedRequest(savecomment);
            else/*from www.  j a  v a  2  s  .co m*/
                listener.onDeniedRequest(comment.getText());
        }
}

From source file:com.softlink.finance.client.view.desktop.DesktopRequestDetailView.java

License:Apache License

@UiHandler("moreinfo")
void onMoreinfoClick(ClickEvent event) {
    if (Window.confirm("Are you sure to want to send back this request to the requester?"))
        if (listener != null) {
            //              listener.onUpdateUserLog();
            if (savecomment.equals("") == false)
                listener.onSendBackRequest(savecomment);
            else//from   w  w w  . j  a va 2 s.  c  o  m
                listener.onSendBackRequest(comment.getText());
        }
}

From source file:com.tasktop.c2c.server.tasks.client.presenters.ProjectAdminTaskKeywordsActivity.java

License:Open Source License

@Override
public void onDeleteKeyword() {

    if (!Window.confirm(super.tasksMessages.tagDeleteConfirmation())) {
        return;//w w w.j  av  a  2s  .c  om
    }

    ProfileGinjector.get.instance().getDispatchService().execute(
            new DeleteKeywordAction(projectIdentifier, selectedKeyword.getId()),

            new AsyncCallbackSupport<DeleteKeywordResult>() {
                @Override
                protected void success(DeleteKeywordResult result) {
                    selectedKeyword = keywords.size() > 0 ? keywords.get(0) : null;
                    ProfileGinjector.get.instance().getNotifier()
                            .displayMessage(Message.createSuccessMessage(tasksMessages.tagDeleted()));
                    updateView();
                }
            });
}

From source file:com.tasktop.c2c.server.tasks.client.presenters.ProjectAdminTaskProductsActivity.java

License:Open Source License

@Override
public void deleteComponent(final Integer componentId, final ClientCallback<Void> callback) {
    if (componentId < 0) {
        removeComponent(selectedProduct, componentId);
        callback.onReturn(null);// w  w  w  . j av  a 2  s . c  o m
        return;
    }
    if (!Window.confirm(super.tasksMessages.componentDeleteConfirmation())) {
        // Didn't get confirmation, so bail out.
        return;
    }
    final Product toModify = selectedProduct;
    ProfileGinjector.get.instance().getDispatchService().execute(
            new DeleteComponentAction(projectIdentifier, componentId),
            new AsyncCallbackSupport<DeleteComponentResult>() {
                @Override
                protected void success(DeleteComponentResult result) {
                    removeComponent(toModify, componentId);
                    callback.onReturn(null);
                    ProfileGinjector.get.instance().getNotifier()
                            .displayMessage(Message.createSuccessMessage(tasksMessages.componentDeleted()));
                }
            });
}

From source file:com.tasktop.c2c.server.tasks.client.presenters.ProjectAdminTaskProductsActivity.java

License:Open Source License

@Override
public void deleteMilestone(final Integer milestoneId, final ClientCallback<Void> callback) {
    if (milestoneId < 0) {
        removeMilestone(selectedProduct, milestoneId);
        callback.onReturn(null);//from w  w w.  j  a va  2  s  .c o m
        return;
    }

    if (!Window.confirm(super.tasksMessages.releaseDeleteConfirmation())) {
        // Didn't get confirmation, so bail out.
        return;
    }

    final Product toModify = selectedProduct;
    ProfileGinjector.get.instance().getDispatchService().execute(
            new DeleteMilestoneAction(projectIdentifier, milestoneId),
            new AsyncCallbackSupport<DeleteMilestoneResult>() {
                @Override
                protected void success(DeleteMilestoneResult result) {
                    removeMilestone(toModify, milestoneId);
                    callback.onReturn(null);
                    ProfileGinjector.get.instance().getNotifier()
                            .displayMessage(Message.createSuccessMessage(tasksMessages.releaseDeleted()));
                }
            });
}