Package com.claymus.gwt

Examples of com.claymus.gwt.Alert


        ManageContents.saveButton.removeAttribute("disabled");
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addHideButton();
        alert.show();
        ManageContents.saveButton.setInnerText("Save Contents Order");
        ManageContents.saveButton.removeAttribute("disabled");
      }

    });
View Full Code Here


        contentDTO.setRoleList(ContentEditor.this.visibleTo.getSelectedRoles());
        ContentEditor.this.contentService.update(encoded, contentDTO, new AsyncCallbackWithMsg<Void>(){

          @Override
          public void onCallSuccess(Void result) {
            Alert alert = new Alert("Success !", "Content Updated Successfully !");
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/content?page=" + pageEncoded);
              }

            });
            alert.show();
          };

          @Override
          public void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            ContentEditor.this.form.setEnabled(true);
          }

        });
      }
    });

    this.contentService.get(pageEncoded, encoded, new AsyncCallbackWithMsg<ContentDTO>(){

      @Override
      public final void onCallSuccess(ContentDTO moduleDTO) {
        ContentEditor.this.putDTO(moduleDTO);
        for(String[] loc : moduleDTO.getLocations())
          ContentEditor.this.location.addItem(loc[0], loc[1]);
        ContentEditor.this.location.setValue(moduleDTO.getLocation());
        for(String[] role : moduleDTO.getRoles())
          ContentEditor.this.visibleTo.addRole(role[1], role[0]);
        ContentEditor.this.visibleTo.setSelection(moduleDTO.getVisibleTo());
        ContentEditor.this.visibleTo.setSelectedRoles(moduleDTO.getRoleList());
        ContentEditor.this.form.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught)  {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

        ManageBlocks.saveButton.removeAttribute("disabled");
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addHideButton();
        alert.show();
        ManageBlocks.saveButton.setInnerText("Save Blocks Order");
        ManageBlocks.saveButton.removeAttribute("disabled");
      }

    });
View Full Code Here

        blockDTO.setNotVisibleAt(new LinkedList<String>(Arrays.asList(BlockEditor.this.notVisibleAt.getTexts())));
        BlockEditor.this.blockService.add(blockDTO, new AsyncCallbackWithMsg<Void>(){

          @Override
          public void onCallSuccess(Void result) {
            Alert alert = new Alert("Success !", "Block Created Successfully !");
            alert.addButton("Add Another Block", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/block/add");
              }

            });
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/block");
              }

            });
            alert.show();
          }

          @Override
          public void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            BlockEditor.this.form.setEnabled(true);
          }

        });
      }

    });

    this.blockService.getLocations(new AsyncCallbackWithMsg<String[][]>() {

      @Override
      public void onCallSuccess(String[][] locations) {
        for(String[] loc : locations)
          BlockEditor.this.location.addItem(loc[0], loc[1]);
        BlockEditor.this.location.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });

    this.blockService.getRoles(new AsyncCallbackWithMsg<String[][]>() {

      @Override
      public void onCallSuccess(String[][] roleList) {
        for(String[] role : roleList)
          BlockEditor.this.visibleTo.addRole(role[1], role[0]);
        BlockEditor.this.visibleTo.setSelection(0);
        BlockEditor.this.visibleTo.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

        blockDTO.setNotVisibleAt(new LinkedList<String>(Arrays.asList(BlockEditor.this.notVisibleAt.getTexts())));
        BlockEditor.this.blockService.update(encoded, blockDTO, new AsyncCallbackWithMsg<Void>(){

          @Override
          public final void onCallSuccess(Void result) {
            Alert alert = new Alert("Success !", "Block Updated Successfully !");
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/block");
              }

            });
            alert.show();
          };

          @Override
          public final void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            BlockEditor.this.form.setEnabled(true);
          }

        });
      }
    });

    this.blockService.get(encoded, new AsyncCallbackWithMsg<BlockDTO>() {

      @Override
      public final void onCallSuccess(BlockDTO moduleDTO) {
        BlockEditor.this.putDTO(moduleDTO);
        for(String[] loc : moduleDTO.getLocations())
          BlockEditor.this.location.addItem(loc[0], loc[1]);
        BlockEditor.this.location.setValue(moduleDTO.getLocation());
        for(String[] role : moduleDTO.getRoles())
          BlockEditor.this.visibleTo.addRole(role[1], role[0]);
        BlockEditor.this.visibleTo.setSelection(moduleDTO.getVisibleTo());
        BlockEditor.this.visibleTo.setSelectedRoles(moduleDTO.getRoleList());
        BlockEditor.this.visibleAt.setTexts(moduleDTO.getVisibleAt().toArray(new String[0]));
        BlockEditor.this.notVisibleAt.setTexts(moduleDTO.getNotVisibleAt().toArray(new String[0]));
        BlockEditor.this.form.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught)  {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

      @Override
      public void onCallSuccess(Void result) {}

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

        Window.Location.reload();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

        PageEditor.this.pageService.add(PageEditor.this.getDTO(), new AsyncCallbackWithMsg<String>() {

          @Override
          public void onCallSuccess(final String encoded) {
            String title = PageEditor.this.titleField.getText();
            Alert alert = new Alert("Success !", (title == null ? "" : "\"" + title + "\" ") + "Page Created Successfully !");
            alert.addButton("Add Another Page", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                PageEditor.this.form.reset();
              }

            }, true);
            alert.addButton("Add Content to " + (title == null ? "Page" : "\"" + title + "\""), new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/content?page=" + encoded);
              }

            });
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/page");
              }

            });
            alert.show();
          }

          @Override
          public void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            PageEditor.this.form.setEnabled(true);
          }

        });
      }

    });

    this.pageService.getLayouts(new AsyncCallbackWithMsg<String[][]>() {

      @Override
      public void onCallSuccess(String[][] layoutArr) {
        for(String[] layout : layoutArr)
          PageEditor.this.layoutField.addItem(layout[0], layout[1]);
        PageEditor.this.layoutField.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
        PageEditor.this.form.setEnabled(true);
      }

    });
  }
