public void saveAllFiles () {
        final JFileChooser fileSelect = new JFileChooser();
        Ctabinterface singleSource = null;
        BufferedWriter outputFile = null;
        boolean doSavingAction = true;
        String tabLabel = null;
        Component[] containers = null;
        javax.swing.filechooser.FileFilter superFilter = (javax.swing.filechooser.FileFilter) new Cextension("X3D", "x3d");
        fileSelect.setFileFilter(superFilter);
        synchronized (tabbedPaneLocker) {
            containers = tabbedPane.getComponents();
        }
        for (int index = 0; index < containers.length; index++) {
            singleSource = (Ctabinterface) containers[index]; // obtain selected source
            doSavingAction = true;
            if (singleSource != null) {
                try {
                    synchronized (singleSource.sourceNameLocker) {
                        if ((singleSource.sourceName == null) && (fileSelect.showSaveDialog(this) == JFileChooser.APPROVE_OPTION))
                            singleSource.sourceName = fileSelect.getSelectedFile().getAbsolutePath()+".x3d";
                        else doSavingAction = false;
                        if ((doSavingAction) || ((singleSource.sourceName != null) && (singleSource.documentChanged))) {
                            outputFile = new BufferedWriter(new FileWriter(singleSource.sourceName));
                            outputFile.write(singleSource.mainView.getDocument().getText(0, singleSource.mainView.getDocument().getLength()));
                            outputFile.newLine();
                            outputFile.close();
                            tabLabel = singleSource.sourceName;
                            if (tabLabel.length() > 10) // Truncate extended tab's names
                                tabLabel = "..."+tabLabel.substring(tabLabel.length()-10);
                            tabbedPane.setTitleAt(tabbedPane.indexOfComponent(singleSource), tabLabel);
                            singleSource.documentChanged = false;
                            consolePane.appendText("X3D file "+singleSource.sourceName+" saved correctly;", false);
                        }
                    }
                } catch (Exception ext) {
                    Cerrorinterface bck = new Cerrorinterface("SAVINGERR", false);
                }
            }
        }
    }