Compare commits

...

1 Commits

Author SHA1 Message Date
Eyck Jentzsch ccc8d80ac2 add help plugin and handler, eclipse help does not start 2021-11-16 18:24:30 +01:00
32 changed files with 400 additions and 3 deletions

View File

@ -64,4 +64,11 @@
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin
id="com.minres.scviewer.help"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature> </feature>

View File

@ -35,7 +35,8 @@ Require-Bundle: javax.inject;bundle-version="1.0.0",
org.eclipse.equinox.p2.core;bundle-version="2.6.300", org.eclipse.equinox.p2.core;bundle-version="2.6.300",
org.eclipse.equinox.p2.engine;bundle-version="2.6.600", org.eclipse.equinox.p2.engine;bundle-version="2.6.600",
org.eclipse.equinox.p2.operations;bundle-version="2.5.700", org.eclipse.equinox.p2.operations;bundle-version="2.5.700",
org.eclipse.equinox.p2.metadata.repository;bundle-version="1.3.400" org.eclipse.equinox.p2.metadata.repository;bundle-version="1.3.400",
org.eclipse.help.base;bundle-version="4.2.900"
Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-RequiredExecutionEnvironment: JavaSE-11
Import-Package: com.minres.scviewer.database, Import-Package: com.minres.scviewer.database,
javax.annotation;version="1.0.0";resolution:=optional, javax.annotation;version="1.0.0";resolution:=optional,

View File

@ -10,10 +10,20 @@
*******************************************************************************/ *******************************************************************************/
package com.minres.scviewer.e4.application.handlers; package com.minres.scviewer.e4.application.handlers;
import java.io.File;
import java.net.URL;
import java.nio.file.Paths;
import org.eclipse.core.runtime.Platform;
import org.eclipse.e4.core.di.annotations.Execute; import org.eclipse.e4.core.di.annotations.Execute;
import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.ui.MUIElement; import org.eclipse.e4.ui.model.application.ui.MUIElement;
import org.eclipse.e4.ui.workbench.modeling.EModelService; import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.help.HelpSystem;
import org.eclipse.help.IHelp;
import org.eclipse.help.standalone.Help;
import org.eclipse.osgi.service.datalocation.Location;
public class HelpHandler { public class HelpHandler {
@ -25,8 +35,16 @@ public class HelpHandler {
// MPart mel = (MPart) ms.find(DIALOG_ID, app); //$NON-NLS-1$ // MPart mel = (MPart) ms.find(DIALOG_ID, app); //$NON-NLS-1$
// mel.setToBeRendered(true); // mel.setToBeRendered(true);
// mel.setToBeRendered(false); // mel.setToBeRendered(false);
MUIElement w = ms.find(WINDOW_ID, app); try {
if(w!=null) w.setToBeRendered(true); File installDir = Paths.get(Platform.getInstallLocation().getURL().toURI()).toFile();
File instanceDir = Paths.get(Platform.getInstanceLocation().getURL().toURI()).toFile();
Help helpSystem = new Help(new String[] {"-eclipseHome", installDir.getAbsolutePath(), "-data", instanceDir.getAbsolutePath()});
helpSystem.start();
helpSystem.displayHelp("/com.minres.scviewer.help/toc.xml");
} catch (Exception e) {
MUIElement w = ms.find(WINDOW_ID, app);
if(w!=null) w.setToBeRendered(true);
}
} }
} }

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.minres.scviewer.help</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
org.eclipse.jdt.core.compiler.compliance=11
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=11

View File

@ -0,0 +1,8 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: SCViewer Help
Bundle-SymbolicName: com.minres.scviewer.help;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: MINRES Technologies GmbH
Automatic-Module-Name: com.minres.scviewer.help
Bundle-RequiredExecutionEnvironment: JavaSE-11

View File