View Full Code Here

        PageEditor.this.pageService.update(PageEditor.this.getDTO(), new AsyncCallbackWithMsg<Void>() {

          @Override
          public void onCallSuccess(Void result) {
            String title = PageEditor.this.titleField.getText();
            Alert alert = new Alert("Success !", (title == null ? "" : "\"" + title + "\" ") + "Page Updated Successfully !");
            alert.addButton("Add Content to " + (title == null ? "Page" : "\"" + title + "\""), new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/content?page=" + encoded);
              }

            });
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/page");
              }

            });
            alert.show();
          }

          @Override
          public void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            PageEditor.this.form.setEnabled(true);
          }

        });
      }

    });

    this.pageService.get(encoded, new AsyncCallbackWithMsg<PageDTO>() {

      @Override
      public void onCallSuccess(PageDTO pageDTO) {
        for(String[] layout : pageDTO.getLayouts())
          PageEditor.this.layoutField.addItem(layout[0], layout[1]);
        PageEditor.this.putDTO(pageDTO);
        PageEditor.this.uriField.setEnabled(false);
        PageEditor.this.form.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
        PageEditor.this.form.setEnabled(true);
      }

    });
  }
View Full Code Here

        contentDTO.setRoleList(ContentEditor.this.visibleTo.getSelectedRoles());
        ContentEditor.this.contentService.add(pageEncoded, contentDTO, new AsyncCallbackWithMsg<Void>(){

          @Override
          public void onCallSuccess(Void result) {
            Alert alert = new Alert("Success !", "Content Created Successfully !");
            alert.addButton("Add Another Content", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/content/add?page=" + pageEncoded);
              }

            });
            alert.addButton("Done", new ClickHandler() {

              @Override
              public void onClick(ClickEvent event) {
                Window.Location.assign("/_ah/content?page=" + pageEncoded);
              }

            });
            alert.show();
          };

          @Override
          public void onCallFailure(Throwable caught) {
            Alert alert = new Alert(caught);
            alert.addHideButton();
            alert.show();
            ContentEditor.this.form.setEnabled(true);
          }

        });
      }

    });

    this.contentService.getLocations(pageEncoded, new AsyncCallback<String[][]>() {

      @Override
      public void onSuccess(String[][] locations) {
        for(String[] loc : locations)
          ContentEditor.this.location.addItem(loc[0], loc[1]);
        ContentEditor.this.location.setStateAsDefault();
      }

      @Override
      public void onFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });

    this.contentService.getRoles(new AsyncCallbackWithMsg<String[][]>() {

      @Override
      public void onCallSuccess(String[][] roleList) {
        for(String[] role : roleList)
          ContentEditor.this.visibleTo.addRole(role[1], role[0]);
        ContentEditor.this.visibleTo.setSelection(0);
        ContentEditor.this.visibleTo.setStateAsDefault();
      }

      @Override
      public void onCallFailure(Throwable caught) {
        Alert alert = new Alert(caught);
        alert.addButton("Reload Page", new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            Window.Location.reload();
          }

        });
        alert.addHideButton();
        alert.show();
      }

    });
  }
View Full Code Here

TOP

Related Classes of com.claymus.gwt.Alert

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.