aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Interfaces/English.lproj/DBView.xib492
-rw-r--r--Source/SPGrowlController.m10
-rw-r--r--Source/SPTableRelations.h50
-rw-r--r--Source/SPTableRelations.m396
4 files changed, 468 insertions, 480 deletions
diff --git a/Interfaces/English.lproj/DBView.xib b/Interfaces/English.lproj/DBView.xib
index ce9d94a3..8a31c76d 100644
--- a/Interfaces/English.lproj/DBView.xib
+++ b/Interfaces/English.lproj/DBView.xib
@@ -2,12 +2,14 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.03">
<data>
<int key="IBDocument.SystemTarget">1050</int>
- <string key="IBDocument.SystemVersion">9G55</string>
+ <string key="IBDocument.SystemVersion">9J61</string>
<string key="IBDocument.InterfaceBuilderVersion">677</string>
- <string key="IBDocument.AppKitVersion">949.43</string>
+ <string key="IBDocument.AppKitVersion">949.46</string>
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
+ <integer value="5596"/>
+ <integer value="673"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -79,7 +81,6 @@
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{212, 393}</string>
<reference key="NSSuperview" ref="73685676"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
@@ -176,7 +177,6 @@
</object>
<string key="NSFrame">{{1, 1}, {212, 393}}</string>
<reference key="NSSuperview" ref="233472824"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="251040077"/>
<reference key="NSDocView" ref="251040077"/>
<object class="NSColor" key="NSBGColor" id="1024678221">
@@ -192,7 +192,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{175, 1}, {15, 481}}</string>
<reference key="NSSuperview" ref="233472824"/>
- <reference key="NSWindow"/>
<reference key="NSTarget" ref="233472824"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">9.979253e-01</double>
@@ -202,7 +201,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-100, -100}, {141, 11}}</string>
<reference key="NSSuperview" ref="233472824"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">257</int>
<reference key="NSTarget" ref="233472824"/>
<string key="NSAction">_doScroller:</string>
@@ -211,7 +209,6 @@
</object>
<string key="NSFrameSize">{214, 395}</string>
<reference key="NSSuperview" ref="355288374"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="73685676"/>
<int key="NSsFlags">530</int>
<reference key="NSVScroller" ref="693168867"/>
@@ -234,7 +231,6 @@
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{212, 123}</string>
<reference key="NSSuperview" ref="685057119"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="_NSCornerView" key="NSCornerView">
<nil key="NSNextResponder"/>
@@ -298,7 +294,6 @@
</object>
<string key="NSFrame">{{1, 1}, {212, 123}}</string>
<reference key="NSSuperview" ref="298226231"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="347093764"/>
<reference key="NSDocView" ref="347093764"/>
<reference key="NSBGColor" ref="1024678221"/>
@@ -309,7 +304,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{175, 1}, {15, 481}}</string>
<reference key="NSSuperview" ref="298226231"/>
- <reference key="NSWindow"/>
<reference key="NSTarget" ref="298226231"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">9.979253e-01</double>
@@ -319,7 +313,6 @@
<int key="NSvFlags">256</int>
<string key="NSFrame">{{-100, -100}, {141, 11}}</string>
<reference key="NSSuperview" ref="298226231"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">257</int>
<reference key="NSTarget" ref="298226231"/>
<string key="NSAction">_doScroller:</string>
@@ -328,7 +321,6 @@
</object>
<string key="NSFrame">{{0, 404}, {214, 125}}</string>
<reference key="NSSuperview" ref="355288374"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="685057119"/>
<int key="NSsFlags">530</int>
<reference key="NSVScroller" ref="245346414"/>
@@ -339,14 +331,12 @@
</object>
<string key="NSFrame">{{-1, 22}, {214, 529}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
</object>
<object class="NSButton" id="644515521">
<reference key="NSNextResponder" ref="372294785"/>
<int key="NSvFlags">292</int>
<string key="NSFrame">{{0, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="492393561">
<int key="NSCellFlags">-2080244224</int>
@@ -375,7 +365,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{20, 0}, {46, 25}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="753352469">
<int key="NSCellFlags">-2076049856</int>
@@ -384,7 +373,7 @@
<reference key="NSControlView" ref="1029554648"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <object class="NSCustomResource" key="NSNormalImage">
+ <object class="NSCustomResource" key="NSNormalImage" id="971555071">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -399,7 +388,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <object class="NSCustomResource" key="NSImage" id="377744195">
+ <object class="NSCustomResource" key="NSImage" id="1058554872">
<string key="NSClassName">NSImage</string>
<string key="NSResourceName">button_action</string>
</object>
@@ -486,7 +475,6 @@
</object>
<string key="NSFrame">{{197, 0}, {15, 23}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="875296521">
<int key="NSCellFlags">130560</int>
@@ -519,7 +507,6 @@
</object>
<string key="NSFrame">{{93, 0}, {104, 23}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="761703901">
<int key="NSCellFlags">130560</int>
@@ -540,7 +527,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{61, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="372294785"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="529591350">
<int key="NSCellFlags">-2080244224</int>
@@ -563,7 +549,6 @@
</object>
<string key="NSFrameSize">{212, 550}</string>
<reference key="NSSuperview" ref="937377983"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="604818293">
@@ -576,7 +561,6 @@
<int key="NSvFlags">274</int>
<string key="NSFrame">{{-7, -10}, {735, 564}}</string>
<reference key="NSSuperview" ref="604818293"/>
- <reference key="NSWindow"/>
<object class="NSMutableArray" key="NSTabViewItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSTabViewItem" id="831053945">
@@ -601,7 +585,6 @@
<int key="NSvFlags">257</int>
<string key="NSFrame">{{538, 4}, {61, 13}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="42997882">
<int key="NSCellFlags">68288064</int>
@@ -622,7 +605,6 @@
<int key="NSvFlags">257</int>
<string key="NSFrame">{{604, 2}, {79, 17}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="126755904">
<int key="NSCellFlags">-1539178944</int>
@@ -731,14 +713,12 @@
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{688, 289}</string>
<reference key="NSSuperview" ref="16936123"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="926883367">
<reference key="NSNextResponder" ref="639957061"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{688, 17}</string>
<reference key="NSSuperview" ref="639957061"/>
- <reference key="NSWindow"/>
<reference key="NSTableView" ref="715508012"/>
</object>
<object class="_NSCornerView" key="NSCornerView" id="868771861">
@@ -746,7 +726,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-26, 0}, {16, 17}}</string>
<reference key="NSSuperview" ref="22340145"/>
- <reference key="NSWindow"/>
</object>
<object class="NSMutableArray" key="NSTableColumns">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1279,7 +1258,6 @@
</object>
<string key="NSFrame">{{1, 17}, {688, 289}}</string>
<reference key="NSSuperview" ref="22340145"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="715508012"/>
<reference key="NSDocView" ref="715508012"/>
<reference key="NSBGColor" ref="1024678221"/>
@@ -1290,7 +1268,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{611, 17}, {15, 274}}</string>
<reference key="NSSuperview" ref="22340145"/>
- <reference key="NSWindow"/>
<reference key="NSTarget" ref="22340145"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">9.858657e-01</double>
@@ -1300,7 +1277,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 291}, {610, 15}}</string>
<reference key="NSSuperview" ref="22340145"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="22340145"/>
<string key="NSAction">_doScroller:</string>
@@ -1315,7 +1291,6 @@
</object>
<string key="NSFrame">{{1, 0}, {688, 17}}</string>
<reference key="NSSuperview" ref="22340145"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="926883367"/>
<reference key="NSDocView" ref="926883367"/>
<reference key="NSBGColor" ref="1024678221"/>
@@ -1325,7 +1300,6 @@
</object>
<string key="NSFrame">{{-1, 22}, {690, 307}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="16936123"/>
<int key="NSsFlags">562</int>
<reference key="NSVScroller" ref="943144555"/>
@@ -1340,7 +1314,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{-1, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="413143172">
<int key="NSCellFlags">-1543373312</int>
@@ -1362,7 +1335,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{93, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="917381158">
<int key="NSCellFlags">-2080244224</int>
@@ -1384,7 +1356,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="578226656">
<int key="NSCellFlags">-1543373312</int>
@@ -1409,7 +1380,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{61, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="626480887">
<int key="NSCellFlags">-1543373312</int>
@@ -1446,7 +1416,6 @@
</object>
<string key="NSFrame">{{125, 0}, {564, 23}}</string>
<reference key="NSSuperview" ref="220777809"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="4715">
<int key="NSCellFlags">130560</int>
@@ -1462,7 +1431,6 @@
</object>
<string key="NSFrameSize">{689, 329}</string>
<reference key="NSSuperview" ref="628830973"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
<object class="NSCustomView" id="1063281455">
@@ -1475,7 +1443,6 @@
<int key="NSvFlags">264</int>
<string key="NSFrame">{{7, 183}, {46, 14}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="749773740">
<int key="NSCellFlags">67239424</int>
@@ -1502,14 +1469,12 @@
<int key="NSvFlags">4352</int>
<string key="NSFrameSize">{688, 141}</string>
<reference key="NSSuperview" ref="794929378"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTableHeaderView" key="NSHeaderView" id="459548655">
<reference key="NSNextResponder" ref="1038672854"/>
<int key="NSvFlags">256</int>
<string key="NSFrameSize">{688, 17}</string>
<reference key="NSSuperview" ref="1038672854"/>
- <reference key="NSWindow"/>
<reference key="NSTableView" ref="584834515"/>
</object>
<object class="_NSCornerView" key="NSCornerView" id="476444025">
@@ -1517,7 +1482,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{-26, 0}, {16, 17}}</string>
<reference key="NSSuperview" ref="376224367"/>
- <reference key="NSWindow"/>
</object>
<object class="NSMutableArray" key="NSTableColumns">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -1770,7 +1734,6 @@
</object>
<string key="NSFrame">{{1, 17}, {688, 141}}</string>
<reference key="NSSuperview" ref="376224367"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="584834515"/>
<reference key="NSDocView" ref="584834515"/>
<reference key="NSBGColor" ref="1024678221"/>
@@ -1781,7 +1744,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{611, 17}, {15, 126}}</string>
<reference key="NSSuperview" ref="376224367"/>
- <reference key="NSWindow"/>
<reference key="NSTarget" ref="376224367"/>
<string key="NSAction">_doScroller:</string>
<double key="NSPercent">8.936170e-01</double>
@@ -1791,7 +1753,6 @@
<int key="NSvFlags">-2147483392</int>
<string key="NSFrame">{{1, 143}, {610, 15}}</string>
<reference key="NSSuperview" ref="376224367"/>
- <reference key="NSWindow"/>
<int key="NSsFlags">1</int>
<reference key="NSTarget" ref="376224367"/>
<string key="NSAction">_doScroller:</string>
@@ -1806,7 +1767,6 @@
</object>
<string key="NSFrame">{{1, 0}, {688, 17}}</string>
<reference key="NSSuperview" ref="376224367"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="459548655"/>
<reference key="NSDocView" ref="459548655"/>
<reference key="NSBGColor" ref="1024678221"/>
@@ -1816,7 +1776,6 @@
</object>
<string key="NSFrame">{{-1, 22}, {690, 159}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<reference key="NSNextKeyView" ref="794929378"/>
<int key="NSsFlags">562</int>
<reference key="NSVScroller" ref="1019209947"/>
@@ -1831,7 +1790,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{-1, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="326048025">
<int key="NSCellFlags">-1543373312</int>
@@ -1853,7 +1811,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{61, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="153146827">
<int key="NSCellFlags">-2080244224</int>
@@ -1875,7 +1832,6 @@
<int key="NSvFlags">292</int>
<string key="NSFrame">{{30, -1}, {32, 25}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="345927225">
<int key="NSCellFlags">-1543373312</int>
@@ -1909,7 +1865,6 @@
</object>
<string key="NSFrame">{{670, 183}, {10, 13}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="545156725">
<int key="NSCellFlags">130560</int>
@@ -1942,7 +1897,6 @@
</object>
<string key="NSFrame">{{93, 0}, {596, 23}}</string>
<reference key="NSSuperview" ref="1063281455"/>
- <reference key="NSWindow"/>
<bool key="NSEnabled">YES</bool>
<object class="NSImageCell" key="NSCell" id="372723860">
<int key="NSCellFlags">130560</int>
@@ -1958,19 +1912,16 @@
</object>
<string key="NSFrame">{{0, 330}, {689, 201}}</string>
<reference key="NSSuperview" ref="628830973"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrame">{{7, 10}, {689, 531}}</string>
<reference key="NSSuperview" ref="461236772"/>
- <reference key="NSWindow"/>
<int key="NSDividerStyle">2</int>
</object>
</object>
<string key="NSFrame">{{10, 7}, {700, 544}}</string>
<reference key="NSSuperview" ref="714795046"/>
- <reference key="NSWindow"/>
</object>
<string key="NSLabel">Structure</string>
<reference key="NSColor" ref="62854682"/>
@@ -2992,7 +2943,7 @@
<reference key="NSControlView" ref="363916571"/>
<int key="NSButtonFlags">-2042609409</int>
<int key="NSButtonFlags2">35</int>
- <reference key="NSNormalImage" ref="377744195"/>
+ <reference key="NSNormalImage" ref="971555071"/>
<string key="NSAlternateContents"/>
<string key="NSKeyEquivalent"/>
<int key="NSPeriodicDelay">400</int>
@@ -3004,7 +2955,7 @@
<string key="NSKeyEquiv"/>
<int key="NSKeyEquivModMask">1048576</int>
<int key="NSMnemonicLoc">2147483647</int>
- <reference key="NSImage" ref="377744195"/>
+ <reference key="NSImage" ref="1058554872"/>
<string key="NSAction">_popUpItemAction:</string>
<reference key="NSTarget" ref="984501775"/>
</object>
@@ -4432,20 +4383,17 @@
</object>
<string key="NSFrame">{{221, 0}, {723, 550}}</string>
<reference key="NSSuperview" ref="937377983"/>
- <reference key="NSWindow"/>
<string key="NSClassName">NSView</string>
</object>
</object>
<string key="NSFrameSize">{944, 550}</string>
<reference key="NSSuperview" ref="579726586"/>
- <reference key="NSWindow"/>
<bool key="NSIsVertical">YES</bool>
<string key="NSAutosaveName">DBViewSplitter</string>
</object>
</object>
<string key="NSFrameSize">{944, 550}</string>
<reference key="NSSuperview"/>
- <reference key="NSWindow"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMinSize">{780, 502}</string>
@@ -9252,14 +9200,14 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSWindowTemplate" id="787219800">
<int key="NSWindowStyleMask">1</int>
<int key="NSWindowBacking">2</int>
- <string key="NSWindowRect">{{196, 203}, {402, 307}}</string>
+ <string key="NSWindowRect">{{196, 203}, {302, 307}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">relationSheet</string>
- <string key="NSWindowClass">NSWindow</string>
+ <string key="NSWindowClass">NSPanel</string>
<nil key="NSViewClass"/>
<string key="NSWindowContentMaxSize">{3.40282e+38, 3.40282e+38}</string>
<object class="NSView" key="NSWindowView" id="842408319">
- <nil key="NSNextResponder"/>
+ <reference key="NSNextResponder"/>
<int key="NSvFlags">256</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -9276,7 +9224,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSPopUpButton" id="1000236670">
<reference key="NSNextResponder" ref="677403043"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{120, 10}, {231, 22}}</string>
+ <string key="NSFrame">{{80, 10}, {171, 22}}</string>
<reference key="NSSuperview" ref="677403043"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="535836876">
@@ -9341,12 +9289,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTextField" id="242233316">
<reference key="NSNextResponder" ref="677403043"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{-1, 15}, {119, 14}}</string>
+ <string key="NSFrame">{{29, 15}, {49, 14}}</string>
<reference key="NSSuperview" ref="677403043"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="148999128">
<int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
+ <int key="NSCellFlags2">4326400</int>
<string key="NSContents">Column:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="242233316"/>
@@ -9355,11 +9303,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {366, 40}}</string>
+ <string key="NSFrame">{{1, 1}, {266, 40}}</string>
<reference key="NSSuperview" ref="536822293"/>
</object>
</object>
- <string key="NSFrame">{{17, 231}, {368, 56}}</string>
+ <string key="NSFrame">{{17, 231}, {268, 56}}</string>
<reference key="NSSuperview" ref="842408319"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -9392,7 +9340,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSPopUpButton" id="974577035">
<reference key="NSNextResponder" ref="40346767"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{120, 40}, {231, 22}}</string>
+ <string key="NSFrame">{{81, 40}, {170, 22}}</string>
<reference key="NSSuperview" ref="40346767"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="431726441">
@@ -9477,7 +9425,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSPopUpButton" id="220041050">
<reference key="NSNextResponder" ref="40346767"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{120, 10}, {231, 22}}</string>
+ <string key="NSFrame">{{81, 10}, {170, 22}}</string>
<reference key="NSSuperview" ref="40346767"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="181520855">
@@ -9562,13 +9510,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTextField" id="402062525">
<reference key="NSNextResponder" ref="40346767"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{0, 45}, {118, 14}}</string>
+ <string key="NSFrame">{{15, 45}, {64, 14}}</string>
<reference key="NSSuperview" ref="40346767"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="878239911">
<int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
- <string key="NSContents">On Update:</string>
+ <int key="NSCellFlags2">4326400</int>
+ <string key="NSContents">On update:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="402062525"/>
<reference key="NSBackgroundColor" ref="62854682"/>
@@ -9578,13 +9526,13 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTextField" id="230425419">
<reference key="NSNextResponder" ref="40346767"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{0, 15}, {118, 14}}</string>
+ <string key="NSFrame">{{19, 15}, {59, 14}}</string>
<reference key="NSSuperview" ref="40346767"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="5496">
<int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
- <string key="NSContents">On Delete:</string>
+ <int key="NSCellFlags2">4326400</int>
+ <string key="NSContents">On delete:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="230425419"/>
<reference key="NSBackgroundColor" ref="62854682"/>
@@ -9592,11 +9540,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {366, 71}}</string>
+ <string key="NSFrame">{{1, 1}, {266, 71}}</string>
<reference key="NSSuperview" ref="607035293"/>
</object>
</object>
- <string key="NSFrame">{{17, 49}, {368, 87}}</string>
+ <string key="NSFrame">{{17, 49}, {268, 87}}</string>
<reference key="NSSuperview" ref="842408319"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -9629,7 +9577,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSPopUpButton" id="13705954">
<reference key="NSNextResponder" ref="931900868"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{120, 40}, {231, 22}}</string>
+ <string key="NSFrame">{{80, 40}, {171, 22}}</string>
<reference key="NSSuperview" ref="931900868"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="141679483">
@@ -9694,7 +9642,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSPopUpButton" id="630409672">
<reference key="NSNextResponder" ref="931900868"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{120, 10}, {231, 22}}</string>
+ <string key="NSFrame">{{80, 10}, {171, 22}}</string>
<reference key="NSSuperview" ref="931900868"/>
<bool key="NSEnabled">YES</bool>
<object class="NSPopUpButtonCell" key="NSCell" id="980368532">
@@ -9824,12 +9772,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTextField" id="355562960">
<reference key="NSNextResponder" ref="931900868"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{1, 45}, {117, 14}}</string>
+ <string key="NSFrame">{{41, 45}, {37, 14}}</string>
<reference key="NSSuperview" ref="931900868"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="725351885">
<int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
+ <int key="NSCellFlags2">4326400</int>
<string key="NSContents">Table:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="355562960"/>
@@ -9840,12 +9788,12 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSTextField" id="81525228">
<reference key="NSNextResponder" ref="931900868"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{1, 15}, {117, 14}}</string>
+ <string key="NSFrame">{{29, 15}, {49, 14}}</string>
<reference key="NSSuperview" ref="931900868"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="20664131">
<int key="NSCellFlags">68288064</int>
- <int key="NSCellFlags2">71435264</int>
+ <int key="NSCellFlags2">4326400</int>
<string key="NSContents">Column:</string>
<reference key="NSSupport" ref="26"/>
<reference key="NSControlView" ref="81525228"/>
@@ -9854,11 +9802,11 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
</object>
- <string key="NSFrame">{{1, 1}, {366, 71}}</string>
+ <string key="NSFrame">{{1, 1}, {266, 71}}</string>
<reference key="NSSuperview" ref="951603292"/>
</object>
</object>
- <string key="NSFrame">{{17, 140}, {368, 87}}</string>
+ <string key="NSFrame">{{17, 140}, {268, 87}}</string>
<reference key="NSSuperview" ref="842408319"/>
<string key="NSOffsets">{0, 0}</string>
<object class="NSTextFieldCell" key="NSTitleCell">
@@ -9881,7 +9829,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSButton" id="158114485">
<reference key="NSNextResponder" ref="842408319"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{291, 13}, {96, 28}}</string>
+ <string key="NSFrame">{{191, 13}, {96, 28}}</string>
<reference key="NSSuperview" ref="842408319"/>
<int key="NSTag">1</int>
<bool key="NSEnabled">YES</bool>
@@ -9902,7 +9850,7 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<object class="NSButton" id="415754263">
<reference key="NSNextResponder" ref="842408319"/>
<int key="NSvFlags">268</int>
- <string key="NSFrame">{{195, 13}, {96, 28}}</string>
+ <string key="NSFrame">{{97, 13}, {96, 28}}</string>
<reference key="NSSuperview" ref="842408319"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="721913578">
@@ -9920,7 +9868,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
</object>
</object>
- <string key="NSFrameSize">{402, 307}</string>
+ <string key="NSFrameSize">{302, 307}</string>
+ <reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
<string key="NSMaxSize">{3.40282e+38, 3.40282e+38}</string>
@@ -14989,30 +14938,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">5540</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">addRow:</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="448462855"/>
- </object>
- <int key="connectionID">5568</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">removeRow:</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="349122210"/>
- </object>
- <int key="connectionID">5569</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">removeButton</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="349122210"/>
- </object>
- <int key="connectionID">5571</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="952375340"/>
@@ -15030,22 +14955,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">relationsView</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="952375340"/>
- </object>
- <int key="connectionID">5574</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">refresh:</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="962247647"/>
- </object>
- <int key="connectionID">5575</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">tableRelationsInstance</string>
<reference key="source" ref="427689665"/>
<reference key="destination" ref="885866030"/>
@@ -15054,14 +14963,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">labelText</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="970233701"/>
- </object>
- <int key="connectionID">5591</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">tableDocumentInstance</string>
<reference key="source" ref="885866030"/>
<reference key="destination" ref="427689665"/>
@@ -15085,14 +14986,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">5595</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">relationSheet</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="787219800"/>
- </object>
- <int key="connectionID">5598</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">closeRelationSheet:</string>
<reference key="source" ref="885866030"/>
@@ -15109,70 +15002,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
<int key="connectionID">5605</int>
</object>
<object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">columnSelect</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="1000236670"/>
- </object>
- <int key="connectionID">5661</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">refTableSelect</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="13705954"/>
- </object>
- <int key="connectionID">5662</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">refColumnSelect</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="630409672"/>
- </object>
- <int key="connectionID">5663</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">onUpdateSelect</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="974577035"/>
- </object>
- <int key="connectionID">5664</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">onDeleteSelect</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="220041050"/>
- </object>
- <int key="connectionID">5665</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">addRelation:</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="158114485"/>
- </object>
- <int key="connectionID">5666</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBActionConnection" key="connection">
- <string key="label">chooseRefTable:</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="13705954"/>
- </object>
- <int key="connectionID">5668</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">refreshButton</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="962247647"/>
- </object>
- <int key="connectionID">5669</int>
- </object>
- <object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">saveServerVariables:</string>
<reference key="source" ref="427689665"/>
@@ -15310,22 +15139,6 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
- <string key="label">tableBox</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="536822293"/>
- </object>
- <int key="connectionID">5710</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
- <string key="label">addButton</string>
- <reference key="source" ref="885866030"/>
- <reference key="destination" ref="448462855"/>
- </object>
- <int key="connectionID">5711</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBOutletConnection" key="connection">
<string key="label">tableList</string>
<reference key="source" ref="885866030"/>
<reference key="destination" ref="251040077"/>
@@ -15752,6 +15565,158 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<int key="connectionID">5901</int>
</object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectTableColumn:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="1000236670"/>
+ </object>
+ <int key="connectionID">5907</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">selectReferenceTable:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="13705954"/>
+ </object>
+ <int key="connectionID">5908</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">addRelation:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="448462855"/>
+ </object>
+ <int key="connectionID">5909</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">removeRelation:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="349122210"/>
+ </object>
+ <int key="connectionID">5910</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">refreshRelations:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="962247647"/>
+ </object>
+ <int key="connectionID">5911</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBActionConnection" key="connection">
+ <string key="label">confirmAddRelation:</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="158114485"/>
+ </object>
+ <int key="connectionID">5912</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">relationsTableView</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="952375340"/>
+ </object>
+ <int key="connectionID">5917</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addRelationButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="448462855"/>
+ </object>
+ <int key="connectionID">5918</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">removeRelationButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="349122210"/>
+ </object>
+ <int key="connectionID">5919</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">refreshRelationsButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="962247647"/>
+ </object>
+ <int key="connectionID">5920</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">labelTextField</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="970233701"/>
+ </object>
+ <int key="connectionID">5921</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addRelationPanel</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="787219800"/>
+ </object>
+ <int key="connectionID">5922</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">addRelationTableBox</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="536822293"/>
+ </object>
+ <int key="connectionID">5923</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">onDeletePopUpButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="220041050"/>
+ </object>
+ <int key="connectionID">5924</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">onUpdatePopUpButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="974577035"/>
+ </object>
+ <int key="connectionID">5925</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">refColumnPopUpButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="630409672"/>
+ </object>
+ <int key="connectionID">5926</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">refTablePopUpButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="13705954"/>
+ </object>
+ <int key="connectionID">5927</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">columnPopUpButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="1000236670"/>
+ </object>
+ <int key="connectionID">5928</int>
+ </object>
+ <object class="IBConnectionRecord">
+ <object class="IBOutletConnection" key="connection">
+ <string key="label">confirmAddRelationButton</string>
+ <reference key="source" ref="885866030"/>
+ <reference key="destination" ref="158114485"/>
+ </object>
+ <int key="connectionID">5929</int>
+ </object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
@@ -24997,8 +24962,8 @@ IGRvIHlvdSB3YW50IHRvIGFkZCBmb3IgdGhpcyBmaWVsZD8</string>
</object>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{177, 216}, {944, 550}}</string>
- <string>{{177, 216}, {944, 550}}</string>
+ <string>{{310, 234}, {944, 550}}</string>
+ <string>{{310, 234}, {944, 550}}</string>
<reference ref="9"/>
<reference ref="9"/>
<string>{{62, 352}, {845, 504}}</string>
@@ -25392,15 +25357,20 @@ aGUgYWN0aXZlIHNlbGVjdGlvbiAo4oyl4oyYUik</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
- <string>{{525, 252}, {402, 307}}</string>
- <string>{{525, 252}, {402, 307}}</string>
+ <string>{{847, 374}, {302, 307}}</string>
+ <string>{{847, 374}, {302, 307}}</string>
<reference ref="8"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<object class="NSMutableArray">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUserGuide">
<reference key="view" ref="842408319"/>
- <float key="location">1.330000e+02</float>
+ <float key="location">9.200000e+01</float>
+ <int key="affinity">0</int>
+ </object>
+ <object class="IBUserGuide">
+ <reference key="view" ref="842408319"/>
+ <float key="location">2.660000e+02</float>
<int key="affinity">0</int>
</object>
</object>
@@ -25852,7 +25822,7 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5906</int>
+ <int key="maxID">5929</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -26373,11 +26343,12 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>addRelation:</string>
- <string>addRow:</string>
- <string>chooseRefTable:</string>
<string>closeRelationSheet:</string>
- <string>refresh:</string>
- <string>removeRow:</string>
+ <string>confirmAddRelation:</string>
+ <string>refreshRelations:</string>
+ <string>removeRelation:</string>
+ <string>selectReferenceTable:</string>
+ <string>selectTableColumn:</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -26387,24 +26358,26 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
<string>id</string>
<string>id</string>
<string>id</string>
+ <string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSMutableArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>addButton</string>
- <string>columnSelect</string>
- <string>labelText</string>
- <string>onDeleteSelect</string>
- <string>onUpdateSelect</string>
- <string>refColumnSelect</string>
- <string>refTableSelect</string>
- <string>refreshButton</string>
- <string>relationSheet</string>
- <string>relationsView</string>
- <string>removeButton</string>
- <string>tableBox</string>
+ <string>addRelationButton</string>
+ <string>addRelationPanel</string>
+ <string>addRelationTableBox</string>
+ <string>columnPopUpButton</string>
+ <string>confirmAddRelationButton</string>
+ <string>labelTextField</string>
+ <string>onDeletePopUpButton</string>
+ <string>onUpdatePopUpButton</string>
+ <string>refColumnPopUpButton</string>
+ <string>refTablePopUpButton</string>
+ <string>refreshRelationsButton</string>
+ <string>relationsTableView</string>
+ <string>removeRelationButton</string>
<string>tableDataInstance</string>
<string>tableDocumentInstance</string>
<string>tableList</string>
@@ -26413,18 +26386,19 @@ Y2hhbmdlIHRoZSBvcmRlcg</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
- <string>id</string>
+ <string>NSButton</string>
+ <string>NSPanel</string>
+ <string>NSBox</string>
+ <string>NSPopUpButton</string>
+ <string>NSButton</string>
+ <string>NSTextField</string>
+ <string>NSPopUpButton</string>
+ <string>NSPopUpButton</string>
+ <string>NSPopUpButton</string>
+ <string>NSPopUpButton</string>
+ <string>NSButton</string>
+ <string>NSTableView</string>
+ <string>NSButton</string>
<string>id</string>
<string>id</string>
<string>id</string>
diff --git a/Source/SPGrowlController.m b/Source/SPGrowlController.m
index d65b5201..13e1698a 100644
--- a/Source/SPGrowlController.m
+++ b/Source/SPGrowlController.m
@@ -29,7 +29,7 @@ static SPGrowlController *sharedGrowlController = nil;
@implementation SPGrowlController
-/*
+/**
* Returns the shared Growl controller.
*/
+ (SPGrowlController *)sharedGrowlController
@@ -58,14 +58,14 @@ static SPGrowlController *sharedGrowlController = nil;
- (id)init
{
- if (self = [super init]) {
+ if ((self = [super init])) {
[GrowlApplicationBridge setGrowlDelegate:self];
}
return self;
}
-/*
+/**
* The following base protocol methods are implemented to ensure the singleton status of this class.
*/
@@ -79,7 +79,7 @@ static SPGrowlController *sharedGrowlController = nil;
- (void)release { }
-/*
+/**
* Posts a Growl notification using the supplied details and default values.
*/
- (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name
@@ -93,7 +93,7 @@ static SPGrowlController *sharedGrowlController = nil;
clickContext:nil];
}
-/*
+/**
* Posts a Growl notification using the supplied details and effectively ignoring the default values.
*/
- (void)notifyWithTitle:(NSString *)title description:(NSString *)description notificationName:(NSString *)name iconData:(NSData *)data priority:(int)priority isSticky:(BOOL)sticky clickContext:(id)clickContext
diff --git a/Source/SPTableRelations.h b/Source/SPTableRelations.h
index bc1cf1fa..72806b77 100644
--- a/Source/SPTableRelations.h
+++ b/Source/SPTableRelations.h
@@ -31,39 +31,41 @@
@interface SPTableRelations : NSObject
{
IBOutlet id tableDocumentInstance;
- IBOutlet id tablesListInstance;
+ IBOutlet id tablesListInstance;
+ IBOutlet id tableDataInstance;
+
IBOutlet id tableList;
IBOutlet id tableWindow;
- IBOutlet id tableDataInstance;
- IBOutlet id addButton;
- IBOutlet id removeButton;
- IBOutlet id refreshButton;
- IBOutlet id labelText;
- IBOutlet id relationsView;
- IBOutlet id relationSheet;
+
+ IBOutlet NSButton *addRelationButton;
+ IBOutlet NSButton *removeRelationButton;
+ IBOutlet NSButton *refreshRelationsButton;
+ IBOutlet NSTextField *labelTextField;
+ IBOutlet NSTableView *relationsTableView;
+ IBOutlet NSPanel *addRelationPanel;
- IBOutlet id tableBox;
- IBOutlet id columnSelect;
- IBOutlet id refTableSelect;
- IBOutlet id refColumnSelect;
- IBOutlet id onUpdateSelect;
- IBOutlet id onDeleteSelect;
+ IBOutlet NSBox *addRelationTableBox;
+ IBOutlet NSPopUpButton *columnPopUpButton;
+ IBOutlet NSPopUpButton *refTablePopUpButton;
+ IBOutlet NSPopUpButton *refColumnPopUpButton;
+ IBOutlet NSPopUpButton *onUpdatePopUpButton;
+ IBOutlet NSPopUpButton *onDeletePopUpButton;
+ IBOutlet NSButton *confirmAddRelationButton;
- CMMCPConnection *mySQLConnection;
+ CMMCPConnection *connection;
- NSMutableArray *relData;
+ NSMutableArray *relationData;
}
-- (void)setConnection:(CMMCPConnection *)theConnection;
+@property (readwrite, assign) CMMCPConnection *connection;
// IB action methods
-- (IBAction)addRow:(id)sender;
-- (IBAction)removeRow:(id)sender;
-- (IBAction)closeRelationSheet:(id)sender;
- (IBAction)addRelation:(id)sender;
-- (IBAction)chooseRefTable:(id)sender;
-- (IBAction)refresh:(id)sender;
-
-- (void)tableChanged:(NSNotification *)notification;
+- (IBAction)removeRelation:(id)sender;
+- (IBAction)closeRelationSheet:(id)sender;
+- (IBAction)confirmAddRelation:(id)sender;
+- (IBAction)selectTableColumn:(id)sender;
+- (IBAction)selectReferenceTable:(id)sender;
+- (IBAction)refreshRelations:(id)sender;
@end
diff --git a/Source/SPTableRelations.m b/Source/SPTableRelations.m
index 35ce0ec7..a08639f9 100644
--- a/Source/SPTableRelations.m
+++ b/Source/SPTableRelations.m
@@ -29,59 +29,46 @@
#import "CMMCPConnection.h"
#import "CMMCPResult.h"
#import "SPTableData.h"
+#import "SPStringAdditions.h"
+
+@interface SPTableRelations (PrivateAPI)
+
+- (void)_updateAvailableTableColumns;
+
+@end
@implementation SPTableRelations
-/*
+@synthesize connection;
+
+/**
* init
*/
- (id)init
{
- if (![super init])
- return nil;
-
- relData = [[NSMutableArray alloc] init];
+ if ((self = [super init])) {
+ relationData = [[NSMutableArray alloc] init];
+ }
return self;
}
-/*
- * dealloc
- */
-- (void)dealloc
-{
- [relData release], relData = nil;
-
- [super dealloc];
-}
-
-/*
- * awakeFromNib
+/**
+ * Register to listen for table selection changes upon nib awakening.
*/
- (void)awakeFromNib
{
[[NSNotificationCenter defaultCenter] addObserver:self
- selector:@selector(tableChanged:)
+ selector:@selector(tableSelectionChanged:)
name:NSTableViewSelectionDidChangeNotification
object:tableList];
}
-/*
- * setConnection
- * set the database connection
- */
-- (void)setConnection:(CMMCPConnection *)theConnection
-{
- // Weak reference
- mySQLConnection = theConnection;
-}
-
#pragma mark -
#pragma mark IB action methods
-/*
- * closeRelationSheet
- * happens if the user hits cancel
+/**
+ * Closes the relation sheet.
*/
- (IBAction)closeRelationSheet:(id)sender
{
@@ -89,162 +76,155 @@
[NSApp stopModalWithCode:0];
}
-/*
- * addRelation
- * attempt to add the relations from the relationSheet data
+/**
+ * Add a new relation using the selected values.
*/
-- (IBAction)addRelation:(id)sender
-{
- // 0 = success
- int retCode = 0;
- NSString *thisTable = [tablesListInstance tableName];
- NSString *thisColumn = [columnSelect titleOfSelectedItem];
- NSString *thatTable = [refTableSelect titleOfSelectedItem];
- NSString *thatColumn = [refColumnSelect titleOfSelectedItem];
- NSString *onUpdate = [onUpdateSelect titleOfSelectedItem];
- NSString *onDelete = [onDeleteSelect titleOfSelectedItem];
- NSString *query = [NSString stringWithFormat:
- @"ALTER TABLE `%@` ADD FOREIGN KEY (`%@`) REFERENCES `%@` (`%@`)",
- thisTable,
- thisColumn,
- thatTable,
- thatColumn];
+- (IBAction)confirmAddRelation:(id)sender
+{
+ NSString *thisTable = [tablesListInstance tableName];
+ NSString *thisColumn = [columnPopUpButton titleOfSelectedItem];
+ NSString *thatTable = [refTablePopUpButton titleOfSelectedItem];
+ NSString *thatColumn = [refColumnPopUpButton titleOfSelectedItem];
+
+ NSString *query = [NSString stringWithFormat:@"ALTER TABLE %@ ADD FOREIGN KEY (%@) REFERENCES %@ (%@)",
+ [thisTable backtickQuotedString],
+ thisColumn,
+ [thatTable backtickQuotedString],
+ thatColumn];
- if( [onDelete length] ) {
- query = [query stringByAppendingString:[NSString stringWithFormat:@" ON DELETE %@", onDelete]];
+ // If required add ON DELETE
+ if ([onDeletePopUpButton indexOfSelectedItem] > 0) {
+ query = [query stringByAppendingString:[NSString stringWithFormat:@" ON DELETE %@", [onDeletePopUpButton titleOfSelectedItem]]];
}
- if( [onUpdate length] ) {
- query = [query stringByAppendingString:[NSString stringWithFormat:@" ON UPDATE %@", onUpdate]];
+
+ // If required add ON UPDATE
+ if ([onUpdatePopUpButton indexOfSelectedItem] > 0) {
+ query = [query stringByAppendingString:[NSString stringWithFormat:@" ON UPDATE %@", [onUpdatePopUpButton titleOfSelectedItem]]];
}
- [mySQLConnection queryString:query];
+ // Execute query
+ [connection queryString:query];
- if ( ! [[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) {
- NSLog(@"error: %@", [mySQLConnection getLastErrorMessage]);
- retCode = 1;
- }
+ int retCode = (![[connection getLastErrorMessage] isEqualToString:@""]);
[NSApp stopModalWithCode:retCode];
}
-/*
- * chooseRefTable
- * update the columns select when the user chooses a reference table
+/**
+ * Updates the available columns when the user selects a table.
*/
-- (IBAction)chooseRefTable:(id)sender
+- (IBAction)selectTableColumn:(id)sender
{
- NSString *table = [refTableSelect titleOfSelectedItem];
-
- [refColumnSelect removeAllItems];
-
- NSDictionary *info = [tableDataInstance informationForTable:table];
- NSArray *cols = [info objectForKey:@"columns"];
- NSMutableArray *colNames = [[NSMutableArray alloc] init];
- // TODO depending on the selected column type, it would be smart to only
- // show columns that are valid to linkage. this.int -> ints only
- for( int i = 0; i < [cols count]; i++ ) {
- [colNames addObject:[[cols objectAtIndex:i] objectForKey:@"name"]];
- }
- [refColumnSelect addItemsWithTitles:colNames];
- [colNames release];
+ [self _updateAvailableTableColumns];
}
-/*
- * addRow
- * called when the user indicated they want to add a relation
+/**
+ * Updates the available columns when the user selects a table.
*/
-- (IBAction)addRow:(id)sender
+- (IBAction)selectReferenceTable:(id)sender
{
- // TODO check that this is an INNO table
+ [self _updateAvailableTableColumns];
+}
+
+/**
+ * Called whenever the user selected to add a new relation.
+ */
+- (IBAction)addRelation:(id)sender
+{
+ // Set up the controls
+ [addRelationTableBox setTitle:[NSString stringWithFormat:@"Table: %@", [tablesListInstance tableName]]];
- // set up the controls
- [tableBox setTitle:[NSString stringWithFormat:@"Table: %@",[tablesListInstance tableName] ]];
- [columnSelect removeAllItems];
- [columnSelect addItemsWithTitles:[tableDataInstance columnNames]];
- [refTableSelect removeAllItems];
- // grab only real tables
- // TODO filter this so it only shows INNO tables
- NSArray *tables = [tablesListInstance tables];
- NSArray *types = [tablesListInstance tableTypes];
- NSMutableArray *validTables = [[NSMutableArray alloc] init];
- for( int i = 0; i < [tables count]; i++ ) {
- if( [[types objectAtIndex:i] intValue] == SP_TABLETYPE_TABLE ) {
- [validTables addObject:[tables objectAtIndex:i]];
- }
+ [columnPopUpButton removeAllItems];
+ [columnPopUpButton addItemsWithTitles:[tableDataInstance columnNames]];
+
+ [refTablePopUpButton removeAllItems];
+
+ // Get all InnoDB tables in the current database
+ CMMCPResult *result = [connection queryString:[NSString stringWithFormat:@"SELECT table_name FROM information_schema.tables WHERE table_type = 'BASE TABLE' AND engine = 'InnoDB' AND table_schema = '%@' AND table_name != '%@'", [tableDocumentInstance database], [tablesListInstance tableName]]];
+
+ [result dataSeek:0];
+
+ for (int i = 0; i < [result numOfRows]; i++)
+ {
+ [refTablePopUpButton addItemWithTitle:[[result fetchRowAsArray] objectAtIndex:0]];
}
- [refTableSelect addItemsWithTitles:validTables];
- [validTables release];
- [self chooseRefTable:nil];
- [NSApp beginSheet:relationSheet
- modalForWindow:tableWindow
- modalDelegate:self
- didEndSelector:nil
- contextInfo:nil];
+ [self selectReferenceTable:nil];
+ [NSApp beginSheet:addRelationPanel
+ modalForWindow:tableWindow
+ modalDelegate:self
+ didEndSelector:nil
+ contextInfo:nil];
- int code = [NSApp runModalForWindow:relationSheet];
+ int code = [NSApp runModalForWindow:addRelationPanel];
- [NSApp endSheet:relationSheet];
- [relationSheet orderOut:nil];
+ [NSApp endSheet:addRelationPanel];
+ [addRelationPanel orderOut:nil];
// 0 indicates success
- if( code ) {
+ if (code) {
NSBeginAlertSheet(NSLocalizedString(@"Error creating relation", @"error creating relation message"),
NSLocalizedString(@"OK", @"OK button"),
nil, nil, [NSApp mainWindow], nil, nil, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"The specified relation was unable to be created.\n\nMySQL said: %@", @"error creating relation informative message"), [mySQLConnection getLastErrorMessage]]);
- } else {
- [self refresh:nil];
+ [NSString stringWithFormat:NSLocalizedString(@"The specified relation was unable to be created.\n\nMySQL said: %@", @"error creating relation informative message"), [connection getLastErrorMessage]]);
+ }
+ else {
+ [self refreshRelations:nil];
}
}
-/*
- * removeRow
- * called when rows are selected and the user wants to remove those relations
+/**
+ * Removes the selected relations.
*/
-- (IBAction)removeRow:(id)sender
+- (IBAction)removeRelation:(id)sender
{
- if ( [relationsView numberOfSelectedRows] ) {
- int resp = NSRunAlertPanel(NSLocalizedString(@"Delete relation", @"delete relation message"),
- NSLocalizedString(@"Are you sure you want to delete the selected relations? This action cannot be undone", @"delete selected relation informative message"),
- NSLocalizedString(@"Delete", @"delete button"),
- NSLocalizedString(@"Cancel", @"cancel button"), nil );
+ if ([relationsTableView numberOfSelectedRows] > 0) {
+
+ int response = NSRunAlertPanel(NSLocalizedString(@"Delete relation", @"delete relation message"),
+ NSLocalizedString(@"Are you sure you want to delete the selected relations? This action cannot be undone", @"delete selected relation informative message"),
+ NSLocalizedString(@"Delete", @"delete button"),
+ NSLocalizedString(@"Cancel", @"cancel button"), nil );
- if( resp == NSAlertDefaultReturn ) {
+ if (response == NSAlertDefaultReturn) {
+
NSString *thisTable = [tablesListInstance tableName];
- NSIndexSet *selectedSet = [relationsView selectedRowIndexes];
+ NSIndexSet *selectedSet = [relationsTableView selectedRowIndexes];
+
unsigned int row = [selectedSet lastIndex];
- while( row != NSNotFound )
+
+ while (row != NSNotFound)
{
- NSArray *relName = [[relData objectAtIndex:row] objectForKey:@"name"];
- NSString *query = [NSString stringWithFormat:@"ALTER TABLE `%@` DROP FOREIGN KEY `%@`", thisTable, relName];
+ NSString *relationName = [[relationData objectAtIndex:row] objectForKey:@"name"];
+ NSString *query = [NSString stringWithFormat:@"ALTER TABLE %@ DROP FOREIGN KEY %@", [thisTable backtickQuotedString], [relationName backtickQuotedString]];
- [mySQLConnection queryString:query];
+ [connection queryString:query];
- if (![[mySQLConnection getLastErrorMessage] isEqualToString:@""] ) {
+ if (![[connection getLastErrorMessage] isEqualToString:@""] ) {
NSBeginAlertSheet(NSLocalizedString(@"Unable to remove relation", @"error removing relation message"),
NSLocalizedString(@"OK", @"OK button"),
nil, nil, [NSApp mainWindow], nil, nil, nil, nil,
- [NSString stringWithFormat:NSLocalizedString(@"The selected relation couldn't be removed.\n\nMySQL said: %@", @"error removing relation informative message"), [mySQLConnection getLastErrorMessage]]);
- // abort loop
+ [NSString stringWithFormat:NSLocalizedString(@"The selected relation couldn't be removed.\n\nMySQL said: %@", @"error removing relation informative message"), [connection getLastErrorMessage]]);
+
+ // Abort loop
break;
}
+
row = [selectedSet indexLessThanIndex:row];
}
- [self refresh:nil];
+
+ [self refreshRelations:nil];
}
}
}
-/*
- * refresh
- * called to refesh the relations list
+/**
+ * Refreshes the displayed relations.
*/
-- (IBAction)refresh:(id)sender
+- (IBAction)refreshRelations:(id)sender
{
- [relData removeAllObjects];
+ [relationData removeAllObjects];
if ([tablesListInstance tableType] == SP_TABLETYPE_TABLE) {
@@ -252,32 +232,33 @@
NSArray *constraints = [tableDataInstance getConstraints];
- for( int i = 0; i < [constraints count]; i++ ) {
- [relData addObject:[NSDictionary dictionaryWithObjectsAndKeys:
- [tablesListInstance tableName], @"table",
- [[constraints objectAtIndex:i] objectForKey:@"name"], @"name",
- [[constraints objectAtIndex:i] objectForKey:@"columns"], @"columns",
- [[constraints objectAtIndex:i] objectForKey:@"ref_table"], @"fk_table",
- [[constraints objectAtIndex:i] objectForKey:@"ref_columns"], @"fk_columns",
- [[constraints objectAtIndex:i] objectForKey:@"update"], @"on_update",
- [[constraints objectAtIndex:i] objectForKey:@"delete"], @"on_delete",
- nil]];
+ for (NSDictionary *constraint in constraints)
+ {
+ [relationData addObject:[NSDictionary dictionaryWithObjectsAndKeys:
+ [tablesListInstance tableName], @"table",
+ [constraint objectForKey:@"name"], @"name",
+ [constraint objectForKey:@"columns"], @"columns",
+ [constraint objectForKey:@"ref_table"], @"fk_table",
+ [constraint objectForKey:@"ref_columns"], @"fk_columns",
+ [constraint objectForKey:@"update"], @"on_update",
+ [constraint objectForKey:@"delete"], @"on_delete",
+ nil]];
}
}
- [relationsView reloadData];
+ [relationsTableView reloadData];
}
-/*
- * tableChanged
- * notification from the tableList when the users click a table
+/**
+ * Called whenever the user selects a different table.
*/
-- (void)tableChanged:(NSNotification *)notification
+- (void)tableSelectionChanged:(NSNotification *)notification
{
// To begin enable all interface elements
- [addButton setEnabled:YES];
- [refreshButton setEnabled:YES];
+ [addRelationButton setEnabled:YES];
+ [refreshRelationsButton setEnabled:YES];
+ [relationsTableView setEnabled:YES];
// Get the current table's storage engine
NSString *engine = [tableDataInstance statusValueForKey:@"Engine"];
@@ -285,76 +266,107 @@
if (([tablesListInstance tableType] == SP_TABLETYPE_TABLE) && ([[engine lowercaseString] isEqualToString:@"innodb"])) {
// Update the text label
- [labelText setStringValue:[NSString stringWithFormat:@"Relations for table: %@", [tablesListInstance tableName]]];
+ [labelTextField setStringValue:[NSString stringWithFormat:@"Relations for table: %@", [tablesListInstance tableName]]];
- [addButton setEnabled:YES];
- [refreshButton setEnabled:YES];
+ [addRelationButton setEnabled:YES];
+ [refreshRelationsButton setEnabled:YES];
+ [relationsTableView setEnabled:YES];
}
else {
- [addButton setEnabled:NO];
- [refreshButton setEnabled:NO];
+ [addRelationButton setEnabled:NO];
+ [refreshRelationsButton setEnabled:NO];
+ [relationsTableView setEnabled:NO];
- [labelText setStringValue:([tablesListInstance tableType] == SP_TABLETYPE_TABLE) ? @"This table does not support relations" : @""];
+ [labelTextField setStringValue:([tablesListInstance tableType] == SP_TABLETYPE_TABLE) ? @"This table does not support relations" : @""];
}
- [self refresh:self];
+ [self refreshRelations:self];
}
#pragma mark -
#pragma mark Tableview datasource methods
-- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
- return [relData count];
+ return [relationData count];
}
-- (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn
- row:(int)rowIndex
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)tableColumn row:(int)rowIndex
{
- return [[relData objectAtIndex:rowIndex] objectForKey:[aTableColumn identifier]];
-}
-
-- (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
-{
-
+ return [[relationData objectAtIndex:rowIndex] objectForKey:[tableColumn identifier]];
}
#pragma mark -
#pragma mark Tableview delegate methods
-- (void)tableView:(NSTableView*)tableView didClickTableColumn:(NSTableColumn *)tableColumn
-{
-
-}
-
-- (void)tableViewSelectionDidChange:(NSNotification *)aNotification
+/**
+ * Called whenever the relations table view selection changes.
+ */
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
- [removeButton setEnabled:([relationsView numberOfSelectedRows] > 0)];
+ [removeRelationButton setEnabled:([relationsTableView numberOfSelectedRows] > 0)];
}
-- (void)tableViewSelectionIsChanging:(NSNotification *)aNotification
-{
-
-}
+#pragma mark -
+#pragma mark Other
-- (void)tableViewColumnDidResize:(NSNotification *)aNotification
-{
+/*
+ * Dealloc.
+ */
+- (void)dealloc
+{
+ [relationData release], relationData = nil;
+ [super dealloc];
}
-- (BOOL)tableView:(NSTableView *)aTableView shouldEditTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
-{
- return NO;
-}
+@end
-- (BOOL)tableView:(NSTableView *)tableView writeRows:(NSArray*)rows toPasteboard:(NSPasteboard*)pboard
-{
- return NO;
-}
+@implementation SPTableRelations (PrivateAPI)
-- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView doCommandBySelector:(SEL)command
+/**
+ * Updates the available table columns that the reference is pointing to. Available columns are those that are
+ * within the selected table and are of the same data type as the column the reference is from.
+ */
+- (void)_updateAvailableTableColumns
{
- return NO;
+ NSString *column = [columnPopUpButton titleOfSelectedItem];
+ NSString *table = [refTablePopUpButton titleOfSelectedItem];
+
+ [tableDataInstance resetAllData];
+ [tableDataInstance updateInformationForCurrentTable];
+
+ NSDictionary *columnInfo = [[tableDataInstance columnWithName:column] copy];
+
+ [refColumnPopUpButton setEnabled:NO];
+ [confirmAddRelationButton setEnabled:NO];
+
+ [refColumnPopUpButton removeAllItems];
+
+ [tableDataInstance resetAllData];
+ NSDictionary *tableInfo = [tableDataInstance informationForTable:table];
+
+ NSArray *columns = [tableInfo objectForKey:@"columns"];
+
+ NSMutableArray *validColumns = [NSMutableArray array];
+
+ // Only add columns of the same data type
+ for (int i = 0; i < [columns count]; i++)
+ {
+ if ([[columnInfo objectForKey:@"type"] isEqualToString:[[columns objectAtIndex:i] objectForKey:@"type"]]) {
+ [validColumns addObject:[[columns objectAtIndex:i] objectForKey:@"name"]];
+ }
+ }
+
+ // Add the valid columns
+ if ([validColumns count] > 0) {
+ [refColumnPopUpButton addItemsWithTitles:validColumns];
+
+ [refColumnPopUpButton setEnabled:YES];
+ [confirmAddRelationButton setEnabled:YES];
+ }
+
+ [columnInfo release];
}
@end