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.common.widgets.socialConnector.SocialConnectorCompanyWidget.java

License:Open Source License

public void onClick(ClickEvent event) {
    Object sender = event.getSource();
    if (sender instanceof Anchor) {
        Anchor b = (Anchor) sender;/*  ww w.  j  a  va2  s .  c  om*/
        String keyString = actionMap.get(b);

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

            if (currentCommand == ACTION_RESET) {
                // wait for token
            }

            if (currentCommand == ACTION_ADD) {
                // add item at the end of list
                rowIndex = accessList.size();
                isNew = true;
                // wait for token
            }

            if (currentCommand == ACTION_DELETE) {
                if (Window.confirm("Are you sure you want to delete this item?")) {
                    deleteAccessToken();
                }
            }
        }
    }
}

From source file:com.risevision.ui.client.company.AuthKeyWidget.java

License:Open Source License

private void resetAuthKey() {
    if (Window.confirm(
            "Resetting the Company Authentication Key will cause existing Data Gadgets to no longer report data until they are updated with the new Key.")) {
        companyService.resetCompanyAuthKey(SelectedCompanyController.getInstance().getSelectedCompanyId(),
                new RpcCallBackHandler());
    }//from  w w w. j a va  2s  .c  om
}

From source file:com.risevision.ui.client.company.ClaimIdWidget.java

License:Open Source License

private void resetAuthKey() {
    if (Window.confirm(
            "Resetting the Company Claim Id will cause existing installations to no longer be associated with your Company.")) {
        companyService.resetCompanyClaimId(SelectedCompanyController.getInstance().getSelectedCompanyId(),
                new RpcCallBackHandler());
    }// w ww .  j a  v a2 s  .c  o  m
}

From source file:com.risevision.ui.client.display.DisplayManageWidget.java

License:Open Source License

private void doActionAutoupgradeApplyAll() {
    if (Window.confirm("This Player Browser selection will be applied to All Displays within this "
            + "Company Account. Are you sure you want to do this?")) {
        autoupgradeApplyAllRPC();//  www .  j  av  a 2  s. c  om
    }
}

From source file:com.risevision.ui.client.display.DisplayManageWidget.java

License:Open Source License

private void doActionRestart() {
    if (Window.confirm("The Rise Player on the Display's Computer will restart "
            + "and the currently Scheduled Content will be interrupted. Do you wish to proceed?")) {
        restartPlayerRPC();/* www .  ja  v  a  2 s  .c o m*/
    }
}

From source file:com.risevision.ui.client.display.DisplayManageWidget.java

License:Open Source License

private void doActionReboot() {
    if (Window.confirm("The Display's Computer will be rebooted and the currently "
            + "Scheduled content will be interrupted. Do you wish to proceed?")) {
        rebootPlayerRPC();//w  w w .  ja  v  a2s . com
    }
}

From source file:com.risevision.ui.client.display.DisplayManageWidget.java

License:Open Source License

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

From source file:com.risevision.ui.client.gadget.GadgetManageWidget.java

License:Open Source License

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

From source file:com.risevision.ui.client.presentation.placeholder.PlaceholderItemListWidget.java

License:Open Source License

public void onClick(ClickEvent event) {
    Object sender = event.getSource();
    PlaylistItemInfo item;/*from   w  w w .  j ava 2 s . co  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 = playlistItems.get(rowIndex);
                PlaylistItemManageWidget.getInstance().show(item, rowIndex, false,
                        new HashMap<String, Object>());
            }

            //            if (currentCommand == ACTION_ADD) {
            //               itemManageWidget.show(null, 0);
            //            }

            //            if (currentCommand == ACTION_INSERT) {
            //               rowIndex = RiseUtils.strToInt(currentKey, 0);
            //               itemManageWidget.show(null, rowIndex);
            //               updateTable();
            //            }

            if (currentCommand == ACTION_DELETE) {
                if (Window.confirm("Are you sure you want to delete this item?")) {
                    rowIndex = RiseUtils.strToInt(currentKey, 0);
                    deleteItem(rowIndex);
                }
            }

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

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

            if (currentCommand == ACTION_VEIWSTATUS) {
                rowIndex = RiseUtils.strToInt(currentKey, 0);
                item = playlistItems.get(rowIndex);
                showInStoreStatusAndHandleAddContent(rowIndex, item.getProductCode());
            }

        }
    }
}

From source file:com.risevision.ui.client.presentation.placeholder.PlaceholderItemListWidget.java

License:Open Source License

private void clearList() {
    if (Window.confirm("Are you sure you want to delete all items?")) {
        playlistItems.clear();//from  w ww. j  a  v a2 s  .  c o m
        fixScheduleItemsId();
        updateTable();
    }
}