View Javadoc

1   package com.explosion.datastream.exql.gui;
2   
3   /*
4    * =============================================================================
5    * 
6    * Copyright 2004 Stephen Cowx
7    * 
8    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
9    * use this file except in compliance with the License. You may obtain a copy of
10   * the License at
11   * 
12   * http://www.apache.org/licenses/LICENSE-2.0
13   * 
14   * Unless required by applicable law or agreed to in writing, software
15   * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
16   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
17   * License for the specific language governing permissions and limitations under
18   * the License.
19   * 
20   * =============================================================================
21   */
22  
23  import java.awt.Dimension;
24  
25  import com.explosion.expf.Application;
26  import com.explosion.expf.ExpFrame;
27  import com.explosion.expf.ExpInternalFrame;
28  import com.explosion.utilities.preferences.groups.PreferenceGroup;
29  
30  
31  
32  /***
33   * Thsi class connects the user to the database of their choice and kicks off a DBBrowser
34   * 
35   * @author Stephen Created on May 3, 2004
36   */
37  public class ConnectNow implements com.explosion.expfmodules.rdbmsconn.connectwizard.ConnectNow {
38  
39  	/*** 
40  	 * @see com.explosion.expfmodules.rdbmsconn.connectwizard.ConnectNow#connect(com.explosion.expfmodules.rdbmsconn.ConnectionDescriptorPreference)
41  	 */
42  	public boolean connect(PreferenceGroup descriptor) 
43  			throws Exception {
44  
45  	        if (descriptor == null)
46  	            throw new Exception("ConnectionDescriptor is null.");
47  
48  	        int heightOfIt = 90;
49  	        int widthOfIt = 320;
50  	        
51  	        ConnectPanel connectPanel = new ConnectPanel();
52  	        ExpInternalFrame frame = ((ExpFrame) Application.getApplicationFrame()).createPaletteFrame(connectPanel, new Dimension(widthOfIt, heightOfIt), "Connecting to "
53  	                + descriptor.getIdentifier(), false);
54  	        connectPanel.connect(descriptor);
55  	        return true;
56  	}
57  }