<customObject id="-2" userLabel="File's Owner" customClass="BreakpointController">
<connections>
<outlet property="arrayController" destination="28" id="35"/>
- <outlet property="sourceView" destination="hds-fn-ZMp" id="xJW-ll-wla"/>
<outlet property="view" destination="uUK-Ll-YSm" id="ujh-9q-BWz"/>
</connections>
</customObject>
<rect key="frame" x="0.0" y="0.0" width="574" height="484"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
- <splitView dividerStyle="thin" id="dSm-S9-gg1">
- <rect key="frame" x="0.0" y="0.0" width="574" height="484"/>
+ <button verticalHuggingPriority="750" misplaced="YES" id="NEA-NE-e2L">
+ <rect key="frame" x="23" y="-1" width="24" height="23"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="RTj-JH-bdO">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="system"/>
+ <string key="keyEquivalent">\7f</string>
+ </buttonCell>
+ <connections>
+ <action selector="removeBreakpoint:" target="-2" id="65m-Li-WgP"/>
+ </connections>
+ </button>
+ <button verticalHuggingPriority="750" misplaced="YES" id="lru-8s-P8q">
+ <rect key="frame" x="0.0" y="-1" width="24" height="23"/>
+ <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+ <buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSAddTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="7HD-4r-sdn">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ <connections>
+ <action selector="addBreakpoint:" target="-2" id="qiy-D7-vZp"/>
+ </connections>
+ </button>
+ <scrollView focusRingType="none" misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="QUj-nl-H1n">
+ <rect key="frame" x="0.0" y="20" width="574" height="464"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <customView id="hds-fn-ZMp" customClass="BSSourceView">
- <rect key="frame" x="0.0" y="0.0" width="574" height="221"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <connections>
- <outlet property="delegate" destination="-2" id="yPG-gl-ySf"/>
- </connections>
- </customView>
- <customView id="siI-sb-Ohb">
- <rect key="frame" x="0.0" y="222" width="574" height="262"/>
- <autoresizingMask key="autoresizingMask"/>
- <subviews>
- <button verticalHuggingPriority="750" misplaced="YES" id="NEA-NE-e2L">
- <rect key="frame" x="23" y="-1" width="26" height="23"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
- <buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSRemoveTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="RTj-JH-bdO">
- <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
- <font key="font" metaFont="system"/>
- <string key="keyEquivalent">\7f</string>
- </buttonCell>
- <connections>
- <action selector="removeBreakpoint:" target="-2" id="65m-Li-WgP"/>
- </connections>
- </button>
- <button verticalHuggingPriority="750" misplaced="YES" id="lru-8s-P8q">
- <rect key="frame" x="0.0" y="-1" width="24" height="23"/>
- <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
- <buttonCell key="cell" type="smallSquare" bezelStyle="smallSquare" image="NSAddTemplate" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="7HD-4r-sdn">
- <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
- <font key="font" metaFont="system"/>
- </buttonCell>
- <connections>
- <action selector="addBreakpoint:" target="-2" id="qiy-D7-vZp"/>
- </connections>
- </button>
- <scrollView misplaced="YES" autohidesScrollers="YES" horizontalLineScroll="19" horizontalPageScroll="10" verticalLineScroll="19" verticalPageScroll="10" usesPredominantAxisScrolling="NO" id="QUj-nl-H1n">
- <rect key="frame" x="0.0" y="20" width="574" height="242"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <clipView key="contentView" id="vnD-I2-3RC">
- <rect key="frame" x="1" y="0.0" width="572" height="241"/>
- <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
- <subviews>
- <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnSelection="YES" autosaveColumns="NO" headerView="XI3-4j-eHA" id="d8X-q7-NYd">
- <rect key="frame" x="0.0" y="0.0" width="572" height="218"/>
- <autoresizingMask key="autoresizingMask"/>
- <size key="intercellSpacing" width="3" height="2"/>
- <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
- <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
- <tableColumns>
- <tableColumn width="425" minWidth="40" maxWidth="1000" id="RCP-bP-B4d">
- <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="File">
- <font key="font" metaFont="smallSystem"/>
- <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/>
- </tableHeaderCell>
- <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="IV1-Sj-2od">
- <font key="font" metaFont="smallSystem"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
- <connections>
- <binding destination="28" name="value" keyPath="arrangedObjects.file" id="8aj-3i-nGj"/>
- </connections>
- </tableColumn>
- <tableColumn width="141" minWidth="40" maxWidth="1000" id="MvD-nE-8qa">
- <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Line">
- <font key="font" metaFont="smallSystem"/>
- <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/>
- </tableHeaderCell>
- <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="kPe-Mi-bAY">
- <font key="font" metaFont="smallSystem"/>
- <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
- <connections>
- <binding destination="28" name="value" keyPath="arrangedObjects.line" id="keh-Aa-ayp"/>
- </connections>
- </tableColumn>
- </tableColumns>
- <connections>
- <outlet property="delegate" destination="-2" id="Tc8-nD-s4R"/>
- </connections>
- </tableView>
- </subviews>
- </clipView>
- <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="Abm-OM-c9d">
- <rect key="frame" x="1" y="223" width="557" height="15"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- <scroller key="verticalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="NO" id="NaV-vD-Og8">
- <rect key="frame" x="558" y="17" width="15" height="206"/>
- <autoresizingMask key="autoresizingMask"/>
- </scroller>
- <tableHeaderView key="headerView" id="XI3-4j-eHA">
- <rect key="frame" x="0.0" y="0.0" width="572" height="23"/>
- <autoresizingMask key="autoresizingMask"/>
- </tableHeaderView>
- </scrollView>
- </subviews>
- </customView>
- </subviews>
- <holdingPriorities>
- <real value="250"/>
- <real value="250"/>
- </holdingPriorities>
- </splitView>
+ <clipView key="contentView" id="vnD-I2-3RC">
+ <rect key="frame" x="1" y="0.0" width="572" height="463"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <tableView focusRingType="none" verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnSelection="YES" autosaveColumns="NO" headerView="XI3-4j-eHA" id="d8X-q7-NYd">
+ <rect key="frame" x="0.0" y="0.0" width="572" height="440"/>
+ <autoresizingMask key="autoresizingMask"/>
+ <size key="intercellSpacing" width="3" height="2"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ <color key="gridColor" name="gridColor" catalog="System" colorSpace="catalog"/>
+ <tableColumns>
+ <tableColumn width="425" minWidth="40" maxWidth="1000" id="RCP-bP-B4d">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="File">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" lineBreakMode="truncatingMiddle" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="IV1-Sj-2od">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ <connections>
+ <binding destination="28" name="value" keyPath="arrangedObjects.file" id="8aj-3i-nGj"/>
+ </connections>
+ </tableColumn>
+ <tableColumn width="141" minWidth="40" maxWidth="1000" id="MvD-nE-8qa">
+ <tableHeaderCell key="headerCell" lineBreakMode="truncatingTail" borderStyle="border" alignment="left" title="Line">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="headerTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" white="0.33333299" alpha="1" colorSpace="calibratedWhite"/>
+ </tableHeaderCell>
+ <textFieldCell key="dataCell" lineBreakMode="truncatingTail" selectable="YES" editable="YES" alignment="left" title="Text Cell" id="kPe-Mi-bAY">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
+ <connections>
+ <binding destination="28" name="value" keyPath="arrangedObjects.line" id="keh-Aa-ayp"/>
+ </connections>
+ </tableColumn>
+ </tableColumns>
+ <connections>
+ <outlet property="delegate" destination="-2" id="Tc8-nD-s4R"/>
+ </connections>
+ </tableView>
+ </subviews>
+ </clipView>
+ <scroller key="horizontalScroller" hidden="YES" verticalHuggingPriority="750" horizontal="YES" id="Abm-OM-c9d">
+ <rect key="frame" x="1" y="223" width="557" height="15"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="NaV-vD-Og8">
+ <rect key="frame" x="558" y="17" width="15" height="206"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </scroller>
+ <tableHeaderView key="headerView" id="XI3-4j-eHA">
+ <rect key="frame" x="0.0" y="0.0" width="572" height="23"/>
+ <autoresizingMask key="autoresizingMask"/>
+ </tableHeaderView>
+ </scrollView>
</subviews>
</view>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
- <arrayController objectClassName="Breakpoint" automaticallyPreparesContent="YES" automaticallyRearrangesObjects="YES" id="28">
+ <arrayController objectClassName="Breakpoint" automaticallyPreparesContent="YES" preservesSelection="NO" selectsInsertedObjects="NO" avoidsEmptySelection="NO" automaticallyRearrangesObjects="YES" id="28">
<declaredKeys>
<string>file</string>
<string>line</string>
</declaredKeys>
<connections>
- <binding destination="-2" name="contentArray" keyPath="manager.breakpoints" id="30"/>
+ <binding destination="-2" name="contentArray" keyPath="_manager.breakpoints" id="3RA-Ia-VZL"/>
</connections>
</arrayController>
<userDefaultsController representsSharedInstance="YES" id="43"/>
#import "AppDelegate.h"
#import "PreferenceNames.h"
-@implementation BreakpointController
+@implementation BreakpointController {
+ BreakpointManager* _manager;
-@synthesize sourceView, arrayController;
+ BSSourceView* _sourceView;
+ NSArrayController* _arrayController;
+}
/**
* Constructor
*/
-- (id)init
+- (id)initWithSourceView:(BSSourceView*)sourceView
{
- if (self = [super initWithNibName:@"Breakpoints" bundle:nil])
- {
- manager = [BreakpointManager sharedManager];
+ if ((self = [super initWithNibName:@"Breakpoints" bundle:nil])) {
+ _manager = [BreakpointManager sharedManager];
+ _sourceView = sourceView;
}
return self;
}
return;
}
- [sourceView setFile:[[panel URL] path]];
+ [_sourceView setFile:[[panel URL] path]];
}
/**
*/
- (IBAction)removeBreakpoint:(id)sender
{
- NSArray* selection = [arrayController selectedObjects];
+ NSArray* selection = [_arrayController selectedObjects];
if ([selection count] < 1)
{
return;
for (Breakpoint* bp in selection)
{
- [manager removeBreakpointAt:[bp line] inFile:[bp file]];
+ [_manager removeBreakpointAt:[bp line] inFile:[bp file]];
}
}
*/
- (void)tableViewSelectionDidChange:(NSNotification*)notif
{
- NSArray* selection = [arrayController selectedObjects];
+ NSArray* selection = [_arrayController selectedObjects];
if ([selection count] < 1)
{
return;
}
Breakpoint* bp = [selection objectAtIndex:0];
- [sourceView setFile:[bp file]];
- [sourceView scrollToLine:[bp line]];
- [sourceView setMarkers:[manager breakpointsForFile:bp.file]];
+ [_sourceView setFile:[bp file]];
+ [_sourceView scrollToLine:[bp line]];
+ [_sourceView setMarkers:[_manager breakpointsForFile:bp.file]];
}
#pragma mark BSSourceView Delegate
-/**
- * The gutter was clicked, which indicates that a breakpoint needs to be changed
- */
-- (void)gutterClickedAtLine:(NSUInteger)line forFile:(NSString*)file
-{
- if ([manager hasBreakpointAt:line inFile:file])
- {
- [manager removeBreakpointAt:line inFile:file];
- }
- else
- {
- Breakpoint* bp = [[Breakpoint alloc] initWithLine:line inFile:file];
- [manager addBreakpoint:bp];
- [bp release];
- }
-
- [sourceView setMarkers:[manager breakpointsForFile:file]];
-}
-
/**
* Accepts a file dragged to set the contents of the display.
*/