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.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void deleteRule() {
    Utility.newRequestObj().deleteDayScheduleRule(currentSelectedRuleName, new AsyncCallback<String>() {
        public void onFailure(Throwable caught) {
            Window.alert("Unable to delete rule");
        }/*  www  .  j  a v  a  2s  .  c o m*/

        public void onSuccess(String result) {
            Window.alert("Deleting rule: " + result);
            if (result.equalsIgnoreCase("OK")) {
                Data.dayScheduleRuleAttributeList.remove(currentSelectedRuleName);
                initializeRuleTable();
            }
        }
    });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void updateRule() {
    Utility.newRequestObj().updateDayScheduleRule(currentSelectedRuleName, ruleName, sH, sM, eH, eM,
            new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    Window.alert("Unable to update rule");
                }/*from  w  ww. ja va  2 s  .  com*/

                public void onSuccess(final String result) {
                    Window.alert("Updating rule: " + result);
                    if (result.equalsIgnoreCase("OK")) {
                        ArrayList<String> temp = new ArrayList<>();
                        temp.add(ruleName);
                        temp.add(String.valueOf(sH));
                        temp.add(String.valueOf(sM));
                        temp.add(String.valueOf(eH));
                        temp.add(String.valueOf(eM));
                        Data.dayScheduleRuleAttributeList.remove(currentSelectedRuleName);
                        Data.dayScheduleRuleAttributeList.put(ruleName, temp);

                        initializeRuleTable();
                    }
                }
            });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void sendCreateScheduleRequest() {
    if (createScheduleType.getSelectedItemText().equals("Regular Schedule")) {
        createRegularSchedule();//from   w w  w .  j  a  v a 2  s .co m
    } else if (createScheduleType.getSelectedItemText().equals("Special Schedule")) {
        createSpecialSchedule();
    } else
        Window.alert("schedule type bug");
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void createRegularSchedule() {
    Utility.newRequestObj().createRegularSchedule(scheduleName, actuatorName, dayMask, rule, onStart, onEnd,
            lock, priority, scheduleEnabled, new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    Window.alert("Unable to create regular schedule");
                }// ww  w.j ava 2s .  co  m

                public void onSuccess(final String result) {
                    Window.alert("Creating regular schedule: " + result);
                    if (result.equalsIgnoreCase("OK")) {
                        getActuatorRegularSchedule(actuatorName);
                    }
                }
            });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void createSpecialSchedule() {
    Utility.newRequestObj().createSpecialSchedule(scheduleName, actuatorName, year, month, day, rule, onStart,
            onEnd, lock, priority, scheduleEnabled, new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    Window.alert("Unable to create special schedule");
                }//from  w w  w  . j  a  v a 2  s  .  c  o  m

                public void onSuccess(final String result) {
                    Window.alert("Creating special schedule: " + result);
                    if (result.equalsIgnoreCase("OK")) {
                        getActuatorSpecialSchedule(actuatorName);
                    }
                }
            });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void updateRegularSchedule() {
    Utility.newRequestObj().updateRegularSchedule(currentSelectedScheduleName, scheduleName, actuatorName,
            dayMask, rule, onStart, onEnd, lock, priority, scheduleEnabled, new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    Window.alert("Unable to create regular schedule");
                }//from   www  .j  ava2 s.  co  m

                public void onSuccess(final String result) {
                    Window.alert("Updating regular schedule: " + result);
                    if (result.equalsIgnoreCase("OK")) {
                        getActuatorRegularSchedule(actuatorName);
                    }
                }
            });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void updateSpecialSchedule() {
    Utility.newRequestObj().updateSpecialSchedule(currentSelectedScheduleName, scheduleName, actuatorName, year,
            month, day, rule, onStart, onEnd, lock, priority, scheduleEnabled, new AsyncCallback<String>() {
                public void onFailure(Throwable caught) {
                    Window.alert("Unable to update special schedule");
                }/*from   w ww . j  a  v a2  s. com*/

                public void onSuccess(final String result) {
                    Window.alert("Updating special schedule: " + result);
                    if (result.equalsIgnoreCase("OK")) {
                        getActuatorSpecialSchedule(actuatorName);
                    }
                }
            });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void deleteRegularSchedule(final String scheduleName) {
    Utility.newRequestObj().deleteRegularSchedule(scheduleName, new AsyncCallback<String>() {
        public void onFailure(Throwable caught) {
            Window.alert("Unable to delete regular schedule");
        }/*from www. j  a  v  a 2s . co  m*/

        public void onSuccess(final String result) {
            Window.alert("Deletion: " + result);
            if (result.equalsIgnoreCase("OK")) {
                ArrayList<String> data = Data.actuatorRegularScheduleList.get(actuatorName);
                data.remove(scheduleName);

                Data.actuatorRegularScheduleList.remove(actuatorName);
                Data.actuatorRegularScheduleList.put(actuatorName, data);

                Data.regularScheduleAttributeList.remove(scheduleName);

                updateRegularScheduleTable(scheduleTable, regularScheduleCache());
            }
        }
    });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void deleteSpecialSchedule(final String scheduleName) {
    Utility.newRequestObj().deleteSpecialSchedule(scheduleName, new AsyncCallback<String>() {
        public void onFailure(Throwable caught) {
            Window.alert("Unable to delete special schedule");
        }//from w w w .  j  a  va2  s . co  m

        public void onSuccess(final String result) {
            Window.alert("Deletion: " + result);
            if (result.equalsIgnoreCase("OK")) {
                ArrayList<String> data = Data.actuatorSpecialScheduleList.get(actuatorName);
                data.remove(scheduleName);

                Data.actuatorSpecialScheduleList.remove(actuatorName);
                Data.actuatorSpecialScheduleList.put(actuatorName, data);

                Data.specialScheduleAttributeList.remove(scheduleName);

                updateSpecialScheduleTable(scheduleTable, specialScheduleCache());
            }
        }
    });
}

From source file:com.google.gwt.sample.stockwatcher.client.SchedulePage.java

private void getActuatorRegularSchedule(final String actuator) {
    Utility.newRequestObj().getActuatorRegularSchedule(actuator, new AsyncCallback<String[][]>() {
        public void onFailure(Throwable caught) {
            Window.alert("Unable to get regular schedule");
            Utility.hideTimer();/*ww w .  j a va 2 s .c  o m*/
        }

        public void onSuccess(String[][] result) {
            if (Utility.isNull(result)) {
                Utility.setMsg(Messages.NO_DATA);
            } else {
                currentActuatorView = actuatorLB.getSelectedItemText();
                refreshRegularScheduleData(actuator, result);
                Utility.hideTimer();
                updateRegularScheduleTable(scheduleTable, result);
            }
        }
    });
}