1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RelationDesignView.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef DBAUI_RELATIONDESIGNVIEW_HXX
34 #include "RelationDesignView.hxx"
36 #ifndef DBAUI_RELATION_TABLEVIEW_HXX
37 #include "RelationTableView.hxx"
39 #ifndef DBAUI_RELATIONCONTROLLER_HXX
40 #include "RelationController.hxx"
43 #include <svtools/undo.hxx>
46 #include <vcl/svapp.hxx>
48 #ifndef _SV_MSGBOX_HXX
49 #include <vcl/msgbox.hxx>
51 #ifndef DBACCESS_UI_BROWSER_ID_HXX
52 #include "browserids.hxx"
55 #include "dbu_rel.hrc"
57 #ifndef _COMPHELPER_TYPES_HXX_
58 #include <comphelper/types.hxx>
60 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
61 #include <connectivity/dbtools.hxx>
63 #ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_
64 #include <com/sun/star/sdbc/DataType.hpp>
66 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
67 #include <com/sun/star/container/XNameAccess.hpp>
69 #ifndef DBAUI_RTABLECONNECTION_HXX
70 #include "RTableConnection.hxx"
72 #ifndef DBAUI_CONNECTIONLINE_HXX
73 #include "ConnectionLine.hxx"
75 #ifndef DBAUI_CONNECTIONLINEDATA_HXX
76 #include "ConnectionLineData.hxx"
78 #ifndef DBAUI_RTABLECONNECTIONDATA_HXX
79 #include "RTableConnectionData.hxx"
81 #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC
82 #include "dbustrings.hrc"
84 #ifndef _COMPHELPER_EXTRACT_HXX_
85 #include <comphelper/extract.hxx>
87 #ifndef DBAUI_TOOLS_HXX
88 #include "UITools.hxx"
90 #ifndef _TOOLS_DEBUG_HXX
91 #include <tools/debug.hxx>
94 using namespace ::dbaui
;
95 using namespace ::com::sun::star::uno
;
96 using namespace ::com::sun::star::lang
;
97 using namespace ::com::sun::star::sdbc
;
98 using namespace ::com::sun::star::beans
;
99 using namespace ::com::sun::star::container
;
101 DBG_NAME(ORelationDesignView
)
102 ORelationDesignView::ORelationDesignView(Window
* _pParent
, ORelationController
& _rController
,const Reference
< XMultiServiceFactory
>& _rFactory
)
103 :OJoinDesignView( _pParent
, _rController
, _rFactory
)
105 DBG_CTOR(ORelationDesignView
,NULL
);
107 // -----------------------------------------------------------------------------
108 ORelationDesignView::~ORelationDesignView()
110 DBG_DTOR(ORelationDesignView
,NULL
);
112 // -------------------------------------------------------------------------
113 void ORelationDesignView::Construct()
115 m_pTableView
= new ORelationTableView(m_pScrollWindow
,this);
116 OJoinDesignView::Construct();
118 // -----------------------------------------------------------------------------
119 void ORelationDesignView::initialize()
121 m_pTableView
->clearLayoutInformation();
122 m_pTableView
->ReSync();
124 OJoinDesignView::initialize();
126 // -----------------------------------------------------------------------------
127 long ORelationDesignView::PreNotify( NotifyEvent
& rNEvt
)
130 if(rNEvt
.GetType() == EVENT_GETFOCUS
)
132 if(!m_pTableView
->HasChildPathFocus())
134 m_pTableView
->GrabTabWinFocus();
139 nDone
= OJoinDesignView::PreNotify(rNEvt
);
142 // -----------------------------------------------------------------------------
143 void ORelationDesignView::GetFocus()
145 OJoinDesignView::GetFocus();
146 if ( m_pTableView
&& m_pTableView
->IsVisible() && !m_pTableView
->GetTabWinMap()->empty() )
147 m_pTableView
->GrabTabWinFocus();
149 // -----------------------------------------------------------------------------