本文整理汇总了Java中javax.help.HelpSetException类的典型用法代码示例。如果您正苦于以下问题:Java HelpSetException类的具体用法?Java HelpSetException怎么用?Java HelpSetException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HelpSetException类属于javax.help包,在下文中一共展示了HelpSetException类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doAction
import javax.help.HelpSetException; //导入依赖的package包/类
/**
* Do action.
*/
@Override
protected void doAction() {
try {
if (helpBroker != null) {
if (helpBroker.isDisplayed()) {
return; // Help already displayed
}
helpBroker.setDisplayed(true); // Help already created but
// hidden - redisplay
return;
}
createAndDisplayHelp();
} catch (HelpSetException ex) {
DError.displayError(frame, ex);
}
}
示例2: initHelpSystem
import javax.help.HelpSetException; //导入依赖的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());
}
}
示例3: createAndDisplayHelp
import javax.help.HelpSetException; //导入依赖的package包/类
private void createAndDisplayHelp() throws HelpSetException {
URL hsUrl = getClass().getResource(res.getString("HelpAction.HelpSet"));
HelpSet hs = new HelpSet(getClass().getClassLoader(), hsUrl);
if (LnfUtil.isDarculaAvailable()) {
URL hsDarculaUrl = getClass().getResource(res.getString("HelpAction.DarculaHelpSet"));
HelpSet hsDarcula = new HelpSet(getClass().getClassLoader(), hsDarculaUrl);
hs.add(hsDarcula);
}
helpBroker = new DefaultHelpBroker(hs);
WindowPresentation windowPresentation = helpBroker.getWindowPresentation();
windowPresentation.createHelpWindow();
// Make window immune to modal dialogs in application
Window helpWindow = windowPresentation.getHelpWindow();
helpWindow.setModalExclusionType(ModalExclusionType.APPLICATION_EXCLUDE);
// Set help icons - set lots of different sizes to give each OS the most
// flexibility in choosing an icon for display
ArrayList<Image> icons = new ArrayList<Image>();
icons.add(Toolkit.getDefaultToolkit().createImage(
getClass().getResource(res.getString("HelpAction.image.16x16"))));
icons.add(Toolkit.getDefaultToolkit().createImage(
getClass().getResource(res.getString("HelpAction.image.24x24"))));
icons.add(Toolkit.getDefaultToolkit().createImage(
getClass().getResource(res.getString("HelpAction.image.32x32"))));
helpWindow.setIconImages(icons);
helpBroker.setLocation(new Point(frame.getX() + 25, frame.getY() + 25));
helpBroker.setSize(new Dimension(850, 600));
helpBroker.setCurrentID(START_ID);
helpBroker.setDisplayed(true);
}
示例4: HelpSet_JavaHelp
import javax.help.HelpSetException; //导入依赖的package包/类
public HelpSet_JavaHelp(HelpModule descriptor) throws MalformedURLException, HelpSetException {
super(descriptor);
String url = descriptor.getUrl();
helpSet = new HelpSet(HelpSet_JavaHelp.class.getClassLoader(),
url.startsWith("/web/") ? getClass().getResource(url) : new URL(url));
initViews();
}
示例5: initialize_help
import javax.help.HelpSetException; //导入依赖的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);
}
}
}
示例6: initialize_help
import javax.help.HelpSetException; //导入依赖的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);
}
}
}