Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: bdb380165a0c2e214da1a173c6859cd8a7f7a36f (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
/*
 * Copyright (c) 2008 Borland Software Corporation
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Artem Tikhomirov (Borland) - [244419] custom parsers
 */

«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
«EXTENSION xpt::StringOperations»

«DEFINE Main FOR gmfgen::CustomParser»
«EXPAND xpt::Common::copyright FOR holder.editorGen-»
«EXPAND xpt::Common::packageStatement FOR qualifiedName»

«EXPAND xpt::Common::generatedClassComment»
public class «qualifiedName.xpandSplit('\\.')->last()»«EXPAND extendsList»«EXPAND implementsList» {
«EXPAND body»
«EXPAND additions»
}
«ENDDEFINE»

«DEFINE additions FOR gmfgen::CustomParser»«ENDDEFINE»
«DEFINE extendsList FOR gmfgen::CustomParser»«ENDDEFINE»
«DEFINE implementsList FOR gmfgen::CustomParser» implements org.eclipse.gmf.runtime.common.ui.services.parser.IParser«ENDDEFINE»

«DEFINE body FOR gmfgen::CustomParser»
	«EXPAND xpt::Common::generatedMemberComment»
	public String getEditString(org.eclipse.core.runtime.IAdaptable element, int flags) {
		return "";
	}

	«EXPAND xpt::Common::generatedMemberComment»
	public org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus isValidEditString(org.eclipse.core.runtime.IAdaptable element, String editString) {
		// TODO change to EDITABLE_STATUS as appropriate
		return org.eclipse.gmf.runtime.common.ui.services.parser.ParserEditStatus.UNEDITABLE_STATUS;
	}

	«EXPAND xpt::Common::generatedMemberComment»
	public org.eclipse.gmf.runtime.common.core.command.ICommand getParseCommand(org.eclipse.core.runtime.IAdaptable element, String newString, int flags) {
		// TODO
		throw new UnsupportedOperationException(); 
	}

	«EXPAND xpt::Common::generatedMemberComment»
	public String getPrintString(org.eclipse.core.runtime.IAdaptable element, int flags) {
		return "";
	}

	«EXPAND xpt::Common::generatedMemberComment»
	public boolean isAffectingEvent(Object event, int flags) {
		return false;
	}

	«EXPAND xpt::Common::generatedMemberComment»
	public org.eclipse.jface.text.contentassist.IContentAssistProcessor getCompletionProcessor(org.eclipse.core.runtime.IAdaptable element) {
    	return null;
	}
«ENDDEFINE»

Back to the top