当前位置: 首页>>代码示例>>Java>>正文


Java HelpSet类代码示例

本文整理汇总了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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:23,代码来源:JavaHelp.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:JavaHelp.java

示例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;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:27,代码来源:AbstractHelp.java

示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:HelpManagerImpl.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:IdeaJHelp.java

示例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);
    }         
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:26,代码来源:HelpAction.java

示例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;
			}
		}
	}
 
开发者ID:sing-group,项目名称:aibench-project,代码行数:21,代码来源:Core.java

示例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;
	}
}
 
开发者ID:iwabuchiken,项目名称:freemind_1.0.0_20140624_214725,代码行数:25,代码来源:FreemindHelpStarter.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:HelpManagerImpl.java

示例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);
}
 
开发者ID:stelian56,项目名称:geometria,代码行数:18,代码来源:GHelpManager.java

示例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();
}
 
开发者ID:shevek,项目名称:spring-rich-client,代码行数:27,代码来源:HelpContents.java

示例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());
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:IntroduceHelp.java

示例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();
}
 
开发者ID:consulo,项目名称:consulo,代码行数:21,代码来源:IdeaJHelp.java

示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:DesktopHelpManagerImpl.java

示例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();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:CheckHelpSets.java


注:本文中的javax.help.HelpSet类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。