How to use the @bentley/imodeljs-frontend.IModelApp.notifications function in @bentley/imodeljs-frontend

To help you get started, we’ve selected a few @bentley/imodeljs-frontend 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 imodeljs / imodeljs / plugins / hypermodeling / src / HyperModelingMarkers.ts View on Github external
return;

    let secLocPropList;
    const where = [...modelIds].join(",");
    const ecsql = "SELECT ECInstanceId as id FROM BisCore.SectionLocation WHERE Model.Id IN (" + where + ")";
    try {
      const secLocIds: Id64Array = [];
      for await (const row of vp.view.iModel.query(ecsql))
        secLocIds.push(row.id);
      if (0 !== secLocIds.length)
        secLocPropList = await vp.view.iModel.elements.getProps(secLocIds) as SectionLocationProps[];
    } catch (_) { }

    if (undefined === secLocPropList || 0 === secLocPropList.length) {
      const msg = HyperModelingPlugin.plugin.i18n.translate("HyperModeling:Error.NotFoundModels");
      IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg, undefined, OutputMessageType.Toast));
      return;
    }

    // Start by creating the decoration object and adding it as a ViewManager decorator.
    SectionLocationSetDecoration.decorator = new SectionLocationSetDecoration(vp, sectionMarkerImage);
    SectionLocationSetDecoration.decorator._detailMarkerImage = await this.loadImage(HyperModelingPlugin.plugin.resolveResourceUrl("detailmarkersprite.ico"));
    SectionLocationSetDecoration.decorator._elevationMarkerImage = await this.loadImage(HyperModelingPlugin.plugin.resolveResourceUrl("elevationmarkersprite.ico"));
    SectionLocationSetDecoration.decorator._planMarkerImage = await this.loadImage(HyperModelingPlugin.plugin.resolveResourceUrl("planmarkersprite.ico"));
    SectionLocationSetDecoration.decorator.createMarkers(secLocPropList);

    if (0 === SectionLocationSetDecoration.decorator._sectionLocations.markers.size) {
      const msg = HyperModelingPlugin.plugin.i18n.translate("HyperModeling:Error.NotFoundModels");
      IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, msg, undefined, OutputMessageType.Toast));
      return;
    }
github imodeljs / imodeljs / ui / components / src / ui-components / editors / CustomNumberEditor.tsx View on Github external
private _onKeyPress = (e: React.KeyboardEvent) => {
    if (e.key === "Escape") {
      e.preventDefault();
      e.stopPropagation();
      this._resetToOriginalValue();
    }

    if (e.key !== "Enter") {
      // istanbul ignore next
      if (IModelApp.notifications)
        IModelApp.notifications.closeInputFieldMessage();
    }
  }
github imodeljs / imodeljs / test-apps / ui-test-app / src / frontend / appui / widgets / UnifiedSelectionTableWidget.tsx View on Github external
      () => IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, "Menu item clicked")),
    );
github imodeljs / imodeljs / test-apps / ui-test-app / src / frontend / tools / ToolWithSettings.ts View on Github external
private showInfoFromCursorMenu(label: string) {
    const msg = `Context Menu selection - ${label}`;
    IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Info, msg));
  }
github imodeljs / imodeljs / test-apps / ui-test-app / src / frontend / tools / ToolSpecifications.tsx View on Github external
      execute: () => IModelApp.notifications.outputMessage(new NotifyMessageDetails(OutputMessagePriority.Warning, "This is a warning message", this._detailedMessage, OutputMessageType.Sticky)),
    });
github imodeljs / imodeljs / core / frontend-devtools / src / widgets / KeyinField.ts View on Github external
const outputMessage = async (msg: string) => {
      await IModelApp.notifications.openMessageBox(MessageBoxType.MediumAlert, msg, MessageBoxIconType.Warning);
      this.focus();
    };
github imodeljs / imodeljs / plugins / geo-photo / src / geoPhoto.ts View on Github external
public async showMarkers(): Promise {
    if (!this._markers) {
      this._markers = new GeoPhotoMarkerManager(this.plugin, this);
    }
    const message: string = this.plugin.i18n.translate("geoPhoto:messages.ShowingMarkers");
    const msgDetails: NotifyMessageDetails = new NotifyMessageDetails(OutputMessagePriority.Info, message);
    IModelApp.notifications.outputMessage(msgDetails);
    return this._markers.startDecorating();
  }
github imodeljs / imodeljs / core / frontend-devtools / src / tools / InspectElementTool.ts View on Github external
let curLine = 0;
        for (const line of lines) {
          appendText(line);
          if (++curLine > maxLines) {
            appendText("...");
            break;
          }
        }

        await IModelApp.notifications.openMessageBox(MessageBoxType.Ok, div, MessageBoxIconType.Information);
      }
    } catch (err) {
      messageDetails = new NotifyMessageDetails(OutputMessagePriority.Error, "Error occurred while generating summary", err.toString());
    }

    IModelApp.notifications.outputMessage(messageDetails);
  }