//
//  WBOutputPanelController.mm
//  MySQLWorkbench
//
//  Created by Alfredo Kojima on 21/Dec/08.
//  Copyright 2008 Sun Microsystems Inc. All rights reserved.
//

#import "WBOutputPanelController.h"
#include "grt/grt_manager.h"

@implementation WBOutputPanelController

- (void)outputUpdated
{
  // make the label bold if there's new data

}


- (void)messagesUpdated
{
  // make the label bold if there's new data
 
}


- (IBAction)changeOutputView:(id)sender
{
  // unset bold label indicated the user viewed it
}


- (NSSize)minimumSize
{
  return NSMakeSize(100, 100);
}


- (NSString*)identifier
{
  return @"output";
}


- (void)awakeFromNib
{
  [outputText setString:@""];
}


- (void)setupWithGRTManager:(bec::GRTManager*)grtm
{
  _grtm= grtm;
  
  [messageDS setListModel:_grtm->get_messages_list()];
}


- (void)addOutputText:(NSString*)line
{
  [[outputText textStorage] insertAttributedString:[[[NSAttributedString alloc] initWithString:line] autorelease]
                                           atIndex:[[outputText textStorage] length]];
  [self outputUpdated];
}


- (void)refreshMessages
{
  [messageTable reloadData];
  [self messagesUpdated];
}

@end
