Skip navigation links
Cyc Core Client Implementation
com.cyc.session.ui

Class CycDialogPane

    • Constructor Detail

      • CycDialogPane

        public CycDialogPane(Object message,
                             String title,
                             int messageType,
                             int optionType,
                             Icon icon,
                             Object[] options,
                             Object initialValue)
    • Method Detail

      • getDialog

        public JDialog getDialog()
        Get the current dialog, creating a new one if needed.
        Returns:
        JDialog
      • prompt

        public void prompt()
        Present the user with the dialog. Once the user has responded, all resources associated with the dialog will be released.
      • getSelectedValue

        public int getSelectedValue()
      • create

        public static CycDialogPane create(Component parentComponent,
                                           JPanel panel,
                                           String title,
                                           int optionType,
                                           int messageType,
                                           Icon icon,
                                           Object[] options,
                                           Object initialValue)
                                    throws HeadlessException
        Brings up a dialog with a specified icon, where the initial choice is determined by the initialValue parameter and the number of choices is determined by the optionType parameter. Method signature closely follows: JOptionPane.showOptionDialog( Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
        Parameters:
        parentComponent - determines the Frame in which the dialog is displayed; if null, or if the parentComponent has no Frame, a default Frame is used
        panel - the JPanel to display
        title - the title string for the dialog
        optionType - an integer designating the options available on the dialog: DEFAULT_OPTION, YES_NO_OPTION, YES_NO_CANCEL_OPTION, or OK_CANCEL_OPTION
        messageType - an integer designating the kind of message this is, primarily used to determine the icon from the pluggable Look and Feel: ERROR_MESSAGE, INFORMATION_MESSAGE, WARNING_MESSAGE, QUESTION_MESSAGE, or PLAIN_MESSAGE
        icon - the icon to display in the dialog
        options - an array of objects indicating the possible choices the user can make; if the objects are components, they are rendered properly; non-String objects are rendered using their toString methods; if this parameter is null, the options are determined by the Look and Feel
        initialValue - the object that represents the default selection for the dialog; only meaningful if options is used; can be null
        Returns:
        an integer indicating the option chosen by the user, or CLOSED_OPTION if the user closed the dialog
        Throws:
        HeadlessException - if GraphicsEnvironment.isHeadless returns true
        See Also:
        GraphicsEnvironment.isHeadless()

Copyright © 2013–2018 Cycorp, Inc. All rights reserved.