Package net.sourceforge.ganttproject.document

Examples of net.sourceforge.ganttproject.document.Document


                addAttribute("id", "tpd6", myAttrs);
                textElement("duration", myAttrs, String.valueOf(t.getDuration().getLength()), handler);

                final List attachments = t.getAttachments();
                for (int i=0; i<attachments.size(); i++) {
                  Document nextAttachment = (Document)attachments.get(i);
                  URI nextUri = nextAttachment.getURI();
                  if (nextUri!=null) {
                    String strUri = URLDecoder.decode(nextUri.toString(), "utf-8");
                    if (strUri.startsWith("file:")) {
                      if (strUri.endsWith("/")) {
                        strUri = strUri.replaceAll("/+$", "");
                      }
                      int lastSlash = strUri.lastIndexOf('/');
                      if (lastSlash >= 0) {
                        addAttribute("display-name", strUri.substring(lastSlash+1), myAttrs);
                      }
                    }
                    textElement("attachment", myAttrs, strUri, handler);
                  }
                  else {
                    textElement("attachment", myAttrs, nextAttachment.getPath(), handler);
                  }
                }
                {
                  ProjectResource coordinator = t.getAssignmentCollection().getCoordinator();
                  if (coordinator!=null) {
View Full Code Here


    }

    protected void openDocument(GanttProject targetProject, IGanttProject bufferProject, UIFacade uiFacade, File selectedFile,
            boolean bMerge) {
        try {
          Document document = bufferProject.getDocumentManager().getDocument(selectedFile.getAbsolutePath());
          document.read();
            targetProject.getRoleManager().importData(bufferProject.getRoleManager());
            {
              CustomPropertyManager targetResCustomPropertyMgr = targetProject.getResourceCustomPropertyManager();
              targetResCustomPropertyMgr.importData(bufferProject.getResourceCustomPropertyManager());
            }
View Full Code Here

        mMRU.removeAll();
        int index = 0;
        Iterator iterator = documentsMRU.iterator();
        while (iterator.hasNext()) {
            index++;
            Document document = (Document) iterator.next();
            JMenuItem mi = new JMenuItem(new OpenDocumentAction(index,
                    document, this));
            mMRU.add(mi);
        }
    }
View Full Code Here

    }

    public void open(Document document) throws IOException {
        openDocument(document);
        if (document.getPortfolio()!=null) {
            Document defaultDocument = document.getPortfolio().getDefaultDocument();
            openDocument(defaultDocument);
        }
    }
View Full Code Here

        //repaint2();
    }

    public void openStartupDocument(String path) {
        if (path != null) {
            final Document document = getDocumentManager().getDocument(path);
            //openStartupDocument(document);
            getUndoManager().undoableEdit("OpenFile", new Runnable() {
                public void run() {
                    try {
                      getProjectUIFacade().openProject(document, getProject());
View Full Code Here

            }
        }
        File userHome = new File(System.getProperty("user.home"));
        File result = new File(userHome, project.getProjectName() + "."
                + proposedExtension);
        Document projectDocument = project.getDocument();
        if (projectDocument != null) {
            File localFile = new File(projectDocument.getFilePath());
            if (localFile.exists()) {
                String name = localFile.getAbsolutePath();
                int lastDot = name.lastIndexOf('.');
                name = name.substring(0, lastDot) + "." + proposedExtension;
                result = new File(name);
View Full Code Here

        PrintRequestAttributeSet attr = new HashPrintRequestAttributeSet();
        attr.add(myMediaSizeName);
        attr.add(myOrientation == PageFormat.LANDSCAPE ?
               OrientationRequested.LANDSCAPE :
                   OrientationRequested.PORTRAIT);
        Document doc = myProject.getDocument();
        if (doc != null)
            attr.add(new JobName(doc.getDescription(), language.getLocale()));

        if (prnJob.printDialog(attr)) {
            try {
                prnJob.print(attr);
                setVisible(false);
View Full Code Here

            // The last opened files
            {
                startElement("files", attrs, handler);
                for (Iterator iterator = documentsMRU.iterator(); iterator
                        .hasNext();) {
                    Document document = (Document) iterator.next();
                    addAttribute("path", document.getPath(), attrs);
                    emptyElement("file", attrs, handler);
                }
                endElement("files", handler);
            }
            addAttribute("category", "menu", attrs);
View Full Code Here

   * the app, or GanttProject is selected via the open-with menu option. The
   * event argument contains the path of the file in either case.
   */
  public void handleOpenFile(ApplicationEvent event) {
    String file;
    Document myDocument;

    if (myProj.checkCurrentProject() == true) {
      file = event.getFilename();
      myDocument = myProj.getDocumentManager().getDocument(file);
      try {
View Full Code Here

TOP

Related Classes of net.sourceforge.ganttproject.document.Document

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.