Package com.extjs.gxt.ui.client.widget

Examples of com.extjs.gxt.ui.client.widget.MessageBox


        ContactData data = datas.get(currentItem);
        if(data == null)
          return;
        final String jid = data.get(JID);   
        final String nick = data.get(ALIAS);
        final MessageBox box = MessageBox.prompt(JabberApp.getConstants().Rename(), JabberApp.getConstants().RenamePrompt()+" "+nick+":");
        box.addCallback(new Listener<MessageBoxEvent>()
        { 
          public void handleEvent(MessageBoxEvent be)
          { 
            if(!be.value.isEmpty())
            {
              if(!be.buttonClicked.getItemId().equals(MessageBox.OK))
                return;
              if(!nick.equals(be.value))
                JabberApp.instance().renameUser(XmppID.parseId(jid), be.value);
            }
          } 
        });
      }
       
      });
     
      groupMenuItem = new MenuItem(JabberApp.getConstants().Group());
      groupMenu = new Menu();
      groupMenuItem.setSubMenu(groupMenu);
      groupMenuItem.addListener(Events.Activate, new Listener<MenuEvent>()
      {
      public void handleEvent(MenuEvent be)
      {
        List<ContactData> datas = store.getModels();
        ContactData data = datas.get(currentItem);
        if(data == null)
          return;
        final String jid = data.get(JID);
        final String group = data.get(USER_GROUP_DD);
        final String nick = data.get(ALIAS);
       
        Menu groupMenu = groupMenuItem.getSubMenu();
        groupMenu.removeAll();
        for(String g:m_groups)
        {
          CheckMenuItem gItem = new CheckMenuItem(g);
          gItem.setGroup("groups");
          if(g.equals(group))
            gItem.setChecked(true);
          groupMenu.add(gItem);
          gItem.addListener(Events.Select, new Listener<MenuEvent>()
          {
            public void handleEvent(MenuEvent be)
            {
              MenuItem mItem = (MenuItem)be.item;
              String newGroup = mItem.getText();
              if(!newGroup.equals(group))
                JabberApp.instance().changeGroup(XmppID.parseId(jid),nick, newGroup);
            }
           
          });
        }
        groupMenu.add(new SeparatorMenuItem());
        MenuItem newGroupItem = new MenuItem(JabberApp.getConstants().New_Group());
        newGroupItem.addListener(Events.Select, new Listener<MenuEvent>()
        {
          public void handleEvent(MenuEvent be)
          {
            final MessageBox box = MessageBox.prompt(JabberApp.getConstants().New_Group(), JabberApp.getConstants().NewGroupPrompt());
            box.addCallback(new Listener<MessageBoxEvent>()
            { 
              public void handleEvent(MessageBoxEvent be)
              { 
                if(!be.value.isEmpty())
                {
View Full Code Here


  cbbChantier.setSelectOnFocus(true);
  addListener = new Listener<BaseEvent>() {
      @Override
      public void handleEvent(BaseEvent be) {
    if (isUpdate || isDelete || isAdded) {
        MessageBox box = new MessageBox();
        box.alert("", "Il faut valider d'abord", null);
    }
      }
  };
  cbbChantier.addListener(Events.OnClick, addListener);
  cbbChantier.addSelectionChangedListener(new SelectionChangedListener<ChantierModel>() {
View Full Code Here

    ColumnModel cm = new ColumnModel(columns);
    return cm;
  }

  protected static MessageBox createConfirmBox(final Listener<MessageBoxEvent> callback, String title, String message) {
    MessageBox box = new MessageBox();
    box.setButtons(MessageBox.OKCANCEL);
    ((Button) box.getDialog().getButtonBar().getItem(0)).setText(messages.yes());
    box.setIcon(MessageBox.QUESTION);
    box.setTitle(title);
    box.addCallback(callback);
    box.setMessage(message);
    box.show();
    return box;
  }
View Full Code Here

    HTML deleteButton = new HTML("<img src='./images/supprimer.png'/>");
    deleteButton.setTitle(messages.delete());
    deleteButton.addClickHandler(new ClickHandler() {
      @Override
      public void onClick(ClickEvent event) {
        MessageBox box = createConfirmBox(callback, messages.deleteConfirmTitle(), messages.deleteConfirmMessage());
        box.show();
      }
    });

    return deleteButton;
  }
View Full Code Here

      }
    }));

    buttonBar.add(new Button("Prompt", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        final MessageBox box = MessageBox.prompt("Name", "Please enter your name:");
        box.addCallback(new Listener<MessageBoxEvent>() {
          public void handleEvent(MessageBoxEvent be) {
            Info.display("MessageBox", "You entered '{0}'", new Params(be.getValue()));
          }
        });
      }
    }));

    buttonBar.add(new Button("Multiline Prompt", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        MessageBox box = MessageBox.prompt("Address", "Please enter your address:", true);
        box.addCallback(new Listener<MessageBoxEvent>() {
          public void handleEvent(MessageBoxEvent be) {
            String v = Format.ellipse(be.getValue(), 80);
            Info.display("MessageBox", "You entered '{0}'", new Params(v));
          }
        });
      }
    }));

    buttonBar.add(new Button("Yes/No/Cancel", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        MessageBox box = new MessageBox();
        box.setButtons(MessageBox.YESNOCANCEL);
        box.setIcon(MessageBox.QUESTION);
        box.setTitle("Save Changes?");
        box.addCallback(l);
        box.setMessage("You are closing a tab that has unsaved changes. Would you like to save your changes?");
        box.show();
      }
    }));

    buttonBar.add(new Button("Progress", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        final MessageBox box = MessageBox.progress("Please wait", "Loading items...",
            "Initializing...");
        final ProgressBar bar = box.getProgressBar();
        final Timer t = new Timer() {
          float i;

          @Override
          public void run() {
            bar.updateProgress(i / 100, (int) i + "% Complete");
            i += 5;
            if (i > 105) {
              cancel();
              box.close();
              Info.display("Message", "Items were loaded", "");
            }
          }
        };
        t.scheduleRepeating(500);
      }
    }));

    buttonBar.add(new Button("Wait", new SelectionListener<ButtonEvent>() {
      public void componentSelected(ButtonEvent ce) {
        final MessageBox box = MessageBox.wait("Progress",
            "Saving your data, please wait...", "Saving...");
        Timer t = new Timer() {
          @Override
          public void run() {
            Info.display("Message", "Your fake data was saved", "");
            box.close();
          }
        };
        t.schedule(5000);
      }
    }));
