Package com.projity.pm.task

Examples of com.projity.pm.task.Project$Workspace


   * @see com.projity.document.ObjectEvent.Listener#objectChanged(com.projity.document.ObjectEvent)
   */
  public void objectChanged(ObjectEvent objectEvent) {

    if (objectEvent.getObject() instanceof Project) {
      Project project = (Project)objectEvent.getObject();
      if (objectEvent.isCreate()) {
        if (project.isOpenedAsSubproject())
          closeProjectFrame(project); // because it's now in a project
        else {
          DocumentFrame f = addProjectFrame(project);
        }

View Full Code Here


  public void setStartupFactory(StartupFactory startupFactory) {
    this.startupFactory = startupFactory;
  }

  public boolean isEditingMasterProject() {
    Project currentProject=currentFrame.getProject();
    if (currentProject == null)
      return false;
    return currentProject.isMaster() && !currentProject.isReadOnly();

  }
View Full Code Here

      frame.setTabNameAndTitle(project);
    }


    public void switchToProject(long projectId) {
      Project project = ProjectFactory.getInstance().findFromId(projectId);
      if (project == null)
        return;
      DocumentFrame f = (DocumentFrame) frameMap.get(project);
      if (f == null)
        return;
View Full Code Here

    CreateOptions opt=new CreateOptions();
    opt.setResourcePool(form.getResourcePool());
    opt.setLocal(local);
    opt.setName(form.getName());
    opt.setAddResources(!local);
    Project project = projectFactory.createProject(opt);
    try {
      //createProject above might make a new resource pool, so make sur it is used when copying properties
      //projectDialog.getForm().setResourcePool(project.getResourcePool());

      project.setManager(form.getManager());
      project.setName(form.getName());
      project.setNotes(form.getNotes());
      project.setForward(form.isForward());
      project.setGroup(form.getGroup());
      project.setDivision(form.getDivision());
      project.setProjectType(form.getProjectType());
      project.setProjectStatus(form.getProjectStatus());
      project.setExpenseType(form.getExpenseType());

      if (!form.isLocal()){
        project.setAccessControlPolicy(form.getAccessControlType());
        project.resetRoles(form.getAccessControlType()==0);
      }


      if (form.isLocal())
        project.setLocal(true);
      else project.setTemporaryLocal(true);
      if (form.isForward())
        project.setStartDate(form.getStartDate());
      else
        project.setFinishDate(form.getStartDate());
      // copy any extra fields to the project
      project.getExtraFields().putAll(form.getExtra().getExtraFields());

//      PropertyUtils.copyProperties(project, projectDialog.getForm());
    } catch (Exception propertyException) {
      propertyException.printStackTrace();
    }
View Full Code Here

      return;
    doingOpenDialog = true;

    finishAnyOperations();

    final Project project;
    project= getCurrentFrame().getProject();

//    List nodes=getCurrentFrame().getSelectedNodes();
//    if (nodes==null||nodes.size()==0) return;
//    Node node=(Node)nodes.get(0);
View Full Code Here



  public void insertSubproject(final Project project, final long subprojectUniqueId,final boolean undo) {
    addHistory("insertSubproject", new Object[]{project.getName(),project.getUniqueId(),subprojectUniqueId});
    Project openedAlready = ProjectFactory.getInstance().findFromId(subprojectUniqueId);

    if (!project.getSubprojectHandler().canInsertProject(subprojectUniqueId)) {
      Alert.error(Messages.getString("GraphicManager.SelectedProjectAlreadySubproject")); //$NON-NLS-1$
      return;
    }
    if (openedAlready != null && openedAlready.isOpenedAsSubproject()) {
      Alert.error(Messages.getString("GraphicManager.SelectedProjectAlreadyOpenedAsSubproject")); //$NON-NLS-1$
      return;
    }
    SubProj subprojectTask = project.getSubprojectHandler().createSubProj(subprojectUniqueId);
    Node subprojectNode = getCurrentFrame().addNodeForImpl(subprojectTask,NodeModel.EVENT);
View Full Code Here

    return result;
  }
protected boolean loadLocalDocument(String fileName,boolean merge){ //uses server to merge
  addHistory("loadLocalDocument",new Object[]{fileName,merge});
    //showWaitCursor(true);
    Project project;
    if (fileName==null) {
      //System.out.println("creating empty project");
      project = projectFactory.createProject();

    } else {
View Full Code Here

  protected void saveLocalDocument(String fileName,final boolean saveAs){
    addHistory("saveLocalDocument",new Object[]{fileName,saveAs});
    //showWaitCursor(true);
    SaveOptions opt=new SaveOptions();
    opt.setLocal(true);
    final Project project=getCurrentFrame().getProject();
    if (project.getFileName()!=fileName){
      final DocumentFrame frame=getCurrentFrame();
      if (saveAs) opt.setSaveAs(true);
      opt.setPostSaving(new Closure(){
        public void execute(Object arg0) {
          if (saveAs) frame.setId(project.getUniqueId()+""); //$NON-NLS-1$
          refreshSaveStatus(true);
        }
      });
    }
    if (fileName.endsWith(".pod")){ //$NON-NLS-1$
View Full Code Here

    if (fileName!=null) loadLocalDocument(fileName,!Environment.getStandAlone());
  }

  public void saveLocalProject(boolean saveAs){
    String fileName=null;
    Project project=getCurrentFrame().getProject();
    if (!saveAs){
      fileName=project.getFileName();
    }
    if (fileName==null) fileName=SessionFactory.getInstance().getLocalSession().chooseFileName(true,project.getGuessedFileName());
    if (fileName!=null) saveLocalDocument(fileName,saveAs);
  }
View Full Code Here

          writable = verifyOpenWritable(projectId);
        if (writable == null)
          return;
        gm.loadDocument(projectId, true,!writable,new Closure(){
          public void execute(Object arg0) {
            Project project=(Project)arg0;
            DocumentFrame frame=gm.getCurrentFrame();
            if (frame!=null&&frame.getProject().getUniqueId() != projectId) {
              gm.switchToProject(projectId);
            }
          }
View Full Code Here

TOP

Related Classes of com.projity.pm.task.Project$Workspace

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.