Examples of CommandHistory


Examples of ch.rakudave.jnetmap.controller.command.CommandHistory

  private List<MapListener> mapListeners;
  @XStreamConverter(SkippingCollectionConverter.class)
  private List<Notifier> statusListeners;
 
  public Map() {
    history = new CommandHistory(Settings.getInt("commandhistory.size", 20));
    graph = new SparseMultigraph<Device, Connection>();
    layout = new StaticLayout<Device, Connection>(this);
    mapListeners = new LinkedList<MapListener>();
    statusListeners = new LinkedList<Notifier>();
  }
View Full Code Here

Examples of ch.rakudave.jnetmap.controller.command.CommandHistory

  /**
   * @return the history
   */
  public CommandHistory getHistory() {
    if (history == null) history = new CommandHistory(Settings.getInt("commandhistory.size", 20));
    return history;
  }
View Full Code Here

Examples of ch.rakudave.jnetmap.controller.command.CommandHistory

 
  public static Action undo() {
    return new AbstractAction(Lang.getNoHTML("menu.undo"), Icons.get("undo")) {
      @Override
      public void actionPerformed(ActionEvent e) {
        CommandHistory history = Controller.getCurrentMap().getHistory();
        try {
          history.undo();
        } catch (Exception ex) {
          Logger.error("An error occured during the last 'undo'", ex);
        }
      }
    };
View Full Code Here

Examples of ch.rakudave.jnetmap.controller.command.CommandHistory

 
  public static Action redo() {
    return new AbstractAction(Lang.getNoHTML("menu.redo"), Icons.get("redo")) {
      @Override
      public void actionPerformed(ActionEvent e) {
        CommandHistory history = Controller.getCurrentMap().getHistory();
        try {
            history.redo();
          } catch (Exception ex) {
            Logger.error("An error occured during the last 'redo'", ex);
          }
        }
    };
View Full Code Here

Examples of edu.isi.karma.controller.history.CommandHistory

    HTable hTable = factory.getHTable(factory.getHNode(hNodeId).getHTableId());
    Selection currentSel = superSel.getSelection(hTable.getId());
    if (currentSel != null) {
      currentSel.updateSelection();
    }
    CommandHistory history = workspace.getCommandHistory();
    List<Command> tmp = gatherAllOperateSelectionCommands(history.getCommandsFromWorksheetId(worksheetId), workspace);
    if (tmp.size() > 0) {
      JSONArray inputJSON = new JSONArray();
      inputJSON.put(CommandInputJSONUtil.createJsonObject("worksheetId", worksheetId, ParameterType.worksheetId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("hNodeId", hNodeId, ParameterType.hNodeId));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("operation", Operation.Intersect.name(), ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("pythonCode", SelectionManager.defaultCode, ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("onError", "false", ParameterType.other));
      inputJSON.put(CommandInputJSONUtil.createJsonObject("selectionName", superSel.getName(), ParameterType.other));
      Command t = null;
      try {
        t = new OperateSelectionCommandFactory().createCommand(inputJSON, workspace);
      }catch(Exception e) {
       
      }
      if (t != null)
        history._getHistory().add(t);
      history._getHistory().addAll(tmp);
    }
    UpdateContainer uc = WorksheetUpdateFactory.createWorksheetHierarchicalAndCleaningResultsUpdates(worksheetId, superSel);
    uc.add(new HistoryUpdate(history));
    return uc;
  }
View Full Code Here

Examples of edu.isi.karma.controller.history.CommandHistory

    oldColumnName = columnNode.getColumnName();
   
    // Change the column name
    columnNode.setColumnName(newColumnName);
   
    CommandHistory history = workspace.getCommandHistory();
    List<ICommand>  allCommands = history._getHistory();
    for(ICommand command : allCommands) {
      String json = command.getInputParameterJson();
      if(json != null && json.length() > 0) {
        JSONArray inputs = new JSONArray(json);
        for(int i=0; i<inputs.length(); i++) {
View Full Code Here

Examples of edu.isi.karma.controller.history.CommandHistory

    savePreferences(workspace);
    boolean storeOldHistory = ModelingConfiguration.isStoreOldHistoryEnabled();
    System.out.println("storeOldHistory: " + storeOldHistory);
    Worksheet worksheet = workspace.getWorksheet(worksheetId);
    SuperSelection selection = getSuperSelection(worksheet);
    CommandHistory history = workspace.getCommandHistory();
    List<Command> oldCommands = history.getCommandsFromWorksheetId(worksheetId);
    if (storeOldHistory) {     
      JSONArray oldCommandsArray = new JSONArray();
      for (Command refined : oldCommands)
        oldCommandsArray.put(workspace.getCommandHistory().getCommandJSON(workspace, refined));
      worksheet.getMetadataContainer().getWorksheetProperties().setPropertyValue(
          Property.oldCommandHistory, oldCommandsArray.toString());
    }
    CommandHistoryUtil historyUtil = new CommandHistoryUtil(history.getCommandsFromWorksheetId(worksheetId), workspace, worksheetId);
    historyUtil.consolidateHistory()
    if (!oldCommands.equals(historyUtil.getCommands())) {
      uc.append(historyUtil.replayHistory());
      uc.removeUpdateByClass(HistoryAddCommandUpdate.class);
      uc.removeUpdateByClass(InfoUpdate.class);
View Full Code Here

Examples of edu.isi.karma.controller.history.CommandHistory

    return this.originalColumnValues;
  }

  protected ICommand extractPreviousCommand(ExecutionController ctrl) {

    CommandHistory commandHistory = ctrl.getWorkspace().getCommandHistory();
    List<ICommand> commands = commandHistory._getHistory();
    for(int i = commands.size() -1 ; i>=0; i--) {
      ICommand command = commands.get(i);
      if(command instanceof SubmitPythonTransformationCommand) {
        SubmitPythonTransformationCommand pyCommand = (SubmitPythonTransformationCommand)command;
        if(pyCommand.worksheetId.equals(this.worksheetId)) {
View Full Code Here

Examples of edu.isi.karma.controller.history.CommandHistory

  }

  public CommandHistory getCommandHistory() {
    if(commandHistory == null)
    {
      commandHistory = new CommandHistory();
    }
    return commandHistory;
  }
View Full Code Here

Examples of org.jboss.as.cli.CommandHistory

        }
    }

    private static void printHistory(CommandContext ctx) {

        CommandHistory history = ctx.getHistory();
        List<String> list = history.asList();
        for(String cmd : list) {
            ctx.printLine(cmd);
        }
        ctx.printLine("(The history is currently " + (history.isUseHistory() ? "enabled)" : "disabled)"));
    }
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.