本文整理汇总了Java中javax.help.HelpSet类的典型用法代码示例。如果您正苦于以下问题:Java HelpSet类的具体用法?Java HelpSet怎么用?Java HelpSet使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HelpSet类属于javax.help包,在下文中一共展示了HelpSet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSearchEngine
import javax.help.HelpSet; //导入依赖的package包/类
/**
*
* @return SearchEngine for QuickSearch
*/
synchronized SearchEngine createSearchEngine() {
//this is not very nice but i didn't any better way to create search engine
MergingSearchEngine result = null;
Collection<? extends HelpSet> sets = getHelpSets();
for (HelpSet hs: sets) {
if (shouldMerge(hs)) {
NavigatorView nv = findNavigatorView(hs);
if( null == nv )
continue;
if( null == result ) {
result = new MergingSearchEngine( nv );
} else {
result.merge( nv );
}
}
}
return result;
}
示例2: createAndDisplayJHelp
import javax.help.HelpSet; //导入依赖的package包/类
private JHelp createAndDisplayJHelp( HelpSet hs ) {
JHelp jh = createJHelp(hs);
if (jh == null) {
return null;
}
if (isModalExcludedSupported()) {
displayHelpInFrame(jh);
} else {
if (currentModalDialog() == null) {
Installer.log.fine("showing as non-dialog");
displayHelpInFrame(jh);
} else {
Installer.log.fine("showing as dialog");
displayHelpInDialog(jh);
}
}
return jh;
}
示例3: getHelpSets
import javax.help.HelpSet; //导入依赖的package包/类
/** Get all available help sets.
* Pay attention to {@link #helpSetsChanged} to see
* when this set will change.
* @return a collection of HelpSet
*/
protected final Collection<? extends HelpSet> getHelpSets() {
if (helpsets == null) {
Installer.log.fine("searching for instances of HelpSet...");
helpsets = Lookup.getDefault().lookupResult(HelpSet.class);
helpsets.addLookupListener(new LookupListener() {
public void resultChanged(LookupEvent ev) {
helpSetsChanged();
}
});
fireChangeEvent(); // since someone may be listening to whether they are ready
}
Collection<? extends HelpSet> c = helpsets.allInstances();
if (Installer.log.isLoggable(Level.FINE)) {
List<String> l = new ArrayList<String>(Math.min(1, c.size()));
for (HelpSet hs: c) {
l.add(hs.getTitle());
}
Installer.log.fine("listing helpsets: " + l);
}
return c;
}
示例4: createHelpSet
import javax.help.HelpSet; //导入依赖的package包/类
@Nullable
private static HelpSet createHelpSet() {
String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
HelpSet mainHelpSet = loadHelpSet(urlToHelp);
if (mainHelpSet == null) return null;
// merge plugins help sets
IdeaPluginDescriptor[] pluginDescriptors = PluginManagerCore.getPlugins();
for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
HelpSetPath[] sets = pluginDescriptor.getHelpSets();
for (HelpSetPath hsPath : sets) {
String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
if (!hsPath.getPath().startsWith("/")) {
url += "/";
}
url += hsPath.getPath();
HelpSet pluginHelpSet = loadHelpSet(url);
if (pluginHelpSet != null) {
mainHelpSet.add(pluginHelpSet);
}
}
}
return mainHelpSet;
}
示例5: IdeaJHelp
import javax.help.HelpSet; //导入依赖的package包/类
/**
* PATCHED VERSION OF SUPER CONSTRUCTOR
*/
public IdeaJHelp(HelpSet hs){
super(new DefaultHelpModel(hs));
navigators=new Vector();
navDisplayed=true;
// HERE -- need to do something about doc title changes....
this.contentViewer=new IdeaJHelpContentViewer(helpModel);
setModel(helpModel);
if(helpModel!=null){
setupNavigators();
}
updateUI();
}
示例6: actionPerformed
import javax.help.HelpSet; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
try {
String helpHS = "jhelpset.hs"; //$NON-NLS-1$
ClassLoader cl = getClass().getClassLoader();
URL hsURL = HelpSet.findHelpSet(cl, helpHS);
HelpSet hs = new HelpSet(null, hsURL);
HelpBroker hb = hs.createHelpBroker();
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
// Default HelpBroker size is too small, make bigger unless on anciente "VGA" resolution
if (d.width >= 1024 && d.height >= 800) {
hb.setSize(new Dimension(1024, 700));
} else {
hb.setSize(new Dimension(640, 480));
}
CSH.DisplayHelpFromSource helpDisplay = new CSH.DisplayHelpFromSource(hb);
helpDisplay.actionPerformed(e);
} catch (Exception ev) {
setEnabled(false);
SPSUtils.showExceptionDialogNoReport(parentFrame,
"Could not load help file",
ev);
}
}
示例7: createHelpBroker
import javax.help.HelpSet; //导入依赖的package包/类
private synchronized void createHelpBroker() {
if (this.helpBroker == null &&
Boolean.parseBoolean(Core.CONFIG.getProperty("help.enabled", "false"))) {
String path = Core.CONFIG.getProperty("help.path");
if (path == null) path = Core.HELP_HS_PATH;
// SwingHelpUtilities.setContentViewerUI("BasicNativeContentViewerUI");
// Find the HelpSet file and create the HelpSet object:
try {
URL hsURL = new File(path).toURI().toURL();//HelpSet.findHelpSet(cl, path);
this.helpBroker = new DefaultHelpBroker(new HelpSet(null, hsURL));
Core.LOGGER.info("HelpSet " + path + " configured");
} catch (Exception ee) {
// Say what the exception really is
Core.LOGGER.error("HelpSet " + path + " not found", ee);
this.helpBroker = null;
}
}
}
示例8: startupMapHook
import javax.help.HelpSet; //导入依赖的package包/类
/**
*
*/
public void startupMapHook() {
super.startupMapHook();
// Find the HelpSet file and create the HelpSet object:
String helpHS = "plugins/help/doc/freemind.hs";
try {
ClassLoader classLoader = this.getClass().getClassLoader();
URL hsURL = HelpSet.findHelpSet(classLoader, helpHS);
HelpSet hs = new HelpSet(classLoader, hsURL);
HelpBroker hb = hs.createHelpBroker();
hb.initPresentation();
hb.setDisplayed(true);
hb.setViewDisplayed(true);
} catch (Exception ee) {
// Say what the exception really is
freemind.main.Resources.getInstance().logException(ee);
logger.warning("HelpSet " + ee.getMessage() + ee);
logger.warning("HelpSet " + helpHS + " not found");
return;
}
}
示例9: createHelpSet
import javax.help.HelpSet; //导入依赖的package包/类
@Nullable
private static HelpSet createHelpSet() {
String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
HelpSet mainHelpSet = loadHelpSet(urlToHelp);
if (mainHelpSet == null) return null;
// merge plugins help sets
IdeaPluginDescriptor[] pluginDescriptors = PluginManager.getPlugins();
for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
HelpSetPath[] sets = pluginDescriptor.getHelpSets();
for (HelpSetPath hsPath : sets) {
String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
if (!hsPath.getPath().startsWith("/")) {
url += "/";
}
url += hsPath.getPath();
HelpSet pluginHelpSet = loadHelpSet(url);
if (pluginHelpSet != null) {
mainHelpSet.add(pluginHelpSet);
}
}
}
return mainHelpSet;
}
示例10: init
import javax.help.HelpSet; //导入依赖的package包/类
public void init() throws Exception {
GOptions options = GOptionsManager.getInstance().getOptions();
String language = options.getLanguage();
logger.info(String.format("Creating helpset for %s", language));
if (mainWindow != null) {
mainWindow.setDisplayed(false);
}
String file = String.format("/javahelp/%s/jhelpset.hs",language);
URL url = GHelpManager.class.getResource(file);
hs = new HelpSet(null, url);
hs.createHelpBroker().initPresentation();
mainWindow = (MainWindow)MainWindow.getPresentation(hs, "mainWindow");
Frame owner = GDocumentHandler.getInstance().getOwnerFrame();
mainWindow.setActivationWindow(owner);
Font font = options.getFont();
mainWindow.setFont(font);
}
示例11: display
import javax.help.HelpSet; //导入依赖的package包/类
public void display(Window parent) {
if (helpFrame == null) {
helpFrame = new JFrame();
helpFrame.getGlassPane().setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
try {
HelpSet helpSet = new HelpSet(null, helpSetPath.getURL());
JHelp jhelp = new JHelp(helpSet);
helpFrame = new JFrame("Help - " + getApplicationName());
helpFrame.getContentPane().add(jhelp);
helpFrame.setIconImage(getApplicationImage());
helpFrame.pack();
}
catch (Exception e) {
e.printStackTrace();
}
helpFrame.getGlassPane().setCursor(Cursor.getDefaultCursor());
}
if (!helpFrame.isVisible()) {
WindowUtils.centerOnParent(helpFrame, parent);
helpFrame.setVisible(true);
}
if ((helpFrame.getExtendedState() & Frame.NORMAL) == 0) {
helpFrame.setExtendedState(Frame.NORMAL);
}
helpFrame.toFront();
}
示例12: initHelpSystem
import javax.help.HelpSet; //导入依赖的package包/类
/**
* Initialize the JavaHelp system.
*/
public static void initHelpSystem() {
// optimization to avoid repeated init
if (fHelp != null && fDisplayHelp != null)
return;
// (uses the classloader mechanism)
ClassLoader loader = IntroduceHelp.class.getClassLoader();
URL helpSetURL = HelpSet.findHelpSet(loader, "Introduce.hs");
try {
helpSet = new HelpSet(null, helpSetURL);
fHelp = helpSet.createHelpBroker();
fDisplayHelp = new CSH.DisplayHelpFromSource(fHelp);
} catch (HelpSetException ex) {
logger.warn("Cannot create help system with: " + helpSetURL + " " + ex.getMessage());
}
}
示例13: IdeaJHelp
import javax.help.HelpSet; //导入依赖的package包/类
/**
* PATCHED VERSION OF SUPER CONSTRUCTOR
*/
public IdeaJHelp(HelpSet hs) {
super(new DefaultHelpModel(hs));
navigators = new Vector();
navDisplayed = true;
// HERE -- need to do something about doc title changes....
this.contentViewer = new IdeaJHelpContentViewer(helpModel);
setModel(helpModel);
if (helpModel != null) {
setupNavigators();
}
updateUI();
}
示例14: createHelpSet
import javax.help.HelpSet; //导入依赖的package包/类
@javax.annotation.Nullable
private static HelpSet createHelpSet() {
String urlToHelp = ApplicationInfo.getInstance().getHelpURL() + "/" + HELP_HS;
HelpSet mainHelpSet = loadHelpSet(urlToHelp);
if (mainHelpSet == null) return null;
// merge plugins help sets
IdeaPluginDescriptor[] pluginDescriptors = PluginManagerCore.getPlugins();
for (IdeaPluginDescriptor pluginDescriptor : pluginDescriptors) {
HelpSetPath[] sets = pluginDescriptor.getHelpSets();
for (HelpSetPath hsPath : sets) {
String url = "jar:file:///" + pluginDescriptor.getPath().getAbsolutePath() + "/help/" + hsPath.getFile() + "!";
if (!hsPath.getPath().startsWith("/")) {
url += "/";
}
url += hsPath.getPath();
HelpSet pluginHelpSet = loadHelpSet(url);
if (pluginHelpSet != null) {
mainHelpSet.add(pluginHelpSet);
}
}
}
return mainHelpSet;
}
示例15: createItem
import javax.help.HelpSet; //导入依赖的package包/类
@Override
public TreeItem createItem(String str, @SuppressWarnings("rawtypes") Hashtable hashtable, HelpSet helpSet, Locale locale) {
String target = (String)hashtable.get("target");
if (target != null) {
if (! map.isValidID(target, hs)) {
log(navfile + ": invalid map ID: " + target, Project.MSG_WARN);
} else {
log("OK map ID: " + target, Project.MSG_VERBOSE);
}
}
return createItem();
}