Examples of TaskTree


Examples of net.sf.gum.gui.swing.tree.TaskTree

   
    this.projectPanel= new ProjectPanel( gumData );       
    super.add( this.projectPanel, BorderLayout.NORTH );

   
    this.taskTree = new TaskTree();
    List<ProjectType> projectTypes = this.gumData.getProject();
    this.taskTree.setProjectType( projectTypes.get( 0 ) );

   
   
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

  }

  @Override
  public void profileExecutionScheduled(Profile profile) {
    Synchronizer sync = guiController.getSynchronizer();
    TaskTree tree = sync.executeProfile(profile, false);
    if (tree == null) {
      profile.setLastError(1, Messages.getString("MainWindow.Error_Comparing_Filesystems")); //$NON-NLS-1$
    }
    else {
      int errorLevel = sync.performActions(tree);
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

    });
    worker.start();
  }

  private synchronized void doRunProfile(Profile p, boolean interactive) {
    TaskTree t = null;
    Timer statusDelayTimer = null;
    try {
      guiController.showBusyCursor(true);
      try {
        // REVISIT wow, a timer here is pretty much overhead / specific for
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

      throw new FileSystemException("destination is unavailable");
    }

    this.actionDecider = actionDecider;

    TaskTree tree = new TaskTree(source, destination);
    Task root = new Task(null, null, new State(State.NodeInSync, Location.None), new Action[] { new Action(Action.Nothing,
        Location.None, BufferUpdate.None, "Root") });
    tree.setRoot(root);

    for (TaskGenerationListener listener : taskGenerationListeners) {
      listener.taskTreeStarted(tree);
    }
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

  }

  @Override
  public TaskTree executeProfile(String name) throws RemoteException {
    Profile p = profileManager.getProfile(name);
    TaskTree tree = synchronizer.executeProfile(p, false);
    return tree;
  }
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

      final Synchronizer sync = new Synchronizer();

      // Apply executing options
      if (line.hasOption("r")) {
        Profile p = profileManager.getProfile(line.getOptionValue("r"));
        TaskTree tree = sync.executeProfile(p, false);
        sync.performActions(tree);
        p.setLastUpdate(new Date());
        profileManager.save();
        return;
      }

      boolean activateRemote = false;
      int port = 10000;
      String password = "admin";
      RemoteException listenerStarupException = null;

      if (line.hasOption("p")) {
        activateRemote = true;
        try {
          String portStr = line.getOptionValue("p");
          port = Integer.parseInt(portStr);
        }
        catch (NumberFormatException e) {
        }

        if (line.hasOption("a")) {
          password = line.getOptionValue("a");
        }
      }
      else {
        activateRemote = preferences.listeningForRemoteConnections();
        port = preferences.getRemoteConnectionsPort();
        password = preferences.getRemoteConnectionsPassword();
      }
      if (activateRemote) {
        try {
          Logger logger = LoggerFactory.getLogger("FullSync");

          RemoteController.getInstance().startServer(port, password, profileManager, sync);
          logger.info("Remote Interface available on port: " + port);
        }
        catch (RemoteException e) {
          ExceptionHandler.reportException(e);
          listenerStarupException = e;
        }
      }

      if (line.hasOption("d")) {
        profileManager.addSchedulerListener(new ProfileSchedulerListener() {
          @Override
          public void profileExecutionScheduled(Profile profile) {
            TaskTree tree = sync.executeProfile(profile, false);
            if (tree == null) {
              profile.setLastError(1, "An error occured while comparing filesystems.");
            }
            else {
              int errorLevel = sync.performActions(tree);
View Full Code Here

Examples of net.sourceforge.fullsync.TaskTree

    expectation = new Hashtable<String, Action>();
  }

  @After
  public void after() throws Exception {
    TaskTree tree;
    /* Phase One: */
    tree = assertPhaseOneActions(expectation);
    /* Phase Two: */
    synchronizer.performActions(tree); // TODO assert task finished events ?
  }
View Full Code Here

Examples of org.projectforge.task.TaskTree

      }
      if (access == GanttAccess.ALL) {
        // User has task access:
        return true;
      }
      final TaskTree taskTree = UserRights.getAccessChecker().getTaskTree();
      final ProjektDO project = taskTree.getProjekt(obj.getTaskId());
      if (project == null) {
        // Project manager group not found:
        return UserRights.getAccessChecker().isUserMemberOfGroup(user, ProjectForgeGroup.PROJECT_MANAGER);
      }
      // Users of the project manager group have access:
View Full Code Here

Examples of org.projectforge.task.TaskTree

   * @param obj
   * @return The root object of the read xml data.
   */
  public GanttChartData readGanttObjects(final GanttChartDO obj)
  {
    final TaskTree taskTree = taskDao.getTaskTree();
    final GanttChartData ganttChartData = Task2GanttTaskConverter.convertToGanttObjectTree(taskTree, obj.getTask());
    final XmlObjectReader reader = new XmlObjectReader() {
      @Override
      protected Object newInstance(final Class< ? > clazz, final Element el, final String attrName, final String attrValue)
      {
        if ("predecessor".equals(attrName) == true && XmlConstants.NULL_IDENTIFIER.equals(attrValue) == true) {
          // Field should set to null.
          return Status.IGNORE;
        }
        if (GanttTask.class.isAssignableFrom(clazz) == true) {
          final GanttTask ganttObject = getGanttObject(taskTree, ganttChartData, el);
          if (ganttObject == null) {
            return new GanttTaskImpl(); // Gantt task not related to a ProjectForge task.
          }
          return ganttObject;
        } else if (Collection.class.isAssignableFrom(clazz) == true) {
          final GanttTask ganttObject = getGanttObject(taskTree, ganttChartData, el.getParent());
          if (ganttObject != null && ganttObject.getChildren() != null) {
            return ganttObject.getChildren();
          }
        }
        return null;
      }

      @Override
      protected boolean addCollectionEntry(final Collection< ? > col, final Object obj, final Element el)
      {
        if (obj instanceof GanttTask == false) {
          return false;
        }
        final GanttTask ganttTask = (GanttTask)obj;
        if (ganttChartData.findById(ganttTask.getId()) != null) {
          // GanttTask already added to the Gantt object tree.
          return true;
        }
        if (taskTree.getTaskById((Integer)ganttTask.getId()) != null) {
          // External task, so ignore it:
          return true;
        }
        return false;
      }
View Full Code Here

Examples of org.projectforge.task.TaskTree

      {
        if (super.ignoreField(obj, field) == true) {
          return true;
        }
        if (obj instanceof GanttTask) {
          final TaskTree taskTree = taskDao.getTaskTree();
          final String fieldName = field.getName();
          if ("id".equals(fieldName) == true) {
            // Id should always be equals and needed in output for the identification of the gantt object.
            return false;
          }
          if ("description".equals(fieldName) == true) {
            return true;
          }
          final GanttTask ganttObject = (GanttTask) obj;
          final TaskDO task = taskTree.getTaskById((Integer) ganttObject.getId());
          if (task != null) {
            if ("predecessor".equals(field.getName()) == true) {
              // Predecessor unmodified?
              return NumberHelper.isEqual((Integer) ganttObject.getPredecessorId(), task.getGanttPredecessorId());
            }
            String taskFieldname = fieldMapping.get(fieldName);
            if (taskFieldname == null) {
              taskFieldname = fieldName;
            }
            for (final Field taskField : taskFields) {
              if (taskFieldname.equals(taskField.getName()) == true) {
                final Object value = BeanHelper.getFieldValue(obj, field);
                final Object taskValue = BeanHelper.getFieldValue(task, taskField);
                if (value instanceof BigDecimal) {
                  // Needed, because 10.0 is not equal to 10.000 (if scale is different).
                  return NumberHelper.isEqual((BigDecimal) value, (BigDecimal) taskValue);
                }
                return ObjectUtils.equals(value, taskValue) == true;
              }
            }
          }
        }
        return false;
      }

      @Override
      protected void writeField(final Field field, final Object obj, final Object fieldValue, final XmlField annotation,
          final Element element)
      {
        if (GanttTask.class.isAssignableFrom(field.getDeclaringClass()) == true) {
          final String fieldName = field.getName();
          if ("id".equals(fieldName) == false) {
            final TaskTree taskTree = taskDao.getTaskTree();
            final GanttTask ganttObject = (GanttTask) obj;
            final TaskDO task = taskTree.getTaskById((Integer) ganttObject.getId());
            if (task != null) {
              String taskFieldname = fieldMapping.get(fieldName);
              if (taskFieldname == null) {
                taskFieldname = fieldName;
              }
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.