Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions core/ui/src/main/java/org/phoebus/ui/help/HelpApplication.java

This file was deleted.

114 changes: 0 additions & 114 deletions core/ui/src/main/java/org/phoebus/ui/help/HelpBrowser.java

This file was deleted.

46 changes: 43 additions & 3 deletions core/ui/src/main/java/org/phoebus/ui/help/OpenHelp.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
*******************************************************************************/
package org.phoebus.ui.help;

import org.phoebus.framework.workbench.ApplicationService;
import org.phoebus.framework.workbench.Locations;
import org.phoebus.ui.application.Messages;
import org.phoebus.ui.javafx.ImageCache;
import org.phoebus.ui.spi.MenuEntry;

import javafx.scene.image.Image;
import org.phoebus.ui.web.WebBrowserApplication;

import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.logging.Level;

import static org.phoebus.ui.application.PhoebusApplication.logger;

/** Menu entry to open help
* @author Kay Kasemir
Expand All @@ -23,7 +31,7 @@ public class OpenHelp implements MenuEntry
@Override
public String getName()
{
return HelpApplication.DISPLAY_NAME;
return Messages.Help;
}

@Override
Expand All @@ -41,7 +49,39 @@ public Image getIcon()
@Override
public Void call()
{
ApplicationService.createInstance(HelpApplication.NAME);
try {
URI helpLocationURI = new URI(determineHelpLocation());
WebBrowserApplication webBrowserApplication = new WebBrowserApplication();
webBrowserApplication.create(helpLocationURI);
} catch (URISyntaxException uriSyntaxException) {
throw new RuntimeException(uriSyntaxException);
}
return null;
}

public static String determineHelpLocation()
{
final File phoenix_install = Locations.install();

// The distribution includes a lib/ and a doc/ folder.
// Check for the doc/index.html
File loc = new File(phoenix_install, "doc/index.html");
if (loc.exists())
return loc.toURI().toString();

// During development,
// product is started from IDE as ....../git/phoebus/phoebus-product.
// Check for copy of docs in ....../git/phoebus/docs/build/html
loc = new File(phoenix_install, "docs");
if (loc.exists())
{
loc = new File(loc, "build/html/index.html");
if (loc.exists())
return loc.toURI().toString();
logger.log(Level.WARNING, "Found phoebus-doc repository, but no build/html/index.html. Run 'make html'");
}

// Fall back to online copy of the manual
return "https://control-system-studio.readthedocs.io";
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
org.phoebus.ui.welcome.Welcome
org.phoebus.ui.pv.PVListApplication
org.phoebus.ui.jobs.JobViewerApplication
org.phoebus.ui.help.HelpApplication
org.phoebus.ui.web.WebBrowserApplication