本文整理匯總了Java中org.openide.nodes.Node.getHtmlDisplayName方法的典型用法代碼示例。如果您正苦於以下問題:Java Node.getHtmlDisplayName方法的具體用法?Java Node.getHtmlDisplayName怎麽用?Java Node.getHtmlDisplayName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openide.nodes.Node
的用法示例。
在下文中一共展示了Node.getHtmlDisplayName方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: configureForNode
import org.openide.nodes.Node; //導入方法依賴的package包/類
private void configureForNode(Node node) {
renderer.reset();
Image nodeIcon = node.getIcon(BeanInfo.ICON_COLOR_16x16);
Icon icon = nodeIcon != null && nodeIcon != BreadcrumbsController.NO_ICON ? ImageUtilities.image2Icon(nodeIcon) : null;
int width = icon != null ? icon.getIconWidth() : 0;
if (width > 0) {
renderer.setIcon(icon);
renderer.setIconTextGap(ICON_TEXT_SEPARATOR);
} else {
renderer.setIcon(null);
renderer.setIconTextGap(0);
}
String html = node.getHtmlDisplayName();
if (html != null) {
renderer.setHtml(true);
renderer.setText(html);
} else {
renderer.setHtml(false);
renderer.setText(node.getDisplayName());
}
renderer.setFont(getFont());
}
示例2: getHtmlDisplayName
import org.openide.nodes.Node; //導入方法依賴的package包/類
/**
* Makes an HTML display name for the given node, if the node should be
* rendered with a non-default font and/or color. The returned string
* (if non-{@code null}) does not contain the leading
* {@code "<html>"} string that in many cases neccessary
* if the HTML markup should be interpreted during rendering.
*
* @param node node to make a display name for
* @param fileModified {@code true} if the file represented by the node
* is modified (contains unsaved changes)
* @param selected if the node is selected (in a table, in a tree, ...)
* @return string with HTML markups included,
* or {@code null} if no HTML markup is neccessary
* @since 1.9.1
*/
public static String getHtmlDisplayName(Node node,
boolean fileModified,
boolean selected) {
boolean bold = fileModified;
boolean colored = !selected;
if (!bold && !colored) {
return null; //no HTML markup necessary
}
String normal = colored ? node.getHtmlDisplayName()
: node.getName();
return bold ? makeBold(normal)
: normal;
}
示例3: htmlDisplayName
import org.openide.nodes.Node; //導入方法依賴的package包/類
/**
* Builds a HTML display name for this component.
*
* @return the created display name
* @see #displayName()
*/
private String htmlDisplayName() {
if (bundleStructure.getNthEntry(0)==null) {
bundleStructure.updateEntries();
}
final Node node = bundleStructure.getNthEntry(0).getDataObject().getNodeDelegate();
String displayName = node.getHtmlDisplayName();
if (displayName != null) {
if (!displayName.startsWith("<html>")) { //NOI18N
displayName = "<html>" + displayName; //NOI18N
}
} else {
displayName = node.getDisplayName();
}
return DataEditorSupport.annotateName(displayName, true, isModified(), false);
}
示例4: getTableCellRendererComponent
import org.openide.nodes.Node; //導入方法依賴的package包/類
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
Icon icon = null;
BookmarksTableModel model = (BookmarksTableModel) table.getModel();
BookmarkNode bNode = model.getEntry(row);
BookmarkInfo bookmark = bNode.getBookmarkInfo();
Node fNode = bNode.getParentNode();
if (fNode != null) {
if (!isSelected) {
String text = fNode.getHtmlDisplayName();
if (text != null) {
text = bookmark.getDescription(text, forHistoryPopup, forHistoryPopup, true);
setText("<html>" + text + "</html>");
} // else leave original text set by "super"
}
Image image = fNode.getIcon(BeanInfo.ICON_COLOR_16x16);
if (image != null) {
icon = ImageUtilities.image2Icon(image);
}
}
setIcon(icon);
return this;
}
示例5: getDisplayName
import org.openide.nodes.Node; //導入方法依賴的package包/類
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;
}
示例6: isHtmlDisplayName
import org.openide.nodes.Node; //導入方法依賴的package包/類
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();
}
示例7: run
import org.openide.nodes.Node; //導入方法依賴的package包/類
public void run() {
OutlineTable tt = (OutlineTable) Models.createView(mcm);
Node root = tt.getExplorerManager ().getRootContext ();
root.getChildren().getNodes();
root.getHtmlDisplayName();
root.getShortDescription();
for (Node n : root.getChildren().getNodes()) {
inspectNode(n);
for (Node nn : n.getChildren().getNodes()) {
inspectNode(nn);
}
}
}
示例8: inspectNode
import org.openide.nodes.Node; //導入方法依賴的package包/類
private void inspectNode(Node n) {
n.getDisplayName();
n.getHtmlDisplayName();
n.getShortDescription();
n.getIcon(BeanInfo.ICON_COLOR_16x16);
n.canCopy();
n.canCut();
n.canRename();
n.getNewTypes();
n.getActions(true);
n.getPreferredAction();
inspectProperties(n);
}
示例9: getMVTCDisplayName
import org.openide.nodes.Node; //導入方法依賴的package包/類
/**
* Returns display name of the multiview top component.
* The first item of the array is normal display name,
* the second item of the array is HTML display name.
*
* @param formDataObject form data object representing the multiview tc.
* @return display names of the MVTC. The second item can be <code>null</code>.
*/
private static String[] getMVTCDisplayName(FormDataObject formDataObject) {
Node node = formDataObject.getNodeDelegate();
String title = node.getDisplayName();
String htmlTitle = node.getHtmlDisplayName();
if (htmlTitle == null) {
try {
htmlTitle = XMLUtil.toElementContent(title);
} catch (CharConversionException x) {
htmlTitle = "???";
}
}
FormEditorSupport fes = (FormEditorSupport)formDataObject.getFormEditorSupport();
if (fes != null) {
FormDesignerTC designerTC = fes.getFormDesignerTC();
if (designerTC != null && designerTC.isShowing()) {
FormModel fm = fes.getFormModel();
if (fm != null) {
FormDesigner fd = FormEditor.getFormDesigner(fes.getFormModel());
if (fd != null && fd.getFormModel() != null
&& !fd.isTopRADComponent() && fd.getTopDesignComponent() != null) {
title = FormUtils.getFormattedBundleString(
"FMT_FormTitleWithContainerName", // NOI18N
new Object[] {title, fd.getTopDesignComponent().getName()});
htmlTitle = FormUtils.getFormattedBundleString(
"FMT_FormTitleWithContainerName", // NOI18N
new Object[] {htmlTitle, fd.getTopDesignComponent().getName()});
}
}
}
}
boolean modified = formDataObject.isModified();
boolean readOnly = readOnly(formDataObject);
return new String[] {
DataEditorSupport.annotateName(title, false, modified, readOnly),
DataEditorSupport.annotateName(htmlTitle, true, modified, readOnly)
};
}
示例10: getTreeCellRendererComponent
import org.openide.nodes.Node; //導入方法依賴的package包/類
/** The component returned by HtmlRenderer.Renderer.getTreeCellRendererComponent() */
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean isSelected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
Node n = Visualizer.findNode(value);
Collection<? extends FixDescription> descriptions = n.getLookup().lookupAll(FixDescription.class);
if (!descriptions.isEmpty()) {
check.setVisible( true );
// if( description.isSelectable() ) {
check.setState(getCheckState(descriptions));
// } else {
// check.setState( getCheckState( description.getSubs() ));
// }
} else {
check.setVisible(false);
}
if ( isSelected ) {
label.setForeground(LIST_FOR_COLORS.getSelectionForeground());
setOpaque(true);
setBackground(LIST_FOR_COLORS.getSelectionBackground());
}
else {
label.setForeground(tree.getForeground());
setOpaque(false);
//setBackground(tree.getBackground());
}
String displayName = n.getHtmlDisplayName();
if (displayName != null) {
if (!displayName.startsWith("<html>"))
displayName = "<html>" + displayName;
} else {
displayName = n.getDisplayName();
}
label.setText( displayName );
label.setIcon( new ImageIcon( n.getIcon(BeanInfo.ICON_COLOR_16x16) ) ); // XXX Ask description directly
return this;
}