Skip to content

Commit

Permalink
Quick changes for java 9. Does not work with java <= 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
ykazakov committed Dec 8, 2017
1 parent 6beb3a6 commit b1c14c2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 199 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
<dependency>
<groupId>org.apache.felix</groupId>
<artifactId>org.apache.felix.main</artifactId>
<version>4.4.1</version>
<version>5.6.10</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion protege-desktop/src/main/env/platform-independent/run.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
setlocal
cd /d %~dp0
java -Xmx${conf.mem.xmx}M -Xms${conf.mem.xms}M -Xss${conf.mem.xss}M ${conf.extra.args} -DentityExpansionLimit=100000000 -Dlogback.configurationFile=conf/logback-win.xml -Dfile.encoding=utf-8 -Dorg.protege.plugin.dir=plugins -classpath bundles/guava.jar;bundles/logback-classic.jar;bundles/logback-core.jar;bundles/slf4j-api.jar;bin/org.apache.felix.main.jar;bin/maven-artifact.jar;bin/protege-launcher.jar org.protege.osgi.framework.Launcher %1
java -Xmx${conf.mem.xmx}M -Xms${conf.mem.xms}M -Xss${conf.mem.xss}M ${conf.extra.args} -DentityExpansionLimit=100000000 -Dlogback.configurationFile=conf/logback-win.xml -Dfile.encoding=utf-8 --add-modules java.xml.bind -Dorg.protege.plugin.dir=plugins -classpath bundles/guava.jar;bundles/logback-classic.jar;bundles/logback-core.jar;bundles/slf4j-api.jar;bin/org.apache.felix.main.jar;bin/maven-artifact.jar;bin/protege-launcher.jar org.protege.osgi.framework.Launcher %1
1 change: 1 addition & 0 deletions protege-desktop/src/main/env/platform-independent/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ java -Xmx${conf.mem.xmx}M -Xms${conf.mem.xms}M \
-Dlogback.configurationFile=conf/logback.xml \
-DentityExpansionLimit=100000000 \
-Dfile.encoding=UTF-8 \
--add-modules java.xml.bind \
${conf.extra.args} \
-classpath bundles/guava.jar:bundles/logback-classic.jar:bundles/logback-core.jar:bundles/slf4j-api.jar:bin/org.apache.felix.main.jar:bin/maven-artifact.jar:bin/protege-launcher.jar \
$CMD_OPTIONS org.protege.osgi.framework.Launcher $1
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Desktop;
import java.io.File;
/*
* Copyright (C) 2007, University of Manchester
Expand All @@ -26,7 +24,7 @@
* Bio Health Informatics Group<br>
* Date: Sep 19, 2008<br><br>
*/
public class ProtegeAppleApplication extends AbstractAppleApplicationWrapper {
public class ProtegeAppleApplication {

private static final Logger logger = LoggerFactory.getLogger(ProtegeAppleApplication.class);

Expand All @@ -43,17 +41,27 @@ public static ProtegeAppleApplication getInstance(){
}


private ProtegeAppleApplication() {
}
private ProtegeAppleApplication() {
Desktop application = Desktop.getDesktop();
application.setPreferencesHandler(event -> handlePreferencesRequest());
application.setAboutHandler(event -> handleAboutRequest());
application.setOpenFileHandler(event -> {
File file = event.getFiles().get(0);
try {
editFile(file.getAbsolutePath());
} catch (Exception e) {
logger.error("invalid file: {}", file);
}
});
application.setQuitHandler((event, response) -> handleQuitRequest());
}


public void setEditorKit(EditorKit eKit){
this.eKit = eKit;
setEnabledPreferencesMenu(eKit != null);
}

@Override
protected void editFile(String fileName) throws Exception {
protected void editFile(String fileName) throws Exception {
ProtegeManager.getInstance().getApplication().editURI(new File(fileName).toURI());
}

Expand Down

0 comments on commit b1c14c2

Please sign in to comment.