Skip to content

Commit 1d865b4

Browse files
author
jantje
committed
#397 remove desktop object completely
1 parent d80f0a3 commit 1d865b4

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

it.baeyens.arduino.core/src/it/baeyens/arduino/actions/LinkCommandHandler.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ public class LinkCommandHandler extends AbstractHandler {
1616
public Object execute(ExecutionEvent event) throws ExecutionException {
1717
try {
1818
String url = event.getParameter("it.baeyens.arduino.core.link.parameter");//$NON-NLS-1$
19-
// Desktop.getDesktop().browse(new URI(url));
2019
org.eclipse.swt.program.Program.launch(url);
2120
} catch (IllegalArgumentException e) {
2221
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.json_browser_fail, e));

it.baeyens.arduino.core/src/it/baeyens/arduino/ui/LinkPreferencePage.java

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
*******************************************************************************/
1111
package it.baeyens.arduino.ui;
1212

13-
import java.awt.Desktop;
1413
import java.io.File;
1514
import java.util.Arrays;
1615
import java.util.HashSet;
@@ -109,15 +108,10 @@ protected void createFieldEditors() {
109108
link.addHyperlinkListener(new HyperlinkAdapter() {
110109
@Override
111110
public void linkActivated(HyperlinkEvent he) {
112-
if (Desktop.isDesktopSupported()) {
113-
try {
114-
// Desktop.getDesktop().browse(new URI());
115-
org.eclipse.swt.program.Program.launch(link.getHref().toString());
116-
117-
} catch (IllegalArgumentException e) {
118-
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.json_browser_fail, e));
119-
}
120-
111+
try {
112+
org.eclipse.swt.program.Program.launch(link.getHref().toString());
113+
} catch (IllegalArgumentException e) {
114+
Common.log(new Status(IStatus.ERROR, Const.CORE_PLUGIN_ID, Messages.json_browser_fail, e));
121115
}
122116
}
123117
});

0 commit comments

Comments
 (0)