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

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

本文整理了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

/** Get a display name containing HTML markup.  <strong><b>Note:</b> If you subclass
 * FilterNode and override <code>getDisplayName()</code>, this method will
 * always return null unless you override it as well (assuming that if you're
 * changing the display name, you don't want an HTML display name constructed
 * from the original node's display name to be what shows up in views of
 * this node).</strong>  If <code>getDisplayName()</code> is not overridden,
 * this method will return whatever the original node returns from this
 * method.
 * <p>
 * Note that if you do override <code>getDisplayName</code>, you should also override
 * this method to return null.
 *
 *
 *
 * @see org.openide.nodes.Node#getHtmlDisplayName
 * @return An HTML display name, if available, or null if no display name
 * is available   */
@Override
public String getHtmlDisplayName() {
  if (overridesGetDisplayName()) {
    return null;
  } else {
    return delegating(DELEGATE_GET_DISPLAY_NAME) ? original.getHtmlDisplayName() : super.getHtmlDisplayName();
  }
}

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

public String getHtmlDisplayName() {
  if (htmlDisplayName == null) {
    htmlDisplayName = node.getHtmlDisplayName();
    if (htmlDisplayName == null) {
      htmlDisplayName = NO_HTML_DISPLAYNAME;
    }
  }
  return (htmlDisplayName == NO_HTML_DISPLAYNAME) ? null : htmlDisplayName;
}

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

public String getHtmlDisplayName() {
  if (htmlDisplayName == null) {
    htmlDisplayName = node.getHtmlDisplayName();
    if (htmlDisplayName == null) {
      htmlDisplayName = NO_HTML_DISPLAYNAME;
    }
  }
  return htmlDisplayName == NO_HTML_DISPLAYNAME ? null : htmlDisplayName;
}

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

public String getHtmlDisplayName() {
  if (htmlDisplayName == null) {
    htmlDisplayName = node.getHtmlDisplayName();
    if (htmlDisplayName == null) {
      htmlDisplayName = NO_HTML_DISPLAYNAME;
    }
  }
  return htmlDisplayName == NO_HTML_DISPLAYNAME ? null : htmlDisplayName;
}

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

@Override
public String getHtmlDisplayName() {
  return node.getHtmlDisplayName();
}

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

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

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

public @Override String getHtmlDisplayName() { // #193262
  if (specialDisplayName) {
    return null;
  } else {
    return getOriginal().getHtmlDisplayName();
  }
}

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

public String getDisplayName(Object o) {
  Node n = Visualizer.findNode(o);
  if (n == null) {
    throw new IllegalStateException("TreeNode must be VisualizerNode but was: " + o + " of class " + o.getClass().getName());
  }
  String text = n.getHtmlDisplayName();
  if( null == text )
    text = n.getDisplayName();
  return text;
}

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

/** Get a display name containing HTML markup.  <strong><b>Note:</b> If you subclass
 * FilterNode and override <code>getDisplayName()</code>, this method will
 * always return null unless you override it as well (assuming that if you're
 * changing the display name, you don't want an HTML display name constructed
 * from the original node's display name to be what shows up in views of
 * this node).</strong>  If <code>getDisplayName()</code> is not overridden,
 * this method will return whatever the original node returns from this 
 * method.
 * <p>
 * Note that if you do override <code>getDisplayName</code>, you should also override
 * this method to return null.
 *
 * 
 *
 * @see org.openide.nodes.Node#getHtmlDisplayName
 * @return An HTML display name, if available, or null if no display name
 * is available   */
public String getHtmlDisplayName() {
  if (overridesGetDisplayName()) {
    return null;
  } else {
    return delegating (DELEGATE_GET_DISPLAY_NAME) ? 
      original.getHtmlDisplayName() : super.getHtmlDisplayName();
  }
}

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

/** Get a display name containing HTML markup.  <strong><b>Note:</b> If you subclass
 * FilterNode and override <code>getDisplayName()</code>, this method will
 * always return null unless you override it as well (assuming that if you're
 * changing the display name, you don't want an HTML display name constructed
 * from the original node's display name to be what shows up in views of
 * this node).</strong>  If <code>getDisplayName()</code> is not overridden,
 * this method will return whatever the original node returns from this 
 * method.
 * <p>
 * Note that if you do override <code>getDisplayName</code>, you should also override
 * this method to return null.
 *
 * 
 *
 * @see org.openide.nodes.Node#getHtmlDisplayName
 * @return An HTML display name, if available, or null if no display name
 * is available   */
public String getHtmlDisplayName() {
  if (overridesGetDisplayName()) {
    return null;
  } else {
    return delegating (DELEGATE_GET_DISPLAY_NAME) ? 
      original.getHtmlDisplayName() : super.getHtmlDisplayName();
  }
}

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

public String getHtmlDisplayName() {
  String name = getOriginal().getHtmlDisplayName();
  if (decorator != null) {
    if (name == null) {
      name = getDisplayName();
    }
    name = decorator.getHtmlDisplayName(name, this);
  }
  return name;
}

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

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

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

String displayName = n.getHtmlDisplayName();

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

@Override
public String getHtmlDisplayName() {
  if (!isTopLevelNode) {
    return getOriginal().getHtmlDisplayName();
  }
   try {
    DataObject dob = getOriginal().getLookup().lookup(DataObject.class);
    FileObject file = dob.getPrimaryFile();
     FileSystem.Status stat = file.getFileSystem().getStatus();
     if (stat instanceof FileSystem.HtmlStatus) {
       FileSystem.HtmlStatus hstat = (FileSystem.HtmlStatus) stat;
      String s = NbBundle.getMessage(SiteDocsNode.class, "LBL_Site_Pages");
       String result = hstat.annotateNameHtml (
         s, Collections.singleton(file));
       //Make sure the super string was really modified
       if (!s.equals(result)) {
         return result;
       }
     }
   } catch (FileStateInvalidException e) {
     ErrorManager.getDefault().notify(ErrorManager.INFORMATIONAL, e);
   }
   return super.getHtmlDisplayName();
}

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

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

相关文章

微信公众号

最新文章

更多