Revision: 26718
          http://sourceforge.net/p/bibdesk/svn/26718
Author:   hofman
Date:     2021-08-23 16:12:18 +0000 (Mon, 23 Aug 2021)
Log Message:
-----------
Set some formatters in IB

Modified Paths:
--------------
    trunk/bibdesk/BDSKEditor.m
    trunk/bibdesk/BDSKFieldSheetController.m
    trunk/bibdesk/BDSKMacroWindowController.m
    trunk/bibdesk/BDSKTemplateDocument.m
    trunk/bibdesk/BDSKTextImportController.m
    trunk/bibdesk/Base.lproj/BDSKEditor.xib
    trunk/bibdesk/Base.lproj/BibPref_AutoFile.xib
    trunk/bibdesk/Base.lproj/BibPref_Cite.xib
    trunk/bibdesk/Base.lproj/BibPref_Crossref.xib
    trunk/bibdesk/Base.lproj/TemplateDocument.xib
    trunk/bibdesk/Base.lproj/TextImport.xib
    trunk/bibdesk/BibPref_AutoFile.h
    trunk/bibdesk/BibPref_AutoFile.m
    trunk/bibdesk/BibPref_Cite.m
    trunk/bibdesk/BibPref_Crossref.m
    trunk/bibdesk/FieldSheet.xib

Modified: trunk/bibdesk/BDSKEditor.m
===================================================================
--- trunk/bibdesk/BDSKEditor.m  2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/BDSKEditor.m  2021-08-23 16:12:18 UTC (rev 26718)
@@ -225,9 +225,6 @@
         [tableView registerForDraggedTypes:[NSArray 
arrayWithObjects:BDSKPasteboardTypePublications, NSPasteboardTypeString, 
(NSString *)kUTTypeURL, (NSString *)kUTTypeFileURL, NSURLPboardType, 
NSFilenamesPboardType, nil]];
     
     // Setup the citekey textfield
-    BDSKCiteKeyFormatter *citeKeyFormatter = [[BDSKCiteKeyFormatter alloc] 
init];
-    [citeKeyField setFormatter:citeKeyFormatter];
-    [citeKeyFormatter release];
        [citeKeyField setStringValue:[publication citeKey]];
     [citeKeyField setEditable:editorFlags.isEditable];
        

