Class Dialogs

java.lang.Object
org.opentrafficsim.editor.Dialogs

public class Dialogs extends Object
Object that is part of OtsEditor and may be used to show dialogs.

Copyright (c) 2026-2026 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.

Author:
Wouter Schakel
  • Constructor Details

    • Dialogs

      public Dialogs(OtsEditor editor)
      Constructor.
      Parameters:
      editor - editor
  • Method Details

    • confirmNodeRemoval

      public boolean confirmNodeRemoval(XsdTreeNode node)
      Requests the user to confirm the deletion of a node. The default button is "Ok". The window popping up is considered sufficient warning, and in this way a speedy succession of "del" and "enter" may delete a consecutive range of nodes to be deleted.
      Parameters:
      node - node.
      Returns:
      true if the user confirms node removal.
    • confirmDiscardChanges

      public boolean confirmDiscardChanges()
      Shows a dialog in a modal pane to confirm discarding unsaved changes.
      Returns:
      whether unsaved changes can be discarded.
    • confirmGeneral

      public boolean confirmGeneral(String message)
      Shows a dialog in a modal pane to confirm message.
      Parameters:
      message - message to be confirmed
      Returns:
      whether message was confirmed.
    • showDescription

      public void showDescription(String description, String title)
      Shows a description in a modal pane.
      Parameters:
      description - description.
      title - title of the window, may be null but typically is the name of the node or attribute
    • showInvalidMessage

      public void showInvalidMessage(String invalidMessage, String title)
      Show invalid message.
      Parameters:
      invalidMessage - invalid message
      title - title, may be null
    • showInvalidToRunMessage

      public void showInvalidToRunMessage()
      Show tree invalid.
    • showCircularInputParameters

      public void showCircularInputParameters(String message)
      Show input parameters have a circular dependency.
      Parameters:
      message - exception message
    • showInvalidExpression

      public void showInvalidExpression(String message)
      Show message about invalid expression.
      Parameters:
      message - exception message
    • showUnableToRunFromTempFile

      public void showUnableToRunFromTempFile()
      Show unable to run.
    • confirmRemoveRecentFile

      public boolean confirmRemoveRecentFile()
      Ask to remove temporary file that could not be loaded.
      Returns:
      whether temporary file may be removed
    • confirmClearRecentFiles

      public boolean confirmClearRecentFiles()
      Ask to clear recent files.
      Returns:
      whether all recent files may be removed
    • confirmLoadAutosaveFile

      public Optional<Boolean> confirmLoadAutosaveFile(File file)
      Ask to load auto save file.
      Parameters:
      file - file
      Returns:
      whether to load auto save file, true means load, false means ok to delete, empty means do nothing
    • confirmRemoveAutosaveFile

      public boolean confirmRemoveAutosaveFile()
      Ask to remove auto save file (which could not be loaded).
      Returns:
      whether to remove auto save file
    • notification

      public void notification(String notification)
      Shows a notification.
      Parameters:
      notification - notification, should be short as it is also used as the dialog title
    • notification

      public void notification(String notification, String title)
      Shows a notification.
      Parameters:
      notification - notification
      title - dialog title