@ -0,0 +1,7 @@
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
html/,\
*.xml

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Main Topic</title>
</head>
<body>
<h1>Main Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic</title>
</head>
<body>
<h1>Sub Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic 2</title>
</head>
<body>
<h1>Sub Topic 2</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Main Topic</title>
</head>
<body>
<h1>Main Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic</title>
</head>
<body>
<h1>Sub Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic 2</title>
</head>
<body>
<h1>Sub Topic 2</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Main Topic</title>
</head>
<body>
<h1>Main Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic</title>
</head>
<body>
<h1>Sub Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic 2</title>
</head>
<body>
<h1>Sub Topic 2</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Main Topic</title>
</head>
<body>
<h1>Main Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic</title>
</head>
<body>
<h1>Sub Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic 2</title>
</head>
<body>
<h1>Sub Topic 2</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Main Topic</title>
</head>
<body>
<h1>Main Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic</title>
</head>
<body>
<h1>Sub Topic</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Sub Topic 2</title>
</head>
<body>
<h1>Sub Topic 2</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,13 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Table of Contents</title>
</head>
<body>
<h1>Table of Contents</h1>
Please enter your text here.
</body>
</html>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.help.toc">
<toc
file="toc.xml"
primary="true">
</toc>
<toc
file="tocconcepts.xml">
</toc>
<toc
file="tocgettingstarted.xml">
</toc>
<toc
file="tocreference.xml">
</toc>
<toc
file="tocsamples.xml">
</toc>
<toc
file="toctasks.xml">
</toc>
</extension>
</plugin>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="SCViewer Table of Contents" topic="html/toc.html">
<topic label="Getting Started">
<anchor id="gettingstarted"/>
</topic>
<topic label="Concepts">
<anchor id="concepts"/>
</topic>
<topic label="Tasks">
<anchor id="tasks"/>
</topic>
<topic label="Reference">
<anchor id="reference"/>
</topic>
<topic label="Samples">
<anchor id="samples"/>
</topic>
</toc>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Concepts" link_to="toc.xml#concepts">
<topic label="Main Topic" href="html/concepts/maintopic.html">
<topic label="Sub Topic" href="html/concepts/subtopic.html" />
</topic>
<topic label="Main Topic 2">
<topic label="Sub Topic 2" href="html/concepts/subtopic2.html" />
</topic>
</toc>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Getting Started" link_to="toc.xml#gettingstarted">
<topic label="Main Topic" href="html/gettingstarted/maintopic.html">
<topic label="Sub Topic" href="html/gettingstarted/subtopic.html" />
</topic>
<topic label="Main Topic 2">
<topic label="Sub Topic 2" href="html/gettingstarted/subtopic2.html" />
</topic>
</toc>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Reference" link_to="toc.xml#reference">
<topic label="Main Topic" href="html/reference/maintopic.html">
<topic label="Sub Topic" href="html/reference/subtopic.html" />
</topic>
<topic label="Main Topic 2">
<topic label="Sub Topic 2" href="html/reference/subtopic2.html" />
</topic>
</toc>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Samples" link_to="toc.xml#samples">
<topic label="Main Topic" href="html/samples/maintopic.html">
<topic label="Sub Topic" href="html/samples/subtopic.html" />
</topic>
<topic label="Main Topic 2">
<topic label="Sub Topic 2" href="html/samples/subtopic2.html" />
</topic>
</toc>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="Tasks" link_to="toc.xml#tasks">
<topic label="Main Topic" href="html/tasks/maintopic.html">
<topic label="Sub Topic" href="html/tasks/subtopic.html" />
</topic>
<topic label="Main Topic 2">
<topic label="Sub Topic 2" href="html/tasks/subtopic2.html" />
</topic>
</toc>

View File

@ -62,6 +62,7 @@
<feature id="com.minres.scviewer.database.feature" installMode="root"/> <feature id="com.minres.scviewer.database.feature" installMode="root"/>
<feature id="org.eclipse.e4.rcp" installMode="root"/> <feature id="org.eclipse.e4.rcp" installMode="root"/>
<feature id="com.opcoach.e4.preferences.feature" installMode="root"/> <feature id="com.opcoach.e4.preferences.feature" installMode="root"/>
<feature id="org.eclipse.help" installMode="root"/>
</features> </features>
<configurations> <configurations>