This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 28623
Collapse All | Expand All

(-)utilities/group/src/org/netbeans/modules/group/GroupShadow.java (-1 / +25 lines)
Lines 612-623 Link Here
612
        /** Gets display name.
612
        /** Gets display name.
613
         * @return display name */
613
         * @return display name */
614
        public String getDisplayName() {
614
        public String getDisplayName() {
615
            DataObject dataObject = getDataObject();
616
            
617
            //TDB - attribute to disable (group) suffix, so Templates can
618
            //use Jarda's group-of-one hack to avoid classloading
619
            try {
620
                Object o = dataObject.getPrimaryFile().getAttribute("usedisplayname"); //NOI18N
621
                if ((o instanceof Boolean) && (o.equals (Boolean.TRUE))) {
622
                    return super.getDisplayName();
623
                }
624
            } catch (Exception e) {
625
                //okay, invalid fs or something
626
            }
627
            
615
            if (groupformat == null) {
628
            if (groupformat == null) {
616
                groupformat = new MessageFormat(GroupShadow.getLocalizedString("FMT_groupShadowName")); // NOI18N
629
                groupformat = new MessageFormat(GroupShadow.getLocalizedString("FMT_groupShadowName")); // NOI18N
617
            }
630
            }
618
631
619
            String name = getName();
632
            String name = getName();
620
            DataObject dataObject = getDataObject();
621
            String displayName = super.getDisplayName();
633
            String displayName = super.getDisplayName();
622
            
634
            
623
            String argument0 = name == null ? "" : name; // NOI18N
635
            String argument0 = name == null ? "" : name; // NOI18N
Lines 924-930 Link Here
924
        /** Gets display name. */
936
        /** Gets display name. */
925
        public String getDisplayName() {
937
        public String getDisplayName() {
926
//            DataObject obj = (DataObject) this.getCookie(DataObject.class);
938
//            DataObject obj = (DataObject) this.getCookie(DataObject.class);
939
            
940
            //Hack to allow a template using a __SomeTemplate__.java
941
            //style name to use a localized display name
927
            FileObject primary = originalDatObj.getPrimaryFile();
942
            FileObject primary = originalDatObj.getPrimaryFile();
943
            try {
944
                Object o = primary.getAttribute("usedisplayname"); //NOI18N
945
                if ((o instanceof Boolean) && (o.equals (Boolean.TRUE))) {
946
                    return originalDatObj.getNodeDelegate().getDisplayName();
947
                }
948
            } catch (Exception e) { 
949
                //okay, invalid fs or something
950
            }
951
928
            String fullname = primary.getPackageNameExt ('/', '.');
952
            String fullname = primary.getPackageNameExt ('/', '.');
929
            int index = fullname.lastIndexOf('/');
953
            int index = fullname.lastIndexOf('/');
930
            String foldername;
954
            String foldername;

Return to bug 28623