@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); } }
@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); } }
@Override public void buttonClick(Button.ClickEvent clickEvent) { if (clickEvent.getSource() == myOkButton) { onOk((T) mySelect.getValue()); } else { onCancel(); } }