本文整理汇总了Java中javax.help.Map.ID类的典型用法代码示例。如果您正苦于以下问题:Java ID类的具体用法?Java ID怎么用?Java ID使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ID类属于javax.help.Map包,在下文中一共展示了ID类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: idChanged
import javax.help.Map.ID; //导入依赖的package包/类
@Override
public void idChanged(HelpModelEvent e) {
ID id = e.getID();
URL url = e.getURL();
TextHelpModel model = theViewer.getModel();
debug("idChanged(" + e + ")");
debug(" = " + id + " " + url);
debug(" my helpModel: " + model);
model.setDocumentTitle(null);
/**
* html future additions
* if we were doing any highlighting of the search text
* code would be needed here remove all the highlights before
* the new page is displayed
*/
try {
setPage(url);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
debug("done with idChanged");
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:25,代码来源:SwingboxContentViewerUI.java
示例2: getTopic
import javax.help.Map.ID; //导入依赖的package包/类
/**
* Retrieves the help topic associated with the given node. Note that this also maintains a map
* of topic id --> topic mappings in the parent help set.
*
* @param node Tree node.
* @return A help topic instance.
*/
protected HelpTopic getTopic(TreeNode node) {
try {
DefaultMutableTreeNode nd = (DefaultMutableTreeNode) node;
TreeItem item = (TreeItem) nd.getUserObject();
ID id = item.getID();
HelpTopic topic = new HelpTopic(id == null ? null : id.getURL(), item.getName(), view.getHelpSet().getTitle());
if (id != null && view.getHelpSet().getKeyData("topics", id.id) == null) {
view.getHelpSet().setKeyData("topics", id.id, topic);
}
return topic;
} catch (MalformedURLException e) {
return null;
}
}
开发者ID:carewebframework,项目名称:carewebframework-core,代码行数:24,代码来源:HelpView.java
示例3: getTopic
import javax.help.Map.ID; //导入依赖的package包/类
@Override
public HelpTopic getTopic(String topicId) {
HelpTopic topic = (HelpTopic) helpSet.getKeyData("topics", topicId);
if (topic != null) {
return topic;
}
ID id = ID.create(topicId, helpSet);
try {
URL url = helpSet.getCombinedMap().getURLFromID(id);
return new HelpTopic(url, topicId, helpSet.getTitle());
} catch (Exception e) {
return null;
}
}
开发者ID:carewebframework,项目名称:carewebframework-core,代码行数:18,代码来源:HelpSet_JavaHelp.java
示例4: setCurrentID
import javax.help.Map.ID; //导入依赖的package包/类
/**
* Shows this ID as content relative to the (top) HelpSet for the HelpBroker
* instance--HelpVisitListeners are notified.
*
* @param id A string that identifies the topic to show for the loaded (top) HelpSet
* @exception BadIDException The ID is not valid for the HelpSet
*/
public void setCurrentID(String id) throws BadIDException{
try{
setCurrentID(ID.create(id,myHelpSet));
} catch(InvalidHelpSetContextException ex){
// this should not happen
new Error("internal error?");
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:IdeaHelpBroker.java
示例5: getCurrentID
import javax.help.Map.ID; //导入依赖的package包/类
/**
* Determines which ID is displayed (if any).
*/
public ID getCurrentID(){
if(jhelp!=null){
return jhelp.getModel().getCurrentID();
} else{
return null;
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:IdeaHelpBroker.java
示例6: rebuild
import javax.help.Map.ID; //导入依赖的package包/类
private void rebuild() {
debug("rebuild");
TextHelpModel model = theViewer.getModel();
if (model == null) {
debug("rebuild-end: model is null");
return;
}
/**
* html future additions
* if we were doing any highlighting the highlights would need
* to be removed here
*/
HelpSet hs = model.getHelpSet();
// for glossary - not set homeID page - glossary is not synchronized
if (theViewer.getSynch()) {
try {
Map.ID homeID = hs.getHomeID();
Locale locale = hs.getLocale();
String name = HelpUtilities.getString(locale, "history.homePage");
model.setCurrentID(homeID, name, (JHelpNavigator) null);
setPage(model.getCurrentURL());
} catch (InvalidHelpSetContextException ex) {
Exceptions.printStackTrace(ex);
} catch (IOException e) {
Exceptions.printStackTrace(e);
}
}
debug("rebuild-end");
}
开发者ID:mantlik,项目名称:swingbox-javahelp-viewer,代码行数:31,代码来源:SwingboxContentViewerUI.java
示例7: getURLFromID
import javax.help.Map.ID; //导入依赖的package包/类
public static URL getURLFromID(String id) throws BadIDException,
MalformedURLException {
initialize();
logger.trace("Looking for id: " + id);
ID theId = ID.create(id, hs);
if (theId == null)
return null;
return hs.getCombinedMap().getURLFromID(theId);
}
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:10,代码来源:HelpCollator.java
示例8: createMyItem
import javax.help.Map.ID; //导入依赖的package包/类
/**
* Create an TOCItem with the given data.
*
* @param tagName
* The TOC type to create. Valid types are "tocitem". Null or
* invalid types will throw an IllegalArgumentException
* @param atts
* Attributes of the Item. Valid attributes are "target",
* "image", and "text". A null atts is valid and means no
* attributes
* @param hs
* HelpSet this item was created under.
* @param locale
* Locale of this item. A null locale is valid.
* @returns A fully constructed TreeItem.
* @throws IllegalArgumentExcetpion
* if tagname is null or invalid.
*/
public TreeItem createMyItem(String target) {
String line, title = "Test";
try {
InputStream test = jarFile.getInputStream(jarFile.getEntry(target));
BufferedReader in = new BufferedReader(new InputStreamReader(test));
if (!in.ready())
throw new IOException();
while ((line = in.readLine()) != null) {
if (line.toLowerCase().contains("title")) {
int beginIndex = line.toLowerCase().indexOf("title") + 6;
int endIndex = line.toLowerCase().indexOf("</title>");
title = line.substring(beginIndex, endIndex);
break;
}
}
in.close();
} catch (IOException e) {
}
Map.ID mapID = null;
try {
mapID = ID.create(target, hs);
} catch (BadIDException bex1) {
}
Map.ID imageMapID = null;
String imageID = "topic.png";
try {
imageMapID = ID.create(imageID, hs);
} catch (BadIDException bex2) {
}
TOCItem item = new TOCItem(mapID, imageMapID, hs, Locale.getDefault());
item.setName(title);
item.setMergeType("javax.help.AppendMerge");
item.setExpansionType(TreeItem.COLLAPSE);
return item;
}
开发者ID:mzmine,项目名称:mzmine2,代码行数:62,代码来源:MZmineTOCView.java
注:本文中的javax.help.Map.ID类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论