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


Java HelpSet.findHelpSet方法代码示例

本文整理汇总了Java中javax.help.HelpSet.findHelpSet方法的典型用法代码示例。如果您正苦于以下问题:Java HelpSet.findHelpSet方法的具体用法?Java HelpSet.findHelpSet怎么用?Java HelpSet.findHelpSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.help.HelpSet的用法示例。


在下文中一共展示了HelpSet.findHelpSet方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: 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

示例4: actionPerformed

import javax.help.HelpSet; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
	try {
		String helpHS = "jhelpset.hs";
		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(parent,
				"Could not load the help file. The dqguruhelp.jar file either " +
				"doesn't exist or isn't in your classpath.\nThis error usually " +
				"occurrs because you are running the DQguru within an IDE.\n" +
				"The Help function is now disabled",
				ev);
	}         
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:29,代码来源:HelpAction.java

示例5: initialize_help

import javax.help.HelpSet; //导入方法依赖的package包/类
private void initialize_help(java.util.Locale p_locale)
{
    // try to find the helpset and create a HelpBroker object
    if (BoardFrame.help_broker == null)
    {
        String language = p_locale.getLanguage();
        String helpset_name;
        if (language.equalsIgnoreCase("de"))
        {
            helpset_name = "helpset/de/Help.hs";
        }
        else
        {
            helpset_name = "helpset/en/Help.hs";
        }
        try
        {
            URL hsURL = HelpSet.findHelpSet(this.getClass().getClassLoader(), helpset_name);
            if (hsURL == null)
            {
                System.out.println("HelpSet " + helpset_name + " not found.");
            }
            else
            {
                BoardFrame.help_set = new HelpSet(null, hsURL);
            }
        }
        catch (HelpSetException ee)
        {
            System.out.println("HelpSet " + helpset_name + " could not be opened.");
            System.out.println(ee.getMessage());
        }
        if (BoardFrame.help_set != null)
        {
            BoardFrame.help_broker = BoardFrame.help_set.createHelpBroker();
        }
        if (BoardFrame.help_broker != null)
        {
            // CSH.DisplayHelpFromSource is a convenience class to display the helpset
            contents_help = new CSH.DisplayHelpFromSource(BoardFrame.help_broker);
            direct_help = new CSH.DisplayHelpAfterTracking(BoardFrame.help_broker);
        }
    }
}
 
开发者ID:andrasfuchs,项目名称:BioBalanceDetector,代码行数:45,代码来源:BoardMenuHelp.java

示例6: createActions

import javax.help.HelpSet; //导入方法依赖的package包/类
/**
 *
 */
private void createActions() {

    actAbout = new ExtAction("&About", "Product Information") {

        @Override
        public void actionPerformed(final ActionEvent event) {
            LOGGER.info(event.getActionCommand());
            showAboutDialog();
        }
    };
    actLicense = new ExtAction("&License", "View License") {

        @Override
        public void actionPerformed(final ActionEvent event) {
            LOGGER.info(event.getActionCommand());
            showLicense();
        }
    };

    actQuit = new ExtAction("&Quit", "Quit EvA2 workbench",
            KeyStroke.getKeyStroke(KeyEvent.VK_Q, InputEvent.CTRL_MASK)) {

        @Override
        public void actionPerformed(final ActionEvent event) {
            int result = JOptionPane.showConfirmDialog(
                    MainFrame.this,
                    "Do you really want to exit EvA2?",
                    "Exit Application",
                    JOptionPane.YES_NO_OPTION);
            if (result == JOptionPane.YES_OPTION) {
                MainFrame.this.close();
            }
        }
    };

    actPreferences = new ExtAction("&Preferences", "Show preferences dialog",
            KeyStroke.getKeyStroke(KeyEvent.VK_P, InputEvent.CTRL_MASK)) {

        @Override
        public void actionPerformed(final ActionEvent event) {
            // ToDo
        }
    };

    actHelp = new ExtAction("&Help", "Show help contents",
            KeyStroke.getKeyStroke(KeyEvent.VK_F1, 0)) {

        @Override
        public void actionPerformed(final ActionEvent event) {
            // ToDo
            String helpHS = "EvA2Help/EvA2Help.hs";
            ClassLoader cl = MainFrame.class.getClassLoader();
            JHelpContentViewer helpPane;
            try {
                URL hsURL = HelpSet.findHelpSet(cl, helpHS);
                HelpSet helpSet = new HelpSet(null, hsURL);
                // Trigger the help viewer:
                helpPane = new JHelpContentViewer(helpSet);
                JHelpNavigator helpNavigator = (JHelpNavigator) helpSet.getNavigatorView("TOC").createNavigator(helpPane.getModel());
                JEFrame helpFrame = new JEFrame("Help contents");
                JSplitPane helpSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, helpNavigator, helpPane);
                helpFrame.add(helpSplit);
                helpFrame.setVisible(true);
                helpFrame.setMaximum(true);
            } catch (Exception ee) {
                // Say what the exception really is
                LOGGER.log(Level.WARNING, "Could not open application help", ee);
            }
        }
    };
}
 
