Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 7be8d788eb3e689d4b8573882516ca9bb00db702 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
/*******************************************************************************
 * Copyright (c) 2015, 2018 Obeo.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0
 *
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: Obeo - initial API and implementation
 *******************************************************************************/
package org.eclipse.eef.properties.ui.legacy.internal.eef2legacy;

import java.util.List;

import org.eclipse.eef.properties.ui.api.IEEFSectionDescriptor;
import org.eclipse.jface.viewers.IFilter;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.tabbed.ISection;
import org.eclipse.ui.views.properties.tabbed.ISectionDescriptor;

/**
 * Wraps an {@link IEEFSectionDescriptor} to an {@link ISectionDescriptor}.
 *
 * @author melanie
 */
public class LegacySectionDescriptor implements ISectionDescriptor {

	/**
	 * The EEF section descriptor.
	 */
	private IEEFSectionDescriptor eefSectionDescriptor;

	/**
	 * The constructor.
	 *
	 * @param eefSectionDescriptor
	 *            EEF section descriptor
	 */
	public LegacySectionDescriptor(IEEFSectionDescriptor eefSectionDescriptor) {
		this.eefSectionDescriptor = eefSectionDescriptor;
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getId()
	 */
	@Override
	public String getId() {
		return this.eefSectionDescriptor.getId();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getFilter()
	 */
	@Override
	public IFilter getFilter() {
		return this.eefSectionDescriptor.getFilter();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getInputTypes()
	 */
	@SuppressWarnings("rawtypes")
	@Override
	public List getInputTypes() {
		return this.eefSectionDescriptor.getInputTypes();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getSectionClass()
	 */
	@Override
	public ISection getSectionClass() {
		return new LegacySection(this.eefSectionDescriptor.getSectionClass());
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getTargetTab()
	 */
	@Override
	public String getTargetTab() {
		return this.eefSectionDescriptor.getTargetTab();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getEnablesFor()
	 */
	@Override
	public int getEnablesFor() {
		return this.eefSectionDescriptor.getEnablesFor();
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#appliesTo(IWorkbenchPart, ISelection)
	 */
	@Override
	public boolean appliesTo(IWorkbenchPart part, ISelection selection) {
		return this.eefSectionDescriptor.appliesTo(part, selection);
	}

	/**
	 * {@inheritDoc}
	 *
	 * @see ISectionDescriptor#getAfterSection()
	 */
	@Override
	public String getAfterSection() {
		return this.eefSectionDescriptor.getAfterSection();
	}

}

Back to the top