Package net.sourceforge.ganttproject.document

Examples of net.sourceforge.ganttproject.document.Document


    public void saveProject(IGanttProject project) {
        if (project.getDocument()==null) {
            saveProjectAs(project);
            return;
        }
        Document document = project.getDocument();
        if (!document.canWrite()) {
            myWorkbenchFacade.showErrorDialog(i18n.getText("msg10"));
            saveProjectAs(project);
            return;
        }
        if (!document.acquireLock()) {
            myWorkbenchFacade.showErrorDialog(i18n.getText("msg14"));
            saveProjectAs(project);
            return;
        }
        try {
View Full Code Here


            myWorkbenchFacade.showErrorDialog(e);
        }
    }

    private void afterSaveProject(IGanttProject project) {
        Document document = project.getDocument();
        myDocumentManager.addToRecentDocuments(document);
        String title = i18n.getText("appliTitle") + " ["
        + document.getDescription() + "]";
        myWorkbenchFacade.setWorkbenchTitle(title);
        if (document.isLocal()) {
            URI url = document.getURI();
            if (url!=null) {
                File file = new File(url);
                if (file!=null) {
                    myDocumentManager.changeWorkingDirectory(file.getParentFile());           
                }
View Full Code Here

                    if (overwritingChoice!=UIFacade.Choice.YES) {
                        continue;
                    }
                }
   
                Document document = myDocumentManager.getDocument(projectfile.getAbsolutePath());
                saveProject(document);
                project.setDocument(document);
                afterSaveProject(project);
                break;
            }
View Full Code Here

        }
    }


    public void saveProjectRemotely(IGanttProject project) {
        Document document = showURLDialog(project);
        if (document!=null) {
            project.setDocument(document);
            saveProject(project);
        }
    }
View Full Code Here

        fc.addChoosableFileFilter(ganttFilter);

        int returnVal = fc.showOpenDialog(myWorkbenchFacade.getMainFrame());
        if (returnVal == JFileChooser.APPROVE_OPTION) {
            final JFileChooser jfc = fc;
            Document document = getDocumentManager().getDocument(
                    jfc.getSelectedFile().getAbsolutePath());
            openProject(document, project);
        }
       
    }
View Full Code Here

            openProject(document, project);
        }
       
    }
    public void openRemoteProject(final IGanttProject project) throws IOException {
        final Document document = showURLDialog(project);
        if (document!=null) {
          openProject(document, project);
        }
    }
View Full Code Here

    private DocumentManager getDocumentManager() {
        return myDocumentManager;
    }
   
    private Document showURLDialog(IGanttProject project) {
        Document document = project.getDocument();
        GanttURLChooser uc = new GanttURLChooser(myWorkbenchFacade.getMainFrame(), false,
                (null != document) ? document.getURLPath() : myDocumentManager.getLastWebDAVDocumentOption().getValue(),
                (null != document) ? document.getUsername() : null,
                (null != document) ? document.getPassword() : null);
        uc.show();
        if (uc.change) {
            document = myDocumentManager.getDocument(uc.fileurl,
                        uc.userName, uc.password);
            myDocumentManager.getLastWebDAVDocumentOption().lock();
View Full Code Here

    }

    private Document saveFile() throws IOException {
        File tempFile = createTemporaryFile();
        tempFile.deleteOnExit();
        Document doc = myManager.getDocumentManager().getDocument(
                tempFile.getAbsolutePath());
        doc.write();
        //GPSaver saver = myManager.getParserFactory().newSaver();
        //saver.save(doc.getOutputStream());
        return doc;
    }
View Full Code Here

            throw new CannotRedoException();
        }
    }

    private void restoreDocument(Document document) throws IOException {
        Document projectDocument = myManager.getProject().getDocument();
    myManager.getProject().close();
        document.read();
        myManager.getProject().setDocument(projectDocument);
       
    }
View Full Code Here

    public String getFileTypeDescription() {
        return GanttLanguage.getInstance().getText("impex.msproject.description");
    }

    public void run(GanttProject project, UIFacade uiFacade, File selectedFile, boolean merge) {
        Document document = getDocument(selectedFile);
        openDocument(project, uiFacade, document);
    }
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.