开发者ID:openea,项目名称:eva2,代码行数:75,代码来源:MainFrame.java

示例7: isAvailable

import javax.help.HelpSet; //导入方法依赖的package包/类
/**
 * Tell if help set can be used
 *
 * @return true if the help set can be used, false otherwise.
 */
public static boolean isAvailable() {
    if (_instance == null) {
        _instance = new HelpView();
    }

    if (!_alreadyInitialized) {
        final ClassLoader appClassLoader = _instance.getClass().getClassLoader();

        URL url = null;
        try {
            // Get the helpset file and create the centered help broker 
            url = HelpSet.findHelpSet(appClassLoader, "documentation.hs");

            _logger.debug("HelpSet.findHelpSet(appClassLoader, 'documentation.hs') = '{}'.", url);

            // http://forums.sun.com/thread.jspa?messageID=10522645
            url = UrlUtils.fixJarURL(url);

            _logger.debug("using helpset url = '{}'.", url);

            // check if the url is valid :
            if (url == null) {
                _logger.info("No helpset document found.");

                return false;
            }

            final HelpSet helpSet = new HelpSet(appClassLoader, url);

            _helpBroker = helpSet.createHelpBroker();

        } catch (Exception e) {
            // skip complex case
            _logger.error("Problem during helpset creation (url='{}', classloader={})",
                    url, appClassLoader, e);
        }

        _alreadyInitialized = true;
    }

    return (_helpBroker != null);
}
 
开发者ID:JMMC-OpenDev,项目名称:jMCS,代码行数:48,代码来源:HelpView.java

示例8: initialize_help

import javax.help.HelpSet; //导入方法依赖的package包/类
private void initialize_help(java.util.Locale p_locale)
{
    // try to find the helpset and create a HelpBroker object
    if (BoardFrame.help_broker == null)
    {
        String language = p_locale.getLanguage();
        String helpset_name;
        if (language.equalsIgnoreCase("de"))
        {
            helpset_name = "helpset/de/Help.hs";
        }
        else
        {
            helpset_name = "helpset/en/Help.hs";
        }
        try
        {
            URL hsURL = HelpSet.findHelpSet(this.getClass().getClassLoader(), helpset_name);
            if (hsURL == null)
            {
                FRLogger.warning("HelpSet " + helpset_name + " not found.");
            }
            else
            {
                BoardFrame.help_set = new HelpSet(null, hsURL);
            }
        }
        catch (HelpSetException ee)
        {
            System.out.println("HelpSet " + helpset_name + " could not be opened.");
            System.out.println(ee.getMessage());
        }
        if (BoardFrame.help_set != null)
        {
            BoardFrame.help_broker = BoardFrame.help_set.createHelpBroker();
        }
        if (BoardFrame.help_broker != null)
        {
            // CSH.DisplayHelpFromSource is a convenience class to display the helpset
            contents_help = new CSH.DisplayHelpFromSource(BoardFrame.help_broker);
            direct_help = new CSH.DisplayHelpAfterTracking(BoardFrame.help_broker);
        }
    }
}
 
开发者ID:freerouting,项目名称:freerouting,代码行数:45,代码来源:BoardMenuHelp.java

