How to use the @theia/core/lib/browser.open function in @theia/core

To help you get started, we’ve selected a few @theia/core 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 eclipse-theia / theia / packages / keymaps / src / browser / keymaps-service.ts View on Github external
open(ref?: Widget): void {
        const options: WidgetOpenerOptions = {
            widgetOptions: ref ? { area: 'main', mode: 'split-right', ref } : { area: 'main' },
            mode: 'activate'
        };
        open(this.opener, this.resource.uri, options);
    }
github eclipse-theia / theia / packages / navigator / src / browser / navigator-model.ts View on Github external
previewNode(node: TreeNode): void {
        if (FileNode.is(node)) {
            open(this.openerService, node.uri, { mode: 'reveal', preview: true });
        }
    }
github eclipse-theia / theia / packages / navigator / src / browser / navigator-model.ts View on Github external
protected doOpenNode(node: TreeNode): void {
        if (FileNode.is(node)) {
            open(this.openerService, node.uri);
        } else {
            super.doOpenNode(node);
        }
    }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-commands.ts View on Github external
this.fileSystem.createFile(fileUri.toString()).then(() => {
                                open(this.openerService, fileUri);
                            });
                        }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-frontend-contribution.ts View on Github external
if (!isOSX && this.isElectron()) {
            return this.doOpenFile();
        }
        const [rootStat] = await this.workspaceService.roots;
        const destinationUri = await this.fileDialogService.showOpenDialog({
            title: WorkspaceCommands.OPEN.dialogLabel,
            canSelectFolders: true,
            canSelectFiles: true
        }, rootStat);
        if (destinationUri && this.getCurrentWorkspaceUri().toString() !== destinationUri.toString()) {
            const destination = await this.fileSystem.getFileStat(destinationUri.toString());
            if (destination) {
                if (destination.isDirectory) {
                    this.workspaceService.open(destinationUri);
                } else {
                    await open(this.openerService, destinationUri);
                }
                return destinationUri;
            }
        }
        return undefined;
    }
github eclipse-theia / theia / packages / extension-manager / src / browser / extension-widget.tsx View on Github external
    protected extensionClick = (extension: Extension) => open(this.openerService, ExtensionUri.toUri(extension.name));
github eclipse-theia / theia / packages / workspace / src / browser / workspace-frontend-contribution.ts View on Github external
protected async doOpenFile(): Promise {
        const props: OpenFileDialogProps = {
            title: WorkspaceCommands.OPEN_FILE.dialogLabel,
            canSelectFolders: false,
            canSelectFiles: true
        };
        const [rootStat] = await this.workspaceService.roots;
        const destinationFileUri = await this.fileDialogService.showOpenDialog(props, rootStat);
        if (destinationFileUri) {
            const destinationFile = await this.fileSystem.getFileStat(destinationFileUri.toString());
            if (destinationFile && !destinationFile.isDirectory) {
                await open(this.openerService, destinationFileUri);
                return destinationFileUri;
            }
        }
        return undefined;
    }
github eclipse-theia / theia / packages / git / src / browser / diff / git-diff-contribution.ts View on Github external
const fileStat = await this.fileSystem.getFileStat(uri);
                        const options: Git.Options.Diff = {
                            uri,
                            range: {
                                fromRevision
                            }
                        };
                        if (fileStat) {
                            if (fileStat.isDirectory) {
                                this.showWidget(options);
                            } else {
                                const fromURI = fileUri.withScheme(GIT_RESOURCE_SCHEME).withQuery(fromRevision);
                                const toURI = fileUri;
                                const diffUri = DiffUris.encode(fromURI, toURI);
                                if (diffUri) {
                                    open(this.openerService, diffUri).catch(e => {
                                        this.notifications.error(e.message);
                                    });
                                }
                            }
                        }
                    }, this.repositoryProvider.findRepository(fileUri));
            }