|
|
@ -5,6 +5,7 @@ import java.awt.event.ActionEvent; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
import java.net.URI; |
|
|
|
import java.net.URI; |
|
|
|
import java.net.URISyntaxException; |
|
|
|
import java.net.URISyntaxException; |
|
|
|
|
|
|
|
import java.util.Locale; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.JOptionPane; |
|
|
|
import javax.swing.KeyStroke; |
|
|
|
import javax.swing.KeyStroke; |
|
|
@ -32,22 +33,27 @@ public class VideoAction extends UpdateAction |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent arg0) |
|
|
|
public void actionPerformed(ActionEvent arg0) |
|
|
|
{ |
|
|
|
{ |
|
|
|
String url = SiteCenter.getInstance().acquireUrlByKind("bbs.video"); |
|
|
|
String url; |
|
|
|
if (StringUtils.isEmpty(url)) { |
|
|
|
if (FRContext.getLocale().equals(Locale.US)) { |
|
|
|
FRContext.getLogger().info("The URL is empty!"); |
|
|
|
url = SiteCenter.getInstance().acquireUrlByKind("bbs.video.en"); |
|
|
|
return; |
|
|
|
} else { |
|
|
|
} |
|
|
|
url = SiteCenter.getInstance().acquireUrlByKind("bbs.video"); |
|
|
|
try { |
|
|
|
} |
|
|
|
Desktop.getDesktop().browse(new URI(url)); |
|
|
|
if (StringUtils.isEmpty(url)) { |
|
|
|
} catch (IOException exp) { |
|
|
|
FRContext.getLogger().info("The URL is empty!"); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
|
|
|
return; |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
} |
|
|
|
} catch (URISyntaxException exp) { |
|
|
|
try { |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
Desktop.getDesktop().browse(new URI(url)); |
|
|
|
} catch (Exception exp) { |
|
|
|
} catch (IOException exp) { |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
JOptionPane.showMessageDialog(null, Inter.getLocText("Set_default_browser")); |
|
|
|
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
} |
|
|
|
} catch (URISyntaxException exp) { |
|
|
|
|
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
|
|
|
|
} catch (Exception exp) { |
|
|
|
|
|
|
|
FRContext.getLogger().errorWithServerLevel(exp.getMessage(), exp); |
|
|
|
|
|
|
|
FRContext.getLogger().error("Can not open the browser for URL: " + url); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
public static final MenuKeySet VIDEO = new MenuKeySet() { |
|
|
|
public static final MenuKeySet VIDEO = new MenuKeySet() { |
|
|
|