本文整理汇总了Java中javax.help.CSH类的典型用法代码示例。如果您正苦于以下问题:Java CSH类的具体用法?Java CSH怎么用?Java CSH使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CSH类属于javax.help包,在下文中一共展示了CSH类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: actionPerformed
import javax.help.CSH; //导入依赖的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);
}
}
示例2: initialise
import javax.help.CSH; //导入依赖的package包/类
@Override
protected void initialise() {
CSH.setHelpIDString(
this,
"net.sf.taverna.t2.workbench.ui.views.contextualviews.activity.DisabledConfigView");
configuration = activity.getConfiguration();
XStream xstream = new XStream(new DomDriver());
Activity a = configuration.getActivity();
xstream.setClassLoader(a.getClass().getClassLoader());
Object origConfig = configuration.getBean();
if (fieldNames == null) {
fieldNames = getFieldNames(origConfig);
}
origConfigXML = xstream.toXML(origConfig);
clonedConfig = xstream.fromXML(origConfigXML);
JPanel panel = UIBuilder.buildEditor(clonedConfig, (String[]) fieldNames.toArray(new String[0]));
this.add(panel, BorderLayout.CENTER);
this.revalidate();
}
示例3: initHelpSystem
import javax.help.CSH; //导入依赖的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());
}
}
示例4: HelpButton
import javax.help.CSH; //导入依赖的package包/类
/**
* This constructor receives as parameter a help ID stored in HelpSet.
*
* @param helpID
*/
public HelpButton(String helpID) {
super("Help");
MainWindow mainWindow = (MainWindow) MZmineCore.getDesktop();
HelpImpl helpImp = mainWindow.getHelpImpl();
if (helpImp == null) {
setEnabled(false);
return;
}
MZmineHelpSet hs = helpImp.getHelpSet();
if (hs == null) {
setEnabled(false);
return;
}
MZmineHelpMap map = (MZmineHelpMap) hs.getLocalMap();
if (!map.isValidID(helpID, hs)) {
setEnabled(false);
return;
}
HelpBroker hb = hs.createHelpBroker();
hs.setHomeID(helpID);
this.addActionListener(new CSH.DisplayHelpFromSource(hb));
}
示例5: getHelpSetListener
import javax.help.CSH; //导入依赖的package包/类
/**
* Get a Action listener for the helpset. Use this by adding it as an
* actionListener to a button
* @return the ActionListener
* TODO: return action listener that pops up a notification dialog.
*/
public ActionListener getHelpSetListener() {
if (helpBroker != null) {
return new CSH.DisplayHelpFromSource(helpBroker);
}
return new HelpErrorListener();
}
示例6: actionPerformed
import javax.help.CSH; //导入依赖的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);
}
}
示例7: setCurrentTabIndex
import javax.help.CSH; //导入依赖的package包/类
/**
*
* @param currentTabIndex
* @throws BadLabDataException
*/
public void setCurrentTabIndex(int currentTabIndex)
throws BadLabDataException {
this.currentTabIndex = currentTabIndex;
// hide all menu items
detritalUTh_menu.setVisible(false);
physicalConstantsModels_menu.setVisible(false);
MineralStdModels_menu.setVisible(false);
// refresh tabs
switch (currentTabIndex) {
case 0:
physicalConstantsModels_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Physical Constants models");
initPhysicalConstantsModelChooser();
break;
case 1:
detritalUTh_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Detrital UTh Models");
initDetritalUThModelChooser();
break;
case 2:
MineralStdModels_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Mineral Standard Models");
initMineralStandardModelChooser();
break;
case 3:
showSavedLabDefaults();
CSH.setHelpIDString(this, "LabData.Managing LabData Default");
}
}
示例8: TrajStatHelp
import javax.help.CSH; //导入依赖的package包/类
public TrajStatHelp() {
f = new JFrame("Menu Example");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JMenuBar mbar = new JMenuBar();
// a file menu
JMenu file = new JMenu("File");
JMenu help = new JMenu("Help");
// add an item to the help menu
help.add(topics = new JMenuItem("Help Topics"));
// add the menu items to the menu bar
mbar.add(file);
mbar.add(help);
// 1. create HelpSet and HelpBroker objects
HelpSet hs = getHelpSet("mi.hs");
HelpBroker hb = hs.createHelpBroker();
// 2. assign help to components
CSH.setHelpIDString(topics, "top");
// 3. handle events
topics.addActionListener(new CSH.DisplayHelpFromSource(hb));
// attach menubar to frame, set its size, and make it visible
f.setJMenuBar(mbar);
f.setSize(500, 300);
f.setVisible(true);
}
示例9: initialize_help
import javax.help.CSH; //导入依赖的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);
}
}
}
示例10: getHelpDisplay
import javax.help.CSH; //导入依赖的package包/类
public static CSH.DisplayHelpFromSource getHelpDisplay() {
return csh;
}
示例11: setCurrentTabIndex
import javax.help.CSH; //导入依赖的package包/类
/**
*
* @param currentTabIndex
* @throws BadLabDataException
*/
public void setCurrentTabIndex(int currentTabIndex)
throws BadLabDataException {
this.currentTabIndex = currentTabIndex;
// hide all menu items
tracers_menu.setVisible(false);
fractionation_menu.setVisible(false);
PbBlanks_menu.setVisible(false);
initialPbModels_menu.setVisible(false);
physicalConstantsModels_menu.setVisible(false);
MineralStdModels_menu.setVisible(false);
// refresh tabs
switch (currentTabIndex) {
case 0:
tracers_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Tracers");
initTracerModelChooser();
break;
case 1:
fractionation_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Fractionation Models");
InitAlphaPbChooser();
InitAlphaPbChooser();
break;
case 2:
PbBlanks_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.U-Pb Blank Models");
initPbBlankModelChooser();
break;
case 3:
initialPbModels_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Initial Pb Model");
initInitialPbModelChooser();
break;
case 4:
physicalConstantsModels_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Physical constants model");
initPhysicalConstantsModelChooser();
break;
case 5:
MineralStdModels_menu.setVisible(true);
CSH.setHelpIDString(this, "LabData.Mineral Standard Models");
initMineralStandardModelChooser();
break;
case 6:
showSavedLabDefaults();
CSH.setHelpIDString(this, "LabData.Managing LabData Default");
}
}
示例12: initialize_help
import javax.help.CSH; //导入依赖的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);
}
}
}
示例13: getFDisplayHelp
import javax.help.CSH; //导入依赖的package包/类
public static CSH.DisplayHelpFromSource getFDisplayHelp() {
return fDisplayHelp;
}
示例14: setFDisplayHelp
import javax.help.CSH; //导入依赖的package包/类
public static void setFDisplayHelp(CSH.DisplayHelpFromSource displayHelp) {
IntroduceHelp.fDisplayHelp = displayHelp;
}
示例15: setHelpSetContext
import javax.help.CSH; //导入依赖的package包/类
/**
* Set the help context for a component
* @param component in question
* @param context is the label in the help documentation
*/
public void setHelpSetContext(Component component, String context) {
helpContext = context;
CSH.setHelpIDString(component, helpContext);
}