Skip to content

Package: ToolingModeUtil

ToolingModeUtil

nameinstructionbranchcomplexitylinemethod
isSegmentToolingEnabled()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2019 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Lucas Koehler - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emfforms.spi.ide.view.segments;
15:
16: import org.eclipse.emfforms.spi.ide.preferences.EmfFormsPreferences;
17:
18: /**
19: * Utility class that allows to query whether segment or dmr based tooling is used.
20: *
21: * @author Lucas Koehler
22: * @since 1.22
23: *
24: */
25: public final class ToolingModeUtil {
26:
27:         /**
28:          * This flag enables the automatic generation of segments from existing DMRs.
29:          *
30:          * @deprecated The tooling mode is no longer defined via runtime parameter but by a workspace preference. See
31:          * {@link EmfFormsPreferences#isSegmentTooling()}
32:          */
33:         @Deprecated
34:         public static final String ENABLE_SEGMENT_TOOLING = "-enableSegmentTooling"; //$NON-NLS-1$
35:
36:         // Utility classes should not be instantiated
37:         private ToolingModeUtil() {
38:         }
39:
40:         /**
41:          * Returns true if the <strong>-enableSegmentTooling</strong> program argument was set.
42:          *
43:          * @return <code>true</code> if the tooling creates segment based DMRs, or <code>false</code> if legacy DMRs are
44:          * created
45:          */
46:         public static boolean isSegmentToolingEnabled() {
47:                 return EmfFormsPreferences.isSegmentTooling();
48:         }
49: }