eclipse plugin: Create the 'getWMLTags' and 'getWMLKeys'...
...methods and attach them to the WMLTag class instead of using the WMLUtils class
This commit is contained in:
parent
62ef78e299
commit
221f18af08
10 changed files with 162 additions and 70 deletions
|
@ -276,7 +276,7 @@ public class WMLProposalProvider extends AbstractWMLProposalProvider
|
|||
WMLTag schemaTag = schemaParser_.getTags().get(tag.getName());
|
||||
if ( schemaTag != null)
|
||||
{
|
||||
for( WMLKey key : WMLUtils.getTagKeys( schemaTag ) )
|
||||
for( WMLKey key : schemaTag.getWMLKeys( ) )
|
||||
{
|
||||
// skip forbidden keys
|
||||
if ( key.is_Forbidden( ) )
|
||||
|
@ -324,7 +324,7 @@ public class WMLProposalProvider extends AbstractWMLProposalProvider
|
|||
if (tagChildren != null)
|
||||
{
|
||||
boolean toAdd = true;
|
||||
for( WMLTag tag : WMLUtils.getTagTags( tagChildren ) )
|
||||
for( WMLTag tag : tagChildren.getWMLTags( ) )
|
||||
{
|
||||
// skip forbidden tags
|
||||
if ( tag.is_Forbidden( ) )
|
||||
|
@ -350,7 +350,7 @@ public class WMLProposalProvider extends AbstractWMLProposalProvider
|
|||
{
|
||||
WMLTag rootTag = schemaParser_.getTags().get("root"); //$NON-NLS-1$
|
||||
dbg( "root node. adding tags: "+ rootTag.getExpressions( ).size() ); //$NON-NLS-1$
|
||||
for( WMLTag tag : WMLUtils.getTagTags( rootTag ) )
|
||||
for( WMLTag tag : rootTag.getWMLTags( ) )
|
||||
{
|
||||
acceptor.accept( createTagProposal( tag, "", ruleProposal, context ) ); //$NON-NLS-1$
|
||||
}
|
||||
|
@ -373,7 +373,7 @@ public class WMLProposalProvider extends AbstractWMLProposalProvider
|
|||
proposal.append("["); //$NON-NLS-1$
|
||||
proposal.append(tag.getName());
|
||||
proposal.append("]\n"); //$NON-NLS-1$
|
||||
for( WMLKey key : WMLUtils.getTagKeys( tag ) )
|
||||
for( WMLKey key : tag.getWMLKeys( ) )
|
||||
{
|
||||
if ( key.is_Required() )
|
||||
proposal.append(String.format("\t%s%s=\n", //$NON-NLS-1$
|
||||
|
|
|
@ -9,6 +9,22 @@
|
|||
containment="true"/>
|
||||
</eClassifiers>
|
||||
<eClassifiers xsi:type="ecore:EClass" name="WMLTag" eSuperTypes="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLRootExpression">
|
||||
<eOperations name="getWMLTags">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="
 EList<WMLTag> result = new org.eclipse.emf.common.util.BasicEList<WMLTag>();
 for ( WMLExpression expression : getExpressions( ) ) {
 if ( expression.isWMLTag( ) )
 result.add( expression.asWMLTag( ) );
 }

 return result;"/>
|
||||
</eAnnotations>
|
||||
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
|
||||
<eTypeArguments eClassifier="ecore:EClass platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag"/>
|
||||
</eGenericType>
|
||||
</eOperations>
|
||||
<eOperations name="getWMLKeys">
|
||||
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
|
||||
<details key="body" value="EList<WMLKey> result = new org.eclipse.emf.common.util.BasicEList<WMLKey>();
 for ( WMLExpression expression : getExpressions( ) ) {
 if ( expression.isWMLKey( ) )
 result.add( expression.asWMLKey( ) );
 }

 return result;"/>
|
||||
</eAnnotations>
|
||||
<eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EEList">
|
||||
<eTypeArguments eClassifier="ecore:EClass platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey"/>
|
||||
</eGenericType>
|
||||
</eOperations>
|
||||
<eStructuralFeatures xsi:type="ecore:EAttribute" name="plus" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
|
||||
defaultValueLiteral=""/>
|
||||
<eStructuralFeatures xsi:type="ecore:EReference" name="Expressions" upperBound="-1"
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag/_InhertedTagName"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag/_NeedingExpansion"/>
|
||||
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag/_Description"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag/getWMLTags"/>
|
||||
<genOperations ecoreOperation="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLTag/getWMLKeys"/>
|
||||
</genClasses>
|
||||
<genClasses ecoreClass="platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey">
|
||||
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference platform:/resource/org.wesnoth/src-gen/org/wesnoth/WML.ecore#//WMLKey/values"/>
|
||||
|
|
|
@ -182,4 +182,22 @@ public interface WMLTag extends WMLRootExpression
|
|||
*/
|
||||
void set_Description(String value);
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model kind="operation" many="false"
|
||||
* annotation="http://www.eclipse.org/emf/2002/GenModel body='\n EList<WMLTag> result = new org.eclipse.emf.common.util.BasicEList<WMLTag>();\n for ( WMLExpression expression : getExpressions( ) ) {\n if ( expression.isWMLTag( ) )\n result.add( expression.asWMLTag( ) );\n }\n\n return result;'"
|
||||
* @generated
|
||||
*/
|
||||
EList<WMLTag> getWMLTags();
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @model kind="operation" many="false"
|
||||
* annotation="http://www.eclipse.org/emf/2002/GenModel body='EList<WMLKey> result = new org.eclipse.emf.common.util.BasicEList<WMLKey>();\n for ( WMLExpression expression : getExpressions( ) ) {\n if ( expression.isWMLKey( ) )\n result.add( expression.asWMLKey( ) );\n }\n\n return result;'"
|
||||
* @generated
|
||||
*/
|
||||
EList<WMLKey> getWMLKeys();
|
||||
|
||||
} // WMLTag
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.util.EObjectContainmentEList;
|
|||
import org.eclipse.emf.ecore.util.InternalEList;
|
||||
|
||||
import org.wesnoth.wml.WMLExpression;
|
||||
import org.wesnoth.wml.WMLKey;
|
||||
import org.wesnoth.wml.WMLTag;
|
||||
import org.wesnoth.wml.WmlPackage;
|
||||
|
||||
|
@ -305,6 +306,39 @@ public class WMLTagImpl extends WMLRootExpressionImpl implements WMLTag
|
|||
eNotify(new ENotificationImpl(this, Notification.SET, WmlPackage.WML_TAG__DESCRIPTION, old_Description, _Description));
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<WMLTag> getWMLTags()
|
||||
{
|
||||
|
||||
EList<WMLTag> result = new org.eclipse.emf.common.util.BasicEList<WMLTag>();
|
||||
for ( WMLExpression expression : getExpressions( ) ) {
|
||||
if ( expression.isWMLTag( ) )
|
||||
result.add( expression.asWMLTag( ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
* @generated
|
||||
*/
|
||||
public EList<WMLKey> getWMLKeys()
|
||||
{
|
||||
EList<WMLKey> result = new org.eclipse.emf.common.util.BasicEList<WMLKey>();
|
||||
for ( WMLExpression expression : getExpressions( ) ) {
|
||||
if ( expression.isWMLKey( ) )
|
||||
result.add( expression.asWMLKey( ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* <!-- begin-user-doc -->
|
||||
* <!-- end-user-doc -->
|
||||
|
|
|
@ -8,6 +8,8 @@ package org.wesnoth.wml.impl;
|
|||
|
||||
import org.eclipse.emf.ecore.EAttribute;
|
||||
import org.eclipse.emf.ecore.EClass;
|
||||
import org.eclipse.emf.ecore.EGenericType;
|
||||
import org.eclipse.emf.ecore.EOperation;
|
||||
import org.eclipse.emf.ecore.EPackage;
|
||||
import org.eclipse.emf.ecore.EReference;
|
||||
|
||||
|
@ -803,6 +805,18 @@ public class WmlPackageImpl extends EPackageImpl implements WmlPackage
|
|||
initEAttribute(getWMLTag__NeedingExpansion(), ecorePackage.getEBoolean(), "_NeedingExpansion", "false", 0, 1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getWMLTag__Description(), ecorePackage.getEString(), "_Description", "", 0, 1, WMLTag.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
||||
EOperation op = addEOperation(wmlTagEClass, null, "getWMLTags", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
EGenericType g1 = createEGenericType(ecorePackage.getEEList());
|
||||
EGenericType g2 = createEGenericType(this.getWMLTag());
|
||||
g1.getETypeArguments().add(g2);
|
||||
initEOperation(op, g1);
|
||||
|
||||
op = addEOperation(wmlTagEClass, null, "getWMLKeys", 0, 1, IS_UNIQUE, IS_ORDERED);
|
||||
g1 = createEGenericType(ecorePackage.getEEList());
|
||||
g2 = createEGenericType(this.getWMLKey());
|
||||
g1.getETypeArguments().add(g2);
|
||||
initEOperation(op, g1);
|
||||
|
||||
initEClass(wmlKeyEClass, WMLKey.class, "WMLKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
|
||||
initEReference(getWMLKey_Values(), this.getWMLKeyValue(), null, "values", null, 0, -1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
initEAttribute(getWMLKey_Eol(), ecorePackage.getEString(), "eol", "", 0, 1, WMLKey.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
|
||||
|
|
|
@ -15,25 +15,51 @@ process( EClass this ):
|
|||
|
||||
// enrich the grammar elements with schema-specific attributes
|
||||
if name == "WMLExpression" then {
|
||||
createAttribute( "_Cardinality", "EChar", " " ) ->
|
||||
createAttribute( "_Cardinality", echar() , " " ) ->
|
||||
|
||||
createCardinalityOperation( "is_Required", '1' ) ->
|
||||
createCardinalityOperation( "is_Forbidden", '-' ) ->
|
||||
createCardinalityOperation( "is_Optional", '?' ) ->
|
||||
createCardinalityOperation( "is_Repeatable", '*' ) ->
|
||||
|
||||
createOperation( "isWMLTag", "return ( this instanceof WMLTag );", "EBoolean" ) ->
|
||||
createOperation( "asWMLTag", "if ( !( this instanceof WMLTag ) ) return null; return ( WMLTag ) this;", "WMLTag" ) ->
|
||||
createOperation( "isWMLKey", "return ( this instanceof WMLKey );", "EBoolean" ) ->
|
||||
createOperation( "asWMLKey", "if ( !( this instanceof WMLKey ) ) return null; return ( WMLKey ) this;", "WMLKey" )
|
||||
createOperation( "isWMLTag",
|
||||
"return ( this instanceof WMLTag );", eboolean() ) ->
|
||||
createOperation( "asWMLTag",
|
||||
"if ( !( this instanceof WMLTag ) ) return null; return ( WMLTag ) this;",
|
||||
wmlType( "WMLTag" ) ) ->
|
||||
createOperation( "isWMLKey",
|
||||
"return ( this instanceof WMLKey );", eboolean() ) ->
|
||||
createOperation( "asWMLKey",
|
||||
"if ( !( this instanceof WMLKey ) ) return null; return ( WMLKey ) this;",
|
||||
wmlType( "WMLKey" ) )
|
||||
|
||||
} else if name == "WMLTag" then {
|
||||
createAttribute( "_InhertedTagName", "EString", "" ) ->
|
||||
createAttribute( "_NeedingExpansion", "EBoolean", "false" ) ->
|
||||
createAttribute( "_Description", "EString", "" )
|
||||
createAttribute( "_InhertedTagName", estring() , "" ) ->
|
||||
createAttribute( "_NeedingExpansion", eboolean() , "false" ) ->
|
||||
createAttribute( "_Description", estring(), "" ) ->
|
||||
|
||||
createGenericOperation( "getWMLTags",
|
||||
"EList<WMLTag> result = new org.eclipse.emf.common.util.BasicEList<WMLTag>();
|
||||
for ( WMLExpression expression : getExpressions( ) ) {
|
||||
if ( expression.isWMLTag( ) )
|
||||
result.add( expression.asWMLTag( ) );
|
||||
}
|
||||
|
||||
return result;", ecoreType( "EEList" ),
|
||||
wmlType( "WMLTag" ) ) ->
|
||||
createGenericOperation( "getWMLKeys",
|
||||
"EList<WMLKey> result = new org.eclipse.emf.common.util.BasicEList<WMLKey>();
|
||||
for ( WMLExpression expression : getExpressions( ) ) {
|
||||
if ( expression.isWMLKey( ) )
|
||||
result.add( expression.asWMLKey( ) );
|
||||
}
|
||||
|
||||
return result;", ecoreType( "EEList" ),
|
||||
wmlType( "WMLKey" ) )
|
||||
} else if name == "WMLKey" then {
|
||||
createAttribute( "_Enum", "EBoolean", "false" ) ->
|
||||
createAttribute( "_Translatable", "EBoolean", "false" ) ->
|
||||
createAttribute( "_DataType", "EString", "" )
|
||||
createAttribute( "_Enum", eboolean(), "false" ) ->
|
||||
createAttribute( "_Translatable", eboolean(), "false" ) ->
|
||||
createAttribute( "_DataType", estring(), "" )
|
||||
};
|
||||
|
||||
process( EStructuralFeature this ):
|
||||
|
@ -45,39 +71,58 @@ process( EAttribute this ):
|
|||
setDefaultValueLiteral( "" );
|
||||
|
||||
createCardinalityOperation( EClass this, String name, char chr ) :
|
||||
let op = newOperation( name, "EBoolean" ) :
|
||||
let op = newOperation( name, eboolean() ) :
|
||||
newAnnotation( op, "return _Cardinality == '" + chr + "';" );
|
||||
|
||||
createOperation( EClass this, String name, String body, String returnType):
|
||||
createOperation( EClass this, String name, String body, EClassifier returnType ):
|
||||
let op = newOperation( name, returnType) : newAnnotation( op, body );
|
||||
|
||||
create EOperation this newOperation( EClass owner, String name, String returnType ) :
|
||||
setName( name ) -> setEType( getDataType( returnType ) ) ->
|
||||
createGenericOperation( EClass this, String name, String body, EClassifier genericType,
|
||||
EClassifier typeArgument ):
|
||||
let op = newGenericOperation( name, createGenericType( genericType, typeArgument ) )
|
||||
: newAnnotation( op, body );
|
||||
|
||||
create EGenericType this createGenericType( EClassifier type, EClassifier argumentType ):
|
||||
let genType = new EGenericType :
|
||||
setEClassifier( type ) ->
|
||||
eTypeArguments.add( let gen = new EGenericType : gen.setEClassifier( argumentType ) );
|
||||
|
||||
create EOperation this newOperation( EClass owner, String name, EClassifier returnType ) :
|
||||
setName( name ) -> setEType( returnType ) ->
|
||||
owner.eOperations.add( this );
|
||||
|
||||
create EOperation this newGenericOperation( EClass owner, String name, EGenericType type ):
|
||||
setName( name ) -> setEGenericType( type ) ->
|
||||
owner.eOperations.add( this );
|
||||
|
||||
create EAnnotation this newAnnotation( EOperation op, String value ):
|
||||
let an = new EStringToStringMapEntry :
|
||||
setSource( "http://www.eclipse.org/emf/2002/GenModel" ) ->
|
||||
an.setKey( "body" ) ->
|
||||
an.setKey( "body" ) ->
|
||||
an.setValue( value ) ->
|
||||
details.add( an ) ->
|
||||
op.eAnnotations.add( this );
|
||||
|
||||
create EAttribute this createAttribute( EClass owner, String name, String type, String defValue ) :
|
||||
create EAttribute this createAttribute( EClass owner, String name, EDataType type, String defValue ) :
|
||||
setName( name ) ->
|
||||
setEType( getDataType( type ) ) ->
|
||||
setEType( type ) ->
|
||||
setDefaultValueLiteral( defValue ) ->
|
||||
// add attribute to class
|
||||
owner.eStructuralFeatures.add( this );
|
||||
|
||||
EDataType getDataType( String name ):
|
||||
if name.startsWith( "E" ) then
|
||||
ecorePackage().getEClassifier( name )
|
||||
else
|
||||
wmlPackage().getEClassifier( name );
|
||||
|
||||
EDataType estring(): ecoreType( "EString" );
|
||||
EDataType echar(): ecoreType( "EChar" );
|
||||
EDataType eboolean(): ecoreType( "EBoolean" );
|
||||
|
||||
EClassifier wmlType( String name ):
|
||||
wmlPackage().getEClassifier( name );
|
||||
|
||||
EPackage wmlPackage():
|
||||
JAVA org.wesnoth.wml.impl.WmlPackageImpl.init();
|
||||
|
||||
EClassifier ecoreType( String name ) :
|
||||
ecorePackage().getEClassifier( name );
|
||||
|
||||
EPackage ecorePackage():
|
||||
JAVA org.eclipse.emf.ecore.impl.EcorePackageImpl.init();
|
|
@ -23,7 +23,6 @@ import org.wesnoth.installs.WesnothInstallsUtils;
|
|||
import org.wesnoth.preferences.Preferences;
|
||||
import org.wesnoth.utils.ResourceUtils;
|
||||
import org.wesnoth.utils.StringUtils;
|
||||
import org.wesnoth.utils.WMLUtils;
|
||||
import org.wesnoth.wml.WMLExpression;
|
||||
import org.wesnoth.wml.WMLTag;
|
||||
import org.wesnoth.wml.WmlFactory2;
|
||||
|
@ -314,7 +313,7 @@ public class SchemaParser
|
|||
{
|
||||
tag.set_NeedingExpansion(false);
|
||||
|
||||
for ( WMLTag subTag : WMLUtils.getTagTags( tag ) ) {
|
||||
for ( WMLTag subTag : tag.getWMLTags( ) ) {
|
||||
expandTag( subTag );
|
||||
}
|
||||
|
||||
|
@ -333,7 +332,7 @@ public class SchemaParser
|
|||
{
|
||||
Collections.sort( tag.getExpressions( ), new CardinalityComparator( ) );
|
||||
|
||||
for ( WMLTag subTag : WMLUtils.getTagTags( tag ) ) {
|
||||
for ( WMLTag subTag : tag.getWMLTags( ) ) {
|
||||
sortChildren( subTag );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
*******************************************************************************/
|
||||
package org.wesnoth.utils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.emf.common.util.EList;
|
||||
import org.eclipse.emf.ecore.EObject;
|
||||
import org.eclipse.xtext.nodemodel.util.NodeModelUtils;
|
||||
|
@ -32,22 +29,6 @@ public class WMLUtils
|
|||
return eObjectAtOffsetHelper_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of child keys for this tag
|
||||
* @param tag The tag to process
|
||||
* @return A list of {@link WMLKey}
|
||||
*/
|
||||
public static List<WMLKey> getTagKeys( WMLTag tag )
|
||||
{
|
||||
List<WMLKey> result = new ArrayList<WMLKey>();
|
||||
for ( WMLExpression expression : tag.getExpressions( ) ) {
|
||||
if ( expression.isWMLKey( ) )
|
||||
result.add( expression.asWMLKey( ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the child key of the specified tag by its name.
|
||||
* @param tag The tag to search into
|
||||
|
@ -56,7 +37,7 @@ public class WMLUtils
|
|||
*/
|
||||
public static WMLKey getKeyByName( WMLTag tag, String name )
|
||||
{
|
||||
for ( WMLKey key: getTagKeys( tag ) ) {
|
||||
for ( WMLKey key: tag.getWMLKeys( ) ) {
|
||||
if ( key.getName( ).equals( name ) )
|
||||
return key;
|
||||
}
|
||||
|
@ -64,22 +45,6 @@ public class WMLUtils
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the list of child tags for this tag
|
||||
* @param tag The tag to process
|
||||
* @return A list of {@link WMLTag}
|
||||
*/
|
||||
public static List<WMLTag> getTagTags( WMLTag tag )
|
||||
{
|
||||
List<WMLTag> result = new ArrayList<WMLTag>();
|
||||
for ( WMLExpression expression : tag.getExpressions( ) ) {
|
||||
if ( expression.isWMLTag( ) )
|
||||
result.add( expression.asWMLTag( ) );
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the child tag of the specified tag by its name.
|
||||
* @param tag The tag to search into
|
||||
|
@ -88,7 +53,7 @@ public class WMLUtils
|
|||
*/
|
||||
public static WMLTag getTagByName( WMLTag tag, String name )
|
||||
{
|
||||
for ( WMLTag subTag : getTagTags( tag ) ) {
|
||||
for ( WMLTag subTag : tag.getWMLTags( ) ) {
|
||||
if ( subTag.asWMLTag( ).getName( ).equals( name ) )
|
||||
return subTag;
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ import org.eclipse.jface.wizard.IWizardPage;
|
|||
import org.wesnoth.Constants;
|
||||
import org.wesnoth.schema.SchemaParser;
|
||||
import org.wesnoth.utils.StringUtils;
|
||||
import org.wesnoth.utils.WMLUtils;
|
||||
import org.wesnoth.wizards.NewWizardTemplate;
|
||||
import org.wesnoth.wml.WMLKey;
|
||||
import org.wesnoth.wml.WMLTag;
|
||||
|
@ -37,7 +36,7 @@ public class WizardGenerator extends NewWizardTemplate
|
|||
else
|
||||
{
|
||||
// keys section
|
||||
List<WMLKey> keys = WMLUtils.getTagKeys( tagContent );
|
||||
List<WMLKey> keys = tagContent.getWMLKeys( );
|
||||
int keysNr = keys.size();
|
||||
int startKey = 0, pgsKey = (keysNr / Constants.WIZ_MaxTextBoxesOnPage);
|
||||
WizardGeneratorPageKey tempPageKey;
|
||||
|
@ -57,7 +56,7 @@ public class WizardGenerator extends NewWizardTemplate
|
|||
}
|
||||
|
||||
// tags section
|
||||
List<WMLTag> tags = WMLUtils.getTagTags( tagContent );
|
||||
List<WMLTag> tags = tagContent.getWMLTags( );
|
||||
int tagsNr = tags.size();
|
||||
int startTag = 0, pgsTag = (tagsNr / Constants.WIZ_MaxGroupsOnPage);
|
||||
WizardGeneratorPageTag tempPageTag;
|
||||
|
|
Loading…
Add table
Reference in a new issue