1e2ff50464088ac07361e9f78505e5da2671a6a3
[platform/upstream/iotivity.git] / service / simulator / java / eclipse-plugin / ClientControllerPlugin / src / oic / simulator / clientcontroller / perspective / PerspectiveFactory.java
1 /*
2  * Copyright 2015 Samsung Electronics All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 package oic.simulator.clientcontroller.perspective;
18
19 import org.eclipse.ui.IPageLayout;
20 import org.eclipse.ui.IPerspectiveFactory;
21
22 import oic.simulator.clientcontroller.view.AttributeView;
23 import oic.simulator.clientcontroller.view.LogView;
24 import oic.simulator.clientcontroller.view.MetaPropertiesView;
25 import oic.simulator.clientcontroller.view.ResourceManagerView;
26
27 /**
28  * This class creates a new eclipse perspective for client controller and
29  * positions the different views inside.
30  */
31 public class PerspectiveFactory implements IPerspectiveFactory {
32
33     public static final String PERSPECTIVE_ID = "oic.simulator.clientcontroller.perspective";
34     private IPageLayout        factory;
35
36     @Override
37     public void createInitialLayout(IPageLayout factory) {
38         this.factory = factory;
39         factory.setEditorAreaVisible(false);
40         addViews();
41         factory.setFixed(false);
42     }
43
44     private void addViews() {
45         factory.addView(ResourceManagerView.VIEW_ID, IPageLayout.LEFT, 0.28f,
46                 factory.getEditorArea());
47         factory.addView(AttributeView.VIEW_ID, IPageLayout.LEFT, 0.7f,
48                 factory.getEditorArea());
49         factory.addView(LogView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
50                 AttributeView.VIEW_ID);
51         factory.addView(MetaPropertiesView.VIEW_ID, IPageLayout.RIGHT, 0.6f,
52                 AttributeView.VIEW_ID);
53     }
54 }