Package org.openoffice.gdocs.util

Examples of org.openoffice.gdocs.util.Document


                docNameLabel2.setVisible(true);
                docNameComboBox.setVisible(true);
                refreshButton.setVisible(true);
                docNameComboBox.addItem(docName.getText());
                final Map<String,Document> map = new HashMap<String,Document>();
                Document selected = null;
                final String docNameStr = docName.getText();
                for (Document doc:docsList) {
                    docNameComboBox.addItem(doc);
                    if (selected==null && docNameStr.startsWith(doc.getTitle())) {
                        selected = doc;
View Full Code Here


                        String mimeType = null;
                        if (currentFormat!=null) {
                            mimeType = currentFormat.getMimeType();
                        }
                        if (updateInsteadOfCreatingNew) {
                            Document docToUpdate = ((Document)docNameComboBox.getSelectedItem());
                            operationStatus = wrapper.update(pathName, docToUpdate.getDocumentLink(), mimeType);
                        } else {                           
                            operationStatus = wrapper.upload(pathName,docName,mimeType,convertToGoogleDocsFormat);
                        }
                        boolean success = false;
                        if (operationStatus!=null) {
View Full Code Here

        jLabel2.setEnabled(true);
        filterText.setEnabled(true);
        filterText.requestFocusInWindow();
        jTable1.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
            public void valueChanged(ListSelectionEvent e) {
                Document entry = ((DocumentsTableModel) jTable1.getModel()).getEntry(jTable1.getSelectedRow());
//                formatChoosePanel.setVisible(false);
                formatChoosePanel.setVisible(true);
                formatChooserLabel.setVisible(false);
                formatComboBox.setVisible(false);
                openViaBrowserButton.setEnabled(false);
View Full Code Here

        }
       
        public void open() {
        try {           
            wrapper.login(creditionals);
            Document entry = (((DocumentsTableModel)jTable1.getModel()).getEntry(jTable1.getSelectedRow()));
            doOpen(entry);
        } catch (AuthenticationException e) {
            e.printStackTrace();
            Configuration.log(e);
            JOptionPane.showMessageDialog(ImportDialog.this,Configuration.getResources().getString("INVALID_CREDITIONALS"));
View Full Code Here

//        }
//        return false;
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        Document entry = getList().get(rowIndex);
        Object obj = null;
        String date = entry.getUpdated();
        try {
//            date = df.format(wrapper.parseDate(entry.getUpdated().replace("Z", "-00:00Z")));
            date = df.format(wrapper.parseDate(entry.getUpdated()));
        } catch (ParseException pe) {
            Configuration.log("Problem with parsing date "+entry.getUpdated());
        }
        String folders = "";
        if (wrapper!=null && "Google Docs".equals(wrapper.getSystem())) {           
            for (String folder:entry.getFolders()) {
                if (folder==null) continue;
                if (isOneOf(folder,"document","presentation","spreadsheet","viewed")) continue;
                String color = folder2color.get(folder);
                if (color==null) {
                    if (lastColor<colors.length) {
                        color = colors[lastColor++];                       
                    } else {
                        color="gray|white";
                    }
                    folder2color.put(folder, color);
                }
                String[] fontColors = color.split("\\|");
                folders+="<i><font bgcolor=\""+fontColors[0]+"\" color=\""+fontColors[1]+"\">&nbsp;"+folder+"&nbsp;</font></i>";
            }
        }
        String name = entry.getTitle();
        if (!"".equals(folders)) {
            name="<html><body>"+name+" "+folders;
        }
        switch (columnIndex) {
            case 0: obj = name; break;
View Full Code Here

        }
        getList().add(entry);
    }

    public Document getEntry(int idx) {
        Document document = null;
        if (idx>=0 && idx<getList().size()) {
            document = getList().get(idx);
        }
        return document;
    }
View Full Code Here

TOP

Related Classes of org.openoffice.gdocs.util.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.