blob: 1fb84eeb94099a2c19a9c89217f78188e4cb74e1 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2015 BSI Business Systems Integration AG.
* 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:
* BSI Business Systems Integration AG - initial API and implementation
******************************************************************************/
package org.eclipse.scout.sdk.s2e.ui.internal.template;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
/**
* <h3>{@link ValueTypeFieldProposal}</h3>
*
* @author Matthias Villiger
* @since 5.2.0
*/
public class ValueTypeFieldProposal extends FormFieldProposal {
public ValueTypeFieldProposal(String name, int relevance, String imageId, ICompilationUnit cu, TypeProposalContext context) {
super(name, relevance, imageId, cu, context);
}
@Override
protected TypeDeclaration createFormFieldType(Type superType) {
return getFactory().newValueField(getProposalContext().getDefaultName())
.withNlsMethod(getNlsMethodName())
.withProposalBaseFqn(getProposalContext().getProposalInterfaceFqn())
.withReadOnlyNameSuffix(getProposalContext().getSuffix())
.withSuperType(superType)
.in(getProposalContext().getDeclaringType())
.atPosition(getProposalContext().getInsertPosition())
.insert()
.get();
}
}