Examples of ActionCommand


Examples of jp.go.aist.sot.client.gui.ActionCommand

    public void clear() {
        text.setText(null);
    }

    public void setStatusLogCommand(Command cmd) {
        details.addActionListener(new ActionCommand(cmd));
    }
View Full Code Here

Examples of net.sf.mvc.mobile.command.ActionCommand

  // setView is called before load
  public void setView(Displayable v) {
    this.view = (EnterNameView) v;
   
    
    view.addCommand(new ActionCommand("Say hello",Command.SCREEN, 1){
      public Navigation execute(Displayable d) throws Exception {
        return new Navigation("say-hello",view.getName());
      }     
    });
    /* Please note that the command above can't be writter as
     *     view.addCommand(new NavigationCommand(
     *       new Navigation("say-hello",  view.getName()), "Say hello", Command.SCREEN, 1));
     * because view.getName() has to be evaluated each time the command is executed
     */
   
    view.addCommand(new ActionCommand("Quit",Command.SCREEN, 9){
      public Navigation execute(Displayable d) throws Exception {
        controler.getMidlet().notifyDestroyed();
        return null;
      }     
    });
    view.addCommand(new NavigationCommand(new Navigation("say-hello", null),
        "Slow load", Command.SCREEN, 2));
    view.addCommand(new ActionCommand("Slow action", Command.SCREEN, 3){
      public Navigation execute(Displayable d) throws Exception {
        String name = view.getName();
        controler.progressListner.setMaxValue(name.length());
        for(int i=0;i<name.length();++i) {
          //slow operation:
View Full Code Here

Examples of net.sf.mvc.mobile.command.ActionCommand

 

  public void setView(Displayable v) {
    this.view = (SayHelloView) v;
   
    view.addCommand(new ActionCommand("Edit", Command.ITEM, 1) {
      public Navigation execute(Displayable d) throws Exception {
        System.out.println(".execute(), name="+name);
        return new Navigation("enter-name", "Edit your name", name);
      }     
    });
View Full Code Here

Examples of net.sf.mvc.mobile.command.ActionCommand

      gauge = new Gauge(labelPrefix, false, 100, 50);
    else
      gauge = new Gauge(labelPrefix, false, -1 /*Gauge.INDEFINITE*/,
          0 /*Gauge.CONTINUOUS_RUNNING*/);
    append(gauge);
    addCommand(new ActionCommand("${abort}",Command.BACK, 1){
      public Navigation execute(Displayable d) throws Exception {
        throw new InterruptedException();
      }     
    });
  }
View Full Code Here

Examples of net.sf.mvc.mobile.command.ActionCommand

      public void run() {
        Displayable progressView = progressListner.getDisplay();
        try {
          //TODO: start after .5 sec
          setView(progressView);
          ActionCommand command = (ActionCommand) c;
          Navigation navigation = command.execute(d);
          if (navigation != null)
            show(navigation.getName(), navigation.getParameter());
          else
            back();
        } catch (InterruptedException ex) {
View Full Code Here

Examples of net.sf.mvc.mobile.command.ActionCommand

      setView(previousView);
  }

  protected void quit() {
    Alert alert = new Alert("${quit}?","${quit.or.restart}?",null, AlertType.CONFIRMATION);
    alert.addCommand(new ActionCommand("${quit}", Command.BACK, 1){
      public Navigation execute(Displayable d) throws Exception {
        midlet.notifyDestroyed();
        return null;
      }           
    });
    alert.addCommand(new ActionCommand("${restart}", Command.OK, 2){
      public Navigation execute(Displayable d) throws Exception {
        start();
        return null;
      }     
    });
View Full Code Here

Examples of org.jitterbit.cli.ui.ActionCommand

                                        "action.ic.tx.ImportMappings",
                                        "action.ic.tx.ExportMappings",
                                        "action.ic.tx.Migrate"))) {
            Action action = lookupAction(p.second);
            if (action != null) {
                commands.add(new ActionCommand(p.first, action));
            }
        }
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

        if (!StringUtils.hasText(commandId)) {
            return null;
        }

        ActionCommand newDetailObjectCommand = new ActionCommand(commandId) {

            protected void doExecuteCommand() {
                maybeCloneObject(); // Avoid losing user edits
            }
        };
        String scid = constructSecurityControllerId(commandId);
        newDetailObjectCommand.setSecurityControllerId(scid);
        return (ActionCommand) getCommandConfigurer().configure(newDetailObjectCommand);
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

        if (!StringUtils.hasText(commandId)) {
            return null;
        }

        ActionCommand printObjectCommand = new ActionCommand(commandId) {

            @Override
            protected void doExecuteCommand() {
                Iterator<T> iter = new Iterator<T>() {

                    private ListSelectionModel sm = getSelectionModel();
                    private int max = sm.getMaxSelectionIndex();
                    private int index = sm.getMinSelectionIndex();

                    @Override
                    public boolean hasNext() {
                        if (sm.isSelectionEmpty())
                            return false;
                        for (; index <= max; index++) {
                            if (sm.isSelectedIndex(index))
                                return true;
                        }
                        return false;
                    }

                    @Override
                    public T next() {
                        if (hasNext())
                            return (T) getMasterEventList().get(index++);

                        throw new NoSuchElementException("No further elements were selected! Check this via hasNext before!");
                    }

                    @Override
                    public void remove() {
                        throw new UnsupportedOperationException("Not supported yet.");
                    }
                };

                printAction(iter);
            }
        };
        String scid = constructSecurityControllerId(commandId);

        printObjectCommand.setSecurityControllerId(scid);
        return (ActionCommand) getCommandConfigurer().configure(printObjectCommand);
    }
View Full Code Here

Examples of org.springframework.richclient.command.ActionCommand

    private ListUtils() {

    }

    public static ActionCommand createRemoveRowCommand(final List list, final ValueModel selectionIndexHolder) {
        ActionCommand removeCommand = new ActionCommand("removeCommand") {
            protected void doExecuteCommand() {
                int selectedRowIndex = ((Integer) selectionIndexHolder.getValue()).intValue();
                list.remove(selectedRowIndex);
            }
        };
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.