# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Sources\MainTrunk\core\windows # This patch can be applied using context Tools: Patch action on respective folder. # Above lines and this line are ignored by the patching process. Index: src/org/netbeans/core/windows/WindowManagerImpl.java *** F:\Sources\MainTrunk\core\windows\src\org\netbeans\core\windows\WindowManagerImpl.java --- F:\Sources\MainTrunk\core\windows\src\org\netbeans\core\windows\WindowManagerImpl.java *************** *** 779,790 **** private static final boolean NAME_HACK = Boolean.getBoolean("nb.tabnames.html"); //NOI18N ! /** Helper method to retrieve the display name of TopComponent. */ public String getTopComponentDisplayName(TopComponent tc) { if(tc == null) { return null; } ! String displayName = tc.getDisplayName(); if (displayName == null) { displayName = tc.getName(); } --- 779,801 ---- private static final boolean NAME_HACK = Boolean.getBoolean("nb.tabnames.html"); //NOI18N ! /** Helper method to retrieve soem form of display name of TopComponent. ! * First tries TopComponent's getHtmlDisplayName, if is it null then continues ! * with getDisplayName and getName in this order. ! * ! * @param tc TopComponent to retrieve display name from. May be null. ! * @return TopComponent's display name or null if no display name available ! * or null TopComponent is given ! */ public String getTopComponentDisplayName(TopComponent tc) { if(tc == null) { return null; } ! String displayName = tc.getHtmlDisplayName(); if (displayName == null) { + displayName = tc.getDisplayName(); + } + if (displayName == null) { displayName = tc.getName(); } if (NAME_HACK && displayName != null) { Index: src/org/netbeans/core/windows/view/ui/DocumentsDlg.java *** F:\Sources\MainTrunk\core\windows\src\org\netbeans\core\windows\view\ui\DocumentsDlg.java --- F:\Sources\MainTrunk\core\windows\src\org\netbeans\core\windows\view\ui\DocumentsDlg.java *************** *** 487,499 **** implements Comparable, Action, PropertyChangeListener { private TopComponent tc; - /** Node asociated to top component, to obtain name from */ - private Node node; public TopComponentNode (TopComponent tc) { super(Children.LEAF); this.tc = tc; - this.node = (Node) tc.getLookup().lookup(Node.class); tc.addPropertyChangeListener(WeakListeners.propertyChange(this, tc)); } --- 487,492 ---- *************** *** 503,519 **** } public String getDisplayName() { // Also #60263. Forms do not have a tc.name?? ! if (node != null) { ! return node.getDisplayName(); ! } ! return tc.getDisplayName(); } public String getHtmlDisplayName() { ! if (node != null) { ! return node.getHtmlDisplayName(); ! } ! return WindowManagerImpl.getInstance().getTopComponentDisplayName(tc); } public Image getIcon (int type) { --- 500,511 ---- } public String getDisplayName() { // Also #60263. Forms do not have a tc.name?? ! String result = tc.getDisplayName(); ! return result != null ? result : tc.getName(); } public String getHtmlDisplayName() { ! return tc.getHtmlDisplayName(); } public Image getIcon (int type) { # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Sources\MainTrunk\openide\loaders # This patch can be applied using context Tools: Patch action on respective folder. # Above lines and this line are ignored by the patching process. Index: src/org/openide/text/DataEditorSupport.java *** F:\Sources\MainTrunk\openide\loaders\src\org\openide\text\DataEditorSupport.java --- F:\Sources\MainTrunk\openide\loaders\src\org\openide\text\DataEditorSupport.java *************** *** 144,156 **** protected String messageName () { if (! obj.isValid()) return ""; // NOI18N String name = obj.getNodeDelegate().getHtmlDisplayName(); ! if (name == null) { ! name = obj.getNodeDelegate().getDisplayName(); ! } else { ! if (!name.startsWith("")) name = "" + name; } ! return addFlagsToName(name); } /** Helper only. */ --- 144,163 ---- protected String messageName () { if (! obj.isValid()) return ""; // NOI18N + return addFlagsToName(obj.getNodeDelegate().getDisplayName()); + } + + protected String messageHtmlName() { + if (! obj.isValid()) return ""; // NOI18N + String name = obj.getNodeDelegate().getHtmlDisplayName(); ! if (name != null) { ! if (!name.startsWith("")) { ! name = "" + name; ! } ! addFlagsToName(name); } ! return name; } /** Helper only. */ # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Sources\MainTrunk\openide\text # This patch can be applied using context Tools: Patch action on respective folder. # Above lines and this line are ignored by the patching process. Index: src/org/openide/text/CloneableEditorSupport.java *** F:\Sources\MainTrunk\openide\text\src\org\openide\text\CloneableEditorSupport.java --- F:\Sources\MainTrunk\openide\text\src\org\openide\text\CloneableEditorSupport.java *************** *** 233,234 **** --- 233,251 ---- * @return name of the editor */ protected abstract String messageName(); + + /** Constructs message that should be used to name the editor component + * in html fashion, with possible coloring, text styles etc. + * + * May return null if no html name is needed or available. + * + * @return html name of the editor component or null + * + * @since ???? + */ + protected String messageHtmlName() { + return null; + } /** Constructs the ID used for persistence of opened editors. * Should be overridden to return sane ID of the underlying document, Index: src/org/openide/text/CloneableEditor.java *** F:\Sources\MainTrunk\openide\text\src\org\openide\text\CloneableEditor.java --- F:\Sources\MainTrunk\openide\text\src\org\openide\text\CloneableEditor.java *************** *** 457,463 **** Mutex.EVENT.writeAccess( new Runnable() { public void run() { ! String name = ces.messageName(); setDisplayName(name); setName(name); // XXX compatibility --- 457,467 ---- Mutex.EVENT.writeAccess( new Runnable() { public void run() { ! String name = ces.messageHtmlName(); ! if (name != null) { ! setHtmlDisplayName(name); ! } ! name = ces.messageName(); setDisplayName(name); setName(name); // XXX compatibility # This patch file was generated by NetBeans IDE # Following Index: paths are relative to: F:\Sources\MainTrunk\openide\windows # This patch can be applied using context Tools: Patch action on respective folder. # Above lines and this line are ignored by the patching process. Index: src/org/openide/windows/TopComponent.java *** F:\Sources\MainTrunk\openide\windows\src\org\openide\windows\TopComponent.java --- F:\Sources\MainTrunk\openide\windows\src\org\openide\windows\TopComponent.java *************** *** 12,13 **** --- 12,18 ---- */ package org.openide.windows; + import javax.swing.plaf.basic.BasicHTML; import org.openide.ErrorManager; import org.openide.awt.UndoRedo; import org.openide.nodes.*; *************** *** 141,148 **** --- 142,158 ---- /** Localized display name of this TopComponent. */ private transient String displayName; + /** Holds localized display name of this TopComponent in html syntax, + * or null if not needed */ + private String htmlDisplayName; + /** identification of serialization version * Used in CloneableTopComponent readObject method. */ short serialVersion = 1; private AttentionGetter attentionGetter = null; + /** Create a top component. */ public TopComponent() { *************** *** 686,687 **** --- 692,706 ---- return; } + /* [dafe] can't put the warning in, because I don't know how to fix + output window, which places html tags into its display name sometimes + if (BasicHTML.isHTMLString(displayName)) { + ErrorManager.getDefault().log(ErrorManager.WARNING, + "WARNING: Call of " + getClass().getName() + ".setDisplayName("" + displayName + "")" + + "shouldn't contain any HTML tags. Please use " + getClass().getName() + ".setHtmlDisplayName(String)" + + "for such purpose. For details please see http://www.netbeans.org/issues/show_bug.cgi?id=66777."); + } */ + this.displayName = displayName; firePropertyChange("displayName", old, displayName); // NOI18N *************** *** 692,703 **** WindowManager.getDefault().topComponentDisplayNameChanged(this, displayName); } ! /** Gets localized dipslay name of this TopComponent. ! * @return localized display name of null if there is none * @since 4.13 */ public String getDisplayName() { return displayName; } /** Sets toolTip for this TopComponent, adds notification * about the change to its WindowManager.TopComponentManager. */ --- 707,754 ---- WindowManager.getDefault().topComponentDisplayNameChanged(this, displayName); } ! /** Gets localized display name of this TopComponent. ! * @return localized display name or null if there is none * @since 4.13 */ public String getDisplayName() { return displayName; } + + /** Sets localized html display name of this TopComponent. + * Hmtl name usually contains basic html tags for text coloring and style. + * Html name may be null if not needed. + * + * @param htmlDisplayName localized html display name which is set + * + * @since ???? + */ + public void setHtmlDisplayName(String htmlDisplayName) { + String old = this.htmlDisplayName; + if ((htmlDisplayName == old) || ((htmlDisplayName != null) && htmlDisplayName.equals(old))) { + return; + } + + this.htmlDisplayName = htmlDisplayName; + firePropertyChange("htmlDisplayName", old, htmlDisplayName); // NOI18N + + // note, so far we don't need this, no ModeContainer cares about + // html name changing + // WindowManager.getDefault().topComponentHtmlDisplayNameChanged(this, htmlDisplayName); + } + + /** Gets localized display name of this TopComponent with added + * html tags for text coloring and/or font style. May return null. + * + * @return localized html display name or null if there is none + * + * @since ???? + */ + public String getHtmlDisplayName() { + return htmlDisplayName; + } + + /** Sets toolTip for this TopComponent, adds notification * about the change to its WindowManager.TopComponentManager. */ public void setToolTipText(String toolTip) {