View Full Code Here

  protected void onRender(Element parent, int index) {
    super.onRender(parent, index);
    final ExampleServiceAsync service = (ExampleServiceAsync) Registry.get(Examples.SERVICE);

    if (service == null) {
      MessageBox box = new MessageBox();
      box.setButtons(MessageBox.OK);
      box.setIcon(MessageBox.INFO);
      box.setTitle("Information");
      box.setMessage("No service detected");
      box.show();
      return;
    }

    FlowLayout layout = new FlowLayout(10);
    setLayout(layout);
View Full Code Here

                                if(i>4) {
                                    message+="<br/>.<br/>.<br/>.";
                                }
                                message+=Messages.get("message.remove.warning","<br/><span style=\"font-style:bold;color:red;\">Warning: this will erase the content definitively from the repository<br/>So it will not be displayed anymore anywere</span>");

                                MessageBox box = new MessageBox();
                                box.setTitle(Messages.get("label.information", "Information"));
                                box.setMessage(message);
                                box.setButtons(MessageBox.YESNO);
                                box.setIcon(icon);
                                box.addCallback(new Listener<MessageBoxEvent>() {
                                    public void handleEvent(MessageBoxEvent be) {
                                        if (be.getButtonClicked().getText().equalsIgnoreCase(Dialog.YES)) {
                                            async.deletePaths(l, new BaseAsyncCallback<Object>() {
                                                public void onApplicationFailure(Throwable throwable) {
                                                    Log.error(throwable.getMessage(), throwable);
                                                    MessageBox.alert(Messages.get("label.error", "Error"), throwable.getMessage(), null);
                                                }

                                                public void onSuccess(Object o) {
                                                    EditLinker el = null;
                                                    if (linker instanceof SidePanelTabItem.SidePanelLinker) {
                                                        el = ((SidePanelTabItem.SidePanelLinker) linker).getEditLinker();
                                                    } else if (linker instanceof EditLinker) {
                                                        el = (EditLinker) linker;
                                                    }
                                                    if (el != null && l.contains(el.getSelectionContext().getMainNode().getPath())) {
                                                        linker.refresh(EditLinker.REFRESH_PAGES);
                                                        linker.select(null);
                                                    } else {
                                                        linker.refresh(EditLinker.REFRESH_ALL);
                                                        linker.select(null);
                                                    }
                                                }
                                            });
                                        }
                                    }
                                });
                                box.show();

                            }

                            public void onApplicationFailure(Throwable caught) {
                                com.google.gwt.user.client.Window.alert("Cannot get status: " + caught.getMessage());
View Full Code Here

    @Override
    protected void createButtons()
    {
        super.createButtons();
       
        final MessageBox mb = new MessageBox();
        mb.setTitle("System of equations saved successfully");
       
        save = new Button("Save");
        save.disable();
        save.addSelectionListener(new SelectionListener<ButtonEvent>()
        {
           
            @Override
            public void componentSelected(ButtonEvent ce)
            {
                if (getNameText().getValue() != null && !getNameText().getValue().isEmpty())
                {
                    SystemEntity entity = new SystemEntity(getNameText().getValue(), getPanel().getEquations(),
                            getPanel().getRangeStart(), getPanel().getRangeStop(), getPanel().getStep());
                    persistentService.persist(entity, new AsyncCallback<Void>()
                    {
                       
                        @Override
                        public void onSuccess(Void result)
                        {
                            setVisible(false);
                            mb.show();
                        }
                       
                        @Override
                        public void onFailure(Throwable caught)
                        {
View Full Code Here

    @Override
    protected void createButtons()
    {
        super.createButtons();
       
        final MessageBox mb = new MessageBox();
        mb.setTitle("System of equations saved successfully");
       
        // Load Button
        load = new Button("Load");
        load.addSelectionListener(new SelectionListener<ButtonEvent>()
        {
View Full Code Here

  }
  private final void moveDownSelection() {
    targetHierarchyTree.moveDownSelection();
  }
  private final void addNode() {
    final MessageBox prompt = MessageBox.prompt("Add custom element",
        "Please specify element name:");
    // TODO BUG IN GXT: TextField is not attached!!!
    // => GET NO KEYEVENTS, so do it myself...
    ComponentHelper.doAttach(prompt.getTextBox());
    prompt.getTextBox().addKeyListener(new KeyListener() {
      public void componentKeyUp(ComponentEvent event) {
        super.componentKeyUp(event);
        if (pressedEnter(event.getKeyCode())) {
          prompt.getDialog().close(
              prompt.getDialog().getButtonById(Dialog.OK));
        }
      }
    });
    prompt.addCallback(new Listener<WindowEvent>() {
      public void handleEvent(WindowEvent be) {
        // have to detach TextField too!!!
        ComponentHelper.doDetach(prompt.getTextBox());
        if (be.buttonClicked != null
            && be.buttonClicked.getItemId().equals(Dialog.OK)) {
          createAndAddNode(((MessageBoxEvent) be).value);
        }
      }
    });
    prompt.show();
  }
View Full Code Here

TOP

Related Classes of com.extjs.gxt.ui.client.widget.MessageBox

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.