Modified: trunk/bibdesk/BDSKFieldSheetController.m
===================================================================
--- trunk/bibdesk/BDSKFieldSheetController.m    2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/BDSKFieldSheetController.m    2021-08-23 16:12:18 UTC (rev 
26718)
@@ -90,9 +90,7 @@
 }
 
 - (void)windowDidLoad {
-    BDSKFieldNameFormatter *formatter = [[[BDSKFieldNameFormatter alloc] init] 
autorelease];
-    [formatter setKnownFieldNames:[self choosableFields]];
-       [chosenFieldComboBox setFormatter:formatter];
+    [[chosenFieldComboBox formatter] setKnownFieldNames:choosableFields];
 }
 
 - (void)setSelectableFields:(NSArray *)array {

Modified: trunk/bibdesk/BDSKMacroWindowController.m
===================================================================
--- trunk/bibdesk/BDSKMacroWindowController.m   2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/BDSKMacroWindowController.m   2021-08-23 16:12:18 UTC (rev 
26718)
@@ -145,14 +145,6 @@
     [tableView setDraggingSourceOperationMask:NSDragOperationCopy 
forLocal:YES];
     [tableView setDraggingSourceOperationMask:NSDragOperationCopy forLocal:NO];
     
-    NSTableColumn *tc = [tableView tableColumnWithIdentifier:MACRO_COLUMNID];
-    [[tc dataCell] setFormatter:[[[MacroKeyFormatter alloc] init] 
autorelease]];
-    if(isEditable)
-        [tableView registerForDraggedTypes:[NSArray 
arrayWithObjects:NSPasteboardTypeString, (NSString *)kUTTypeFileURL, 
NSFilenamesPboardType, nil]];
-    tc = [tableView tableColumnWithIdentifier:DEFINITION_COLUMNID];
-    [[tc dataCell] setFormatter:tableCellFormatter];
-    [tableView reloadData];
-    
     BDSKTypeSelectHelper *aTypeSelectHelper = [[BDSKTypeSelectHelper alloc] 
init];
     [aTypeSelectHelper setCyclesSimilarResults:YES];
     [aTypeSelectHelper setMatchesPrefix:NO];

Modified: trunk/bibdesk/BDSKTemplateDocument.m
===================================================================
--- trunk/bibdesk/BDSKTemplateDocument.m        2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/BDSKTemplateDocument.m        2021-08-23 16:12:18 UTC (rev 
26718)
@@ -41,7 +41,6 @@
 #import "BDSKTypeTemplate.h"
 #import "BDSKTypeManager.h"
 #import "BDSKStringConstants.h"
-#import "BDSKFieldNameFormatter.h"
 #import "BDSKFieldSheetController.h"
 #import "NSWindowController_BDSKExtensions.h"
 #import "BDSKTemplateParser.h"
@@ -266,8 +265,6 @@
     width = NSWidth([[[tableView enclosingScrollView] contentView] 
visibleRect]) - 2.0 * [tableView intercellSpacing].width - [[tableView 
tableColumnWithIdentifier:@"included"] width];
     [tableColumn setWidth:fmax(width, [tableColumn minWidth])];
     
-       [fieldField setFormatter:[[[BDSKFieldNameFormatter alloc] init] 
autorelease]];
-    
     [(NSNumberFormatter *)[sizeComboBox formatter] 
setZeroSymbol:NSLocalizedString(@"Inherit", @"Inherit font size placeholder")];
     
     [ownerController bind:@"contentObject" toObject:self withKeyPath:@"self" 
options:nil];

Modified: trunk/bibdesk/BDSKTextImportController.m
===================================================================
--- trunk/bibdesk/BDSKTextImportController.m    2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/BDSKTextImportController.m    2021-08-23 16:12:18 UTC (rev 
26718)
@@ -158,7 +158,6 @@
 - (NSString *)windowNibName { return @"TextImport"; }
 
 - (void)windowDidLoad{
-    [citeKeyField setFormatter:[[[BDSKCiteKeyFormatter alloc] init] 
autorelease]];
     [citeKeyField setStringValue:[[self publication] citeKey]];
     
     [statusLine setStringValue:@""];

Modified: trunk/bibdesk/Base.lproj/BDSKEditor.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BDSKEditor.xib     2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/Base.lproj/BDSKEditor.xib     2021-08-23 16:12:18 UTC (rev 
26718)
@@ -181,6 +181,7 @@
                                                         <textField 
verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="820">
                                                             <rect key="frame" 
x="76" y="306" width="280" height="21"/>
                                                             <textFieldCell 
key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" 
editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" 
alignment="left" drawsBackground="YES" id="1009">
+                                                                
<customFormatter key="formatter" id="SBB-E6-GGd" 
customClass="BDSKCiteKeyFormatter"/>
                                                                 <font 
key="font" metaFont="system"/>
                                                                 <color 
key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                                 <color 
key="backgroundColor" name="textBackgroundColor" catalog="System" 
colorSpace="catalog"/>

Modified: trunk/bibdesk/Base.lproj/BibPref_AutoFile.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BibPref_AutoFile.xib       2021-08-23 14:41:33 UTC 
(rev 26717)
+++ trunk/bibdesk/Base.lproj/BibPref_AutoFile.xib       2021-08-23 16:12:18 UTC 
(rev 26718)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="8000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="17701"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="18122"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -83,6 +83,7 @@
                 <textField toolTip="The folder to use for automatically filed 
papers" horizontalHuggingPriority="99" verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="102">
                     <rect key="frame" x="233" y="478" width="248" height="21"/>
                     <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" 
drawsBackground="YES" id="367">
+                        <customFormatter key="formatter" id="spc-jH-2vQ" 
customClass="BDSKFolderPathFormatter"/>
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" 
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

Modified: trunk/bibdesk/Base.lproj/BibPref_Cite.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BibPref_Cite.xib   2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/Base.lproj/BibPref_Cite.xib   2021-08-23 16:12:18 UTC (rev 
26718)
@@ -218,7 +218,8 @@
                     <constraints>
                         <constraint firstAttribute="width" priority="749" 
constant="100" id="BE5-v8-Q9w"/>
                     </constraints>
-                    <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" 
title="cite" drawsBackground="YES" id="389">
+                    <textFieldCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" alignment="left" 
drawsBackground="YES" id="389">
+                        <customFormatter key="formatter" id="IGm-7m-0kw" 
customClass="BDSKDragCopyCiteKeyFormatter"/>
                         <font key="font" metaFont="system"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" 
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

Modified: trunk/bibdesk/Base.lproj/BibPref_Crossref.xib
===================================================================
--- trunk/bibdesk/Base.lproj/BibPref_Crossref.xib       2021-08-23 14:41:33 UTC 
(rev 26717)
+++ trunk/bibdesk/Base.lproj/BibPref_Crossref.xib       2021-08-23 16:12:18 UTC 
(rev 26718)
@@ -99,6 +99,7 @@
                                                     <textField 
horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="5EX-C4-6Zn">
                                                         <rect key="frame" 
x="0.0" y="0.0" width="137" height="14"/>
                                                         <textFieldCell 
key="cell" controlSize="small" scrollable="YES" lineBreakMode="clipping" 
selectable="YES" editable="YES" sendsActionOnEndEditing="YES" id="ICk-uH-G74">
+                                                            <customFormatter 
key="formatter" id="VqN-1B-jf9" customClass="BDSKTypeNameFormatter"/>
                                                             <font key="font" 
metaFont="smallSystem"/>
                                                             <color 
key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                                             <color 
key="backgroundColor" name="textBackgroundColor" catalog="System" 
colorSpace="catalog"/>

Modified: trunk/bibdesk/Base.lproj/TemplateDocument.xib
===================================================================
--- trunk/bibdesk/Base.lproj/TemplateDocument.xib       2021-08-23 14:41:33 UTC 
(rev 26717)
+++ trunk/bibdesk/Base.lproj/TemplateDocument.xib       2021-08-23 16:12:18 UTC 
(rev 26718)
@@ -1602,6 +1602,7 @@
                 <textField verticalHuggingPriority="750" 
translatesAutoresizingMaskIntoConstraints="NO" id="1134">
                     <rect key="frame" x="121" y="4" width="187" height="19"/>
                     <textFieldCell key="cell" controlSize="small" 
scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" 
drawsBackground="YES" id="1926">
+                        <customFormatter key="formatter" id="lsU-66-XfL" 
customClass="BDSKFieldNameFormatter"/>
                         <font key="font" metaFont="smallSystem"/>
                         <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" 
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

Modified: trunk/bibdesk/Base.lproj/TextImport.xib
===================================================================
--- trunk/bibdesk/Base.lproj/TextImport.xib     2021-08-23 14:41:33 UTC (rev 
26717)
+++ trunk/bibdesk/Base.lproj/TextImport.xib     2021-08-23 16:12:18 UTC (rev 
26718)
@@ -146,7 +146,7 @@
                                                                         
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="pUV-Qw-lHM">
                                                                             
<rect key="frame" x="0.0" y="1" width="45" height="15"/>
                                                                             
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" 
sendsActionOnEndEditing="YES" id="TLi-Tu-8b8">
-                                                                               
 <font key="font" metaFont="system" size="12"/>
+                                                                               
 <font key="font" metaFont="cellTitle"/>
                                                                                
 <color key="textColor" name="controlTextColor" catalog="System" 
colorSpace="catalog"/>
                                                                                
 <color key="backgroundColor" name="textBackgroundColor" catalog="System" 
colorSpace="catalog"/>
                                                                             
</textFieldCell>
@@ -181,7 +181,7 @@
                                                                         
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="Qnd-8Y-VkX">
                                                                             
<rect key="frame" x="0.0" y="1" width="79" height="15"/>
                                                                             
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" 
sendsActionOnEndEditing="YES" id="7ju-J5-Wae">
-                                                                               
 <font key="font" metaFont="system" size="12"/>
+                                                                               
 <font key="font" metaFont="cellTitle"/>
                                                                                
 <color key="textColor" name="controlTextColor" catalog="System" 
colorSpace="catalog"/>
                                                                                
 <color key="backgroundColor" name="textBackgroundColor" catalog="System" 
colorSpace="catalog"/>
                                                                             
</textFieldCell>
@@ -217,7 +217,7 @@
                                                                         
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="Vuc-uc-lVd">
                                                                             
<rect key="frame" x="0.0" y="1" width="98" height="15"/>
                                                                             
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" 
selectable="YES" editable="YES" sendsActionOnEndEditing="YES" id="OMP-vJ-84O" 
customClass="BDSKComplexStringCell">
-                                                                               
 <font key="font" metaFont="system" size="12"/>
+                                                                               
 <font key="font" metaFont="cellTitle"/>
                                                                                
 <color key="textColor" name="controlTextColor" catalog="System" 
colorSpace="catalog"/>
                                                                                
 <color key="backgroundColor" name="textBackgroundColor" catalog="System" 
colorSpace="catalog"/>
                                                                             
</textFieldCell>
@@ -320,6 +320,7 @@
                                     <textField verticalHuggingPriority="750" 
horizontalCompressionResistancePriority="250" 
translatesAutoresizingMaskIntoConstraints="NO" id="239">
                                         <rect key="frame" x="62" y="242" 
width="220" height="21"/>
                                         <textFieldCell key="cell" 
scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" 
drawsBackground="YES" id="309">
+                                            <customFormatter key="formatter" 
id="4x6-hl-AO0" customClass="BDSKCiteKeyFormatter"/>
                                             <font key="font" 
metaFont="system"/>
                                             <color key="textColor" 
name="controlTextColor" catalog="System" colorSpace="catalog"/>
                                             <color key="backgroundColor" 
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

Modified: trunk/bibdesk/BibPref_AutoFile.h
===================================================================
--- trunk/bibdesk/BibPref_AutoFile.h    2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/BibPref_AutoFile.h    2021-08-23 16:12:18 UTC (rev 26718)
@@ -93,3 +93,6 @@
 - (IBAction)showLocalUrlFormatWarning:(id)sender;
 
 @end
+
+
+@interface BDSKFolderPathFormatter : NSFormatter @end

Modified: trunk/bibdesk/BibPref_AutoFile.m
===================================================================
--- trunk/bibdesk/BibPref_AutoFile.m    2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/BibPref_AutoFile.m    2021-08-23 16:12:18 UTC (rev 26718)
@@ -50,10 +50,6 @@
 #define MAX_PREVIEW_WIDTH      501.0
 #define MAX_FORMAT_WIDTH       288.0
 
-
-@interface BDSKFolderPathFormatter : NSFormatter @end
-
-
 @interface BibPref_AutoFile (Private)
 - (NSString *)formatError;
 - (void)setLocalUrlFormatInvalidWarning:(NSString *)message;
@@ -84,9 +80,7 @@
        BDSKFormatStringFormatter *formatter = [[BDSKFormatStringFormatter 
alloc] initWithField:BDSKLocalFileString];
     [formatField setFormatter:formatter];
        [formatter release];
-    
-    [papersFolderLocationTextField setFormatter:[[[BDSKFolderPathFormatter 
alloc] init] autorelease]];
-    
+        
     [previewDisplay setStringValue:[[BDSKPreviewItem sharedItem] displayText]];
     [previewDisplay sizeToFit];
     

Modified: trunk/bibdesk/BibPref_Cite.m
===================================================================
--- trunk/bibdesk/BibPref_Cite.m        2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/BibPref_Cite.m        2021-08-23 16:12:18 UTC (rev 26718)
@@ -64,10 +64,6 @@
 - (void)loadView {
     [super loadView];
     
-    BDSKDragCopyCiteKeyFormatter *formatter = [[BDSKDragCopyCiteKeyFormatter 
alloc] init];
-    [citeStringField setFormatter:formatter];
-    [formatter release];
-    
     [self updateTemplates];
     [self updateCiteCommandUI];
     

Modified: trunk/bibdesk/BibPref_Crossref.m
===================================================================
--- trunk/bibdesk/BibPref_Crossref.m    2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/BibPref_Crossref.m    2021-08-23 16:12:18 UTC (rev 26718)
@@ -37,7 +37,6 @@
  */
 
 #import "BibPref_Crossref.h"
-#import "BDSKTypeNameFormatter.h"
 #import "BDSKStringConstants.h"
 
 
@@ -56,9 +55,6 @@
     
     typesArray = [[NSMutableArray alloc] initWithCapacity:4];
        [typesArray setArray:[sud 
arrayForKey:BDSKTypesForDuplicateBooktitleKey]];
-    BDSKTypeNameFormatter *typeNameFormatter = [[BDSKTypeNameFormatter alloc] 
init];
-    [[[[tableView tableColumns] objectAtIndex:0] dataCell] 
setFormatter:typeNameFormatter];
-    [typeNameFormatter release];
     
     [self updateAddRemoveButton];
     [self updateDuplicateTypes];

Modified: trunk/bibdesk/FieldSheet.xib
===================================================================
--- trunk/bibdesk/FieldSheet.xib        2021-08-23 14:41:33 UTC (rev 26717)
+++ trunk/bibdesk/FieldSheet.xib        2021-08-23 16:12:18 UTC (rev 26718)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="17701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" 
toolsVersion="18122" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" 
useAutolayout="YES">
     <dependencies>
         <deployment identifier="macosx"/>
         <development version="8000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="17701"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" 
version="18122"/>
         <capability name="documents saved in the Xcode 8 format" 
minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -122,6 +122,7 @@
                             <constraint firstAttribute="width" 
relation="greaterThanOrEqual" constant="200" id="Wbm-km-nVP"/>
                         </constraints>
                         <comboBoxCell key="cell" scrollable="YES" 
lineBreakMode="clipping" selectable="YES" editable="YES" 
sendsActionOnEndEditing="YES" borderStyle="bezel" alignment="left" 
drawsBackground="YES" numberOfVisibleItems="5" id="98" 
customClass="BDSKComboBoxCell">
+                            <customFormatter key="formatter" id="9GD-NK-dO6" 
customClass="BDSKFieldNameFormatter"/>
                             <font key="font" metaFont="system"/>
                             <color key="textColor" name="controlTextColor" 
catalog="System" colorSpace="catalog"/>
                             <color key="backgroundColor" 
name="textBackgroundColor" catalog="System" colorSpace="catalog"/>

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to