1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #include "RelationDesignView.hxx"
30 #include "RelationTableView.hxx"
31 #include "RelationController.hxx"
32 #include <svl/undo.hxx>
33 #include <vcl/svapp.hxx>
34 #include <vcl/msgbox.hxx>
35 #include "browserids.hxx"
36 #include "dbu_rel.hrc"
37 #include <comphelper/types.hxx>
38 #include <connectivity/dbtools.hxx>
39 #include <com/sun/star/sdbc/DataType.hpp>
40 #include <com/sun/star/container/XNameAccess.hpp>
41 #include "RTableConnection.hxx"
42 #include "ConnectionLine.hxx"
43 #include "ConnectionLineData.hxx"
44 #include "RTableConnectionData.hxx"
45 #include "dbustrings.hrc"
46 #include <comphelper/extract.hxx>
47 #include "UITools.hxx"
48 #include <tools/debug.hxx>
50 using namespace ::dbaui
;
51 using namespace ::com::sun::star::uno
;
52 using namespace ::com::sun::star::lang
;
53 using namespace ::com::sun::star::sdbc
;
54 using namespace ::com::sun::star::beans
;
55 using namespace ::com::sun::star::container
;
57 DBG_NAME(ORelationDesignView
)
58 ORelationDesignView::ORelationDesignView(Window
* _pParent
, ORelationController
& _rController
,const Reference
< XMultiServiceFactory
>& _rFactory
)
59 :OJoinDesignView( _pParent
, _rController
, _rFactory
)
61 DBG_CTOR(ORelationDesignView
,NULL
);
63 // -----------------------------------------------------------------------------
64 ORelationDesignView::~ORelationDesignView()
66 DBG_DTOR(ORelationDesignView
,NULL
);
68 // -------------------------------------------------------------------------
69 void ORelationDesignView::Construct()
71 m_pTableView
= new ORelationTableView(m_pScrollWindow
,this);
72 OJoinDesignView::Construct();
74 // -----------------------------------------------------------------------------
75 void ORelationDesignView::initialize()
77 m_pTableView
->clearLayoutInformation();
78 m_pTableView
->ReSync();
80 OJoinDesignView::initialize();
82 // -----------------------------------------------------------------------------
83 long ORelationDesignView::PreNotify( NotifyEvent
& rNEvt
)
86 if(rNEvt
.GetType() == EVENT_GETFOCUS
)
88 if(!m_pTableView
->HasChildPathFocus())
90 m_pTableView
->GrabTabWinFocus();
95 nDone
= OJoinDesignView::PreNotify(rNEvt
);
98 // -----------------------------------------------------------------------------
99 void ORelationDesignView::GetFocus()
101 OJoinDesignView::GetFocus();
102 if ( m_pTableView
&& m_pTableView
->IsVisible() && !m_pTableView
->GetTabWinMap()->empty() )
103 m_pTableView
->GrabTabWinFocus();
105 // -----------------------------------------------------------------------------
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */