This repository has been archived by the owner on Jul 16, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
69 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# The :projector-server:runServer task requires the following two declarations. | ||
projectorLauncher.targetClassPath=/home/azureuser/IdeaProjects/ebviewer/build/libs/ebviewer-0.6.0-11-d94eefedee-SNAPSHOT.jar | ||
projectorLauncher.classToLaunch=io.github.eb4j.ebview.EBViewer | ||
#useLocalProjectorServer=true | ||
|
||
# to enable connections via relay define both next variables | ||
#ORG_JETBRAINS_PROJECTOR_SERVER_RELAY_URL=localhost | ||
#ORG_JETBRAINS_PROJECTOR_SERVER_RELAY_SERVER_ID=DEFAULT_SERVER_ID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package io.github.eb4j.ebview; | ||
|
||
import org.jetbrains.projector.server.ProjectorLauncher; | ||
import org.jetbrains.projector.server.ProjectorServer; | ||
import tokyo.northside.protocol.URLProtocolHandler; | ||
|
||
import javax.swing.UIManager; | ||
import javax.swing.UnsupportedLookAndFeelException; | ||
import java.io.File; | ||
|
||
public class HeadlessEBViewer extends EBViewer implements Runnable { | ||
|
||
|
||
public HeadlessEBViewer(final File dictionaryDirectory) { | ||
super(dictionaryDirectory); | ||
} | ||
|
||
/** | ||
* Main function. | ||
* @param args command line arguments. | ||
*/ | ||
public static void main(final String... args) { | ||
if (ProjectorServer.isEnabled()) { | ||
if (!ProjectorLauncher.runProjectorServer()) { | ||
throw new RuntimeException("Fail to start projector server"); | ||
} | ||
} | ||
URLProtocolHandler.install(); | ||
try { | ||
UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); | ||
} catch (ClassNotFoundException | UnsupportedLookAndFeelException | IllegalAccessException | InstantiationException e) { | ||
e.printStackTrace(); | ||
} | ||
File dictionaryDirectory = null; | ||
if (args.length == 1) { | ||
dictionaryDirectory = new File(args[0]); | ||
} | ||
try { | ||
EBViewer viewer = new HeadlessEBViewer(dictionaryDirectory); | ||
Thread t = new Thread(viewer); | ||
t.start(); | ||
} catch (Exception e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
} |