Exemplo n.º 1
0
 private void startReminder() {
   Runnable command =
       new Runnable() {
         @Override
         public void run() {
           try {
             System.out.println("Time to break!");
             Runtime.getRuntime()
                 .exec(
                     new String[] {
                       "zenity", "--info", "--title=" + TITLE, "--text=" + messageField.getText()
                     });
             System.out.println("Message was shown");
           } catch (IOException e) {
             e.printStackTrace();
           }
         }
       };
   Options options = optionsStorage.load();
   reminder.start(options.getWorkDuration(), command);
   startButton.setEnabled(false);
   pauseButton.setText(messageSource.getMessage("label.pause"));
 }
Exemplo n.º 2
0
 private void resumeReminder() {
   reminder.resume();
   startButton.setEnabled(false);
   pauseButton.setText(messageSource.getMessage("label.pause"));
 }
Exemplo n.º 3
0
 private void pauseReminder() {
   reminder.pause();
   startButton.setEnabled(true);
   pauseButton.setText(messageSource.getMessage("label.resume"));
 }