Examples of ConfirmationDialog


Examples of org.pokenet.client.ui.base.ConfirmationDialog

        public void actionPerformed(ActionEvent e) {
          GameClient.getInstance().getPacketGenerator().writeTcpMessage("Pe0" + index);
          GameClient.getInstance().getDisplay().remove(m_evolveDialog);
        }
      };
      m_evolveDialog = new ConfirmationDialog(GameClient.getInstance().getOurPlayer().getPokemon()
          [pokeIndex].getName() + " is trying to evolve.", yes, no);
    }
View Full Code Here

Examples of org.pokenet.client.ui.base.ConfirmationDialog

    m_sellButton[0].setSize(getWidth(), 35);
    m_sellButton[0].setLocation(0, m_cancel.getY() - 35);
    m_sellButton[0].addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e){
        try{
        final ConfirmationDialog m_confirm = new ConfirmationDialog("Are you sure you want to sell "
            + m_sellList.getSelectedName() + " for $" + (ItemDatabase.getInstance().getItem(
                m_sellList.getSelectedName()).getPrice() / 2) + "?");
        m_confirm.addYesListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
            GameClient.getInstance().getPacketGenerator().writeTcpMessage("Ss" + ItemDatabase.getInstance()
                .getItem(m_sellList.getSelectedName()).getId() + ",");
            GameClient.getInstance().getDisplay().remove(m_confirm);
          }
        });
        m_confirm.addNoListener(new ActionListener(){
          public void actionPerformed(ActionEvent e){
            GameClient.getInstance().getDisplay().remove(m_confirm);
          }
        });
        } catch (Exception e2) {e2.printStackTrace();}
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

        }

        if (getDetailForm().isDirty()) {
            String title = getMessage(new String[]{getId() + ".dirtyNew.title", "masterForm.dirtyNew.title"});
            String message = getMessage(new String[]{getId() + ".dirtyNew.message", "masterForm.dirtyNew.message"});
            ConfirmationDialog dlg = new ConfirmationDialog(title, message) {

                @Override
                protected void onConfirm() {
                    cloneSelectedItems();
                }
            };
            dlg.showDialog();
        } else {
            cloneSelectedItems();
        }
    }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

  protected void onCancel() {
    // Warn the user if they are about to discard their changes
    if (form.getFormModel().isDirty()) {
      String msg = getMessage("contactProperties.dirtyCancelMessage");
      String title = getMessage("contactProperties.dirtyCancelTitle");
      ConfirmationDialog dlg = new ConfirmationDialog(title, msg) {
        protected void onConfirm() {
          ContactPropertiesDialog.super.onCancel();
        }
      };
      dlg.showDialog();
    }
    else {
      super.onCancel();
    }
  }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

    {
        public void execute()
        {
            String title = getMessage("contact.confirmDelete.title");
            String message = getMessage("contact.confirmDelete.message");
            ConfirmationDialog dlg = new ConfirmationDialog(title, message)
            {
                protected void onConfirm()
                {
                    for (Object selected : widget.getSelectedRows())
                    {
                        Contact contact = (Contact) selected;
                        // Delete the object from the persistent store.
                        getContactDataStore().delete(contact);
                        // And notify the rest of the application of the change
                        getApplicationContext().publishEvent(
                                new LifecycleApplicationEvent(LifecycleApplicationEvent.DELETED, contact));
                    }
                }
            };
            dlg.showDialog();
        }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

                    petCount++;
                }
                nodesToDelete.add(node);
            }

            ConfirmationDialog dialog = new ConfirmationDialog() {
                protected void onConfirm() {
                    for (Iterator i = nodesToDelete.iterator(); i.hasNext();) {
                        DefaultMutableTreeNode node = (DefaultMutableTreeNode)i.next();
                        ownersTreeModel.removeNodeFromParent(node);
                        if (node.getUserObject() instanceof Owner) {
                            // clinic.deleteOwner((Owner) node.getUserObject());
                        }
                        else {
                            // clinic.deletePet((Pet) node.getUserObject());
                        }
                    }
                }
            };
            //  TODO check default closeAction on ConfirmationDialog
            // setting closeAction explicitly to dispose, if confirmationDialog has this default,
            // this line may be removed.
            dialog.setCloseAction(CloseAction.DISPOSE);

            if (ownerCount > 0 && petCount > 0) {
                dialog.setTitle(getMessage("confirmDeleteOwnerAndPetDialog.title"));
                dialog.setConfirmationMessage(getMessage("confirmDeleteOwnerAndPetDialog.label"));
            }
            else if (ownerCount > 0) {
                dialog.setTitle(getMessage("confirmDeleteOwnerDialog.title"));
                dialog.setConfirmationMessage(getMessage("confirmDeleteOwnerDialog.label"));
            }
            else {
                dialog.setTitle(getMessage("confirmDeletePetDialog.title"));
                dialog.setConfirmationMessage(getMessage("confirmDeletePetDialog.label"));
            }

            dialog.showDialog();
        }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

        // If configured, have the user confirm the delete operation
        if( isConfirmDelete() ) {
            String title = getMessage( new String[] { getId() + ".confirmDelete.title", "masterForm.confirmDelete.title" } );
            String message = getConfirmDeleteMessage();
            ConfirmationDialog dlg = new ConfirmationDialog( title, message ) {

                protected void onConfirm() {
                    deleteSelectedItems();
                    getSelectionModel().clearSelection();
                }
            };
            dlg.showDialog();
        } else {
            deleteSelectedItems();
            getSelectionModel().clearSelection();
        }
    }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

        final ActionCommand detailNewObjectCommand = detailForm.getNewFormObjectCommand();

        if( getDetailForm().isDirty() ) {
            String title = getMessage( new String[] { getId() + ".dirtyNew.title", "masterForm.dirtyNew.title" } );
            String message = getMessage( new String[] { getId() + ".dirtyNew.message", "masterForm.dirtyNew.message" } );
            ConfirmationDialog dlg = new ConfirmationDialog( title, message ) {
                protected void onConfirm() {
                    // Tell both forms that we are creating a new object
                    detailNewObjectCommand.execute(); // Do subform action first
                    creatingNewObject();
                    detailForm.creatingNewObject();
                }
            };
            dlg.showDialog();
        } else {
            // Tell both forms that we are creating a new object
            detailNewObjectCommand.execute(); // Do subform action first
            creatingNewObject();
            detailForm.creatingNewObject();
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

                return;
            }
            if( getDetailForm().isDirty() ) {
                String title = getMessage( new String[] { getId() + ".dirtyChange.title", "masterForm.dirtyChange.title" } );
                String message = getMessage( new String[] { getId() + ".dirtyChange.message", "masterForm.dirtyChange.message" } );
                ConfirmationDialog dlg = new ConfirmationDialog( title, message ) {

                    protected void onConfirm() {
                        getDetailForm().setSelectedIndex( newIndex );
                    }

                    protected void onCancel() {
                        // Force the selction back
                        super.onCancel();
                        if( getDetailForm().isEditingNewFormObject() ) {
                            // Since they were editing a new object, we just
                            // need to clear the selection
                            getSelectionModel().clearSelection();
                        } else {
                            int index = getDetailForm().getSelectedIndex();
                            getSelectionModel().setSelectionInterval( index, index );
                        }
                    }

                };
                dlg.showDialog();
            } else {
                getDetailForm().setSelectedIndex( newIndex );
            }
        }
View Full Code Here

Examples of org.springframework.richclient.dialog.ConfirmationDialog

  @Override
  public void revert( @Nullable final Runnable callback ) {
    if ( getFormModel().isDirty() ) {
      String msg = springSupport.getMessage( baseId + ".dirtyRevertMessage" );
      String title = springSupport.getMessage( baseId + ".dirtyRevertTitle" );
      ConfirmationDialog dlg = new ConfirmationDialog( title, msg ) {
        @Override
        protected void onConfirm() {
          getFormModel().revert();
          if ( callback != null ) {
            callback.run();
          }
        }
      };
      dlg.showDialog();
    } else {
      getFormModel().revert();
      if ( callback != null ) {
        callback.run();
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.