Exemplo n.º 1
0
 @Override
 public void buttonClick(Button.ClickEvent clickEvent) {
   if (clickEvent.getButton() == myGraphicsMagickHomepageButton) {
     getWindow().open(new ExternalResource("http://www.graphicsmagick.org"));
   } else if (clickEvent.getButton() == myGraphicsMagickBinarySelect) {
     File dir =
         StringUtils.isNotBlank((CharSequence) myGraphicsMagickBinary.getValue())
             ? new File((String) myGraphicsMagickBinary.getValue())
             : null;
     new ServerSideFileChooserWindow(
         50,
         Sizeable.UNITS_EM,
         null,
         getBundleString("miscConfigPanel.caption.selectGraphicsMagickBinary"),
         dir,
         null,
         ServerSideFileChooser.PATTERN_ALL,
         false,
         getApplication().getServerSideFileChooserLabels()) {
       @Override
       protected void onFileSelected(File file) {
         myGraphicsMagickBinary.setValue(file.getAbsolutePath());
         getWindow().getParent().removeWindow(this);
       }
     }.show(getWindow());
   } else {
     super.buttonClick(clickEvent);
   }
 }
Exemplo n.º 2
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   if (event.getButton().equals(btnSave)) {
     save();
   } else if (event.getButton().equals(btnRun)) {
     openExecutionWindow();
   } else if (event.getButton().equals(btnParameters)) {
     openParameterConfigurationWindow();
   }
 }
Exemplo n.º 3
0
 @Override
 public void buttonClick(final Button.ClickEvent clickEvent) {
   if (clickEvent.getButton() == myVlcHomepageButton) {
     getWindow().open(new ExternalResource("http://www.videolan.org"));
   } else if (clickEvent.getButton() == myVlcBinarySelect) {
     File dir =
         StringUtils.isNotBlank((CharSequence) myVlcBinary.getValue())
             ? new File((String) myVlcBinary.getValue())
             : null;
     new ServerSideFileChooserWindow(
         50,
         Sizeable.UNITS_EM,
         null,
         getBundleString("streamingConfigPanel.caption.selectVlcBinary"),
         dir,
         null,
         ServerSideFileChooser.PATTERN_ALL,
         false,
         getApplication().getServerSideFileChooserLabels()) {
       @Override
       protected void onFileSelected(File file) {
         myVlcBinary.setValue(file.getAbsolutePath());
         getWindow().getParent().removeWindow(this);
       }
     }.show(getWindow());
   } else if (clickEvent.getButton() == myAddTranscoder) {
     final TranscoderConfig config = new TranscoderConfig();
     config.setName(
         getBundleString(
             "transcoderConfigPanel.defaultName", myTranscoderNumberGenerator.getAndIncrement()));
     editTranscoderConfig(
         config,
         new Runnable() {
           @Override
           public void run() {
             myTranscoderConfigs.add(config);
           }
         });
   } else if (clickEvent.getButton() == myClearAllCachesButton) {
     boolean success =
         MyTunesRss.TRANSCODER_CACHE.clear()
             & MyTunesRss.HTTP_LIVE_STREAMING_CACHE.clear()
             & MyTunesRss.TEMP_CACHE.clear();
     if (success) {
       ((MainWindow) VaadinUtils.getApplicationWindow(this))
           .showInfo("streamingConfigPanel.clearAllCaches.done");
     } else {
       ((MainWindow) VaadinUtils.getApplicationWindow(this))
           .showWarning("streamingConfigPanel.clearAllCaches.warn");
     }
   } else {
     super.buttonClick(clickEvent);
   }
 }
 /* (non-Javadoc)
  * @see com.vaadin.ui.Button.ClickListener#buttonClick(com.vaadin.ui.Button.ClickEvent)
  */
 public void buttonClick(Button.ClickEvent event) {
   final Button btn = event.getButton();
   if (btn == okButton) {
     form.commit();
     fieldChanged();
   }
   close();
 }
Exemplo n.º 5
0
 @Override
 public void buttonClick(Button.ClickEvent clickEvent) {
   if (clickEvent.getSource() == myOkButton) {
     onOk((T) mySelect.getValue());
   } else {
     onCancel();
   }
 }
Exemplo n.º 6
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   final Button source = event.getButton();
   if (form.cancelButton == source) {
     getHome();
   } else if (form.changePasswordButton == source) {
     saveForm(form.binder);
   }
 }
    @Override
    public void buttonClick(final Button.ClickEvent event) {
      if (event.getButton().getId().equals(okButton.getId())) {
        callback.onConfirmResult(true);
      } else {
        callback.onConfirmResult(false);
      }

      close();
    }
Exemplo n.º 8
0
 @SuppressWarnings("serial")
 @Override
 public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
   if (event.getSource() == btnCreate) {
     createCategory();
   } else if (event.getSource() == btnUpdate) {
     ConfirmDialog.show(
         UI.getCurrent(),
         "Confirm update",
         "Are you sure you want to the update the selected category details?",
         "Yes",
         "No",
         new ConfirmDialog.Listener() {
           @Override
           public void onClose(ConfirmDialog dialog) {
             if (dialog.isConfirmed()) {
               updateCategory();
             }
           }
         });
   } else if (event.getSource() == btnDelete) {
     ConfirmDialog.show(
         UI.getCurrent(),
         "Confirm deletion",
         "Are you sure you want to the delete the selected category?",
         "Yes",
         "No",
         new ConfirmDialog.Listener() {
           @Override
           public void onClose(ConfirmDialog dialog) {
             if (dialog.isConfirmed()) {
               deleteCategory();
             }
           }
         });
   }
 }
Exemplo n.º 9
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   final Button source = event.getButton();
   if (source == form.save) {
     saveForm(form.binder);
   } else if (source == form.edit) {
     setEditFormProperties();
   } else if (source == form.cancel) {
     getHome();
   } else if (source == form.update) {
     saveEditedForm(form.binder);
   } else if (source == form.delete) {
     deleteForm(form.binder);
   }
 }
Exemplo n.º 10
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   if (event.getButton() == btDetails) {
     if (detailsPanel.isVisible()) {
       detailsPanel.setVisible(false);
       btDetails.setCaption("Show Details");
       layout.setExpandRatio(detailsPanel, 0.0f);
       layout.setExpandRatio(actionsLayout, 1.0f);
     } else {
       detailsPanel.setVisible(true);
       btDetails.setCaption("Hide Details");
       layout.setExpandRatio(detailsPanel, 1.0f);
       layout.setExpandRatio(actionsLayout, 0.0f);
     }
   } else if (event.getButton() == btClose) {
     this.close();
   } else if (event.getButton() == btReportBug) {
     this.close();
     UI ui = UI.getCurrent();
     if (ui instanceof SearchUI) {
       ((SearchUI) ui).reportBug(cause);
     }
   }
 }
Exemplo n.º 11
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   final Button source = event.getButton();
 }
Exemplo n.º 12
0
 @Override
 public void buttonClick(Button.ClickEvent event) {
   okPressed = event.getSource() == okButton;
   close();
 }