Examples of QuestionDialog


Examples of com.mucommander.ui.dialog.QuestionDialog

            }
            catch(WarnUserException e) {
              // TODO: question the user how does he want to open the file (as image, text..)
                // Todo: display a proper warning dialog with the appropriate icon
             
                QuestionDialog dialog = new QuestionDialog((Frame)null, Translator.get("warning"), Translator.get(e.getMessage()), frame,
                                                           new String[] {Translator.get("file_editor.open_anyway"), Translator.get("cancel")},
                                                           new int[]  {0, 1},
                                                           0);

                int ret = dialog.getActionValue();
                if(ret==1 || ret==-1)   // User canceled the operation
                    throw new UserCancelledException();

                // User confirmed the operation
                viewer = factory.createFileViewer();
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

                if(!globalHistory.historyContains(folderURL) && !file.equals(folderPanel.getFileTable().getSelectedFile())) {
                  // Restore default cursor
                  mainFrame.setCursor(Cursor.getDefaultCursor());

                  // Download or browse file ?
                  QuestionDialog dialog = new QuestionDialog(mainFrame,
                      null,
                      Translator.get("table.download_or_browse"),
                      mainFrame,
                      new String[] {BROWSE_TEXT, DOWNLOAD_TEXT, CANCEL_TEXT},
                      new int[] {BROWSE_ACTION, DOWNLOAD_ACTION, CANCEL_ACTION},
                      0);

                  int ret = dialog.getActionValue();

                  if(ret==-1 || ret==CANCEL_ACTION)
                    break;

                  // Download file
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

    // false if the user canceled the dialog or the save failed.
    public boolean askSave() {
        if(!saveNeeded)
            return true;

        QuestionDialog dialog = new QuestionDialog(getFrame(), null, Translator.get("file_editor.save_warning"), getFrame(),
                                                   new String[] {Translator.get("save"), Translator.get("dont_save"), Translator.get("cancel")},
                                                   new int[]  {JOptionPane.YES_OPTION, JOptionPane.NO_OPTION, JOptionPane.CANCEL_OPTION},
                                                   0);
        int ret = dialog.getActionValue();

        if((ret==JOptionPane.YES_OPTION && trySave(getCurrentFile())) || ret==JOptionPane.NO_OPTION) {
            setSaveNeeded(false);
            return true;
        }
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

                    editor = factory.createFileEditor();
                    break;
                }
            }
            catch(WarnUserException e) {
                QuestionDialog dialog = new QuestionDialog((Frame)null, Translator.get("warning"), Translator.get(e.getMessage()), null,
                                                           new String[] {Translator.get("file_editor.open_anyway"), Translator.get("cancel")},
                                                           new int[]  {0, 1},
                                                           0);

                int ret = dialog.getActionValue();
                if(ret==1 || ret==-1)   // User canceled the operation
                    throw new UserCancelledException();

                // User confirmed the operation
                editor = factory.createFileEditor();
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

        // Send a system notification if a notifier is available and enabled
        if(AbstractNotifier.isAvailable() && AbstractNotifier.getNotifier().isEnabled())
            AbstractNotifier.getNotifier().displayBackgroundNotification(NotificationType.JOB_ERROR, title, message);

        QuestionDialog dialog;
        if(getProgressDialog()==null)
            dialog = new QuestionDialog(getMainFrame(),
                                        title,
                                        message,
                                        getMainFrame(),
                                        actionTexts,
                                        actionValues,
                                        0);
        else
            dialog = new QuestionDialog(getProgressDialog(),
                                        title,
                                        message,
                                        getMainFrame(),
                                        actionTexts,
                                        actionValues,
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

        super.checkCommit();

        // If the theme has been modified and is not the user theme, asks the user to confirm
        // whether it's ok to overwrite his user theme.
        if(!theme.isIdentical(data) && !theme.canModify())
            if(new QuestionDialog(this, Translator.get("warning"), Translator.get("theme_editor.theme_warning"),
                                  this, new String[]{Translator.get("yes"), Translator.get("no")}, new int[]{0,1}, 0).getActionValue() != 0)
                return false;
        return true;
    }
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

        UIManager.LookAndFeelInfo selection; // Currently selected look and feel.

        selection = lookAndFeels[lookAndFeelComboBox.getSelectedIndex()];

        // Asks the user whether he's sure he wants to delete the selected look and feel.
        if(new QuestionDialog(parent, null, Translator.get("prefs_dialog.delete_look_and_feel", selection.getName()), parent,
                              new String[] {Translator.get("yes"), Translator.get("no")},
                              new int[]  {YES_ACTION, NO_ACTION},
                              0).getActionValue() != YES_ACTION)
            return;
View Full Code Here

Examples of com.mucommander.ui.dialog.QuestionDialog

     * Deletes the specified theme.
     * @param theme theme to delete.
     */
    private void deleteTheme(Theme theme) {
        // Asks the user whether he's sure he wants to delete the selected theme.
        if(new QuestionDialog(parent, null, Translator.get("prefs_dialog.delete_theme", theme.getName()), parent,
                              new String[] {Translator.get("yes"), Translator.get("no")},
                              new int[]  {YES_ACTION, NO_ACTION},
                              0).getActionValue() != YES_ACTION)
            return;

View Full Code Here

Examples of hexenschach.gui.QuestionDialog

    GraphicsDevice device = environment.getDefaultScreenDevice();
    DisplayMode display = device.getDisplayMode();
    int x = display.getWidth();
    int y = display.getHeight();
    if(x < minXResolution || y < minYResolution) {
      QuestionDialog resolutionWarning = new QuestionDialog(gui, Dictionary.RelosutionDialogWarning) {
        private static final long serialVersionUID = -2534780214591239505L;
        @Override
        public void cancelButtonClicked() {
          System.exit(0);
        }
        @Override
        public void noButtonClicked() {
          System.exit(0);
        }
        @Override
        public void yesButtonClicked() {
          setVisible(false);
        }
      };
      resolutionWarning.setVisible(true);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.