KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > eclipse > console > HibernateConsolePerspectiveFactory


1 /*
2  * Created on 2004-10-12
3  *
4  */

5 package org.hibernate.eclipse.console;
6
7 import org.eclipse.ui.IFolderLayout;
8 import org.eclipse.ui.IPageLayout;
9 import org.eclipse.ui.IPerspectiveFactory;
10
11 /**
12  * @author max
13  *
14  */

15 public class HibernateConsolePerspectiveFactory implements IPerspectiveFactory {
16
17     // Folders
18
public static final String JavaDoc ID_CONFIGURATION_FOLDERVIEW = "org.hibernate.eclipse.console.ConfigurationFolderView"; //$NON-NLS-1$
19
public static final String JavaDoc ID_RESULT_FOLDERVIEW = "org.hibernate.eclipse.console.QueryResultsFolderView"; //$NON-NLS-1$
20
public static final String JavaDoc ID_PROPERTY_SHEET_FOLDERVIEW = "org.hibernate.eclipse.console.PropertiesFolderView"; //$NON-NLS-1$
21

22     public static final String JavaDoc ID_QUERYEDITOR_VIEW = "org.hibernate.eclipse.console.views.HQLEditorView";
23     public static final String JavaDoc ID_CONFIGURATION_VIEW = "org.hibernate.eclipse.console.views.KnownConfigurationsView";
24     public static final String JavaDoc ID_QUERYRESULTS_VIEW = "org.hibernate.eclipse.console.views.QueryPageTabView";
25     public static final String JavaDoc ID_PROPERTY_SHEET_VIEW = "org.eclipse.ui.views.PropertySheet";
26     
27     /* (non-Javadoc)
28      * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
29      */

30     public void createInitialLayout(IPageLayout layout) {
31         layout.setEditorAreaVisible(false);
32         IFolderLayout side =
33             layout.createFolder(
34                 ID_CONFIGURATION_FOLDERVIEW,
35                 IPageLayout.LEFT,
36                 0.33F,
37                 layout.getEditorArea());
38         
39         side.addView(ID_CONFIGURATION_VIEW);
40         
41         IFolderLayout leftBottomLeft =
42             layout.createFolder(
43                 ID_PROPERTY_SHEET_FOLDERVIEW,
44                 IPageLayout.BOTTOM,
45                 0.75F,
46                 ID_CONFIGURATION_VIEW
47             );
48             
49         leftBottomLeft.addView(ID_PROPERTY_SHEET_VIEW);
50         
51         layout.addView(ID_QUERYEDITOR_VIEW, IPageLayout.TOP, 0.33F, layout.getEditorArea()); //$NON-NLS-1$
52

53         IFolderLayout bottomRight =
54             layout.createFolder(
55                 ID_RESULT_FOLDERVIEW,
56                 IPageLayout.LEFT,
57                 0.33F,
58                 layout.getEditorArea());
59         
60         bottomRight.addView(ID_QUERYRESULTS_VIEW);
61         bottomRight.addView("org.eclipse.pde.runtime.LogView");
62         
63         layout.setEditorAreaVisible(false);
64         
65     }
66
67 }
68
Popular Tags