/
JDBCSelectionWizardPage.java
112 lines (97 loc) · 3.64 KB
/
JDBCSelectionWizardPage.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
/*
*************************************************************************
* Copyright (c) 2005, 2006 Actuate Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Actuate Corporation - initial API and implementation
*
*************************************************************************
*/
package org.eclipse.birt.report.data.oda.jdbc.ui.profile;
import java.util.Properties;
import org.eclipse.birt.report.data.oda.jdbc.ui.util.bidi.profile.BidiSettingsSupport;
import org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSourceWizardPage;
import org.eclipse.swt.widgets.Composite;
/**
*
* jdbc selection page
*
*/
public class JDBCSelectionWizardPage extends DataSourceWizardPage
{
/**
* helper object
*/
private JDBCSelectionPageHelper m_pageHelper;
private Properties m_folderProperties;
private BidiSettingsSupport bidiSupport = new BidiSettingsSupport(); //bidi_hcg
public BidiSettingsSupport getBidiSupport (){
return bidiSupport;
}
public JDBCSelectionWizardPage( String pageName )
{
super( pageName );
// page title is specified in extension manifest
}
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.oda.design.ui.profile.wizards.DataSourceWizardPage#createPageCustomControl(org.eclipse.swt.widgets.Composite)
*/
public void createPageCustomControl( Composite parent )
{
if( m_pageHelper == null )
m_pageHelper = new JDBCSelectionPageHelper( this );
Composite content = m_pageHelper.createCustomControl( parent );
m_pageHelper.initCustomControl( m_folderProperties ); // in case init was called before create
//bidi_hcg: add "Bidi Settings..." button to "Edit Data Source dialog"
m_pageHelper.addBidiSettingsButton( content, m_folderProperties );
m_pageHelper.setResourceIdentifier( this.getHostResourceIdentifiers( ) );
this.setPingButtonVisible( false );
}
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.oda.design.ui.profile.wizards.DataSourceWizardPage#initPageCustomControl(java.util.Properties)
*/
public void setInitialProperties( Properties dataSourceProps )
{
m_folderProperties = dataSourceProps;
if( m_pageHelper == null )
return; // ignore, wait till createPageCustomControl to initialize
m_pageHelper.initCustomControl( m_folderProperties );
}
/* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.oda.design.ui.profile.wizards.DataSourceWizardPage#collectCustomProperties()
*/
public Properties collectCustomProperties()
{
if( m_pageHelper != null )
return m_pageHelper.collectCustomProperties( m_folderProperties );
return ( m_folderProperties != null ) ?
m_folderProperties : new Properties();
}
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.DialogPage#setVisible(boolean)
*/
public void setVisible( boolean visible )
{
super.setVisible( visible );
getControl( ).setFocus( );
}
/*
* (non-Javadoc)
* @see org.eclipse.datatools.connectivity.oda.design.ui.wizards.DataSourceWizardPage#refresh()
*/
public void refresh( )
{
// enable/disable all controls on page in respect of the editable session state
enableAllControls( getControl( ), isSessionEditable( ) );
if ( m_pageHelper != null )
{
m_pageHelper.resetTestAndMngButton( );
}
}
}