org.openide.nodes.Node.getHtmlDisplayName()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(160)

本文整理了Java中org.openide.nodes.Node.getHtmlDisplayName()方法的一些代码示例,展示了Node.getHtmlDisplayName()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Node.getHtmlDisplayName()方法的具体详情如下:
包路径:org.openide.nodes.Node
类名称:Node
方法名:getHtmlDisplayName

Node.getHtmlDisplayName介绍

[英]Return a variant of the display name containing HTML markup conforming to the limited subset of font-markup HTML supported by the lightweight HTML renderer org.openide.awt.HtmlRenderer (font color, bold, italic and strikethrough supported; font colors can be UIManager color keys if they are prefixed with a ! character, i.e. <font color='!controlShadow'>). Enclosing <html> tags are not needed. If returning non-null, HTML markup characters that should be literally renderered must be escaped (> becomes > and so forth).

This method should return either an HTML display name or null; it should not return the non-HTML display name.

Note there is no property corresponding to the HTML display name - if it should change, a change in the display name should be fired; this should not be a mechanism for returning anything other than a marked up version of the return value of getDisplayName.
[中]返回包含HTML标记的显示名称变体,该HTML标记符合轻量级HTML呈现程序org.openide.awt.HtmlRenderer支持的字体标记HTML的有限子集(支持字体颜色、粗体、斜体和删除线;字体颜色可以是UIManager颜色键,如果它们的前缀为!字符,即<font color='!controlShadow'>)。不需要包含<html>标记。如果返回非null,则必须转义应按字面形式呈现的HTML标记字符(>变为&gt;,以此类推)。
此方法应返回HTML显示名称或null;它不应该返回非HTML显示名称。
注意,没有与HTML显示名称对应的属性——如果它应该更改,则应该触发显示名称的更改;除了返回值getDisplayName的标记版本之外,这不应该是返回任何内容的机制。

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-nodes

  1. /** Get a display name containing HTML markup. <strong><b>Note:</b> If you subclass
  2. * FilterNode and override <code>getDisplayName()</code>, this method will
  3. * always return null unless you override it as well (assuming that if you're
  4. * changing the display name, you don't want an HTML display name constructed
  5. * from the original node's display name to be what shows up in views of
  6. * this node).</strong> If <code>getDisplayName()</code> is not overridden,
  7. * this method will return whatever the original node returns from this
  8. * method.
  9. * <p>
  10. * Note that if you do override <code>getDisplayName</code>, you should also override
  11. * this method to return null.
  12. *
  13. *
  14. *
  15. * @see org.openide.nodes.Node#getHtmlDisplayName
  16. * @return An HTML display name, if available, or null if no display name
  17. * is available */
  18. @Override
  19. public String getHtmlDisplayName() {
  20. if (overridesGetDisplayName()) {
  21. return null;
  22. } else {
  23. return delegating(DELEGATE_GET_DISPLAY_NAME) ? original.getHtmlDisplayName() : super.getHtmlDisplayName();
  24. }
  25. }

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public String getHtmlDisplayName() {
  2. if (htmlDisplayName == null) {
  3. htmlDisplayName = node.getHtmlDisplayName();
  4. if (htmlDisplayName == null) {
  5. htmlDisplayName = NO_HTML_DISPLAYNAME;
  6. }
  7. }
  8. return (htmlDisplayName == NO_HTML_DISPLAYNAME) ? null : htmlDisplayName;
  9. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. public String getHtmlDisplayName() {
  2. if (htmlDisplayName == null) {
  3. htmlDisplayName = node.getHtmlDisplayName();
  4. if (htmlDisplayName == null) {
  5. htmlDisplayName = NO_HTML_DISPLAYNAME;
  6. }
  7. }
  8. return htmlDisplayName == NO_HTML_DISPLAYNAME ? null : htmlDisplayName;
  9. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. public String getHtmlDisplayName() {
  2. if (htmlDisplayName == null) {
  3. htmlDisplayName = node.getHtmlDisplayName();
  4. if (htmlDisplayName == null) {
  5. htmlDisplayName = NO_HTML_DISPLAYNAME;
  6. }
  7. }
  8. return htmlDisplayName == NO_HTML_DISPLAYNAME ? null : htmlDisplayName;
  9. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-inspect

  1. @Override
  2. public String getHtmlDisplayName() {
  3. return node.getHtmlDisplayName();
  4. }

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public boolean isHtmlDisplayName(Object o) {
  2. Node n = Visualizer.findNode(o);
  3. if (n == null) {
  4. throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + o + " of class " + o.getClass().getName());
  5. }
  6. return null != n.getHtmlDisplayName();
  7. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-apisupport-project

  1. public @Override String getHtmlDisplayName() { // #193262
  2. if (specialDisplayName) {
  3. return null;
  4. } else {
  5. return getOriginal().getHtmlDisplayName();
  6. }
  7. }

代码示例来源:origin: org.netbeans.api/org-openide-explorer

  1. public String getDisplayName(Object o) {
  2. Node n = Visualizer.findNode(o);
  3. if (n == null) {
  4. throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + o + " of class " + o.getClass().getName());
  5. }
  6. String text = n.getHtmlDisplayName();
  7. if( null == text )
  8. text = n.getDisplayName();
  9. return text;
  10. }

代码示例来源:origin: net.sf.squirrel-sql.thirdpary-non-maven/openide

  1. /** Get a display name containing HTML markup. <strong><b>Note:</b> If you subclass
  2. * FilterNode and override <code>getDisplayName()</code>, this method will
  3. * always return null unless you override it as well (assuming that if you're
  4. * changing the display name, you don't want an HTML display name constructed
  5. * from the original node's display name to be what shows up in views of
  6. * this node).</strong> If <code>getDisplayName()</code> is not overridden,
  7. * this method will return whatever the original node returns from this
  8. * method.
  9. * <p>
  10. * Note that if you do override <code>getDisplayName</code>, you should also override
  11. * this method to return null.
  12. *
  13. *
  14. *
  15. * @see org.openide.nodes.Node#getHtmlDisplayName
  16. * @return An HTML display name, if available, or null if no display name
  17. * is available */
  18. public String getHtmlDisplayName() {
  19. if (overridesGetDisplayName()) {
  20. return null;
  21. } else {
  22. return delegating (DELEGATE_GET_DISPLAY_NAME) ?
  23. original.getHtmlDisplayName() : super.getHtmlDisplayName();
  24. }
  25. }

代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide

  1. /** Get a display name containing HTML markup. <strong><b>Note:</b> If you subclass
  2. * FilterNode and override <code>getDisplayName()</code>, this method will
  3. * always return null unless you override it as well (assuming that if you're
  4. * changing the display name, you don't want an HTML display name constructed
  5. * from the original node's display name to be what shows up in views of
  6. * this node).</strong> If <code>getDisplayName()</code> is not overridden,
  7. * this method will return whatever the original node returns from this
  8. * method.
  9. * <p>
  10. * Note that if you do override <code>getDisplayName</code>, you should also override
  11. * this method to return null.
  12. *
  13. *
  14. *
  15. * @see org.openide.nodes.Node#getHtmlDisplayName
  16. * @return An HTML display name, if available, or null if no display name
  17. * is available */
  18. public String getHtmlDisplayName() {
  19. if (overridesGetDisplayName()) {
  20. return null;
  21. } else {
  22. return delegating (DELEGATE_GET_DISPLAY_NAME) ?
  23. original.getHtmlDisplayName() : super.getHtmlDisplayName();
  24. }
  25. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-xml-xam-ui

  1. public String getHtmlDisplayName() {
  2. String name = getOriginal().getHtmlDisplayName();
  3. if (decorator != null) {
  4. if (name == null) {
  5. name = getDisplayName();
  6. }
  7. name = decorator.getHtmlDisplayName(name, this);
  8. }
  9. return name;
  10. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-modelutil

  1. label.setText( n.getHtmlDisplayName() );
  2. label.setIcon( new ImageIcon( n.getIcon(BeanInfo.ICON_COLOR_16x16) ) ); // XXX Ask description directly
  3. if (check.isVisible()) {

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-java-hints-analyzer

  1. String displayName = n.getHtmlDisplayName();

代码示例来源:origin: org.codehaus.mevenide/nb-project

  1. @Override
  2. public String getHtmlDisplayName() {
  3. if (!isTopLevelNode) {
  4. return getOriginal().getHtmlDisplayName();
  5. }
  6. try {
  7. DataObject dob = getOriginal().getLookup().lookup(DataObject.class);
  8. FileObject file = dob.getPrimaryFile();
  9. FileSystem.Status stat = file.getFileSystem().getStatus();
  10. if (stat instanceof FileSystem.HtmlStatus) {
  11. FileSystem.HtmlStatus hstat = (FileSystem.HtmlStatus) stat;
  12. String s = NbBundle.getMessage(SiteDocsNode.class, "LBL_Site_Pages");
  13. String result = hstat.annotateNameHtml (
  14. s, Collections.singleton(file));
  15. //Make sure the super string was really modified
  16. if (!s.equals(result)) {
  17. return result;
  18. }
  19. }
  20. } catch (FileStateInvalidException e) {
  21. ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
  22. }
  23. return super.getHtmlDisplayName();
  24. }

代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-inspect

  1. selectedNode.getLookup().lookup(org.netbeans.modules.web.webkit.debugging.api.dom.Node.class);
  2. if (node.getNodeType() == Document.ELEMENT_NODE) {
  3. String name = selectedNode.getHtmlDisplayName();
  4. if (name.startsWith("<html>")) { // NOI18N
  5. name = name.substring(6);

相关文章