public ErrorReportDialog(AptiAPI aptiAPI, ErrorReport report) {
    this.aptiAPI = aptiAPI;
    this.report = report;

    setContentPane(contentPane);
    setModal(true);
    setResizable(false);
    getRootPane().setDefaultButton(sendReportButton);

    this.sendReportButton.addActionListener(this);
    this.dontSendButton.addActionListener(this);
    this.viewDetailsButton.addActionListener(this);

    TextFilter.assignFilter(this.descriptionArea, 255, TextFilter.NO_HTML, null);
    TextFilter.assignFilter(this.nameField, 70, TextFilter.ALPHA_SPACE, null);
    TextFilter.assignFilter(this.emailAddressField, 100, TextFilter.EMAIL, null);

    // call onDontSendReport() when cross is clicked
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent e) {
            onDontSendReport();
          }
        });

    // call onDontSendReport() on ESCAPE
    contentPane.registerKeyboardAction(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            onDontSendReport();
          }
        },
        KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0),
        JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);

    pack();
    setLocationRelativeTo(null);
  }
Ejemplo n.º 2
0
  public ExtractionTab(EmojiToolsGUI gui, File fontFile) {

    this.gui = gui;
    this.fontFile = null;

    setLayout(new BorderLayout());
    this.add(contentPane, BorderLayout.CENTER);

    this.browseButton.addActionListener(this);
    this.renameRadioButton1.addActionListener(this);
    this.renameRadioButton2.addActionListener(this);
    this.convertRadioButton1.addActionListener(this);
    this.convertRadioButton2.addActionListener(this);

    TextFilter.assignFilter(this.extractionDirectoryField, 50, TextFilter.FILENAME, this);

    this.openRootDirectoryButton.addActionListener(this);
    this.startExtractionButton.addActionListener(this);

    if (fontFile != null && fontFile.exists()) {
      this.fontFile = fontFile;
      startExtraction();
    }
  }