2 * Copyright 2015 Samsung Electronics All Rights Reserved.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package oic.simulator.serviceprovider.perspective;
19 import oic.simulator.serviceprovider.view.AttributeView;
20 import oic.simulator.serviceprovider.view.LogView;
21 import oic.simulator.serviceprovider.view.MetaPropertiesView;
22 import oic.simulator.serviceprovider.view.MultiResourceOrchestrationView;
23 import oic.simulator.serviceprovider.view.ResourceManagerView;
24 import oic.simulator.serviceprovider.view.ResourceObserverView;
26 import org.eclipse.ui.IFolderLayout;
27 import org.eclipse.ui.IPageLayout;
28 import org.eclipse.ui.IPerspectiveFactory;
31 * This class creates a new eclipse perspective for service provider and
32 * positions the different views inside.
34 public class PerspectiveFactory implements IPerspectiveFactory {
36 public static final String PERSPECTIVE_ID = "oic.simulator.serviceprovider.perspective";
37 private IPageLayout factory;
40 public void createInitialLayout(IPageLayout factory) {
41 this.factory = factory;
42 factory.setEditorAreaVisible(false);
44 factory.setFixed(false);
47 private void addViews() {
48 factory.addView(ResourceManagerView.VIEW_ID, IPageLayout.LEFT, 0.3f,
49 factory.getEditorArea());
51 IFolderLayout folder = factory.createFolder(
52 "oic.simulator.serviceprovider.perspective.folder",
53 IPageLayout.BOTTOM, 0.65f, ResourceManagerView.VIEW_ID);
54 folder.addView(MetaPropertiesView.VIEW_ID);
55 folder.addView(ResourceObserverView.VIEW_ID);
57 factory.addView(AttributeView.VIEW_ID, IPageLayout.LEFT, 0.7f,
58 factory.getEditorArea());
59 factory.addView(LogView.VIEW_ID, IPageLayout.BOTTOM, 0.65f,
60 AttributeView.VIEW_ID);
61 factory.addView(MultiResourceOrchestrationView.VIEW_ID,
62 IPageLayout.RIGHT, 0.6f, AttributeView.VIEW_ID);