How to use the @theia/core/lib/browser.ConfirmDialog 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 / workspace / src / browser / workspace-frontend-contribution.ts View on Github external
private async confirmOverwrite(uri: URI): Promise {
        // Electron already handles the confirmation so do not prompt again.
        if (this.isElectron()) {
            return true;
        }
        // Prompt users for confirmation before overwriting.
        const confirmed = await new ConfirmDialog({
            title: 'Overwrite',
            msg: `Do you really want to overwrite "${uri.toString()}"?`
        }).open();
        return !!confirmed;
    }
github eclipsesource / coffee-editor / web / jsonforms-tree / src / browser / tree / json-forms-tree-widget.tsx View on Github external
return event => {
      event.stopPropagation();
      const dialog = new ConfirmDialog({
        title: 'Delete Node?',
        msg: 'Are you sure you want to delete the selected node?'
      });
      dialog.open().then(remove => {
        if (remove && node.parent && node.parent && JsonFormsTree.Node.is(node.parent)) {
          this.onDeleteEmitter.fire(node);
        }
      });
    };
  }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-delete-handler.ts View on Github external
protected confirm(uris: URI[]): Promise {
        return new ConfirmDialog({
            title: `Delete File${uris.length === 1 ? '' : 's'}`,
            msg: this.getConfirmMessage(uris)
        }).open();
    }
github eclipse-theia / theia / packages / git / src / browser / git-widget.tsx View on Github external
protected confirmAll(): Promise {
        return new ConfirmDialog({
            title: 'Discard All Changes',
            msg: 'Do you really want to discard all changes?'
        }).open();
    }
github eclipse-theia / theia / packages / filesystem / src / browser / filesystem-frontend-module.ts View on Github external
bind(FileShouldOverwrite).toFunction(async function (file: FileStat, stat: FileStat): Promise {
        const dialog = new ConfirmDialog({
            title: `The file '${file.uri}' has been changed on the file system.`,
            msg: 'Do you want to overwrite the changes made on the file system?',
            ok: 'Yes',
            cancel: 'No'
        });
        return !!await dialog.open();
    });
github eclipse-theia / theia / packages / git / src / browser / git-commands.ts View on Github external
protected confirmAll(): Promise {
        return new ConfirmDialog({
            title: 'Discard All Changes',
            msg: 'Do you really want to discard all changes?'
        }).open();
    }
github eclipse-theia / theia / packages / git / src / browser / git-commands.ts View on Github external
protected confirm(path: string): Promise {
        const uri = new URI(path);
        return new ConfirmDialog({
            title: 'Discard changes',
            msg: `Do you really want to discard changes in ${uri.displayName}?`
        }).open();
    }
github eclipse-theia / theia / packages / workspace / src / browser / workspace-frontend-contribution.ts View on Github external
protected async closeWorkspace(): Promise {
        const dialog = new ConfirmDialog({
            title: WorkspaceCommands.CLOSE.label!,
            msg: 'Do you really want to close the workspace?'
        });
        if (await dialog.open()) {
            await this.workspaceService.close();
        }
    }
github eclipse-theia / theia / packages / search-in-workspace / src / browser / search-in-workspace-result-tree-widget.tsx View on Github external
protected confirmReplaceAll(resultNumber: number, fileNumber: number): Promise {
        const go = fileNumber > 1;
        return new ConfirmDialog({
            title: 'Replace all',
            msg: `Do you really want to replace ${resultNumber} match${resultNumber > 1 ? 'es' : ''} ${go ? 'across' : 'in'} `
                + `${fileNumber} file${go ? 's' : ''} with "${this._replaceTerm}"?`
        }).open();
    }