How to use the @theia/filesystem/lib/common.FileStat.is function in @theia/filesystem

To help you get started, we’ve selected a few @theia/filesystem examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipsesource / coffee-editor / web / coffee-editor-extension / src / browser / CoffeeLabelProvider.ts View on Github external
canHandle(uri: object): number {
        let toCheck = uri;
        if (FileStat.is(toCheck)) {
            toCheck = new URI(toCheck.uri);
        }
        if (toCheck instanceof URI) {
            if (toCheck.path.ext === '.coffee') {
                return 1000;
            }
        }
        return 0;
    }
github eclipse-theia / theia / packages / plugin-ext / src / main / browser / plugin-icon-theme-service.ts View on Github external
if (element.expanded) {
                return [this.rootFolderExpandedIcon, this.expandedFolderNameIcon(name)];
            }
            return [this.rootFolderIcon, this.folderNameIcon(name)];
        }
        if (DirNode.is(element)) {
            if (element.expanded) {
                const name = this.labelProvider.getName(element);
                return [this.folderExpandedIcon, this.expandedFolderNameIcon(name)];
            }
            return this.getFolderClassNames(element);
        }
        if (FileStatNode.is(element)) {
            return this.getFileClassNames(element, element.fileStat.uri);
        }
        if (FileStat.is(element)) {
            if (element.isDirectory) {
                return this.getFolderClassNames(element);
            }
            return this.getFileClassNames(element, element.uri);
        }
        if (URIIconReference.is(element)) {
            if (element.id === 'folder') {
                return this.getFolderClassNames(element);
            }
            return this.getFileClassNames(element, element.uri && element.uri.toString());
        }
        return this.getFileClassNames(element, element.toString());
    }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-uri-contribution.ts View on Github external
protected getUri(element: URI | URIIconReference | FileStat): URI | undefined {
        if (FileStat.is(element)) {
            return new URI(element.uri);
        }
        return super.getUri(element);
    }
}
github eclipse-theia / theia / packages / workspace / src / browser / workspace-uri-contribution.ts View on Github external
protected asURIIconReference(element: URI | URIIconReference | FileStat): URI | URIIconReference {
        if (FileStat.is(element)) {
            return URIIconReference.create(element.isDirectory ? 'folder' : 'file', new URI(element.uri));
        }
        return element;
    }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-uri-contribution.ts View on Github external
canHandle(element: object): number {
        if ((element instanceof URI && element.scheme === 'file' || URIIconReference.is(element) || FileStat.is(element))) {
            return 10;
        }
        return 0;
    }