Package org.jamesii.gui.application.action

Examples of org.jamesii.gui.application.action.AbstractAction


    this.tree.setEditable(flag);
  }

  @Override
  protected IAction[] generateActions() {
    return new IAction[] { new AbstractAction("tree.expandAll", "Expand All",
        new String[] { "" }, this) {

      @Override
      public void execute() {
        for (int i = 0; i < tree.getRowCount(); i++) {
View Full Code Here


    actions.add(new ActionSet("org.jamesii.choose", null, "Choose", null, null,
        icon, this));

    for (int i = 0; i < directories.length; i++) {
      final File dir = directories[i];
      actions.add(new AbstractAction(directories[i].getName(), FileSystemView
          .getFileSystemView().getSystemDisplayName(dir), null, null,
          FileSystemView.getFileSystemView().getSystemIcon(dir),
          new String[] { "org.jamesii.choose" }, null, null, this) {
        @Override
        public void execute() {
View Full Code Here

    Icon startIcon = IconManager.getIcon(IconIdentifier.PLAY_SMALL, "start");
    Icon pauseIcon = IconManager.getIcon(IconIdentifier.PAUSE_SMALL, "pause");
    Icon stopIcon = IconManager.getIcon(IconIdentifier.STOP_SMALL, "stop");

    IAction action =
        new AbstractAction("simulation.start", "start", startIcon,
            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.startSimulationRun(info);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
        };
    action.setEnabled(getSelectedNodeInfo() != null);
    actions.add(action);

    action =
        new AbstractAction("simulation.pause", "pause", pauseIcon,
            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.executeRunnableCommand(info, "pause", null);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
        };
    action.setEnabled(getSelectedNodeInfo() != null);
    actions.add(action);

    action =
        new AbstractAction("simulation.stop", "stop", stopIcon,
            new String[] { "" }, null, null, this) {

          @Override
          public void execute() {
            synchronized (this) {
              ISimulationServer simServer = (ISimulationServer) getServer();
              ComputationTaskIDObject info =
                  (ComputationTaskIDObject) getSelectedNodeInfo().getInfo();
              try {
                simServer.stopProc(info);
              } catch (RemoteException e) {
                SimSystem.report(e);
              }
            }
          }
        };
    action.setEnabled(getSelectedNodeInfo() != null);
    actions.add(action);

    return actions.toArray(new IAction[actions.size()]);
  }
View Full Code Here

TOP

Related Classes of org.jamesii.gui.application.action.AbstractAction

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.