| /*=============================================================================# |
| # Copyright (c) 2007, 2020 Stephan Wahlbrink and others. |
| # |
| # This program and the accompanying materials are made available under the |
| # terms of the Eclipse Public License 2.0 which is available at |
| # https://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0 |
| # which is available at https://www.apache.org/licenses/LICENSE-2.0. |
| # |
| # SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 |
| # |
| # Contributors: |
| # Stephan Wahlbrink <sw@wahlbrink.eu> - initial API and implementation |
| #=============================================================================*/ |
| |
| package org.eclipse.statet.redocs.wikitext.r.core.source; |
| |
| import org.eclipse.statet.base.ext.templates.StatextCodeTemplateContextType; |
| import org.eclipse.statet.ltk.ui.templates.IWaTemplateContextTypeExtension1; |
| |
| |
| public class WikitextRweaveTemplateContextType extends StatextCodeTemplateContextType |
| implements IWaTemplateContextTypeExtension1 { |
| |
| |
| /*- Context Types -------------------------------------------------------------*/ |
| |
| public static final String NEWDOC_CONTEXTTYPE_SUFFIX= "weave_NewDoc"; //$NON-NLS-1$ |
| |
| public static final String WEAVE_DOCDEFAULT_CONTEXTTYPE_SUFFIX= "weave_Weave:DocDefault"; //$NON-NLS-1$ |
| |
| /*- Templates -----------------------------------------------------------------*/ |
| |
| |
| public WikitextRweaveTemplateContextType(final String id) { |
| super(id); |
| |
| init(); |
| } |
| |
| /** Instantiation extension point */ |
| public WikitextRweaveTemplateContextType() { |
| super(); |
| } |
| |
| |
| @Override |
| public void init() { |
| final String id= getId(); |
| |
| addCommonVariables(); |
| if (id.endsWith(NEWDOC_CONTEXTTYPE_SUFFIX)) { |
| addSourceUnitGenerationVariables(); |
| } |
| else if (id.endsWith(WEAVE_DOCDEFAULT_CONTEXTTYPE_SUFFIX)) { |
| addEditorVariables(); |
| } |
| } |
| |
| } |