Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Saving and loading custom plugins works

  • Loading branch information...
commit 1c09897bb04ddb0eeda7ae85f87b97c05ca842ae 1 parent 11c8ef5
svnuser authored
View
5 CSVDocument/CSVDocument.m
@@ -119,7 +119,7 @@ - (BOOL) parseCSVString:(NSString *)string maxRows:(NSUInteger)maxRows error:(NS
if (autoDetectSeparator) {
self.separator = @",";
- NSUInteger testStringLength = ([string length] > 200) ? 200 : [string length];
+ NSUInteger testStringLength = MIN([string length], 200);
NSString *testString = [string substringToIndex:testStringLength];
NSArray *possSeparators = [NSArray arrayWithObjects:@";", @" ", nil];
@@ -365,7 +365,8 @@ - (NSString *) stringInFormat:(PPStringFormat *)format
}
// get the string from the formatter
- NSString *string = [format stringForRows:exportRows includeHeaderRows:headerFlag withColumns:columnArray];
+// format.exportHeaders = headerFlag;
+ NSString *string = [format stringForRows:exportRows andColumns:columnArray];
return string;
}
#endif
View
2,945 CSVManipulator.xcodeproj/pp.pbxuser
2,594 additions, 351 deletions not shown
View
93 CSVManipulator.xcodeproj/pp.perspectivev3
@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>ActivePerspectiveName</key>
- <string>Project</string>
+ <string>Debug</string>
<key>AllowedModules</key>
<array>
<dict>
@@ -255,7 +255,7 @@
<key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
<array>
<real>22</real>
- <real>243</real>
+ <real>276</real>
</array>
<key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
<array>
@@ -281,13 +281,14 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>8</integer>
+ <integer>24</integer>
+ <integer>22</integer>
<integer>1</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 0}, {265, 867}}</string>
+ <string>{{0, 2}, {298, 867}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -297,34 +298,30 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {282, 885}}</string>
+ <string>{{0, 0}, {315, 885}}</string>
<key>GroupTreeTableConfiguration</key>
<array>
<string>SCMStatusColumn</string>
<real>22</real>
<string>MainColumn</string>
- <real>243</real>
+ <real>276</real>
</array>
- <key>RubberWindowFrame</key>
- <string>208 102 1430 926 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>PBXSmartGroupTreeModule</string>
<key>Proportion</key>
- <string>282pt</string>
+ <string>315pt</string>
</dict>
<dict>
<key>Dock</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>EEF027910D6D8015000532A4</string>
<key>PBXProjectModuleLabel</key>
- <string>CSVWindowController.m</string>
+ <string>PPStringFormat.m</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
@@ -332,11 +329,11 @@
<key>PBXProjectModuleGUID</key>
<string>EEF027920D6D8015000532A4</string>
<key>PBXProjectModuleLabel</key>
- <string>CSVWindowController.m</string>
+ <string>PPStringFormat.m</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>EE7146D5113680A900418030</string>
+ <string>EE7148481136DEF100418030</string>
<key>history</key>
<array>
<string>EECAA3C10D803E5200AE2D4A</string>
@@ -355,7 +352,6 @@
<string>EE13773B1088A0B700D31816</string>
<string>EE13773C1088A0B700D31816</string>
<string>EE13778E1088A95400D31816</string>
- <string>EE13795B1088C3F300D31816</string>
<string>EE1379E7108F07B200D31816</string>
<string>EE137A9D10904B7A00D31816</string>
<string>EE137B11109065AF00D31816</string>
@@ -367,47 +363,48 @@
<string>EE118A4E109AFA990072804F</string>
<string>EE118A4F109AFA990072804F</string>
<string>EE118B09109B30470072804F</string>
- <string>EE118D6010A1C7C80072804F</string>
<string>EE118D6210A1C7C80072804F</string>
<string>EE118D8310A1D0310072804F</string>
<string>EE118DBE10A1D5320072804F</string>
<string>EE118EF210A1F78A0072804F</string>
<string>EE1A5DA310BAF0F10041C5BF</string>
<string>EE1A5DD910BAF46D0041C5BF</string>
- <string>EE7144E8113538C800418030</string>
<string>EE7144E9113538C800418030</string>
<string>EE7144EA113538C800418030</string>
- <string>EE7144EC113538C800418030</string>
- <string>EE7144ED113538C800418030</string>
- <string>EE7144EE113538C800418030</string>
- <string>EE7144EF113538C800418030</string>
- <string>EE7144FB11353C9E00418030</string>
<string>EE7144FD11353C9E00418030</string>
- <string>EE71465C11356A4600418030</string>
- <string>EE71465D11356A4600418030</string>
- <string>EE71465E11356A4600418030</string>
- <string>EE71465F11356A4600418030</string>
- <string>EE71466011356A4600418030</string>
- <string>EE71466111356A4600418030</string>
- <string>EE71466211356A4600418030</string>
- <string>EE71466311356A4600418030</string>
- <string>EE71466411356A4600418030</string>
<string>EE71466611356A4600418030</string>
<string>EE71466711356A4600418030</string>
- <string>EE71466811356A4600418030</string>
<string>EE71466911356A4600418030</string>
<string>EE71466A11356A4600418030</string>
- <string>EE71467311356DAB00418030</string>
<string>EE71467C113582F400418030</string>
<string>EE71469B11367CB000418030</string>
<string>EE71469C11367CB000418030</string>
<string>EE7146A911367CE300418030</string>
<string>EE7146AF11367D7D00418030</string>
- <string>EE7146B011367D7D00418030</string>
<string>EE7146B111367D7D00418030</string>
- <string>EE7146B211367D7D00418030</string>
- <string>EE7146B911367E3D00418030</string>
- <string>EE7146D41136809200418030</string>
+ <string>EE7146EE1136972000418030</string>
+ <string>EE7146FC11369A2800418030</string>
+ <string>EE7146FD11369A2800418030</string>
+ <string>EE7146FE11369A2800418030</string>
+ <string>EE7146FF11369A2800418030</string>
+ <string>EE7147231136A57900418030</string>
+ <string>EE7147241136A57900418030</string>
+ <string>EE7147301136B1DC00418030</string>
+ <string>EE7147311136B1DC00418030</string>
+ <string>EE7147321136B1DC00418030</string>
+ <string>EE7147331136B1DC00418030</string>
+ <string>EE7147371136B4A300418030</string>
+ <string>EE7147431136B73500418030</string>
+ <string>EE7147C61136C6C600418030</string>
+ <string>EE7147CF1136C70200418030</string>
+ <string>EE71481A1136DD7D00418030</string>
+ <string>EE71481B1136DD7D00418030</string>
+ <string>EE71481C1136DD7D00418030</string>
+ <string>EE71481D1136DD7D00418030</string>
+ <string>EE71481E1136DD7D00418030</string>
+ <string>EE7148201136DD7D00418030</string>
+ <string>EE7148431136DEED00418030</string>
+ <string>EE7148441136DEED00418030</string>
</array>
</dict>
<key>SplitCount</key>
@@ -421,9 +418,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{0, 0}, {1143, 880}}</string>
- <key>RubberWindowFrame</key>
- <string>208 102 1430 926 0 0 1680 1028 </string>
+ <string>{{0, 0}, {1110, 880}}</string>
</dict>
<key>Module</key>
<string>PBXNavigatorGroup</string>
@@ -463,8 +458,6 @@
<dict>
<key>Frame</key>
<string>{{10, 27}, {1143, -27}}</string>
- <key>RubberWindowFrame</key>
- <string>208 102 1430 926 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>PBXProjectFindModule</string>
@@ -523,7 +516,7 @@
<key>GeometryConfiguration</key>
<dict>
<key>Frame</key>
- <string>{{10, 27}, {1143, -27}}</string>
+ <string>{{10, 27}, {1110, -27}}</string>
</dict>
<key>Module</key>
<string>PBXBuildResultsModule</string>
@@ -532,7 +525,7 @@
</dict>
</array>
<key>Proportion</key>
- <string>1143pt</string>
+ <string>1110pt</string>
</dict>
</array>
<key>Name</key>
@@ -596,6 +589,8 @@
<key>Layout</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -607,6 +602,8 @@
<dict>
<key>Frame</key>
<string>{{0, 0}, {1430, 501}}</string>
+ <key>RubberWindowFrame</key>
+ <string>208 102 1430 926 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>PBXDebugCLIModule</string>
@@ -681,7 +678,11 @@
</array>
<key>Frame</key>
<string>{{0, 183}, {462, 196}}</string>
+ <key>RubberWindowFrame</key>
+ <string>208 102 1430 926 0 0 1680 1028 </string>
</dict>
+ <key>RubberWindowFrame</key>
+ <string>208 102 1430 926 0 0 1680 1028 </string>
</dict>
<key>Module</key>
<string>PBXDebugSessionModule</string>
@@ -743,6 +744,8 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>EE7148491136DEF100418030</string>
+ <string>EEF071321086083800C05DE9</string>
<string>EE7144BB113535C600418030</string>
<string>EE7144BC113535C600418030</string>
<string>/Users/pp/Cocoa/CSVManipulator/CSVManipulator.xcodeproj</string>
@@ -1580,7 +1583,7 @@
<key>TableOfContents</key>
<array>
<string>EEF071321086083800C05DE9</string>
- <string>EE071B7610D0EA7100B89F82</string>
+ <string>EE71471011369B8100418030</string>
<string>EEF071311086083800C05DE9</string>
</array>
<key>WindowString</key>
View
19 CSVWindowController.h
@@ -29,24 +29,33 @@
IBOutlet NSPopUpButton *copyAsKindPopup;
+ // toolbar items (needed for validation)
+ IBOutlet NSToolbarItem *addRowItem;
+ IBOutlet NSToolbarItem *removeRowItem;
+ IBOutlet NSToolbarItem *addColumnItem;
+ IBOutlet NSToolbarItem *removeColumnItem;
+ IBOutlet NSToolbarItem *restoreOrderItem;
+ IBOutlet NSToolbarItem *showFormatsItem;
+
// Progress window
IBOutlet NSPanel *progressSheet;
IBOutlet NSProgressIndicator *progressIndicator;
IBOutlet NSTextField *progressPercentage;
-
- // state
- BOOL canRemoveColumn;
}
@property (nonatomic, assign) MyDocument *document;
@property (nonatomic, retain) IBOutlet DataTableView *mainTable;
@property (nonatomic, retain) IBOutlet PPToolbarView *mainToolbar;
+@property (nonatomic, retain) NSToolbarItem *addRowItem;
+@property (nonatomic, retain) NSToolbarItem *removeRowItem;
+@property (nonatomic, retain) NSToolbarItem *addColumnItem;
+@property (nonatomic, retain) NSToolbarItem *removeColumnItem;
+@property (nonatomic, retain) NSToolbarItem *restoreOrderItem;
+@property (nonatomic, retain) NSToolbarItem *showFormatsItem;
@property (nonatomic, retain) IBOutlet NSPanel *progressSheet;
-@property (nonatomic, readonly, assign) BOOL canRemoveColumn;
-
// Row/Column control
- (IBAction) addCSVColumn:(id)sender;
View
61 CSVWindowController.m
@@ -28,7 +28,13 @@ @implementation CSVWindowController
@synthesize mainTable;
@synthesize mainToolbar;
@synthesize progressSheet;
-@dynamic canRemoveColumn;
+
+@synthesize addRowItem;
+@synthesize removeRowItem;
+@synthesize addColumnItem;
+@synthesize removeColumnItem;
+@synthesize restoreOrderItem;
+@synthesize showFormatsItem;
- (void) dealloc
@@ -40,6 +46,15 @@ - (void) dealloc
self.progressSheet = nil;
+ self.addRowItem = nil;
+
+ self.addRowItem = nil;
+ self.removeRowItem = nil;
+ self.addColumnItem = nil;
+ self.removeColumnItem = nil;
+ self.restoreOrderItem = nil;
+ self.showFormatsItem = nil;
+
[super dealloc];
}
@@ -77,8 +92,6 @@ - (IBAction) addCSVColumn:(id)sender
- (IBAction) removeCSVColumn:(id)sender
{
- [self willChangeValueForKey:@"canRemoveColumn"];
-
NSIndexSet *indexes = [mainTable selectedColumnIndexes];
if ([indexes count] > 0) {
NSArray *exColumns = [[mainTable tableColumns] objectsAtIndexes:indexes];
@@ -95,7 +108,6 @@ - (IBAction) removeCSVColumn:(id)sender
[mainTable sizeLastColumnToFit];
}
- [self didChangeValueForKey:@"canRemoveColumn"];
}
- (IBAction) addCSVRow:(id)sender
@@ -110,11 +122,6 @@ - (IBAction) removeCSVRow:(id)sender
document.documentEdited = YES;
}
-- (BOOL) canRemoveColumn
-{
- return ([mainTable numberOfSelectedColumns] > 0);
-}
-
- (IBAction) restoreOriginalOrder:(id)sender;
{
[document restoreOriginalOrder];
@@ -185,7 +192,6 @@ - (void) redefineTable
- (void) addColumn:(CSVColumn *)newColumn toTable:(NSTableView *)aTableView withWidth:(CGFloat)width
{
if (aTableView == mainTable) {
- [self willChangeValueForKey:@"canRemoveColumn"];
// add the table column
DataTableColumn *tableColumn = [DataTableColumn column];
@@ -216,16 +222,12 @@ - (void) addColumn:(CSVColumn *)newColumn toTable:(NSTableView *)aTableView with
toObject:document.csvDocument.columnDict
withKeyPath:[NSString stringWithFormat:@"%@.type", newColumn.key]
options:nil];
-
- [self didChangeValueForKey:@"canRemoveColumn"];
}
}
- (void) tableViewSelectionDidChange:(NSNotification *)notification
{
- [self willChangeValueForKey:@"canRemoveColumn"];
-
NSInteger selected_row = [mainTable selectedRow];
if (selected_row >= 0) {
@@ -234,20 +236,16 @@ - (void) tableViewSelectionDidChange:(NSNotification *)notification
[mainTable editColumn:1 row:selected_row withEvent:nil select:YES];
}
}
- [self didChangeValueForKey:@"canRemoveColumn"];
}
- (void) tableView:(NSTableView *)tableView didClickTableColumn:(NSTableColumn *)tableColumn
{
- [self willChangeValueForKey:@"canRemoveColumn"];
-
// set sort descriptors
if (mainTable == tableView) {
[(DataTableView *)tableView setSortDescriptorsWithColumn:(DataTableColumn *)tableColumn];
[document setDataIsAtOriginalOrder:NO];
}
- [self didChangeValueForKey:@"canRemoveColumn"];
}
@@ -303,6 +301,33 @@ - (void) refreshData
+#pragma mark Toolbar
+- (BOOL) validateToolbarItem:(NSToolbarItem *)theItem
+{
+ if (addRowItem == theItem) {
+ return [document.csvDocument.rowController canInsert];
+ }
+ if (removeRowItem == theItem) {
+ return [document.csvDocument.rowController canRemove];
+ }
+ if (addColumnItem == theItem) {
+ return YES;
+ }
+ if (removeColumnItem == theItem) {
+ return ([mainTable numberOfSelectedColumns] > 0);
+ }
+ if (showFormatsItem == theItem) {
+ return YES;
+ }
+ if (restoreOrderItem == theItem) {
+ return document.documentEdited;
+ }
+ return YES;
+}
+#pragma mark -
+
+
+
#pragma mark Inspector
- (IBAction) showInspector:(id)sender
{
View
78 English.lproj/MainMenu.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="81"/>
+ <integer value="24"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -736,6 +736,32 @@
<reference key="NSOnImage" ref="1033313550"/>
<reference key="NSMixedImage" ref="280036839"/>
</object>
+ <object class="NSMenuItem" id="109239901">
+ <reference key="NSMenu" ref="835318025"/>
+ <bool key="NSIsDisabled">YES</bool>
+ <bool key="NSIsSeparator">YES</bool>
+ <string key="NSTitle"/>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1033313550"/>
+ <reference key="NSMixedImage" ref="280036839"/>
+ </object>
+ <object class="NSMenuItem" id="434077863">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Formats</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1033313550"/>
+ <reference key="NSMixedImage" ref="280036839"/>
+ </object>
+ <object class="NSMenuItem" id="1018708678">
+ <reference key="NSMenu" ref="835318025"/>
+ <string key="NSTitle">Format Preview</string>
+ <string key="NSKeyEquiv"/>
+ <int key="NSMnemonicLoc">2147483647</int>
+ <reference key="NSOnImage" ref="1033313550"/>
+ <reference key="NSMixedImage" ref="280036839"/>
+ </object>
<object class="NSMenuItem" id="299356726">
<reference key="NSMenu" ref="835318025"/>
<bool key="NSIsDisabled">YES</bool>
@@ -850,7 +876,7 @@
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="987607687">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">268</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -859,6 +885,7 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{96, 18}, {286, 18}}</string>
<reference key="NSSuperview" ref="987607687"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="669889039">
<int key="NSCellFlags">-2080244224</int>
@@ -886,6 +913,7 @@
<int key="NSvFlags">268</int>
<string key="NSFrame">{{17, 46}, {76, 17}}</string>
<reference key="NSSuperview" ref="987607687"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="50651795">
<int key="NSCellFlags">68288064</int>
@@ -902,6 +930,7 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{95, 41}, {288, 26}}</string>
<reference key="NSSuperview" ref="987607687"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="903976981">
<int key="NSCellFlags">-2076049856</int>
@@ -942,6 +971,8 @@
</object>
</object>
<string key="NSFrameSize">{400, 85}</string>
+ <reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
</object>
@@ -1775,6 +1806,9 @@
<reference ref="625202149"/>
<reference ref="575023229"/>
<reference ref="1011231497"/>
+ <reference ref="434077863"/>
+ <reference ref="109239901"/>
+ <reference ref="1018708678"/>
</object>
<reference key="parent" ref="713487014"/>
</object>
@@ -2057,6 +2091,21 @@
<reference key="object" ref="669889039"/>
<reference key="parent" ref="880449534"/>
</object>
+ <object class="IBObjectRecord">
+ <int key="objectID">406</int>
+ <reference key="object" ref="434077863"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">407</int>
+ <reference key="object" ref="109239901"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">408</int>
+ <reference key="object" ref="1018708678"/>
+ <reference key="parent" ref="835318025"/>
+ </object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
@@ -2226,6 +2275,9 @@
<string>395.IBPluginDependency</string>
<string>396.IBPluginDependency</string>
<string>397.IBPluginDependency</string>
+ <string>406.IBPluginDependency</string>
+ <string>407.IBPluginDependency</string>
+ <string>408.IBPluginDependency</string>
<string>5.IBPluginDependency</string>
<string>5.ImportedFromIB2</string>
<string>56.IBPluginDependency</string>
@@ -2374,7 +2426,7 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
- <string>{{508, 763}, {197, 73}}</string>
+ <string>{{642, 713}, {194, 123}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{525, 802}, {197, 73}}</string>
@@ -2429,6 +2481,9 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
+ <string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
@@ -2482,7 +2537,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">404</int>
+ <int key="maxID">408</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -2527,19 +2582,8 @@
<string key="className">MyDocument</string>
<string key="superclassName">NSDocument</string>
<object class="NSMutableDictionary" key="actions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>addCSVRow:</string>
- <string>copy:</string>
- <string>removeCSVRow:</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- </object>
+ <string key="NS.key.0">copy:</string>
+ <string key="NS.object.0">id</string>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
View
91 English.lproj/MyDocument.xib
@@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="5"/>
+ <integer value="100362"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -979,35 +979,52 @@
<int key="connectionID">100409</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBBindingConnection" key="connection">
- <string key="label">enabled: canRemoveColumn</string>
- <reference key="source" ref="212672555"/>
- <reference key="destination" ref="512844837"/>
- <object class="NSNibBindingConnector" key="connector">
- <reference key="NSSource" ref="212672555"/>
- <reference key="NSDestination" ref="512844837"/>
- <string key="NSLabel">enabled: canRemoveColumn</string>
- <string key="NSBinding">enabled</string>
- <string key="NSKeyPath">canRemoveColumn</string>
- <object class="NSDictionary" key="NSOptions">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSArray" key="dict.sortedKeys">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <string>NSNoSelectionPlaceholder</string>
- <string>NSNotApplicablePlaceholder</string>
- <string>NSNullPlaceholder</string>
- </object>
- <object class="NSMutableArray" key="dict.values">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="0"/>
- <integer value="0"/>
- <integer value="0"/>
- </object>
- </object>
- <int key="NSNibBindingConnectorVersion">2</int>
- </object>
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addRowItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="676812408"/>
+ </object>
+ <int key="connectionID">100416</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">removeRowItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="279959149"/>
+ </object>
+ <int key="connectionID">100417</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addColumnItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="236734965"/>
+ </object>
+ <int key="connectionID">100418</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">removeColumnItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="212672555"/>
+ </object>
+ <int key="connectionID">100419</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">showFormatsItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="59653895"/>
+ </object>
+ <int key="connectionID">100420</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">restoreOrderItem</string>
+ <reference key="source" ref="512844837"/>
+ <reference key="destination" ref="672269291"/>
</object>
- <int key="connectionID">100414</int>
+ <int key="connectionID">100421</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -1373,7 +1390,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{391, 918}, {616, 0}}</string>
+ <string>{{391, 691}, {616, 227}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
@@ -1415,7 +1432,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">100414</int>
+ <int key="maxID">100421</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -1452,6 +1469,8 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>addColumnItem</string>
+ <string>addRowItem</string>
<string>copyAsKindPopup</string>
<string>importAbortedField</string>
<string>mainTable</string>
@@ -1460,9 +1479,15 @@
<string>progressIndicator</string>
<string>progressPercentage</string>
<string>progressSheet</string>
+ <string>removeColumnItem</string>
+ <string>removeRowItem</string>
+ <string>restoreOrderItem</string>
+ <string>showFormatsItem</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <string>NSToolbarItem</string>
+ <string>NSToolbarItem</string>
<string>NSPopUpButton</string>
<string>NSTextField</string>
<string>DataTableView</string>
@@ -1471,6 +1496,10 @@
<string>NSProgressIndicator</string>
<string>NSTextField</string>
<string>NSPanel</string>
+ <string>NSToolbarItem</string>
+ <string>NSToolbarItem</string>
+ <string>NSToolbarItem</string>
+ <string>NSToolbarItem</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
View
16 FileExport/PPStringFormat.h
@@ -10,7 +10,7 @@
@class PPStringFormatRow;
-@interface PPStringFormat : NSObject <NSCopying> {
+@interface PPStringFormat : NSObject <NSCopying, NSCoding> {
BOOL systemFormat; // indicates whether this is a system format or not
NSString *name;
NSString *type;
@@ -19,9 +19,12 @@
NSString *prefix; // what to put before the content, e.g. <root>
NSString *suffix; // obviously what to put after, e.g. </root>
+ BOOL exportHeaders; // if NO header rows will not be exported
BOOL useHeaderNamesAsKey; // if YES the column names will be used as keys
PPStringFormatRow *headerFormat; // the formatRow that formats rows marked as header
PPStringFormatRow *valueFormat; // the formatRow that formats arbitrary rows
+
+ NSURL *fileURL;
}
@property (nonatomic, assign, getter=isSystemFormat) BOOL systemFormat;
@@ -32,20 +35,27 @@
@property (nonatomic, copy) NSString *prefix;
@property (nonatomic, copy) NSString *suffix;
+@property (nonatomic, assign) BOOL exportHeaders;
@property (nonatomic, assign) BOOL useHeaderNamesAsKey;
@property (nonatomic, retain) PPStringFormatRow *headerFormat;
@property (nonatomic, retain) PPStringFormatRow *valueFormat;
+@property (nonatomic, readwrite, copy) NSURL *fileURL;
+
+ (PPStringFormat *) csvFormat;
+ (PPStringFormat *) tabFormat;
+ (PPStringFormat *) flatXMLFormat;
+ (PPStringFormat *) sqlFormat;
-- (NSString *) stringForRows:(NSArray *)csvRows includeHeaderRows:(BOOL)includeHeaderRows withColumns:(NSArray *)columns;
-
+- (NSString *) stringForRows:(NSArray *)csvRows andColumns:(NSArray *)columns;
- (NSString *) headerForColumnKeys:(NSArray *)keys values:(NSArray *)values;
- (NSString *) rowForColumnKeys:(NSArray *)keys values:(NSArray *)values;
++ (PPStringFormat *) formatFromFile:(NSURL *)aFileURL error:(NSError **)outError;
+- (BOOL) writeToFile:(NSURL *)aFileURL error:(NSError **)outError;
+- (BOOL) save:(NSError **)outError;
+- (BOOL) deleteFile:(NSError **)outError;
+
@end
View
146 FileExport/PPStringFormat.m
@@ -24,16 +24,37 @@ @implementation PPStringFormat
@synthesize prefix;
@synthesize suffix;
+@synthesize exportHeaders;
@synthesize useHeaderNamesAsKey;
@synthesize headerFormat;
@synthesize valueFormat;
+@synthesize fileURL;
+- (void) dealloc
+{
+ self.name = nil;
+ self.type = nil;
+ self.formatDescription = nil;
+
+ self.prefix = nil;
+ self.suffix = nil;
+
+ self.headerFormat = nil;
+ self.valueFormat = nil;
+
+ self.fileURL = nil;
+
+ [super dealloc];
+}
+
- (id) initWithName:(NSString *)newName
{
self = [super init];
if (self) {
self.name = newName;
+ self.useHeaderNamesAsKey = YES;
+ self.exportHeaders = YES;
}
return self;
}
@@ -42,37 +63,60 @@ - (id) copyWithZone:(NSZone *)zone
{
PPStringFormat *copy = [[[self class] allocWithZone:zone] initWithName:self.name];
// copies are never system formats, so don't assign the bool
+ copy.type = self.type;
copy.formatDescription = self.formatDescription;
copy.prefix = self.prefix;
copy.suffix = self.suffix;
+ copy.exportHeaders = self.exportHeaders;
+ copy.useHeaderNamesAsKey = self.useHeaderNamesAsKey;
copy->headerFormat = [self.headerFormat copyWithZone:zone];
copy->valueFormat = [self.valueFormat copyWithZone:zone];
return copy;
}
+#pragma mark -
-- (void) dealloc
+
+
+#pragma mark NSCoding
+- (id) initWithCoder:(NSCoder *)aDecoder
{
- self.name = nil;
- self.type = nil;
- self.formatDescription = nil;
-
- self.prefix = nil;
- self.suffix = nil;
-
- self.headerFormat = nil;
- self.valueFormat = nil;
-
+ if (self = [self init]) {
+ self.name = [aDecoder decodeObjectForKey:@"name"];
+ self.type = [aDecoder decodeObjectForKey:@"type"];
+ self.formatDescription = [aDecoder decodeObjectForKey:@"formatDescription"];
+
+ self.prefix = [aDecoder decodeObjectForKey:@"prefix"];
+ self.suffix = [aDecoder decodeObjectForKey:@"suffix"];
+ exportHeaders = [aDecoder decodeBoolForKey:@"exportHeaders"];
+ useHeaderNamesAsKey = [aDecoder decodeBoolForKey:@"useHeaderNamesAsKey"];
+
+ self.headerFormat = [aDecoder decodeObjectForKey:@"headerFormat"];
+ self.valueFormat = [aDecoder decodeObjectForKey:@"valueFormat"];
+ }
+ return self;
+}
- [super dealloc];
+- (void) encodeWithCoder:(NSCoder *)aCoder
+{
+ [aCoder encodeObject:name forKey:@"name"];
+ [aCoder encodeObject:type forKey:@"type"];
+ [aCoder encodeObject:formatDescription forKey:@"formatDescription"];
+ [aCoder encodeObject:prefix forKey:@"prefix"];
+ [aCoder encodeObject:suffix forKey:@"suffix"];
+ [aCoder encodeBool:exportHeaders forKey:@"exportHeaders"];
+ [aCoder encodeBool:useHeaderNamesAsKey forKey:@"useHeaderNamesAsKey"];
+
+ [aCoder encodeObject:headerFormat forKey:@"headerFormat"];
+ [aCoder encodeObject:valueFormat forKey:@"valueFormat"];
}
#pragma mark -
#pragma mark Formatting
-- (NSString *) stringForRows:(NSArray *)csvRows includeHeaderRows:(BOOL)includeHeaderRows withColumns:(NSArray *)columns;
+- (NSString *) stringForRows:(NSArray *)csvRows andColumns:(NSArray *)columns;
{
NSMutableString *string = nil;
@@ -99,7 +143,7 @@ - (NSString *) stringForRows:(NSArray *)csvRows includeHeaderRows:(BOOL)includeH
[string appendString:[valueFormat rowForKeys:keys values:[row valuesForColumns:columns]]]; // value row
i++;
}
- else if (includeHeaderRows) {
+ else if (exportHeaders) {
[string appendString:[headerFormat rowForKeys:keys values:[row valuesForColumns:columns]]]; // header row
i++;
}
@@ -135,6 +179,79 @@ - (NSString *) rowForColumnKeys:(NSArray *)keys values:(NSArray *)values;
+#pragma mark Loading and Saving from/to file
++ (PPStringFormat *) formatFromFile:(NSURL *)aFileURL error:(NSError **)outError
+{
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+
+ // does the file exist and is readable?
+ if (![fm isReadableFileAtPath:[aFileURL path]]) {
+ NSString *err = [NSString stringWithFormat:@"File at %@ is not readable", [aFileURL path]];
+ if (outError) {
+ NSDictionary *errorDict = [NSDictionary dictionaryWithObject:err forKey:NSLocalizedDescriptionKey];
+ *outError = [NSError errorWithDomain:NSCocoaErrorDomain code:11 userInfo:errorDict];
+ }
+ else {
+ NSLog(@"%@", err);
+ }
+ return NO;
+ }
+
+ // unarchive
+ PPStringFormat *stringFormat = [NSKeyedUnarchiver unarchiveObjectWithFile:[aFileURL path]];
+ stringFormat.fileURL = aFileURL;
+
+ return stringFormat;
+}
+
+
+- (BOOL) writeToFile:(NSURL *)aFileURL error:(NSError **)outError
+{
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+
+ // can we write to the file if it already exists?
+ if ([fm fileExistsAtPath:[aFileURL path]] && ![fm isWritableFileAtPath:[aFileURL path]]) {
+ if (!outError) {
+ NSLog(@"File at %@ is not writable", [aFileURL path]);
+ }
+ return NO;
+ }
+
+ return [NSKeyedArchiver archiveRootObject:self toFile:[aFileURL path]];
+}
+
+- (BOOL) save:(NSError **)outError
+{
+ if (nil == self.fileURL) {
+ if (!outError) {
+ NSLog(@"Can't save %@ without known URL", self.name);
+ }
+ return NO;
+ }
+
+ return [self writeToFile:fileURL error:outError];
+}
+
+- (BOOL) deleteFile:(NSError **)outError
+{
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+
+ // if the file is still there (which it should), delete it!
+ if ([fm fileExistsAtPath:[fileURL path]]) {
+ if (![fm removeItemAtPath:[fileURL path] error:outError]) {
+ if (!outError) {
+ NSLog(@"File at %@ is not writable", [fileURL path]);
+ }
+ return NO;
+ }
+ }
+
+ return YES;
+}
+#pragma mark -
+
+
+
#pragma mark Predefined formats
+ (PPStringFormat *) csvFormat
{
@@ -203,6 +320,7 @@ + (PPStringFormat *) flatXMLFormat
myself.name = @"XML";
myself.type = @"xml";
myself.formatDescription = @"A format that exports your file to a flat XML structure";
+ myself.exportHeaders = NO;
// Setup CSV properties
NSArray *keyPairs = [PPStringFormatTransformPair transformPairsFromTo:
View
2  FileExport/PPStringFormatEntity.h
@@ -9,7 +9,7 @@
#import <Cocoa/Cocoa.h>
-@interface PPStringFormatEntity : NSObject <NSCopying> {
+@interface PPStringFormatEntity : NSObject <NSCopying, NSCoding> {
NSString *separator; // will be put between each key/value pair
NSString *stringFormat; // e.g. <$key>$value</$key>
NSString *numberFormat;
View
26 FileExport/PPStringFormatEntity.m
@@ -51,6 +51,32 @@ - (void) dealloc
+#pragma mark NSCoding
+- (id) initWithCoder:(NSCoder *)aDecoder
+{
+ if (self = [self init]) {
+ self.separator = [aDecoder decodeObjectForKey:@"separator"];
+ self.stringFormat = [aDecoder decodeObjectForKey:@"stringFormat"];
+ self.numberFormat = [aDecoder decodeObjectForKey:@"numberFormat"];
+
+ self.keyTransforms = [aDecoder decodeObjectForKey:@"keyTransforms"];
+ self.valueTransforms = [aDecoder decodeObjectForKey:@"valueTransforms"];
+ }
+ return self;
+}
+
+- (void) encodeWithCoder:(NSCoder *)aCoder
+{
+ [aCoder encodeObject:separator forKey:@"separator"];
+ [aCoder encodeObject:stringFormat forKey:@"stringFormat"];
+ [aCoder encodeObject:numberFormat forKey:@"numberFormat"];
+ [aCoder encodeObject:keyTransforms forKey:@"keyTransforms"];
+ [aCoder encodeObject:valueTransforms forKey:@"valueTransforms"];
+}
+#pragma mark -
+
+
+
#pragma mark Formatting
- (NSString *) stringForKeys:(NSArray *)keys values:(NSArray *)values
{
View
5 FileExport/PPStringFormatManager.h
@@ -18,6 +18,7 @@
NSArray *systemFormats;
IBOutlet PPStringFormatsController *formatController;
PPStringFormat *selectedFormat;
+ PPStringFormat *formatToBeRemoved;
// main views
IBOutlet NSView *detailContainer;
@@ -48,10 +49,14 @@
+ (PPStringFormatManager *) sharedManager;
+ (void) show:(id)sender;
+- (IBAction) askToRemoveFormat:(id)sender;
+
- (IBAction) showPreview:(id)sender;
- (IBAction) updatePreview:(id)sender;
- (IBAction) exportDocument:(id)sender;
- (IBAction) copySelectedFormat:(id)sender;
+- (IBAction) loadFormatPlugins:(NSError **)outError;
+
@end
View
141 FileExport/PPStringFormatManager.m
@@ -14,6 +14,8 @@
#import "MyDocument.h"
#import "CSVDocument.h"
+#define kPluginFormatFileExtension @"stringformat"
+
@interface PPStringFormatManager ()
@@ -21,6 +23,12 @@ @interface PPStringFormatManager ()
@property (nonatomic, readwrite, retain) NSArray *systemFormats;
@property (nonatomic, readwrite, retain) PPStringFormatsController *formatController;
+- (void) didEndAlert:(NSAlert *)alert withCode:(NSInteger)retCode fromContext:(id)contextInfo;
+
+- (NSString *) formatPluginPath;
+- (NSURL *) possiblePathForName:(NSString *)name;
+- (BOOL) formatPluginDirectoryExistsOrCreate:(NSError **)outError;
+
@end
@@ -171,7 +179,7 @@ - (PPStringFormat *) selectedFormat
-#pragma mark Awakening
+#pragma mark Awakening and Closing
- (void) awakeFromNib
{
[super awakeFromNib];
@@ -182,6 +190,29 @@ - (void) awakeFromNib
[self tableViewSelectionDidChange:myNote];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(controlTextDidEndEditing:) name:NSTextDidEndEditingNotification object:nil];
+
+ // load custom formats
+ NSError *error = nil;
+ [self loadFormatPlugins:&error];
+ if (nil != error) {
+ NSLog(@"Error loading plugins: %@", [error localizedDescription]);
+ }
+}
+
+- (void) windowWillClose:(NSNotification *)notification
+{
+ NSError *error = nil;
+
+ // save custom formats on window close
+ for (PPStringFormat *format in [formatController arrangedObjects]) {
+ if (!format.isSystemFormat) {
+ if (![self formatPluginDirectoryExistsOrCreate:&error] || ![format save:&error]) {
+
+ // we currently just log the error...
+ NSLog(@"There was an error saving %@: %@", format.name, [error localizedDescription]);
+ }
+ }
+ }
}
#pragma mark -
@@ -214,6 +245,47 @@ - (void) controlTextDidEndEditing:(NSNotification *)aNotification
#pragma mark Actions
+- (IBAction) askToRemoveFormat:(id)sender
+{
+ formatToBeRemoved = [[formatController selectedObjects] objectAtIndex:0]; // Error checking, anyone??
+ if (nil != formatToBeRemoved) {
+ NSString *alertTitle = [NSString stringWithFormat:@"Delete %@", formatToBeRemoved.name];
+ NSAlert *askAlert = [NSAlert alertWithMessageText:alertTitle
+ defaultButton:@"Delete"
+ alternateButton:@"Cancel"
+ otherButton:nil
+ informativeTextWithFormat:@"This will permanently remove the format %@", formatToBeRemoved.name];
+ [askAlert beginSheetModalForWindow:self.window
+ modalDelegate:self
+ didEndSelector:@selector(didEndAlert:withCode:fromContext:)
+ contextInfo:@"confirmFormatDeletion"];
+ }
+}
+
+- (void) didEndAlert:(NSAlert *)alert withCode:(NSInteger)retCode fromContext:(id)contextInfo
+{
+ // want to remove a format
+ if ([contextInfo isEqual:@"confirmFormatDeletion"]) {
+ if (NSAlertDefaultReturn == retCode) {
+ if (nil != formatToBeRemoved) {
+ NSError *error = nil;
+ if ([formatToBeRemoved deleteFile:&error]) {
+ [formatController removeObject:formatToBeRemoved];
+ formatToBeRemoved = nil;
+ }
+ else if (error != nil) {
+ [[alert window] orderOut:nil];
+ NSAlert *otherAlert = [NSAlert alertWithError:error];
+ [otherAlert beginSheetModalForWindow:self.window modalDelegate:nil didEndSelector:NULL contextInfo:nil];
+ }
+ }
+ else {
+ NSLog(@"Uh-oh, formatToBeRemoved is nil!!");
+ }
+ }
+ }
+}
+
- (IBAction) showPreview:(id)sender
{
[previewPanelController showWindow:sender];
@@ -258,10 +330,33 @@ - (IBAction) copySelectedFormat:(id)sender
if (nil != selected) {
PPStringFormat *copy = [selected copy];
copy.name = [NSString stringWithFormat:@"%@ copy", selected.name];
+ copy.fileURL = [self possiblePathForName:copy.name];
+
[formatController addObject:copy];
[copy release];
}
}
+
+- (IBAction) loadFormatPlugins:(NSError **)outError
+{
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+ NSString *pluginPath = [self formatPluginPath];
+ NSArray *files = [fm contentsOfDirectoryAtPath:pluginPath error:outError];
+
+ // we got files, try to open them
+ if ([files count] > 0) {
+ for (NSString *file in files) {
+ if ([[file pathExtension] isEqualToString:kPluginFormatFileExtension]) {
+ NSURL *fileURL = [NSURL fileURLWithPath:[pluginPath stringByAppendingPathComponent:file]];
+
+ PPStringFormat *pluginFormat = [PPStringFormat formatFromFile:fileURL error:outError];
+ if (nil != pluginFormat) {
+ [formatController addObject:pluginFormat];
+ }
+ }
+ }
+ }
+}
#pragma mark -
@@ -282,6 +377,50 @@ - (NSString *) windowFrameAutosaveName
{
return @"PPStringFormatManager";
}
+#pragma mark -
+
+
+
+#pragma mark Utilities
+- (NSString *) formatPluginPath
+{
+ return [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Application Support/CSVManipulator/Formats"];
+}
+
+- (NSURL *) possiblePathForName:(NSString *)name
+{
+ NSString *appSupportPath = [self formatPluginPath];
+ NSString *fileName = name;
+
+ NSString *proposedPath = [[appSupportPath stringByAppendingPathComponent:fileName] stringByAppendingPathExtension:kPluginFormatFileExtension];
+
+ // check if the file exists
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+ NSUInteger i = 1;
+ while ([fm fileExistsAtPath:proposedPath]) {
+ fileName = [NSString stringWithFormat:@"%@-%i", name, i];
+ proposedPath = [[appSupportPath stringByAppendingPathComponent:fileName] stringByAppendingPathExtension:kPluginFormatFileExtension];
+ }
+
+ return [NSURL fileURLWithPath:proposedPath isDirectory:NO];
+}
+
+- (BOOL) formatPluginDirectoryExistsOrCreate:(NSError **)outError
+{
+ NSFileManager *fm = [[[NSFileManager alloc] init] autorelease];
+ NSString *path = [self formatPluginPath];
+
+ // try to create
+ if (![fm fileExistsAtPath:path]) {
+ NSError *error = *outError;
+ if (![fm createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:&error]) {
+ NSLog(@"Creating plugin directory failed: %@", [error localizedDescription]);
+ return NO;
+ }
+ }
+
+ return YES;
+}
@end
View
2  FileExport/PPStringFormatRow.h
@@ -10,7 +10,7 @@
@class PPStringFormatEntity;
-@interface PPStringFormatRow : NSObject <NSCopying> {
+@interface PPStringFormatRow : NSObject <NSCopying, NSCoding> {
NSString *format; // e.g. <row>\n\t@values\n</row>
BOOL newline; // if YES adds a newline after the row
View
25 FileExport/PPStringFormatRow.m
@@ -58,6 +58,31 @@ - (void) dealloc
+#pragma mark NSCoding
+- (id) initWithCoder:(NSCoder *)aDecoder
+{
+ if (self = [self init]) {
+ self.format = [aDecoder decodeObjectForKey:@"format"];
+ newline = [aDecoder decodeBoolForKey:@"newline"];
+
+ self.keyFormat = [aDecoder decodeObjectForKey:@"keyFormat"];
+ self.valueFormat = [aDecoder decodeObjectForKey:@"valueFormat"];
+ }
+ return self;
+}
+
+- (void) encodeWithCoder:(NSCoder *)aCoder
+{
+ [aCoder encodeObject:format forKey:@"format"];
+ [aCoder encodeBool:newline forKey:@"newline"];
+
+ [aCoder encodeObject:keyFormat forKey:@"keyFormat"];
+ [aCoder encodeObject:valueFormat forKey:@"valueFormat"];
+}
+#pragma mark -
+
+
+
#pragma mark Formatting
- (NSString *) rowForKeys:(NSArray *)keys values:(NSArray *)values
{
View
2  FileExport/PPStringFormatTransformPair.h
@@ -11,7 +11,7 @@
#import <Cocoa/Cocoa.h>
-@interface PPStringFormatTransformPair : NSObject {
+@interface PPStringFormatTransformPair : NSObject <NSCoding> {
NSString *from;
NSString *to;
}
View
19 FileExport/PPStringFormatTransformPair.m
@@ -69,6 +69,25 @@ - (void) dealloc
+#pragma mark NSCoding
+- (id) initWithCoder:(NSCoder *)aDecoder
+{
+ if (self = [self init]) {
+ self.from = [aDecoder decodeObjectForKey:@"from"];
+ self.to = [aDecoder decodeObjectForKey:@"to"];
+ }
+ return self;
+}
+
+- (void) encodeWithCoder:(NSCoder *)aCoder
+{
+ [aCoder encodeObject:from forKey:@"from"];
+ [aCoder encodeObject:to forKey:@"to"];
+}
+#pragma mark -
+
+
+
#pragma mark Transforming
- (NSMutableString *) transform:(NSMutableString *)string
{
View
45 Iconset.svg
@@ -16,7 +16,7 @@
version="1.1"
inkscape:version="0.47 r22583"
sodipodi:docname="Iconset.svg"
- inkscape:export-filename="/Users/pp/Cocoa/CSVManipulator/Images/Toolbar/TB_reorder.png"
+ inkscape:export-filename="/Users/pp/Cocoa/CSVManipulator/Images/Toolbar/TB_export_formats.png"
inkscape:export-xdpi="9"
inkscape:export-ydpi="9"
style="display:inline">
@@ -2116,6 +2116,39 @@
in="SourceGraphic" />
</feMerge>
</filter>
+ <filter
+ id="filter8428"
+ inkscape:label="Drop shadow"
+ width="1.5"
+ height="1.5"
+ x="-.25"
+ y="-.25">
+ <feGaussianBlur
+ id="feGaussianBlur8430"
+ in="SourceAlpha"
+ stdDeviation="0.200000"
+ result="blur" />
+ <feColorMatrix
+ id="feColorMatrix8432"
+ result="bluralpha"
+ type="matrix"
+ values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 0.750000 0 " />
+ <feOffset
+ id="feOffset8434"
+ in="bluralpha"
+ dx="-0.000000"
+ dy="10.000000"
+ result="offsetBlur" />
+ <feMerge
+ id="feMerge8436">
+ <feMergeNode
+ id="feMergeNode8438"
+ in="offsetBlur" />
+ <feMergeNode
+ id="feMergeNode8440"
+ in="SourceGraphic" />
+ </feMerge>
+ </filter>
</defs>
<sodipodi:namedview
id="base"
@@ -2454,15 +2487,15 @@
</g>
<text
xml:space="preserve"
- style="font-size:72.60823822000000405px;font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Arial Black;-inkscape-font-specification:'Arial Black, Heavy';"
- x="68.389496"
- y="984.8855"
+ style="font-size:100px;font-style:normal;font-variant:normal;font-weight:900;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;filter:url(#filter8428);font-family:Arial Black;-inkscape-font-specification:'Arial Black, Heavy'"
+ x="34.911678"
+ y="1004.494"
id="text7890"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan7892"
- x="68.389496"
- y="984.8855">XML</tspan></text>
+ x="34.911678"
+ y="1004.494">XML</tspan></text>
<path
style="fill:none;stroke:#000000;stroke-width:6;stroke-linecap:round;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
d="m 64.234,85 191.119,0"
View
2  Info.plist
@@ -64,6 +64,6 @@
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>SVNRevision</key>
- <string>1522</string>
+ <string>1523</string>
</dict>
</plist>
View
366 PPStringFormatManager.xib
@@ -12,8 +12,9 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="26"/>
<integer value="261"/>
- <integer value="482"/>
+ <integer value="182"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -40,17 +41,17 @@
<string key="NSClassName">NSApplication</string>
</object>
<object class="NSWindowTemplate" id="494406532">
- <int key="NSWindowStyleMask">31</int>
+ <int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{791, 599}, {583, 386}}</string>
- <int key="NSWTFlags">-461897728</int>
+ <int key="NSWTFlags">-461896704</int>
<string key="NSWindowTitle">Formats</string>
- <string key="NSWindowClass">NSPanel</string>
+ <string key="NSWindowClass">NSWindow</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSWindowContentMinSize">{583, 386}</string>
<object class="NSView" key="NSWindowView" id="326520409">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -283,7 +284,7 @@
<double key="NSPercent">0.99450549450549453</double>
</object>
</object>
- <string key="NSFrame">{{-1, 27}, {156, 360}}</string>
+ <string key="NSFrame">{{-1, 26}, {156, 360}}</string>
<reference key="NSSuperview" ref="816300787"/>
<reference key="NSNextKeyView" ref="869486384"/>
<int key="NSsFlags">530</int>
@@ -312,9 +313,10 @@
</object>
</object>
<string key="NSFrameSize">{583, 386}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1680, 1028}}</string>
- <string key="NSMinSize">{583, 402}</string>
+ <string key="NSMinSize">{583, 408}</string>
<string key="NSMaxSize">{1.79769e+308, 1.79769e+308}</string>
<string key="NSFrameAutosaveName"/>
</object>
@@ -342,6 +344,9 @@
<string>valueFormat.valueFormat.separator</string>
<string>valueFormat.valueFormat.stringFormat</string>
<string>valueFormat.valueFormat.numberFormat</string>
+ <string>useHeaderNamesAsKey</string>
+ <string>exportHeader</string>
+ <string>exportHeaders</string>
</object>
<bool key="NSEditable">YES</bool>
<object class="_NSManagedProxy" key="_NSManagedProxy"/>
@@ -352,26 +357,29 @@
<bool key="NSClearsFilterPredicateOnInsertion">YES</bool>
</object>
<object class="NSCustomView" id="589581180">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">274</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="NSTextField" id="956176887">
+ <object class="NSTextField" id="548717336">
<reference key="NSNextResponder" ref="589581180"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{17, 235}, {385, 34}}</string>
+ <string key="NSFrame">{{17, 20}, {385, 112}}</string>
<reference key="NSSuperview" ref="589581180"/>
<bool key="NSEnabled">YES</bool>
- <object class="NSTextFieldCell" key="NSCell" id="897797976">
+ <object class="NSTextFieldCell" key="NSCell" id="240034012">
<int key="NSCellFlags">67239424</int>
<int key="NSCellFlags2">138412032</int>
- <string key="NSContents">Create a copy of this format in order to edit the properties</string>
- <object class="NSFont" key="NSSupport">
+ <string type="base64-UTF8" key="NSContents">Q3VzdG9tIGZvcm1hdHMgYXJlIHN0b3JlZCBpbiB0aGUgZGlyZWN0b3J5Cgp+L0xpYnJhcnkvQXBwbGlj
+YXRpb24gU3VwcG9ydC9DU1ZNYW5pcHVsYXRvci9Gb3JtYXRzCgpZb3UgY2FuIHNoYXJlIHRoZXNlIGZv
+cm1hdHMgd2l0aCBvdGhlciB1c2VycyBieSBnaXZpbmcgdGhlbSB0aGUgYXBwcm9wcmlhdGUgZm9ybWF0
+IGZpbGUuA</string>
+ <object class="NSFont" key="NSSupport" id="395591902">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">13</double>
<int key="NSfFlags">16</int>
</object>
- <reference key="NSControlView" ref="956176887"/>
+ <reference key="NSControlView" ref="548717336"/>
<object class="NSColor" key="NSBackgroundColor" id="699481158">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
@@ -381,6 +389,22 @@
<reference key="NSTextColor" ref="438798139"/>
</object>
</object>
+ <object class="NSTextField" id="956176887">
+ <reference key="NSNextResponder" ref="589581180"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{17, 235}, {385, 34}}</string>
+ <reference key="NSSuperview" ref="589581180"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSTextFieldCell" key="NSCell" id="897797976">
+ <int key="NSCellFlags">67239424</int>
+ <int key="NSCellFlags2">138412032</int>
+ <string key="NSContents">Create a copy of this format in order to edit the properties</string>
+ <reference key="NSSupport" ref="395591902"/>
+ <reference key="NSControlView" ref="956176887"/>
+ <reference key="NSBackgroundColor" ref="699481158"/>
+ <reference key="NSTextColor" ref="438798139"/>
+ </object>
+ </object>
<object class="NSButton" id="854616307">
<reference key="NSNextResponder" ref="589581180"/>
<int key="NSvFlags">269</int>
@@ -439,6 +463,7 @@
</object>
</object>
<string key="NSFrameSize">{419, 386}</string>
+ <reference key="NSSuperview"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSTabView" id="887525032">
@@ -446,20 +471,22 @@
<int key="NSvFlags">18</int>
<string key="NSFrameSize">{442, 380}</string>
<reference key="NSSuperview"/>
+ <reference key="NSWindow"/>
<object class="NSMutableArray" key="NSTabViewItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTabViewItem" id="890921181">
<string key="NSIdentifier">1</string>
<object class="NSView" key="NSView" id="503915447">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder" ref="887525032"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTextField" id="114944929">
<reference key="NSNextResponder" ref="503915447"/>
<int key="NSvFlags">266</int>
- <string key="NSFrame">{{14, 268}, {394, 17}}</string>
+ <string key="NSFrame">{{14, 218}, {394, 17}}</string>
<reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="429493175">
<int key="NSCellFlags">68288064</int>
@@ -474,8 +501,9 @@
<object class="NSTextField" id="81545208">
<reference key="NSNextResponder" ref="503915447"/>
<int key="NSvFlags">290</int>
- <string key="NSFrame">{{14, 130}, {394, 17}}</string>
+ <string key="NSFrame">{{14, 105}, {394, 17}}</string>
<reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="464697779">
<int key="NSCellFlags">68288064</int>
@@ -492,6 +520,7 @@
<int key="NSvFlags">266</int>
<string key="NSFrame">{{17, 292}, {388, 39}}</string>
<reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="735896891">
<int key="NSCellFlags">-1805517311</int>
@@ -530,8 +559,32 @@
<object class="NSTextView" id="409068417">
<reference key="NSNextResponder" ref="120447356"/>
<int key="NSvFlags">2322</int>
- <string key="NSFrame">{{0, 4}, {371, 69}}</string>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple HTML pasteboard type</string>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>Apple URL pasteboard type</string>
+ <string>CorePasteboardFlavorType 0x6D6F6F76</string>
+ <string>NSColor pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NSStringPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT RTFD pasteboard type</string>
+ <string>NeXT Rich Text Format v1.0 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ <string>NeXT font pasteboard type</string>
+ <string>NeXT ruler pasteboard type</string>
+ <string>WebURLsWithTitlesPboardType</string>
+ <string>public.url</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{371, 40}</string>
<reference key="NSSuperview" ref="120447356"/>
+ <reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="406678574">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -605,12 +658,13 @@
</object>
<int key="NSTVFlags">6</int>
<string key="NSMaxSize">{463, 1e+07}</string>
- <string key="NSMinize">{223, 69}</string>
+ <string key="NSMinize">{223, 40}</string>
<nil key="NSDelegate"/>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {371, 107}}</string>
+ <string key="NSFrame">{{1, 1}, {371, 78}}</string>
<reference key="NSSuperview" ref="155399785"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="409068417"/>
<reference key="NSDocView" ref="409068417"/>
<reference key="NSBGColor" ref="996713986"/>
@@ -623,8 +677,9 @@
<object class="NSScroller" id="425601435">
<reference key="NSNextResponder" ref="155399785"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{372, 1}, {15, 107}}</string>
+ <string key="NSFrame">{{372, 1}, {15, 78}}</string>
<reference key="NSSuperview" ref="155399785"/>
+ <reference key="NSWindow"/>
<reference key="NSTarget" ref="155399785"/>
<string key="NSAction">_doScroller:</string>
<double key="NSCurValue">1</double>
@@ -635,6 +690,7 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="155399785"/>
+ <reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="155399785"/>
<string key="NSAction">_doScroller:</string>
@@ -642,8 +698,9 @@
<double key="NSPercent">0.94565218687057495</double>
</object>
</object>
- <string key="NSFrame">{{17, 155}, {388, 109}}</string>
+ <string key="NSFrame">{{17, 130}, {388, 80}}</string>
<reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="120447356"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="425601435"/>
@@ -663,8 +720,32 @@
<object class="NSTextView" id="1004581941">
<reference key="NSNextResponder" ref="883215519"/>
<int key="NSvFlags">2322</int>
- <string key="NSFrame">{{0, 4}, {371, 23}}</string>
+ <object class="NSMutableSet" key="NSDragTypes">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <object class="NSArray" key="set.sortedObjects">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <string>Apple HTML pasteboard type</string>
+ <string>Apple PDF pasteboard type</string>
+ <string>Apple PICT pasteboard type</string>
+ <string>Apple PNG pasteboard type</string>
+ <string>Apple URL pasteboard type</string>
+ <string>CorePasteboardFlavorType 0x6D6F6F76</string>
+ <string>NSColor pasteboard type</string>
+ <string>NSFilenamesPboardType</string>
+ <string>NSStringPboardType</string>
+ <string>NeXT Encapsulated PostScript v1.2 pasteboard type</string>
+ <string>NeXT RTFD pasteboard type</string>
+ <string>NeXT Rich Text Format v1.0 pasteboard type</string>
+ <string>NeXT TIFF v4.0 pasteboard type</string>
+ <string>NeXT font pasteboard type</string>
+ <string>NeXT ruler pasteboard type</string>
+ <string>WebURLsWithTitlesPboardType</string>
+ <string>public.url</string>
+ </object>
+ </object>
+ <string key="NSFrameSize">{371, 0}</string>
<reference key="NSSuperview" ref="883215519"/>
+ <reference key="NSWindow"/>
<object class="NSTextContainer" key="NSTextContainer" id="158637758">
<object class="NSLayoutManager" key="NSLayoutManager">
<object class="NSTextStorage" key="NSTextStorage">
@@ -722,12 +803,13 @@
</object>
<int key="NSTVFlags">6</int>
<string key="NSMaxSize">{463, 1e+07}</string>
- <string key="NSMinize">{223, 23}</string>
+ <string key="NSMinize">{223, 0}</string>
<nil key="NSDelegate"/>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {371, 107}}</string>
+ <string key="NSFrame">{{1, 1}, {371, 78}}</string>
<reference key="NSSuperview" ref="184681403"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="1004581941"/>
<reference key="NSDocView" ref="1004581941"/>
<reference key="NSBGColor" ref="996713986"/>
@@ -737,8 +819,9 @@
<object class="NSScroller" id="483131275">
<reference key="NSNextResponder" ref="184681403"/>
<int key="NSvFlags">256</int>
- <string key="NSFrame">{{372, 1}, {15, 107}}</string>
+ <string key="NSFrame">{{372, 1}, {15, 78}}</string>
<reference key="NSSuperview" ref="184681403"/>
+ <reference key="NSWindow"/>
<reference key="NSTarget" ref="184681403"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">0.99248120300751874</double>
@@ -748,6 +831,7 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-100, -100}, {87, 18}}</string>
<reference key="NSSuperview" ref="184681403"/>
+ <reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="184681403"/>
<string key="NSAction">_doScroller:</string>
@@ -755,16 +839,70 @@
<double key="NSPercent">0.94565218687057495</double>
</object>
</object>
- <string key="NSFrame">{{17, 17}, {388, 109}}</string>
+ <string key="NSFrame">{{17, 17}, {388, 80}}</string>
<reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="883215519"/>
<int key="NSsFlags">18</int>
<reference key="NSVScroller" ref="483131275"/>
<reference key="NSHScroller" ref="513692035"/>
<reference key="NSContentView" ref="883215519"/>
</object>
+ <object class="NSButton" id="743326924">
+ <reference key="NSNextResponder" ref="503915447"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{15, 268}, {392, 18}}</string>
+ <reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="5353783">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Export Headers</string>
+ <reference key="NSSupport" ref="487227377"/>
+ <reference key="NSControlView" ref="743326924"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <object class="NSCustomResource" key="NSNormalImage" id="438355507">
+ <string key="NSClassName">NSImage</string>
+ <string key="NSResourceName">NSSwitch</string>
+ </object>
+ <object class="NSButtonImageSource" key="NSAlternateImage" id="24352232">
+ <string key="NSImageName">NSSwitch</string>
+ </object>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
+ <object class="NSButton" id="335950633">
+ <reference key="NSNextResponder" ref="503915447"/>
+ <int key="NSvFlags">266</int>
+ <string key="NSFrame">{{15, 248}, {392, 18}}</string>
+ <reference key="NSSuperview" ref="503915447"/>
+ <reference key="NSWindow"/>
+ <bool key="NSEnabled">YES</bool>
+ <object class="NSButtonCell" key="NSCell" id="311735947">
+ <int key="NSCellFlags">-2080244224</int>
+ <int key="NSCellFlags2">0</int>
+ <string key="NSContents">Use Header Names as Keys</string>
+ <reference key="NSSupport" ref="487227377"/>
+ <reference key="NSControlView" ref="335950633"/>
+ <int key="NSButtonFlags">1211912703</int>
+ <int key="NSButtonFlags2">2</int>
+ <reference key="NSNormalImage" ref="438355507"/>
+ <reference key="NSAlternateImage" ref="24352232"/>
+ <string key="NSAlternateContents"/>
+ <string key="NSKeyEquivalent"/>
+ <int key="NSPeriodicDelay">200</int>
+ <int key="NSPeriodicInterval">25</int>
+ </object>
+ </object>
</object>
<string key="NSFrame">{{10, 33}, {422, 334}}</string>
+ <reference key="NSSuperview" ref="887525032"/>
+ <reference key="NSWindow"/>
</object>
<string key="NSLabel">Document</string>
<reference key="NSColor" ref="699481158"/>
@@ -791,13 +929,8 @@
<reference key="NSControlView" ref="623589137"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
- <object class="NSCustomResource" key="NSNormalImage" id="868661480">
- <string key="NSClassName">NSImage</string>
- <string key="NSResourceName">NSSwitch</string>
- </object>
- <object class="NSButtonImageSource" key="NSAlternateImage" id="24352232">
- <string key="NSImageName">NSSwitch</string>
- </object>
+ <reference key="NSNormalImage" ref="438355507"/>
+ <reference key="NSAlternateImage" ref="24352232"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">200</int>
@@ -1210,7 +1343,7 @@
<object class="NSTabViewItem" id="31144894">
<string key="NSIdentifier">Item 2</string>
<object class="NSView" key="NSView" id="259208903">
- <reference key="NSNextResponder" ref="887525032"/>
+ <nil key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1228,7 +1361,7 @@
<reference key="NSControlView" ref="522829011"/>
<int key="NSButtonFlags">1211912703</int>
<int key="NSButtonFlags2">2</int>
- <reference key="NSNormalImage" ref="868661480"/>
+ <reference key="NSNormalImage" ref="438355507"/>
<reference key="NSAlternateImage" ref="24352232"/>