Author: timotei
Date: Tue Jul 26 17:34:40 2011
New Revision: 50436
URL: http://svn.gna.org/viewcvs/wesnoth?rev=50436&view=rev
Log:
eclipse plugin: Enhance the existing WMLFactory
with some methods
Added:
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/WmlFactory2.java
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/WmlFactory2Impl.java
Added: trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/WmlFactory2.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/WmlFactory2.java?rev=50436&view=auto
==============================================================================
--- trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/WmlFactory2.java (added)
+++ trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/WmlFactory2.java Tue
Jul 26 17:34:40 2011
@@ -1,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011 by Timotei Dolean <[email protected]>
+ *
+ * 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
+
*******************************************************************************/
+package org.wesnoth.wml;
+
+import org.wesnoth.wml.impl.WmlFactory2Impl;
+
+public interface WmlFactory2 extends WmlFactory
+{
+ WmlFactory2 eINSTANCE = new WmlFactory2Impl();
+
+ WMLTag createWMLTag( String name );
+ WMLTag createWMLTag( String name, String extendedName );
+ WMLTag createWMLTag( String name, String extendedName, char cardinality );
+
+ WMLKey createWMLKey( String name, String dataType );
+ WMLKey createWMLKey( String name, String dataType, char cardinality );
+ WMLKey createWMLKey( String name, String dataType, char cardinality,
boolean translatable );
+}
Added:
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/WmlFactory2Impl.java
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/WmlFactory2Impl.java?rev=50436&view=auto
==============================================================================
---
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/WmlFactory2Impl.java
(added)
+++
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/wml/impl/WmlFactory2Impl.java
Tue Jul 26 17:34:40 2011
@@ -1,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 by Timotei Dolean <[email protected]>
+ *
+ * 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
+
*******************************************************************************/
+package org.wesnoth.wml.impl;
+
+import org.wesnoth.wml.WMLKey;
+import org.wesnoth.wml.WMLTag;
+import org.wesnoth.wml.WmlFactory2;
+
+public class WmlFactory2Impl extends WmlFactoryImpl implements WmlFactory2
+{
+ @Override
+ public WMLTag createWMLTag( String name )
+ {
+ return createWMLTag( name, "" );
+ }
+
+ @Override
+ public WMLTag createWMLTag( String name, String inhertedName )
+ {
+ return createWMLTag( name, inhertedName, '*' );
+ }
+
+ @Override
+ public WMLTag createWMLTag( String name, String inhertedName, char
cardinality )
+ {
+ WMLTag tag = createWMLTag( );
+
+ tag.setName( name );
+ tag.setEndName( name );
+
+ tag.set_Cardinality( cardinality );
+ tag.set_InhertedTagName( inhertedName );
+
+ return tag;
+ }
+
+ @Override
+ public WMLKey createWMLKey( String name, String dataType )
+ {
+ return createWMLKey( name, dataType, '*' );
+ }
+
+ @Override
+ public WMLKey createWMLKey( String name, String dataType, char cardinality
)
+ {
+ return createWMLKey( name, dataType, cardinality, false );
+ }
+
+ @Override
+ public WMLKey createWMLKey( String name, String dataType, char
cardinality, boolean translatable )
+ {
+ WMLKey key = createWMLKey( );
+
+ key.setName( name );
+
+ key.set_DataType( dataType );
+ key.set_Cardinality( cardinality );
+ key.set_Translatable( translatable );
+
+ return key;
+ }
+}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits