2005-05-13 00:00:56 +00:00
|
|
|
/**
|
|
|
|
EOMInspectorController.m <title>EOMInspectorController Class</title>
|
|
|
|
|
|
|
|
Copyright (C) 2005 Free Software Foundation, Inc.
|
|
|
|
|
2007-01-05 16:17:04 +00:00
|
|
|
Author: Matt Rice <ratmice@gmail.com>
|
2005-05-13 00:00:56 +00:00
|
|
|
Date: April 2005
|
|
|
|
|
|
|
|
This file is part of the GNUstep Database Library.
|
|
|
|
|
|
|
|
<license>
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
2007-07-12 06:39:22 +00:00
|
|
|
version 3 of the License, or (at your option) any later version.
|
2005-05-13 00:00:56 +00:00
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
</license>
|
|
|
|
**/
|
|
|
|
|
|
|
|
#include <EOModeler/EOModelerApp.h>
|
|
|
|
#include <EOModeler/EOMInspector.h>
|
|
|
|
#include <EOModeler/EOMInspectorController.h>
|
|
|
|
#include <EOModeler/EOModelerEditor.h>
|
|
|
|
|
2008-05-09 20:32:12 +00:00
|
|
|
#ifdef NeXT_GUI_LIBRARY
|
|
|
|
#include <AppKit/AppKit.h>
|
|
|
|
#else
|
2005-05-13 00:00:56 +00:00
|
|
|
#include <AppKit/NSBox.h>
|
|
|
|
#include <AppKit/NSButtonCell.h>
|
2006-09-05 21:38:09 +00:00
|
|
|
#include <AppKit/NSMatrix.h>
|
|
|
|
#include <AppKit/NSScrollView.h>
|
|
|
|
#include <AppKit/NSPanel.h>
|
2008-05-09 20:32:12 +00:00
|
|
|
#include <AppKit/NSView.h>
|
|
|
|
#endif
|
2005-05-13 00:00:56 +00:00
|
|
|
|
2008-05-09 20:32:12 +00:00
|
|
|
#ifdef NeXT_Foundation_LIBRARY
|
|
|
|
#include <Foundation/Foundation.h>
|
|
|
|
#else
|
2005-05-13 00:00:56 +00:00
|
|
|
#include <Foundation/NSNotification.h>
|
|
|
|
#include <Foundation/NSException.h>
|
|
|
|
#include <Foundation/NSArray.h>
|
2008-05-09 20:32:12 +00:00
|
|
|
#endif
|
2005-05-13 00:00:56 +00:00
|
|
|
|
|
|
|
static EOMInspectorController *_sharedInspectorController;
|
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
static NSMatrix *_iconBar;
|
|
|
|
|
2005-05-13 00:00:56 +00:00
|
|
|
@interface EOMInspectorController(Private)
|
|
|
|
- (void) _selectionChanged:(NSNotification *)notif;
|
|
|
|
@end
|
2006-09-05 21:38:09 +00:00
|
|
|
|
2005-05-13 00:00:56 +00:00
|
|
|
@implementation EOMInspectorController
|
|
|
|
|
|
|
|
- (id) init
|
|
|
|
{
|
2006-09-05 21:38:09 +00:00
|
|
|
NSButtonCell *iconCell;
|
|
|
|
NSSize scrollSize;
|
|
|
|
|
2005-05-13 00:00:56 +00:00
|
|
|
if (_sharedInspectorController)
|
|
|
|
[[NSException exceptionWithName: NSInternalInconsistencyException
|
|
|
|
reason: @"EOMInspectorController is a singleton"
|
|
|
|
userInfo:nil] raise];
|
|
|
|
self = [super init];
|
2006-09-05 21:38:09 +00:00
|
|
|
scrollSize = [NSScrollView frameSizeForContentSize:NSMakeSize(256, 64)
|
|
|
|
hasHorizontalScroller:YES
|
|
|
|
hasVerticalScroller:NO
|
|
|
|
borderType:NSNoBorder];
|
|
|
|
window = [[NSPanel alloc] initWithContentRect:NSMakeRect(220, 536, 272, 388+scrollSize.height)
|
2005-05-13 00:00:56 +00:00
|
|
|
styleMask:NSTitledWindowMask | NSClosableWindowMask
|
|
|
|
backing:NSBackingStoreBuffered
|
|
|
|
defer:YES];
|
* EOModeler/EOMInspectorController.m (-init): Don't release the window
on close.
(_selectionChanged:): Fix view swapping. Set view as needing display.
* EOModeler/EOModelExtensions.m:
(+mutableAttributedStringWithBoldSubstitutionsWithFormat:): Implement.
* EOModeler/EOModelerApp.h: Add -removeDocument:, -documentAtPath:,
and -loadDocumentAtPath: methods.
* EOModeler/EOModelerApp.m (-init:): Add parentheses around
assignment.
(-allPasteboardTypes): Initial implementation.
(-removeDocument:): If removing the active document, set the active
document to nil.
(-documentWithPath:): Change array iterators to unsigned.
(-registerColumNames:forClass:provider:): Ditto.
(-modelContainingFetchSpecification:): Temporarily return nil.
(-nameForFetchSpecification:): Ditto.
* EOModeler/EOModelerDocument.h: Declare consistency check
notification constants. Add -adaptor, -appendConsistencyCheckErrorText:,
-appendConsistencyCheckSuccessText:, -addEntity:, -addRelationship,
-addAttribute and -delete.
* EOModeler/EOModelerDocument.m: Add consistency check notification
constants. Add private category interface.
(-firstSelectionOfClass:): Change array iterators to unsigned.
Remove debugging logs.
(-validateMenuItem:): Initial implementation.
(-initWithModel:): Add parentheses around assignment. Add the model
to the default model group.
(-dealloc, -delete:): Initial implementation.
(-isDirty, -prepareToSave,-checkCloseDocument): Return no temporarily
until implemented.
(-saveToPath:): Break long messages into separate lines.
(-addDefaultEditor:, -addEntity:, -addAttribute:): Ditto.
(-addRelationship:, ):
(-activate): Remove commented out code.
(-closeEditor:, -checkCloseEditor:): Add comments.
(-canFlattenSelectedAttribute): Add temporary return value.
(-windowWillClose:): Remove self from the open documents.
(-checkConsistency:): Implement.
(-appendConsistencyCheckErrorText:): Ditto.
(-appendConsistencyCheckSuccessText:): Ditto.
* EOModeler/EOModelerEditor.m (-initWithDocument:): Add parentheses
around assignment. Don't retain our document.
(-selectionPath:, -viewedObjectPath): Return nil.
(-[EOModelerCompoundEditor dealloc]): Implement.
(-[EOModelerCompoundEditor initWithParentObject:): Add parentheses
around assignment.
(-[EOModelerEmbedibleEditor pathViewPreferenceHint:): Return nil.
* EOModeler/GNUmakefile: Remove extra whitespace.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21440 72102866-910b-0410-8b05-ffd578937521
2005-07-09 17:44:40 +00:00
|
|
|
[window setReleasedWhenClosed:NO];
|
2006-09-05 21:38:09 +00:00
|
|
|
|
|
|
|
scrollView = [[NSScrollView alloc] initWithFrame: NSMakeRect(0, 388, 272, scrollSize.height)];
|
|
|
|
scrollSize = [NSScrollView contentSizeForFrameSize:NSMakeSize(256,64)
|
|
|
|
hasHorizontalScroller:YES
|
|
|
|
hasVerticalScroller:NO
|
|
|
|
borderType:NSNoBorder];
|
|
|
|
|
|
|
|
[scrollView setHasHorizontalScroller:YES];
|
|
|
|
[scrollView setHasVerticalScroller:NO];
|
|
|
|
_iconBar = [[NSMatrix alloc] initWithFrame:NSMakeRect(0, 0, 272, scrollSize.height)];
|
|
|
|
[_iconBar setAutosizesCells:NO];
|
|
|
|
[_iconBar setCellSize:NSMakeSize(64,64)];
|
|
|
|
[_iconBar setTarget:self];
|
|
|
|
[_iconBar setAction:@selector(_selectInspector:)];
|
|
|
|
iconCell = [[NSButtonCell alloc] initTextCell:@""];
|
|
|
|
[iconCell setButtonType:NSMomentaryPushInButton];
|
|
|
|
[iconCell setImagePosition:NSImageOnly];
|
|
|
|
[_iconBar setPrototype:iconCell];
|
|
|
|
[scrollView setDocumentView: _iconBar];
|
|
|
|
|
|
|
|
[[window contentView] addSubview: scrollView];
|
|
|
|
|
2005-05-13 00:00:56 +00:00
|
|
|
_sharedInspectorController = self;
|
|
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter]
|
|
|
|
addObserver:_sharedInspectorController
|
|
|
|
selector:@selector(_selectionChanged:)
|
|
|
|
name:EOMSelectionChangedNotification
|
|
|
|
object:nil];
|
|
|
|
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) _showInspector
|
|
|
|
{
|
|
|
|
[window makeKeyAndOrderFront:self];
|
|
|
|
[self _selectionChanged:nil];
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (void) showInspector
|
|
|
|
{
|
|
|
|
[[self sharedInstance] _showInspector];
|
|
|
|
}
|
|
|
|
|
|
|
|
+ (EOMInspectorController *)sharedInstance
|
|
|
|
{
|
|
|
|
if (!_sharedInspectorController)
|
|
|
|
return [[self alloc] init];
|
|
|
|
|
|
|
|
return _sharedInspectorController;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void) _selectionChanged:(NSNotification *)notif
|
|
|
|
{
|
2006-09-05 21:38:09 +00:00
|
|
|
NSArray *swvop = [[EOMApp currentEditor] selectionWithinViewedObject];
|
2005-05-13 00:00:56 +00:00
|
|
|
id inspector;
|
2006-09-05 21:38:09 +00:00
|
|
|
|
2005-05-13 00:00:56 +00:00
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
if ([swvop count])
|
2005-05-13 00:00:56 +00:00
|
|
|
{
|
2006-09-05 21:38:09 +00:00
|
|
|
/* inspectors is ordered in the lowest -displayOrder first. */
|
|
|
|
id selection = [swvop objectAtIndex:0];
|
|
|
|
NSArray *inspectors;
|
|
|
|
int i, c;
|
|
|
|
|
|
|
|
inspectors = [EOMInspector allInspectorsThatCanInspectObject: selection];
|
|
|
|
c = [inspectors count];
|
|
|
|
[_iconBar renewRows:1 columns:c];
|
|
|
|
[_iconBar setNeedsDisplay:YES];
|
* EOModeler/EOMInspectorController.m (-init): Don't release the window
on close.
(_selectionChanged:): Fix view swapping. Set view as needing display.
* EOModeler/EOModelExtensions.m:
(+mutableAttributedStringWithBoldSubstitutionsWithFormat:): Implement.
* EOModeler/EOModelerApp.h: Add -removeDocument:, -documentAtPath:,
and -loadDocumentAtPath: methods.
* EOModeler/EOModelerApp.m (-init:): Add parentheses around
assignment.
(-allPasteboardTypes): Initial implementation.
(-removeDocument:): If removing the active document, set the active
document to nil.
(-documentWithPath:): Change array iterators to unsigned.
(-registerColumNames:forClass:provider:): Ditto.
(-modelContainingFetchSpecification:): Temporarily return nil.
(-nameForFetchSpecification:): Ditto.
* EOModeler/EOModelerDocument.h: Declare consistency check
notification constants. Add -adaptor, -appendConsistencyCheckErrorText:,
-appendConsistencyCheckSuccessText:, -addEntity:, -addRelationship,
-addAttribute and -delete.
* EOModeler/EOModelerDocument.m: Add consistency check notification
constants. Add private category interface.
(-firstSelectionOfClass:): Change array iterators to unsigned.
Remove debugging logs.
(-validateMenuItem:): Initial implementation.
(-initWithModel:): Add parentheses around assignment. Add the model
to the default model group.
(-dealloc, -delete:): Initial implementation.
(-isDirty, -prepareToSave,-checkCloseDocument): Return no temporarily
until implemented.
(-saveToPath:): Break long messages into separate lines.
(-addDefaultEditor:, -addEntity:, -addAttribute:): Ditto.
(-addRelationship:, ):
(-activate): Remove commented out code.
(-closeEditor:, -checkCloseEditor:): Add comments.
(-canFlattenSelectedAttribute): Add temporary return value.
(-windowWillClose:): Remove self from the open documents.
(-checkConsistency:): Implement.
(-appendConsistencyCheckErrorText:): Ditto.
(-appendConsistencyCheckSuccessText:): Ditto.
* EOModeler/EOModelerEditor.m (-initWithDocument:): Add parentheses
around assignment. Don't retain our document.
(-selectionPath:, -viewedObjectPath): Return nil.
(-[EOModelerCompoundEditor dealloc]): Implement.
(-[EOModelerCompoundEditor initWithParentObject:): Add parentheses
around assignment.
(-[EOModelerEmbedibleEditor pathViewPreferenceHint:): Return nil.
* EOModeler/GNUmakefile: Remove extra whitespace.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21440 72102866-910b-0410-8b05-ffd578937521
2005-07-09 17:44:40 +00:00
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
if (c)
|
2005-05-13 00:00:56 +00:00
|
|
|
{
|
2006-09-05 21:38:09 +00:00
|
|
|
for (i = 0; i < c; i++)
|
|
|
|
{
|
|
|
|
NSCell *aCell = [_iconBar cellAtRow:0 column:i];
|
|
|
|
inspector = [inspectors objectAtIndex:i];
|
|
|
|
|
|
|
|
[aCell setImage:[inspector image]];
|
|
|
|
[aCell setRepresentedObject:inspector];
|
|
|
|
}
|
|
|
|
|
|
|
|
[_iconBar setNeedsDisplay:YES];
|
|
|
|
|
|
|
|
/* if the current inspector can support the object,
|
|
|
|
select it instead. Otherwise select the first inspector.
|
|
|
|
*/
|
|
|
|
if ([inspectors containsObject:lastInspector])
|
|
|
|
{
|
|
|
|
inspector = lastInspector;
|
|
|
|
[inspector prepareForDisplay];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
inspector = [inspectors objectAtIndex:0];
|
|
|
|
[inspector prepareForDisplay];
|
|
|
|
|
|
|
|
if ([lastInspector view] && lastInspector != inspector)
|
2008-05-09 22:50:00 +00:00
|
|
|
[[lastInspector view] removeFromSuperview];
|
* EOModeler/EOMInspectorController.m (-init): Don't release the window
on close.
(_selectionChanged:): Fix view swapping. Set view as needing display.
* EOModeler/EOModelExtensions.m:
(+mutableAttributedStringWithBoldSubstitutionsWithFormat:): Implement.
* EOModeler/EOModelerApp.h: Add -removeDocument:, -documentAtPath:,
and -loadDocumentAtPath: methods.
* EOModeler/EOModelerApp.m (-init:): Add parentheses around
assignment.
(-allPasteboardTypes): Initial implementation.
(-removeDocument:): If removing the active document, set the active
document to nil.
(-documentWithPath:): Change array iterators to unsigned.
(-registerColumNames:forClass:provider:): Ditto.
(-modelContainingFetchSpecification:): Temporarily return nil.
(-nameForFetchSpecification:): Ditto.
* EOModeler/EOModelerDocument.h: Declare consistency check
notification constants. Add -adaptor, -appendConsistencyCheckErrorText:,
-appendConsistencyCheckSuccessText:, -addEntity:, -addRelationship,
-addAttribute and -delete.
* EOModeler/EOModelerDocument.m: Add consistency check notification
constants. Add private category interface.
(-firstSelectionOfClass:): Change array iterators to unsigned.
Remove debugging logs.
(-validateMenuItem:): Initial implementation.
(-initWithModel:): Add parentheses around assignment. Add the model
to the default model group.
(-dealloc, -delete:): Initial implementation.
(-isDirty, -prepareToSave,-checkCloseDocument): Return no temporarily
until implemented.
(-saveToPath:): Break long messages into separate lines.
(-addDefaultEditor:, -addEntity:, -addAttribute:): Ditto.
(-addRelationship:, ):
(-activate): Remove commented out code.
(-closeEditor:, -checkCloseEditor:): Add comments.
(-canFlattenSelectedAttribute): Add temporary return value.
(-windowWillClose:): Remove self from the open documents.
(-checkConsistency:): Implement.
(-appendConsistencyCheckErrorText:): Ditto.
(-appendConsistencyCheckSuccessText:): Ditto.
* EOModeler/EOModelerEditor.m (-initWithDocument:): Add parentheses
around assignment. Don't retain our document.
(-selectionPath:, -viewedObjectPath): Return nil.
(-[EOModelerCompoundEditor dealloc]): Implement.
(-[EOModelerCompoundEditor initWithParentObject:): Add parentheses
around assignment.
(-[EOModelerEmbedibleEditor pathViewPreferenceHint:): Return nil.
* EOModeler/GNUmakefile: Remove extra whitespace.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21440 72102866-910b-0410-8b05-ffd578937521
2005-07-09 17:44:40 +00:00
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
if ([inspector view] && lastInspector != inspector)
|
|
|
|
[[window contentView] addSubview:[inspector view]];
|
|
|
|
|
|
|
|
[window setTitle:[inspector displayName]];
|
|
|
|
}
|
* EOModeler/EOMInspectorController.m (-init): Don't release the window
on close.
(_selectionChanged:): Fix view swapping. Set view as needing display.
* EOModeler/EOModelExtensions.m:
(+mutableAttributedStringWithBoldSubstitutionsWithFormat:): Implement.
* EOModeler/EOModelerApp.h: Add -removeDocument:, -documentAtPath:,
and -loadDocumentAtPath: methods.
* EOModeler/EOModelerApp.m (-init:): Add parentheses around
assignment.
(-allPasteboardTypes): Initial implementation.
(-removeDocument:): If removing the active document, set the active
document to nil.
(-documentWithPath:): Change array iterators to unsigned.
(-registerColumNames:forClass:provider:): Ditto.
(-modelContainingFetchSpecification:): Temporarily return nil.
(-nameForFetchSpecification:): Ditto.
* EOModeler/EOModelerDocument.h: Declare consistency check
notification constants. Add -adaptor, -appendConsistencyCheckErrorText:,
-appendConsistencyCheckSuccessText:, -addEntity:, -addRelationship,
-addAttribute and -delete.
* EOModeler/EOModelerDocument.m: Add consistency check notification
constants. Add private category interface.
(-firstSelectionOfClass:): Change array iterators to unsigned.
Remove debugging logs.
(-validateMenuItem:): Initial implementation.
(-initWithModel:): Add parentheses around assignment. Add the model
to the default model group.
(-dealloc, -delete:): Initial implementation.
(-isDirty, -prepareToSave,-checkCloseDocument): Return no temporarily
until implemented.
(-saveToPath:): Break long messages into separate lines.
(-addDefaultEditor:, -addEntity:, -addAttribute:): Ditto.
(-addRelationship:, ):
(-activate): Remove commented out code.
(-closeEditor:, -checkCloseEditor:): Add comments.
(-canFlattenSelectedAttribute): Add temporary return value.
(-windowWillClose:): Remove self from the open documents.
(-checkConsistency:): Implement.
(-appendConsistencyCheckErrorText:): Ditto.
(-appendConsistencyCheckSuccessText:): Ditto.
* EOModeler/EOModelerEditor.m (-initWithDocument:): Add parentheses
around assignment. Don't retain our document.
(-selectionPath:, -viewedObjectPath): Return nil.
(-[EOModelerCompoundEditor dealloc]): Implement.
(-[EOModelerCompoundEditor initWithParentObject:): Add parentheses
around assignment.
(-[EOModelerEmbedibleEditor pathViewPreferenceHint:): Return nil.
* EOModeler/GNUmakefile: Remove extra whitespace.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21440 72102866-910b-0410-8b05-ffd578937521
2005-07-09 17:44:40 +00:00
|
|
|
|
|
|
|
[[inspector view] setNeedsDisplay:YES];
|
2005-05-13 00:00:56 +00:00
|
|
|
[inspector refresh];
|
|
|
|
lastInspector = inspector;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
* EOModeler/EOMInspectorController.m (-init): Don't release the window
on close.
(_selectionChanged:): Fix view swapping. Set view as needing display.
* EOModeler/EOModelExtensions.m:
(+mutableAttributedStringWithBoldSubstitutionsWithFormat:): Implement.
* EOModeler/EOModelerApp.h: Add -removeDocument:, -documentAtPath:,
and -loadDocumentAtPath: methods.
* EOModeler/EOModelerApp.m (-init:): Add parentheses around
assignment.
(-allPasteboardTypes): Initial implementation.
(-removeDocument:): If removing the active document, set the active
document to nil.
(-documentWithPath:): Change array iterators to unsigned.
(-registerColumNames:forClass:provider:): Ditto.
(-modelContainingFetchSpecification:): Temporarily return nil.
(-nameForFetchSpecification:): Ditto.
* EOModeler/EOModelerDocument.h: Declare consistency check
notification constants. Add -adaptor, -appendConsistencyCheckErrorText:,
-appendConsistencyCheckSuccessText:, -addEntity:, -addRelationship,
-addAttribute and -delete.
* EOModeler/EOModelerDocument.m: Add consistency check notification
constants. Add private category interface.
(-firstSelectionOfClass:): Change array iterators to unsigned.
Remove debugging logs.
(-validateMenuItem:): Initial implementation.
(-initWithModel:): Add parentheses around assignment. Add the model
to the default model group.
(-dealloc, -delete:): Initial implementation.
(-isDirty, -prepareToSave,-checkCloseDocument): Return no temporarily
until implemented.
(-saveToPath:): Break long messages into separate lines.
(-addDefaultEditor:, -addEntity:, -addAttribute:): Ditto.
(-addRelationship:, ):
(-activate): Remove commented out code.
(-closeEditor:, -checkCloseEditor:): Add comments.
(-canFlattenSelectedAttribute): Add temporary return value.
(-windowWillClose:): Remove self from the open documents.
(-checkConsistency:): Implement.
(-appendConsistencyCheckErrorText:): Ditto.
(-appendConsistencyCheckSuccessText:): Ditto.
* EOModeler/EOModelerEditor.m (-initWithDocument:): Add parentheses
around assignment. Don't retain our document.
(-selectionPath:, -viewedObjectPath): Return nil.
(-[EOModelerCompoundEditor dealloc]): Implement.
(-[EOModelerCompoundEditor initWithParentObject:): Add parentheses
around assignment.
(-[EOModelerEmbedibleEditor pathViewPreferenceHint:): Return nil.
* EOModeler/GNUmakefile: Remove extra whitespace.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@21440 72102866-910b-0410-8b05-ffd578937521
2005-07-09 17:44:40 +00:00
|
|
|
[[lastInspector view] removeFromSuperview];
|
|
|
|
lastInspector = nil;
|
2005-05-13 00:00:56 +00:00
|
|
|
NSLog(@"no inspector");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-10-14 00:51:32 +00:00
|
|
|
[[lastInspector view] removeFromSuperview];
|
|
|
|
lastInspector = nil;
|
2005-05-13 00:00:56 +00:00
|
|
|
NSLog(@"no selection");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
- (void) _selectInspector:(id)sender
|
2005-05-13 00:00:56 +00:00
|
|
|
{
|
2006-09-05 21:38:09 +00:00
|
|
|
EOMInspector *inspector = [[sender selectedCell] representedObject];
|
|
|
|
|
|
|
|
[inspector prepareForDisplay];
|
2005-05-13 00:00:56 +00:00
|
|
|
|
2006-09-05 21:38:09 +00:00
|
|
|
if ([lastInspector view] && lastInspector != inspector)
|
2008-05-09 22:50:00 +00:00
|
|
|
[[lastInspector view] removeFromSuperview];
|
2006-09-05 21:38:09 +00:00
|
|
|
|
|
|
|
if ([inspector view] && lastInspector != inspector)
|
|
|
|
[[window contentView] addSubview:[inspector view]];
|
|
|
|
|
|
|
|
[[inspector view] setNeedsDisplay:YES];
|
|
|
|
[inspector refresh];
|
|
|
|
|
|
|
|
lastInspector = inspector;
|
2005-05-13 00:00:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@end
|