Package org.openide.filesystems

Examples of org.openide.filesystems.FileSystem


    private void STRIKETHROUGHActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_STRIKETHROUGHActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_STRIKETHROUGHActionPerformed

    private void setMimeType(JEditorPane editorPane, String mimeType, String extension) {
        FileSystem fileSystem = FileUtil.createMemoryFileSystem();
        try {
            FileObject file = fileSystem.getRoot().createData("template", extension);
            DataObject data = DataObject.find(file);
            if (data != null) {
                EditorKit kit = CloneableEditorSupport.getEditorKit(mimeType);
                editorPane.setEditorKit(kit);
                editorPane.getDocument().putProperty(Document.StreamDescriptionProperty, data);
View Full Code Here


        }
    }

    public void initFilters() {

        FileSystem fs = Repository.getDefault().getDefaultFileSystem();
        FileObject folder = fs.getRoot().getFileObject(FOLDER_ID);
        FileObject[] children = folder.getChildren();

        List<CustomFilter> customFilters = new ArrayList<CustomFilter>();
        HashMap<CustomFilter, String> afterMap = new HashMap<CustomFilter, String>();
        Set<CustomFilter> enabledSet = new HashSet<CustomFilter>();
View Full Code Here

    private static String getJsHelperText() {
        InputStream is = null;
        StringBuilder sb = new StringBuilder("importPackage(Packages.com.sun.hotspot.igv.filter);importPackage(Packages.com.sun.hotspot.igv.graph);importPackage(Packages.com.sun.hotspot.igv.data);importPackage(Packages.com.sun.hotspot.igv.util);importPackage(java.awt);");
        try {
            FileSystem fs = Repository.getDefault().getDefaultFileSystem();
            FileObject fo = fs.getRoot().getFileObject(JAVASCRIPT_HELPER_ID);
            is = fo.getInputStream();
            BufferedReader r = new BufferedReader(new InputStreamReader(is));
            String s;
            while ((s = r.readLine()) != null) {
                sb.append(s);
View Full Code Here

     *
     * @throws java.io.IOException
     */
    @Test
    public void testValidateFuelDirectoryName() throws IOException {
        FileSystem fileSystem = FileUtil.createMemoryFileSystem();
        FileObject sourceDirectory = fileSystem.getRoot();
        FileObject fuelDirectory = sourceDirectory.createFolder("myfuel");
        FileObject fuelFile = sourceDirectory.createData("myfuel.php");

        // directory
        FuelPhpCustomizerValidator validator = new FuelPhpCustomizerValidator()
View Full Code Here

     *
     * @throws java.io.IOException
     */
    @Test
    public void testValidateOilPathFile() throws IOException {
        FileSystem fileSystem = FileUtil.createMemoryFileSystem();
        FileObject sourceDirectory = fileSystem.getRoot();
        FileObject oil = sourceDirectory.createData("oil");

        // directory
        FuelPhpCustomizerValidator validator = new FuelPhpCustomizerValidator()
                .validateOilPath(sourceDirectory);
View Full Code Here

     *
     * @throws java.io.IOException
     */
    @Test
    public void testValidateOilPathDirectory() throws IOException {
        FileSystem fileSystem = FileUtil.createMemoryFileSystem();
        FileObject sourceDirectory = fileSystem.getRoot();
        FileObject oil = sourceDirectory.createFolder("oil");
        // directory
        FuelPhpCustomizerValidator validator = new FuelPhpCustomizerValidator()
                .validateOilPath(sourceDirectory);
        ValidationResult result = validator.getResult();
View Full Code Here

    }

    private void attachStatusListener() {
        try {
            final FileObject fileObject = getFile();
            FileSystem fs = fileObject.getFileSystem();
            FileStatusListener l = FileUtil.weakFileStatusListener(new FileStatusListener() {
                public void annotationChanged(FileStatusEvent ev) {
                    if (ev.hasChanged(fileObject)) {
                        if (ev.isNameChange()) {
                            fireDisplayNameChange(null, null);
                        }
                        if (ev.isIconChange()) {
                            fireIconChange();
                        }
                    }
                }
            }, fs);
            fs.addFileStatusListener(l);
        } catch (FileStateInvalidException ex) {
            Exceptions.printStackTrace(ex);
        }
    }
View Full Code Here

            //http://wiki.netbeans.org/ProjectVersioning
            //the code is slightly deprecated and could be updated, but it
            //still works.
            try {
                Repository repository  = Repository.getDefault();
                FileSystem sfs = repository.getDefaultFileSystem();
                FileObject fo = sfs.findResource("Projects/Actions")// NOI18N
                if (fo != null) {
                    DataObject dobj = DataObject.find(fo);
                    FolderLookup actionRegistry = new FolderLookup((DataFolder)dobj);
                    Lookup.Template query = new Lookup.Template(Object.class);
                    Lookup lookup = actionRegistry.getLookup();
View Full Code Here

       
        Collection<? extends FileSystem> collection = Lookup.getDefault().lookupAll(FileSystem.class);
        Iterator<? extends FileSystem> it = collection.iterator();
        boolean found = false;
        while(it.hasNext() && !found) {
            FileSystem fs = it.next();
            if(fs instanceof OptionsFileSystem) {
                optionsFileSystem = (OptionsFileSystem) fs;
                found = true;
            }
        }
View Full Code Here

TOP

Related Classes of org.openide.filesystems.FileSystem

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.