Files
tustu/app/com/efiAnalytics/ui/BrowserLauncher.java
johndoe6345789 31d7fce51a Add new UI components and event listeners for enhanced functionality
- Implemented BinTableFocusListener to manage focus events in BinTableView.
- Created BinTableKeyListener to handle key events and trigger updates.
- Added BinTableRefreshRunner and BinTableUpdateRunner for background processing.
- Introduced BinTableSelectionRunner to manage selection changes in the table.
- Developed BinTableToggleListener for toggling table states.
- Implemented BrowserLauncher for opening URLs and files in the default browser.
- Created ChartClickHandler and ChartMouseHandler for interactive chart features.
- Added ChartDataPoint and ChartDataSeriesManager for managing chart data.
- Introduced DataGapRange for handling data gaps in charts.
- Created DoubleValueListener interface for double value callbacks.
- Implemented HexByteTextArea for displaying and editing hex byte data.
- Developed LineChartComponent for rendering line charts.
- Added NavigationListener interface for navigation events.
- Created SimpleCallback interface for simple callback mechanisms.
- Implemented TableSelectionInfo interface for managing table selection states.
- Developed TargetIndicatorComponent for visualizing target indicators.
- Added TextFieldSelectAllListener to select all text in text fields on focus.
2026-01-11 06:44:28 +00:00

102 lines
3.9 KiB
Java

package com.efiAnalytics.ui;
import bH.D;
import bH.X;
import java.awt.Desktop;
import java.io.File;
import java.io.IOException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
public class BrowserLauncher {
static dK a = null;
public static void a(String paramString) {
if (paramString.startsWith("file:") && paramString.toLowerCase().contains(".pdf"))
try {
String str1 = X.b(paramString, " ", "%20");
URL uRL = new URL(str1);
a(uRL);
return;
} catch (MalformedURLException malformedURLException) {}
String str = System.getProperty("os.name");
boolean bool = false;
if (bool) {
URI uRI = null;
try {
String str1 = X.b(paramString, " ", "%20");
uRI = (new URL(str1)).toURI();
} catch (MalformedURLException malformedURLException) {
Logger.getLogger(aN.class.getName()).log(Level.SEVERE, (String)null, malformedURLException);
D.d("Invalid URL, will attempt direct opening: " + paramString);
bool = false;
} catch (URISyntaxException uRISyntaxException) {
Logger.getLogger(aN.class.getName()).log(Level.SEVERE, (String)null, uRISyntaxException);
D.d("Invalid URL, will attempt direct opening: " + paramString);
bool = false;
}
Desktop desktop = Desktop.getDesktop();
if (paramString.startsWith("http:")) {
try {
desktop.browse(uRI);
} catch (IOException iOException) {
Logger.getLogger(aN.class.getName()).log(Level.SEVERE, (String)null, iOException);
String str1 = "Failed to launch App for URL: " + paramString + "\nError: " + iOException.getLocalizedMessage();
JOptionPane.showMessageDialog(null, str1);
}
} else {
String str1 = paramString.substring(7);
File file = new File(str1);
try {
desktop.open(file);
} catch (IOException iOException) {
Logger.getLogger(aN.class.getName()).log(Level.SEVERE, (String)null, iOException);
String str2 = "Failed to launch App for URL: " + paramString + "\nError: " + iOException.getLocalizedMessage();
JOptionPane.showMessageDialog(null, str2);
}
}
}
if (!bool)
try {
D.d("Opening URL: " + paramString);
if (str.startsWith("Mac OS")) {
Class<?> clazz = Class.forName("com.apple.eio.FileManager");
Method method = clazz.getDeclaredMethod("openURL", new Class[] { String.class });
method.invoke(null, new Object[] { paramString });
} else if (str.startsWith("Windows")) {
Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + paramString);
} else {
String[] arrayOfString = { "chrome", "firefox", "chromium-browser", "opera", "konqueror", "epiphany", "mozilla", "netscape" };
String str1 = null;
for (byte b = 0; b < arrayOfString.length && str1 == null; b++) {
if (Runtime.getRuntime().exec(new String[] { "which", arrayOfString[b] }).waitFor() == 0)
str1 = arrayOfString[b];
}
if (str1 == null)
throw new Exception("Could not find web browser");
Runtime.getRuntime().exec(new String[] { str1, paramString });
}
} catch (Exception exception) {
JOptionPane.showMessageDialog(null, "Failed to launch App for URL: :\n" + exception.getLocalizedMessage());
}
}
public static void a(URL paramURL) {
if (a == null)
a = new dK(bV.c());
a.a(paramURL);
a.a(true);
}
}
/* Location: /home/rewrich/Downloads/TunerStudioMS/TunerStudioMS/!/com/efiAnalytics/ui/aN.class
* Java compiler version: 8 (52.0)
* JD-Core Version: 1.1.3
*/