use of javax.swing.event.HyperlinkListener in project android by JetBrains.
the class ServicePanelBuilder method addLink.
public HyperlinkLabel addLink(@NotNull String text, @NotNull final URI uri) {
HyperlinkLabel linkLabel = new HyperlinkLabel(text);
linkLabel.addHyperlinkListener(new HyperlinkListener() {
@Override
public void hyperlinkUpdate(HyperlinkEvent e) {
try {
Desktop.getDesktop().browse(uri);
} catch (IOException e1) {
// Don't care
}
}
});
addComponent(linkLabel);
return linkLabel;
}
use of javax.swing.event.HyperlinkListener in project intellij-plugins by JetBrains.
the class FlexBaseRunner method checkDebuggerFromSdk4.
private static void checkDebuggerFromSdk4(final Project project, final RunProfile runProfile, final FlashRunnerParameters params, final FlexBuildConfiguration bc) {
final Sdk sdk = bc.getSdk();
assert sdk != null;
final Sdk sdkForDebugger = FlexDebugProcess.getDebuggerSdk(params.getDebuggerSdkRaw(), sdk);
if (!FlexSdkUtils.isAirSdkWithoutFlex(sdk) && StringUtil.compareVersionNumbers(sdkForDebugger.getVersionString(), "4") < 0) {
final HyperlinkListener listener = new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(final HyperlinkEvent e) {
if ("RunConfiguration".equals(e.getDescription())) {
for (RunnerAndConfigurationSettings configuration : RunManager.getInstance(project).getConfigurationSettingsList(((RunConfiguration) runProfile).getType())) {
if (configuration.getConfiguration() == runProfile) {
RunDialog.editConfiguration(project, configuration, FlexBundle.message("edit.configuration.title"));
break;
}
}
}
}
};
final String message = FlexBundle.message("flex.sdk.3.mac.debug.problem", sdkForDebugger.getVersionString());
ToolWindowManager.getInstance(project).notifyByBalloon(ToolWindowId.DEBUG, MessageType.WARNING, message, null, listener);
}
}
use of javax.swing.event.HyperlinkListener in project processdash by dtuma.
the class TaskScheduleDialog method displayErrorDialog.
protected void displayErrorDialog(Map errors) {
if (errors == null || errors.size() == 0)
return;
String[] footer = EVMetrics.isWarningOnly(errors) ? null : resources.getStrings("Error_Dialog.Foot");
ErrorReporter err = new ErrorReporter(resources.getString("Error_Dialog.Title"), resources.getStrings("Error_Dialog.Head"), footer);
Iterator i = errors.keySet().iterator();
while (i.hasNext()) {
err.logError(//
StringUtils.findAndReplace(//
(String) i.next(), "\n#", "\n#http://ignored/"));
}
err.setHyperlinkListener(new HyperlinkListener() {
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
String url = e.getURL().getFile();
int pos = url.lastIndexOf('/');
String helpSet = url.substring(0, pos);
String topic = url.substring(pos + 1);
String helpUri = helpSet + "/frame.html?" + topic;
Browser.launch(helpUri);
}
}
});
err.done();
}
Aggregations