527e4606e70f58b4852a81728454557cc025923f
[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 oic.simulator.clientcontroller.view.AttributeView;
20 import oic.simulator.clientcontroller.view.LogView;
21 import oic.simulator.clientcontroller.view.MetaPropertiesView;
22 import oic.simulator.clientcontroller.view.MultiResourceOrchestrationView;
23 import oic.simulator.clientcontroller.view.ResourceManagerView;
24
25 import org.eclipse.ui.IPageLayout;
26 import org.eclipse.ui.IPerspectiveFactory;
27
28 /**
29  * This class creates a new eclipse perspective for client controller and
30  * positions the different views inside.
31  */
32 public class PerspectiveFactory implements IPerspectiveFactory {
33
34     public static final String PERSPECTIVE_ID = "oic.simulator.clientcontroller.perspective";
35     private IPageLayout        factory;
36
37     @Override
38     public void createInitialLayout(IPageLayout factory) {
39         this.factory = factory;
40         factory.setEditorAreaVisible(false);
41         addViews();
42         factory.setFixed(false);
43     }
44
45     private void addViews() {
46         factory.addView(ResourceManagerView.VIEW_ID, IPageLayout.LEFT, 0.3f,
47                 factory.getEditorArea());
48         factory.addView(MetaPropertiesView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
49                 ResourceManagerView.VIEW_ID);
50         factory.addView(AttributeView.VIEW_ID, IPageLayout.LEFT, 0.7f,
51                 factory.getEditorArea());
52         factory.addView(LogView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
53                 AttributeView.VIEW_ID);
54         factory.addView(MultiResourceOrchestrationView.VIEW_ID,
55                 IPageLayout.RIGHT, 0.6f, AttributeView.VIEW_ID);
56     }
57 }