Examples of CommandData


Examples of info.walnutstreet.vs.ps03v2.common.CommandData

   */
  @Override
  public void run() {
    try {
      while (this.socket.isConnected()) {
        CommandData data = (CommandData)inputStream.readObject();
        System.out.println("Client send command: " +  data.getCommand());
       
        switch (data.getCommand()) {
          case CLIENT_SENDS_REQUEST_BUY_MY_CART:
            this.handleRequestBuyMyCart();
            break;
          case CLIENT_SENDS_REQUEST_EDIT_RESERVE_GOOD: // OK
            this.handleEditReservationGood(data.getId(), data.getNumber());
            break;
          case CLIENT_SENDS_REQUEST_DELETE_RESERVE_GOOD: // OK
            this.handleRequestDeleteReservatedGood(data.getId());
            break;
          case CLIENT_SENDS_REQUEST_FOR_GOOD_LIST: // OK
            this.handleRequestForGoodList();
            break;
          case CLIENT_SENDS_REQUEST_RESERVE_GOOD: // OK
            this.handleRequestReserveGood(data.getId(), data.getNumber());
            break;
          default:
            break;
        }
      }
View Full Code Here

Examples of lmnd.model.command.CommandData

        public void actionPerformed(ActionEvent event) {
                if (Button.CANSEL.equals(event.getActionCommand())) {
                        dialog.dispose();
                        return;
                }
                CommandData data = new CommandData();
                Credentials credentials = dialog.getCredentials();
                data.addItem(Keys.CREDENTIALS, credentials);
                Collection<File> sources = getSourceFiles();
                data.addItem(Keys.SOURCE_FILES, sources);
                MessageData messageData = dialog.getMessageData();
                data.addItem(Keys.MESSAGE_DATA, messageData);
                // Create command.
                SendEmail sendEmail = new SendEmail();
                try {
                        sendEmail.perform(data);
                } catch (Exception exception) {
View Full Code Here

Examples of lmnd.model.command.CommandData

    }

    public void actionPerformed(ActionEvent event) {
        // Get file name.
        String name = JOptionPane.showInputDialog("Enter file name:");
        CommandData data = new CommandData();
        String path = getAbsolutePath() + "/" + name;
        File file = new File(path);
        data.addItem(Keys.FILE, file);
        // Create command.
        CreateFile createFile = new CreateFile();
        try {
            createFile.perform(data);
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        // Refresh panels.
        CommandData refreshData = new CommandData();
        refreshData.addItem(Keys.PANELS, panels);
        Refresh refresh = new Refresh();
        try {
            refresh.perform(refreshData);
        } catch (Exception exception) {
            exception.printStackTrace();
View Full Code Here

Examples of lmnd.model.command.CommandData

                this.panels = panels;
        }
        public void actionPerformed(ActionEvent event) {
                // Get directory name.
                String path = getSelectedPath();
                CommandData data = new CommandData();
                data.addItem(Keys.DIR_NAME, path);
                // Create command.
                Delete delete = new Delete();
                try {
                        delete.perform(data);
                } catch (Exception exception) {
                        exception.printStackTrace();
                }
                // Refresh panels.
                CommandData refreshData = new CommandData();
                refreshData.addItem(Keys.PANELS, panels);
                Refresh refresh = new Refresh();
                try {
                        refresh.perform(refreshData);
                } catch (Exception exception) {
                        exception.printStackTrace();
View Full Code Here

Examples of lmnd.model.command.CommandData

                this.panels = panels;
        }
        public void actionPerformed(ActionEvent event) {
                // Get directory name.
                File file = getSelectedFile();
                CommandData data = new CommandData();
                data.addItem(Keys.FILE, file);
                // Create command.
                Edit edit = new Edit();
                try {
                        edit.perform(data);
                } catch (Exception exception) {
View Full Code Here

Examples of lmnd.model.command.CommandData

        }
        public void actionPerformed(ActionEvent event) {
                // Get directory name.
                Collection<File> sources = getSourceFiles();
                File destanation = getDestanationPath();
                CommandData data = new CommandData();
                data.addItem(Keys.SOURCE_FILES, sources);
                data.addItem(Keys.DEST_DIR, destanation);
                // Create command.
                Copy copy = new Copy();
                try {
                        copy.perform(data);
                } catch (Exception exception) {
                        exception.printStackTrace();
                }
                // Refresh panels.
                CommandData refreshData = new CommandData();
                refreshData.addItem(Keys.PANELS, panels);
                Refresh refresh = new Refresh();
                try {
                        refresh.perform(refreshData);
                } catch (Exception exception) {
                        exception.printStackTrace();
View Full Code Here

Examples of lmnd.model.command.CommandData

        }
        @Override
        public void actionPerformed(ActionEvent event) {
                // Get directory name.
                File file = getSelectedFile();
                CommandData data = new CommandData();
                data.addItem(Keys.FILE, file);
                // Create command.
                View view = new View();
                try {
                        view.perform(data);
                } catch (Exception exception) {
View Full Code Here

Examples of lmnd.model.command.CommandData

    @Override
    public void actionPerformed(ActionEvent event) {
        // Get directory name.
        Collection<File> sources = getSourceFiles();
        File destanation = getDestanationPath();
        CommandData data = new CommandData();
        data.addItem(Keys.SOURCE_FILES, sources);
        data.addItem(Keys.DEST_DIR, destanation);
        // Create command.
        Move move = new Move();
        try {
            move.perform(data);
        } catch (Exception exception) {
            exception.printStackTrace();
        }
        // Refresh panels.
        CommandData refreshData = new CommandData();
        refreshData.addItem(Keys.PANELS, panels);
        Refresh refresh = new Refresh();
        try {
            refresh.perform(refreshData);
        } catch (Exception exception) {
            exception.printStackTrace();
View Full Code Here

Examples of lmnd.model.command.CommandData

        }
        @Override
        public void actionPerformed(ActionEvent event) {
                // Get new name.
                String newName = JOptionPane.showInputDialog("Enter new name:");
                CommandData data = new CommandData();
                data.addItem(Keys.NEW_NAME, newName);
                // Get file to be renamed.
                File file = getSelectedFile();
                data.addItem(Keys.FILE, file);
                // Create command.
                Rename rename = new Rename();
                try {
                        rename.perform(data);
                } catch (Exception exception) {
                        exception.printStackTrace();
                }
                // Refresh panels.
                CommandData refreshData = new CommandData();
                refreshData.addItem(Keys.PANELS, panels);
                Refresh refresh = new Refresh();
                try {
                        refresh.perform(refreshData);
                } catch (Exception exception) {
                        exception.printStackTrace();
View Full Code Here

Examples of lmnd.model.command.CommandData

                this.panels = panels;
        }
        public void actionPerformed(ActionEvent event) {
                // Get directory name.
                String name = JOptionPane.showInputDialog("Enter directory name:");
                CommandData data = new CommandData();
                String path = getAbsolutePath() + "/" + name;
                data.addItem(Keys.DIR_NAME, path);
                // Create directory.
                MakeDirectory makeDirectory = new MakeDirectory();
                try {
                        makeDirectory.perform(data);
                } catch (Exception exception) {
                        exception.printStackTrace();
                }
                // Refresh panels.
                CommandData refreshData = new CommandData();
                refreshData.addItem(Keys.PANELS, panels);
                Refresh refresh = new Refresh();
                try {
                        refresh.perform(refreshData);
                } catch (Exception exception) {
                        exception.printStackTrace();
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.