示例9: start

import javax.help.HelpSet; //导入方法依赖的package包/类
@Override
public void start(BundleContext bc) throws Exception {
	
	CySwingApplication cytoscapeDesktopService = getService(bc,CySwingApplication.class);

	// register visualization related managers to Cytoscape
	// network creation
	CyNetworkManager cyNetworkManagerServiceRef = getService(bc,CyNetworkManager.class);
	CyNetworkNaming cyNetworkNamingServiceRef = getService(bc,CyNetworkNaming.class);
	CyNetworkFactory cyNetworkFactoryServiceRef = getService(bc,CyNetworkFactory.class);
	
	// progress dialog
	DialogTaskManager dialogTaskManager = getService(bc, DialogTaskManager.class);
	
	// view creation
	CyNetworkViewFactory networkViewFactory = getService(bc, CyNetworkViewFactory.class);
	CyNetworkViewManager networkViewManager = getService(bc, CyNetworkViewManager.class);
 
	// visual style manager
	VisualMappingManager vmmServiceRef = getService(bc,VisualMappingManager.class);
	VisualStyleFactory vsfServiceRef = getService(bc,VisualStyleFactory.class);

	// visual mapping functions
	VisualMappingFunctionFactory vmfFactoryC = getService(bc,VisualMappingFunctionFactory.class, "(mapping.type=continuous)");
	VisualMappingFunctionFactory vmfFactoryD = getService(bc,VisualMappingFunctionFactory.class, "(mapping.type=discrete)");
	VisualMappingFunctionFactory vmfFactoryP = getService(bc,VisualMappingFunctionFactory.class, "(mapping.type=passthrough)");

	// layout manager
	CyLayoutAlgorithmManager clamRef = getService(bc, CyLayoutAlgorithmManager.class);
	
	// main control panel added to the left of Cytoscape panel
	kddnConfigurePanel = new KddnConfigurePanel(cyNetworkManagerServiceRef,
			cyNetworkNamingServiceRef,cyNetworkFactoryServiceRef,
			dialogTaskManager, networkViewFactory, networkViewManager,
			vmmServiceRef, vsfServiceRef, vmfFactoryC,
			vmfFactoryD, vmfFactoryP, clamRef);
	registerService(bc,kddnConfigurePanel,CytoPanelComponent.class, new Properties());
	
	// results panel added to the right of Cytoscape panel
	kddnResultsPanel = new KddnResultsPanel(cytoscapeDesktopService);
	registerService(bc, kddnResultsPanel, CytoPanelComponent.class, new Properties());
	
	// menu items
	CyApplicationManager cyApplicationManager = getService(bc, CyApplicationManager.class);
	
	KddnMenuAction runMenu = new KddnMenuAction(cyApplicationManager, "Run analysis", cytoscapeDesktopService, kddnConfigurePanel);
	registerAllServices(bc, runMenu, new Properties());

	KddnMenuAction helpMenu = new KddnMenuAction(cyApplicationManager, "Help", cytoscapeDesktopService, kddnConfigurePanel);
	registerAllServices(bc, helpMenu, new Properties());
	
	KddnMenuAction aboutMenu = new KddnMenuAction(cyApplicationManager, "About", cytoscapeDesktopService, kddnConfigurePanel);
	registerAllServices(bc, aboutMenu, new Properties());
	
	// help doc
	cyHelpBroker = getService(bc, CyHelpBroker.class);

	final String HELP_SET_NAME = "/help/jhelpset";
	final ClassLoader classLoader = getClass().getClassLoader();
	URL helpSetURL;
	try {
		helpSetURL = HelpSet.findHelpSet(classLoader, HELP_SET_NAME);
		final HelpSet newHelpSet = new HelpSet(classLoader, helpSetURL);
		cyHelpBroker.getHelpSet().add(newHelpSet);
	} catch (final Exception e) {
		System.err.println("Could not find help set: \"" + HELP_SET_NAME + ".");
	}
}
 
开发者ID:tianye03,项目名称:kddn-cytoscape,代码行数:69,代码来源:CyActivator.java


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