# HG changeset patch # User haismail # Date 1264415181 -7200 # Node ID 7ff23301fe2288f14785fa63b149d702324dc59b # Parent 61163b28edca2a31aae8be2c130314040f3263fb iMaker plugin updated: Ticket #1188: As a Carbide.c++ user I want to modify my .IMP file using iMaker plugin diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/AllTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/AllTests.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import junit.framework.Test; +import junit.framework.TestSuite; + +/** + * + * A test suite for the 'Imp' model. + * + * @generated + */ +public class AllTests { + + public static Test suite() { + TestSuite suite = new TestSuite( + "Test for com.nokia.s60tools.imaker.internal.impmodel.tests"); +// suite.addTestSuite(CommentContainerTest.class); +// suite.addTestSuite(CommentTest.class); +// suite.addTestSuite(ConfigEntryTest.class); +// suite.addTestSuite(FileListEntryTest.class); +// suite.addTestSuite(ImpDocumentTest.class); +// suite.addTestSuite(LineNumberContainerTest.class); +// suite.addTestSuite(OverrideConfigurationTest.class); +// suite.addTestSuite(OverrideFilesTest.class); +// suite.addTestSuite(VariableTest.class); + suite.addTestSuite(ImpResourceLoadTests.class); + suite.addTestSuite(ImpResourceSaveTests.class); + return suite; + } +} //ImpAllTests diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/CommentContainerTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/CommentContainerTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.CommentContainer; + +import junit.framework.TestCase; + +/** + * + * A test case for the model object 'Comment Container'. + * + * @generated + */ +public abstract class CommentContainerTest extends TestCase { + + /** + * The fixture for this Comment Container test case. + * + * + * @generated + */ + protected CommentContainer fixture = null; + + /** + * Constructs a new Comment Container test case with the given name. + * + * + * @generated + */ + public CommentContainerTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Comment Container test case. + * + * + * @generated + */ + protected void setFixture(CommentContainer fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Comment Container test case. + * + * + * @generated + */ + protected CommentContainer getFixture() { + return fixture; + } + +} //CommentContainerTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/CommentTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/CommentTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Comment'. + * + * @generated + */ +public class CommentTest extends TestCase { + + /** + * The fixture for this Comment test case. + * + * + * @generated + */ + protected Comment fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(CommentTest.class); + } + + /** + * Constructs a new Comment test case with the given name. + * + * + * @generated + */ + public CommentTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Comment test case. + * + * + * @generated + */ + protected void setFixture(Comment fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Comment test case. + * + * + * @generated + */ + protected Comment getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createComment()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //CommentTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ConfigEntryTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ConfigEntryTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Config Entry'. + * + * @generated + */ +public class ConfigEntryTest extends TestCase { + + /** + * The fixture for this Config Entry test case. + * + * + * @generated + */ + protected ConfigEntry fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(ConfigEntryTest.class); + } + + /** + * Constructs a new Config Entry test case with the given name. + * + * + * @generated + */ + public ConfigEntryTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Config Entry test case. + * + * + * @generated + */ + protected void setFixture(ConfigEntry fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Config Entry test case. + * + * + * @generated + */ + protected ConfigEntry getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createConfigEntry()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //ConfigEntryTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/FileListEntryTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/FileListEntryTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'File List Entry'. + * + * @generated + */ +public class FileListEntryTest extends TestCase { + + /** + * The fixture for this File List Entry test case. + * + * + * @generated + */ + protected FileListEntry fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(FileListEntryTest.class); + } + + /** + * Constructs a new File List Entry test case with the given name. + * + * + * @generated + */ + public FileListEntryTest(String name) { + super(name); + } + + /** + * Sets the fixture for this File List Entry test case. + * + * + * @generated + */ + protected void setFixture(FileListEntry fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this File List Entry test case. + * + * + * @generated + */ + protected FileListEntry getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createFileListEntry()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //FileListEntryTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpDocumentTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpDocumentTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Imp Document'. + * + *

+ * The following operations are tested: + *

+ *

+ * @generated + */ +public class ImpDocumentTest extends TestCase { + + /** + * The fixture for this Imp Document test case. + * + * + * @generated + */ + protected ImpDocument fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(ImpDocumentTest.class); + } + + /** + * Constructs a new Imp Document test case with the given name. + * + * + * @generated + */ + public ImpDocumentTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Imp Document test case. + * + * + * @generated + */ + protected void setFixture(ImpDocument fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Imp Document test case. + * + * + * @generated + */ + protected ImpDocument getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createImpDocument()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + + /** + * Tests the '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getVariable(java.lang.String) Get Variable}' operation. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getVariable(java.lang.String) + * @generated NOT + */ + public void testGetVariable__String() { + ImpmodelFactory factory = ImpmodelFactory.eINSTANCE; + Variable v1 = factory.createVariable(); + Variable v2 = factory.createVariable(); + + String v1_name = "v1"; + String v2_name = "v2"; + v1.setName(v1_name); + v2.setName(v2_name); + + getFixture().getVariables().add(v1); + getFixture().getVariables().add(v2); + + assertSame(v1, getFixture().getVariable(v1_name)); + assertSame(v2, getFixture().getVariable(v2_name)); + assertSame(null, getFixture().getVariable("test")); + } + +} //ImpDocumentTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpResourceLoadTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpResourceLoadTests.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,236 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.io.Writer; +import java.util.Map; + +import junit.framework.TestCase; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; +import com.nokia.s60tools.imaker.internal.impmodel.util.ImpResourceFactoryImpl; + +/** + * + * A test suite for the 'impmodel' package. + * + * @generated + */ +public class ImpResourceLoadTests extends TestCase { + + + + private File testFile; + + @Override + protected void setUp() throws Exception { + testFile = getTestFile(); + } + + @Override + protected void tearDown() throws Exception { + testFile.delete(); + } + + private File getTestFile() throws IOException { + File file = File.createTempFile("test", ".imp"); + return file; + } + + public void testLoadingEmptyFile() throws Exception { + EObject contents = loadContents(); + assertNotNull(contents); + assertTrue(contents instanceof ImpDocument); + } + + + public void testLoadingComments() throws Exception { + String comments = "#comment1\n#comment2\nhuuhaa"; + populateTestFile(comments); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of comments found!",doc.getComments().size()==2); + Comment cm = doc.getComments().get(0); + assertEquals("comment1", cm.getComment()); + } + + public void testLoadingVariables() throws Exception { + String content = "#comment1\nvar1 = foo\nvar1 = bar"; + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of variables found!",doc.getVariables().size()==2); + Variable var = doc.getVariables().get(0); + assertEquals("var1", var.getName()); + assertEquals("foo", var.getValue()); + } + + public void testLoadingOverrideFiles() throws Exception { + String content = "#comment1\nvar1 = foo\n" + + "define IMAGE_ORIDEFILES\n" + + "\ttarget1 source1\n" + + "\ttarget2 source2\n" + + "endef"; + + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of override files found!",doc.getOrideFiles().size()==1); + + OverrideFiles of = doc.getOrideFiles().get(0); + assertTrue("Not desired amount of entries in the list!",of.getEntries().size()==2); + } + + public void testLoadingOverrideFilesWithSpace() throws Exception { + String content = "#comment1\nvar1 = foo\n" + + "define IMAGE_ORIDEFILES\n" + + "\t\"source file1\" target1\n" + + "\tsource2 \"target file2\"\n" + + "endef"; + + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of override files found!",doc.getOrideFiles().size()==1); + + OverrideFiles of = doc.getOrideFiles().get(0); + assertTrue("Not desired amount of entries in the list!",of.getEntries().size()==2); + FileListEntry entry = of.getEntries().get(0); + assertEquals("\"source file1\"", entry.getSource()); + entry = of.getEntries().get(1); + assertEquals("\"target file2\"", entry.getTarget()); + + } + + public void testLoadingOverrideConfs() throws Exception { + String content = "#comment1\nvar1 = foo\n" + + "define IMAGE_ORIDECONF\n" + + "\tekern.exe udeb core\n" + + "\tAbout.r01 hie rofs2\n" + + "endef"; + + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of override confs found!",doc.getOrideConfs().size()==1); + + OverrideConfiguration oc = doc.getOrideConfs().get(0); + assertTrue("Not desired amount of entries in the list!",oc.getEntries().size()==2); + ConfigEntry entry = oc.getEntries().get(0); + assertEquals("ekern.exe", entry.getTarget()); + assertEquals("udeb", entry.getAction()); + assertEquals("core", entry.getLocation()); + } + + public void testLoadingOverrideFilesAndConfsTogether() throws Exception { + String content = "#comment1\n#variables\nvar1 = foo\n" + + "#trace files\n" + + "define IMAGE_ORIDEFILES\n" + + "\tsource1 ekern.exe\n" + + "\tsource2 About.r01\n" + + "endef\n" + + "#trace configurations\n" + + "define IMAGE_ORIDECONF\n" + + "\tekern.exe udeb core\n" + + "\tAbout.r01 hie rofs2\n" + + "endef"; + + populateTestFile(content); + + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue("Not desired amount of override files found!",doc.getOrideFiles().size()==1); + assertTrue("Not desired amount of override confs found!",doc.getOrideConfs().size()==1); + + OverrideFiles files = doc.getOrideFiles().get(0); + FileListEntry entry = files.getEntries().get(0); + assertFalse("File Entry has no associated action",entry.getActions().isEmpty()); + ConfigEntry action = entry.getActions().get(0); + assertEquals("udeb", action.getAction()); + assertEquals("core", action.getLocation()); + } + + public void testLoadingLineBreaks() throws Exception { + String comment = "This is a longggggg comment continued and continued"; + String content = "#This is a longggggg \\\ncomment continued \\\nand continued\n"; + + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertTrue(doc.getComments().size()==1); + assertEquals(comment, doc.getComments().get(0).getComment()); + } + + public void testLoadingLineNumbers() throws Exception { + String content = "#comment1\n" + + "var1 = foo\n" + + "#trace files\n" + + "define IMAGE_ORIDEFILES\n" + + "\ttarget1 source1\n" + + "\ttarget2 source2\n" + + "endef\n" + + "#trace configurations\n" + + "define IMAGE_ORIDECONF\n" + + "\tekern.exe udeb core\n" + + "\tAbout.r01 hie rofs2\n" + + "endef"; + + populateTestFile(content); + ImpDocument doc = (ImpDocument) loadContents(); + assertEquals(1, doc.getComments().get(0).getLineNumber()); + assertEquals(3, doc.getComments().get(1).getLineNumber()); + assertEquals(8, doc.getComments().get(2).getLineNumber()); + assertEquals(2, doc.getVariables().get(0).getLineNumber()); + assertEquals(4, doc.getOrideFiles().get(0).getLineNumber()); + assertEquals(9, doc.getOrideConfs().get(0).getLineNumber()); + } + + private void populateTestFile(String content) throws IOException { + Writer output = new BufferedWriter(new FileWriter(testFile)); + try { + output.write( content ); + } + finally { + output.close(); + } + } + + private EObject loadContents() throws IOException { + ResourceSetImpl rs = new ResourceSetImpl(); + Map factoryMap = rs.getResourceFactoryRegistry().getExtensionToFactoryMap(); + factoryMap.put("imp", new ImpResourceFactoryImpl()); + + URI uri = URI.createFileURI(testFile.getAbsolutePath()); + Resource resource = rs.createResource(uri); + assertNotNull(resource); + resource.load(null); + EList contents = resource.getContents(); + assertFalse("resource is empty",contents.isEmpty()); + return contents.get(0); + } + +} //ImpResourceLoadTests diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpResourceSaveTests.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpResourceSaveTests.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,206 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import java.io.File; +import java.io.IOException; +import java.util.Map; + +import junit.framework.TestCase; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; +import com.nokia.s60tools.imaker.internal.impmodel.util.ImpResourceFactoryImpl; + +/** + * A test suite for the 'impmodel' + * package. + * + * @generated + */ +public class ImpResourceSaveTests extends TestCase { + + private File testFile; + private ImpmodelFactory factory; + private ImpDocument document; + + @Override + protected void setUp() throws Exception { + factory = ImpmodelFactory.eINSTANCE; + document = factory.createImpDocument(); + testFile = getTestFile(); + } + + @Override + protected void tearDown() throws Exception { + testFile.delete(); + } + + + public void testSavingEmptyDocument() throws Exception { + saveModel(document); + EObject doc = loadContents(); + assertNotNull(doc); + } + + public void testSavingDocumentWithComments() throws Exception { + Comment comment = factory.createComment(); + comment.setComment("This is a test comment"); + document.getComments().add(comment); + saveModel(document); + ImpDocument doc = (ImpDocument) loadContents(); + assertNotNull(doc); + assertTrue("Expected comment not found!",doc.getComments().size()==1); + Comment cm = doc.getComments().get(0); + assertEquals(comment.getComment(), cm.getComment()); + } + + public void testSavingDocumentWithVariabless() throws Exception { + String name = "foo"; + String value = "bar"; + + Variable var = factory.createVariable(); + var.setName(name); + var.setValue(value); + document.getVariables().add(var); + saveModel(document); + ImpDocument doc = (ImpDocument) loadContents(); + assertNotNull(doc); + assertTrue("Expected variable not found!",doc.getVariables().size()==1); + Variable vr = doc.getVariables().get(0); + assertEquals(name, vr.getName()); + assertEquals(value, vr.getValue()); + } + + public void testSavingDocumentWithOrideFiles() throws Exception { + String source = "foo"; + String target = "bar"; + + OverrideFiles orid = factory.createOverrideFiles(); + FileListEntry entry = factory.createFileListEntry(); + entry.setSource(source); + entry.setTarget(target); + orid.getEntries().add(entry); + document.getOrideFiles().add(orid); + saveModel(document); + ImpDocument doc = (ImpDocument) loadContents(); + assertNotNull(doc); + assertTrue("Expected override files not found!",doc.getOrideFiles().size()==1); + OverrideFiles or = doc.getOrideFiles().get(0); + assertTrue(or.getEntries().size()==1); + entry = or.getEntries().get(0); + assertEquals(source, entry.getSource()); + assertEquals(target, entry.getTarget()); + } + + public void testSavingDocumentWithOrideConfs() throws Exception { + String file = "foo"; + String action = "udeb"; + String location = "core"; + + OverrideConfiguration orid = factory.createOverrideConfiguration(); + ConfigEntry entry = factory.createConfigEntry(); + entry.setTarget(file); + entry.setAction(action); + entry.setLocation(location); + orid.getEntries().add(entry); + document.getOrideConfs().add(orid); + saveModel(document); + ImpDocument doc = (ImpDocument) loadContents(); + assertNotNull(doc); + assertTrue("Expected override files not found!",doc.getOrideConfs().size()==1); + OverrideConfiguration or = doc.getOrideConfs().get(0); + assertTrue(or.getEntries().size()==1); + entry = or.getEntries().get(0); + assertEquals(file, entry.getTarget()); + assertEquals(action, entry.getAction()); + assertEquals(location, entry.getLocation()); + } + + public void testSavingDocumentWithLineNumbers() throws Exception { + Comment comment = factory.createComment(); + comment.setComment("Example file"); + comment.setLineNumber(0); + document.getComments().add(comment); + + Variable var = factory.createVariable(); + var.setName("foo"); + var.setValue("bar"); + var.setLineNumber(4); + document.getVariables().add(var); + + + ConfigEntry entry = factory.createConfigEntry(); + entry.setTarget("foo"); + entry.setAction("udeb"); + entry.setLocation("core"); + OverrideConfiguration orid = factory.createOverrideConfiguration(); + orid.getEntries().add(entry); + orid.setLineNumber(9); + document.getOrideConfs().add(orid); + + saveModel(document); + + ImpDocument doc = (ImpDocument) loadContents(); + assertEquals(1, doc.getComments().get(0).getLineNumber()); + assertEquals(5, doc.getVariables().get(0).getLineNumber()); + assertEquals(10, doc.getOrideConfs().get(0).getLineNumber()); } + + private File getTestFile() throws IOException { + File file = File.createTempFile("test", ".imp"); + return file; + } + + private void saveModel(EObject model) throws IOException { + Resource res = getResource(); + res.getContents().add(model); + res.save(null); + } + + private EObject loadContents() throws IOException { + Resource resource = getResource(); + resource.load(null); + EList contents = resource.getContents(); + assertFalse("resource is empty", contents.isEmpty()); + return contents.get(0); + } + + private Resource getResource() { + ResourceSetImpl rs = new ResourceSetImpl(); + Map factoryMap = rs.getResourceFactoryRegistry() + .getExtensionToFactoryMap(); + factoryMap.put("imp", new ImpResourceFactoryImpl()); + + URI uri = URI.createFileURI(testFile.getAbsolutePath()); + Resource resource = rs.createResource(uri); + return resource; + } + +} // ImpResourceLoadTests diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpmodelExample.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/ImpmodelExample.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,136 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.util.Diagnostician; + +import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl; + +/** + * + * A sample utility for the 'impmodel' package. + * + * @generated + */ +public class ImpmodelExample { + /** + * + * Load all the argument file paths or URIs as instances of the model. + * + * @param args the file paths or URIs. + * @generated + */ + public static void main(String[] args) { + // Create a resource set to hold the resources. + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Register the appropriate resource factory to handle all file extensions. + // + resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put + (Resource.Factory.Registry.DEFAULT_EXTENSION, + new XMIResourceFactoryImpl()); + + // Register the package to ensure it is available during loading. + // + resourceSet.getPackageRegistry().put + (ImpmodelPackage.eNS_URI, + ImpmodelPackage.eINSTANCE); + + // If there are no arguments, emit an appropriate usage message. + // + if (args.length == 0) { + System.out.println("Enter a list of file paths or URIs that have content like this:"); + try { + Resource resource = resourceSet.createResource(URI.createURI("http:///My.impmodel")); + ImpDocument root = ImpmodelFactory.eINSTANCE.createImpDocument(); + resource.getContents().add(root); + resource.save(System.out, null); + } + catch (IOException exception) { + exception.printStackTrace(); + } + } + else { + // Iterate over all the arguments. + // + for (int i = 0; i < args.length; ++i) { + // Construct the URI for the instance file. + // The argument is treated as a file path only if it denotes an existing file. + // Otherwise, it's directly treated as a URL. + // + File file = new File(args[i]); + URI uri = file.isFile() ? URI.createFileURI(file.getAbsolutePath()): URI.createURI(args[0]); + + try { + // Demand load resource for this file. + // + Resource resource = resourceSet.getResource(uri, true); + System.out.println("Loaded " + uri); + + // Validate the contents of the loaded resource. + // + for (EObject eObject : resource.getContents()) { + Diagnostic diagnostic = Diagnostician.INSTANCE.validate(eObject); + if (diagnostic.getSeverity() != Diagnostic.OK) { + printDiagnostic(diagnostic, ""); + } + } + } + catch (RuntimeException exception) { + System.out.println("Problem loading " + uri); + exception.printStackTrace(); + } + } + } + } + + /** + * + * Prints diagnostics with indentation. + * + * @param diagnostic the diagnostic to print. + * @param indent the indentation for printing. + * @generated + */ + protected static void printDiagnostic(Diagnostic diagnostic, String indent) { + System.out.print(indent); + System.out.println(diagnostic.getMessage()); + for (Diagnostic child : diagnostic.getChildren()) { + printDiagnostic(child, indent + " "); + } + } + +} //ImpmodelExample diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/LineNumberContainerTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/LineNumberContainerTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,70 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer; + +import junit.framework.TestCase; + +/** + * + * A test case for the model object 'Line Number Container'. + * + * @generated + */ +public abstract class LineNumberContainerTest extends TestCase { + + /** + * The fixture for this Line Number Container test case. + * + * + * @generated + */ + protected LineNumberContainer fixture = null; + + /** + * Constructs a new Line Number Container test case with the given name. + * + * + * @generated + */ + public LineNumberContainerTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Line Number Container test case. + * + * + * @generated + */ + protected void setFixture(LineNumberContainer fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Line Number Container test case. + * + * + * @generated + */ + protected LineNumberContainer getFixture() { + return fixture; + } + +} //LineNumberContainerTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/OverrideConfigurationTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/OverrideConfigurationTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Override Configuration'. + * + * @generated + */ +public class OverrideConfigurationTest extends TestCase { + + /** + * The fixture for this Override Configuration test case. + * + * + * @generated + */ + protected OverrideConfiguration fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(OverrideConfigurationTest.class); + } + + /** + * Constructs a new Override Configuration test case with the given name. + * + * + * @generated + */ + public OverrideConfigurationTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Override Configuration test case. + * + * + * @generated + */ + protected void setFixture(OverrideConfiguration fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Override Configuration test case. + * + * + * @generated + */ + protected OverrideConfiguration getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createOverrideConfiguration()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //OverrideConfigurationTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/OverrideFilesTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/OverrideFilesTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Override Files'. + * + * @generated + */ +public class OverrideFilesTest extends TestCase { + + /** + * The fixture for this Override Files test case. + * + * + * @generated + */ + protected OverrideFiles fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(OverrideFilesTest.class); + } + + /** + * Constructs a new Override Files test case with the given name. + * + * + * @generated + */ + public OverrideFilesTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Override Files test case. + * + * + * @generated + */ + protected void setFixture(OverrideFiles fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Override Files test case. + * + * + * @generated + */ + protected OverrideFiles getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createOverrideFiles()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //OverrideFilesTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/TestBasicTokenizer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/TestBasicTokenizer.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,125 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import java.util.StringTokenizer; + +import com.nokia.s60tools.imaker.internal.impmodel.util.BasicTokenizer; + +import junit.framework.TestCase; + +public class TestBasicTokenizer extends TestCase { + + @Override + protected void tearDown() throws Exception { + super.tearDown(); + } + + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + public void testNullInput() throws Exception { + BasicTokenizer bt = new BasicTokenizer(null); + assertEquals(0, bt.countTokens()); + } + + public void testEmptyInput() throws Exception { + BasicTokenizer bt = new BasicTokenizer(""); + assertEquals(0, bt.countTokens()); + } + + public void testStringTokenizerUsage() throws Exception { + String input = "\tone \ttwo "; + StringTokenizer st = new StringTokenizer(input); + assertEquals(2, st.countTokens()); + assertEquals("one", st.nextToken()); + assertEquals("two", st.nextToken()); + } + + public void testBasicTokenizerCountTokens() throws Exception { + String input = "one two tree"; + BasicTokenizer bt = new BasicTokenizer(input); + assertEquals(3, bt.countTokens()); + } + + public void testBasicTokenizerCountTokensAdvanced() throws Exception { + String input = "\"one two\" tree"; + BasicTokenizer pt = new BasicTokenizer(input); + assertEquals(2, pt.countTokens()); + + input = "one \"two tree\""; + pt = new BasicTokenizer(input); + assertEquals(2, pt.countTokens()); + + input = "\"one two\" \"tree four\""; + pt = new BasicTokenizer(input); + assertEquals(2, pt.countTokens()); + assertEquals("\"one two\"", pt.nextToken()); + assertEquals("\"tree four\"", pt.nextToken()); + } + + public void testBasicTokenizerWithStringWithOneVariable() throws Exception { + BasicTokenizer bt = new BasicTokenizer("name=value"); + assertEquals(1, bt.countTokens()); + assertEquals("name=value", bt.nextToken()); + + bt = new BasicTokenizer("name =value"); + assertEquals(1, bt.countTokens()); + assertEquals("name=value", bt.nextToken()); + + bt = new BasicTokenizer("name = value"); + assertEquals(1, bt.countTokens()); + assertEquals("name=value", bt.nextToken()); + + bt = new BasicTokenizer("name = \"value\""); + assertEquals(1, bt.countTokens()); + assertEquals("name=\"value\"", bt.nextToken()); + } + + public void testBasicTokenizerWithStringWithSubstring() throws Exception { + BasicTokenizer bt = new BasicTokenizer("\"this is a substring\""); + assertEquals(1, bt.countTokens()); + assertEquals("\"this is a substring\"", bt.nextToken()); + } + + public void testBasicTokenizerWithStringWithIncompleteSubstring() throws Exception { + BasicTokenizer bt = new BasicTokenizer("\"sample substring"); + assertEquals(2, bt.countTokens()); + assertEquals("\"sample", bt.nextToken()); + assertEquals("substring", bt.nextToken()); + } + + public void testBasicTokenizerWithStringWithOneVariableWithStringValue() throws Exception { + BasicTokenizer bt = new BasicTokenizer("name = \"long value with spaces\""); + assertEquals(1, bt.countTokens()); + assertEquals("name=\"long value with spaces\"", bt.nextToken()); + } + + + + public void testBasicTokenizerMultipleVariables() throws Exception { + String input = "name1 = value1 name2= \"value 2\" name3 =value3"; + BasicTokenizer bt = new BasicTokenizer(input); + assertEquals(3, bt.countTokens()); + assertEquals("name1=value1", bt.nextToken()); + assertEquals("name2=\"value 2\"", bt.nextToken()); + assertEquals("name3=value3", bt.nextToken()); + } +} diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/VariableTest.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/impmodel/tests/VariableTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,104 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.tests; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; + +import junit.framework.TestCase; + +import junit.textui.TestRunner; + +/** + * + * A test case for the model object 'Variable'. + * + * @generated + */ +public class VariableTest extends TestCase { + + /** + * The fixture for this Variable test case. + * + * + * @generated + */ + protected Variable fixture = null; + + /** + * + * + * @generated + */ + public static void main(String[] args) { + TestRunner.run(VariableTest.class); + } + + /** + * Constructs a new Variable test case with the given name. + * + * + * @generated + */ + public VariableTest(String name) { + super(name); + } + + /** + * Sets the fixture for this Variable test case. + * + * + * @generated + */ + protected void setFixture(Variable fixture) { + this.fixture = fixture; + } + + /** + * Returns the fixture for this Variable test case. + * + * + * @generated + */ + protected Variable getFixture() { + return fixture; + } + + /** + * + * + * @see junit.framework.TestCase#setUp() + * @generated + */ + @Override + protected void setUp() throws Exception { + setFixture(ImpmodelFactory.eINSTANCE.createVariable()); + } + + /** + * + * + * @see junit.framework.TestCase#tearDown() + * @generated + */ + @Override + protected void tearDown() throws Exception { + setFixture(null); + } + +} //VariableTest diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/AllTests.java --- a/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/AllTests.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/AllTests.java Mon Jan 25 12:26:21 2010 +0200 @@ -38,6 +38,7 @@ suite.addTestSuite(PatternsTest.class); suite.addTest(com.nokia.s60tools.imaker.internal.iqrf.tests.AllTests.suite()); suite.addTest(com.nokia.s60tools.imaker.internal.model.iContent.tests.AllTests.suite()); + suite.addTest(com.nokia.s60tools.imaker.internal.impmodel.tests.AllTests.suite()); //$JUnit-END$ return suite; } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/IMakerAPITest.java --- a/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/IMakerAPITest.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/IMakerAPITest.java Mon Jan 25 12:26:21 2010 +0200 @@ -32,7 +32,7 @@ IIMakerWrapper wrapper = getWrapper(stubPath); String version = wrapper.getIMakerCoreVersion(); - assertTrue("iMaker API don't work as expected!", version.startsWith("iMaker 09.37.01")); + assertTrue("iMaker API don't work as expected!", version.startsWith("iMaker 10.03.01")); } private IIMakerWrapper getWrapper(String stubPath) { diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ImakerPropertiesTest.java --- a/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ImakerPropertiesTest.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ImakerPropertiesTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -16,48 +16,255 @@ */ package com.nokia.s60tools.imaker.internal.tests; - +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; import java.util.List; +import java.util.Map; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import com.nokia.s60tools.imaker.IMakerKeyConstants; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpConstants; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; +import com.nokia.s60tools.imaker.internal.impmodel.util.ImpResourceFactoryImpl; import com.nokia.s60tools.imaker.internal.model.ImakerProperties; +import com.nokia.s60tools.imaker.internal.model.iContent.IContentFactory; +import com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION; +import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry; + + public class ImakerPropertiesTest extends ProjectBuilder { - private String FIELD_NAME = "NAME"; - private String FIELD_VALUE = "FIELD_VALUE"; +// private String FIELD_NAME = "NAME"; +// private String FIELD_VALUE = "FIELD_VALUE"; + private ImakerProperties iProperties; + private IFile file; - public void setUp() throws Exception { + @Override + protected void setUp() throws Exception { createDefaultProject(); assertTrue(project.isAccessible()); + iProperties = new ImakerProperties(); + file = project.getFile("sample.imp"); } + @Override public void tearDown() throws Exception { closeAndDeleteDefaultProject(); } - public void testImakerProperties() throws Exception { - IFile[] ifiles = addImakerImpFiles(); - for (int i = 0; i < ifiles.length; i++) { - IFile file = ifiles[i]; - ImakerProperties ip = ImakerProperties.createFromFile(file); - String field = (String) ip.get(IMakerKeyConstants.PRODUCT); - assertTrue(!field.equals("")); - field = (String) ip.get(IMakerKeyConstants.TYPE); - assertTrue(!field.equals("")); - - ip.put(FIELD_NAME, FIELD_VALUE); - - ip.saveToFile(file); - ip = ImakerProperties.createFromFile(file); - assertEquals(FIELD_VALUE, ip.get(FIELD_NAME)); - - String mk = (String) ip.get(IMakerKeyConstants.MAKEFILE); - List command = ip.parseImakerCommand(project, project.getLocation()); - assertTrue("Expected command not correct! command="+command,command.indexOf(mk)!=-1); - } + + public void testImakerPropertiesLoading() throws Exception { + String content = "define IMAGE_ORIDECONF\n" + + "\\sys\\bin\\HelloConsole.exe replace-add core\n" + + "endef\n" + + "define IMAGE_ORIDEFILES\n" + + "\\epoc32\\release\\ARMV5\\UDEB\\HelloConsole.exe \\sys\\bin\\HelloConsole.exe\n" + + "endef\n" + "WORKDIR = \\temp\n" + "VERBOSE = 31\n" + + "USE_SYMGEN = 1\n" + "TYPE = rnd\n" + + "DEFAULT_GOALS = core rofs3\n" + "TARGET_PRODUCT = test_ui\n" + + "RUN_PLATSIM = 1\n" + "PLATSIM_INSTANCE = 4"; + + IFile ifile = addImakerImpFiles(content, "test1.imp"); + + //create properties from the file + ImakerProperties ip = ImakerProperties.createFromFile(ifile); + assertNotNull(ip); + + //verify + assertEquals("test_ui",ip.get(IMakerKeyConstants.PRODUCT)); + assertEquals("core rofs3",ip.get(IMakerKeyConstants.TARGET_LIST)); + assertEquals("rnd",ip.get(IMakerKeyConstants.TYPE)); + assertEquals("1",ip.get(IMakerKeyConstants.SYMBOLFILES)); + assertEquals("31",ip.get(IMakerKeyConstants.VERBOSE)); + + String adds = (String) ip.get(IMakerKeyConstants.ADDITIONAL_PARAMETERS); + assertTrue(adds.contains("WORKDIR")); + assertFalse(adds.contains("RUN_PLATSIM")); + + assertEquals("4",ip.get(IMakerKeyConstants.PLATSIM_INSTANCE)); + assertEquals("1",ip.get(IMakerKeyConstants.PLATSIM_RUN)); + } + + public void testImakerPropertiesLoadingFiles() throws Exception { + String content = "define IMAGE_ORIDECONF\n" + + "\\sys\\bin\\HelloConsole1.exe replace-add core\n" + + "HelloConsole2.exe replace-add rofs3\n" + + "endef\n" + + "define IMAGE_ORIDEFILES\n" + + "\\epoc32\\release\\ARMV5\\UDEB\\HelloConsole1.exe \\sys\\bin\\HelloConsole1.exe\n" + + "\\epoc32\\release\\ARMV5\\UDEB\\HelloConsole2.exe \\sys\\test\\HelloConsole2.exe\n" + + "endef\n"; + + IFile ifile = addImakerImpFiles(content, "test1.imp"); + + //create properties from the file + ImakerProperties ip = ImakerProperties.createFromFile(ifile); + assertNotNull(ip); + + //verify + Object files = ip.get(IMakerKeyConstants.DEBUGFILES); + assertNotNull(files); + List oFiles = (List) files; + assertEquals(2, oFiles.size()); + IbyEntry iby = oFiles.get(0); + + assertEquals(true, iby.isEnabled()); + assertEquals("\\epoc32\\release\\ARMV5\\UDEB\\HelloConsole1.exe", iby.getFile()); + assertEquals("\\sys\\bin\\HelloConsole1.exe", iby.getTarget()); + assertEquals("CORE", iby.getLocation().getLiteral()); + } + + public void testSavingToFileMainTab() throws Exception { + String product = "test_product"; + String targets = "t1 t2 t3"; + String type = "rnd"; + String symgen = "1"; + String verbose = "31"; + + iProperties.put(IMakerKeyConstants.PRODUCT, product); + iProperties.put(IMakerKeyConstants.TARGET_LIST, targets); + iProperties.put(IMakerKeyConstants.TYPE, type); + iProperties.put(IMakerKeyConstants.SYMBOLFILES, symgen); + iProperties.put(IMakerKeyConstants.VERBOSE, verbose); + + createAndSaveTheFile(); + + ImpDocument model = getImpModelAndVerify(); + + verifyVariableIsPresent(ImpConstants.TARGET_PRODUCT, product, model); + verifyVariableIsPresent(ImpConstants.DEFAULT_GOALS, targets, model); + verifyVariableIsPresent(ImpConstants.TYPE,type,model); + verifyVariableIsPresent(ImpConstants.USE_SYMGEN,symgen,model); + verifyVariableIsPresent(ImpConstants.VERBOSE,verbose,model); + } + + public void testSavingToFileMainTabAdditionalParameters() throws Exception { + String var1_value = "\\temp"; + String var2_value = "\"test value2\""; + String addParameters = "VAR1="+var1_value+" VAR2="+var2_value; + + iProperties.put(IMakerKeyConstants.ADDITIONAL_PARAMETERS, addParameters); + + createAndSaveTheFile(); + + ImpDocument model = getImpModelAndVerify(); + + //verify additionals + verifyVariableIsPresent("VAR1",var1_value,model); + verifyVariableIsPresent("VAR2","test value2",model); + } + + public void testSavingToFileContentTab() throws Exception { + List entries = new ArrayList(); + + IbyEntry entry = IContentFactory.eINSTANCE.createIbyEntry(); + entry.setEnabled(true); + entry.setDebug(true); + entry.setFile("file1"); + entry.setLocation(IMAGESECTION.CORE); + entry.setTarget("target1"); + entries.add(entry); + + entry = IContentFactory.eINSTANCE.createIbyEntry(); + entry.setEnabled(false); + entry.setDebug(true); + entry.setFile("file2"); + entry.setLocation(IMAGESECTION.ROFS3); + entry.setTarget("target2"); + entries.add(entry); + + entry = IContentFactory.eINSTANCE.createIbyEntry(); + entry.setEnabled(true); + entry.setDebug(true); + entry.setFile("file3"); + entry.setLocation(IMAGESECTION.ROFS3); + entry.setTarget("target3"); + entries.add(entry); + + + iProperties.put(IMakerKeyConstants.DEBUGFILES, entries); + + createAndSaveTheFile(); + + ImpDocument model = getImpModelAndVerify(); + + assertEquals(1,model.getOrideFiles().size()); + OverrideFiles files = model.getOrideFiles().get(0); + assertEquals(2, files.getEntries().size()); + FileListEntry fEntry = files.getEntries().get(0); + assertEquals("file1", fEntry.getSource()); + assertEquals("target1", fEntry.getTarget()); + assertEquals("core", fEntry.getActions().get(0).getLocation()); + + fEntry = files.getEntries().get(1); + assertEquals(1, fEntry.getActions().size()); + ConfigEntry cEntry = fEntry.getActions().get(0); + assertEquals("rofs3", cEntry.getLocation()); + } + + public void testSavingToFilePlatsimTab() throws Exception { + String instance = "5"; + String run = "1"; + + iProperties.put(IMakerKeyConstants.PLATSIM_INSTANCE, instance); + iProperties.put(IMakerKeyConstants.PLATSIM_RUN, run); + + createAndSaveTheFile(); + + ImpDocument model = getImpModelAndVerify(); + + verifyVariableIsPresent(ImpConstants.PLATSIM_INSTANCE, instance, model); + verifyVariableIsPresent(ImpConstants.PLATSIM_RUN, run, model); + } + + private ImpDocument getImpModelAndVerify() throws IOException { + //verify that correct file is produced + ImpDocument model = (ImpDocument) getFileContentAsImpModel(file.getLocation().toFile()); + assertNotNull(model); + return model; + } + + private void createAndSaveTheFile() throws CoreException { + //create file + file.create(null, true, null); + + //Save the properties to file + iProperties.saveToFile(file.getLocation().toFile()); + file.refreshLocal(IResource.DEPTH_ZERO, null); + } + + private void verifyVariableIsPresent(String name, String value, ImpDocument model) { + Variable var = model.getVariable(name); + assertNotNull(var); + assertEquals(value, var.getValue()); + } + + private EObject getFileContentAsImpModel(File file) throws IOException { + ResourceSetImpl rs = new ResourceSetImpl(); + Map factoryMap = rs.getResourceFactoryRegistry().getExtensionToFactoryMap(); + factoryMap.put("imp", new ImpResourceFactoryImpl()); + + URI uri = URI.createFileURI(file.getAbsolutePath()); + Resource resource = rs.createResource(uri); + assertNotNull(resource); + resource.load(null); + EList contents = resource.getContents(); + assertFalse("resource is empty",contents.isEmpty()); + return contents.get(0); } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectBuilder.java --- a/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectBuilder.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectBuilder.java Mon Jan 25 12:26:21 2010 +0200 @@ -20,7 +20,6 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.FilenameFilter; -import java.io.InputStream; import junit.framework.TestCase; @@ -35,16 +34,21 @@ public class ProjectBuilder extends TestCase { public static final String TESTDATA_DIR = "testdata"; public static final String[] imp_file_names = new String[] {"test1.imp","test2.imp"}; +// public static final String[] imp_file_names = new String[] {"test1.imp","test2.imp"}; public static final String[] imp_file_contents = new String[] { - "#iMaker properties\n" + - "#Fri Sep 18 09:31:17 EEST 2009\n" + - "PRODUCT=my_product.mk\n" + - "TARGET=all\n" + - "HWID=1010\n" + - "NAME=FIELD_VALUE\n" + - "MAKEFILE=\\\\epoc32\\\\rom\\\\config\\\\ncp70\\\\corolla\\\\corolla12mpix\\\\image_conf_corolla12mpix.mk\n" + - "TYPE=rnd\n" + - "TARGET_LIST=all\n", + "define IMAGE_ORIDECONF\n" + + "\\sys\\bin\\HelloConsole.exe replace-add core\n"+ + "endef\n" + + "define IMAGE_ORIDEFILES\n" + + "\\epoc32\\release\\ARMV5\\UDEB\\HelloConsole.exe \\sys\\bin\\HelloConsole.exe\n"+ + "endef\n"+ + "WORKDIR = \\temp\n"+ + "VERBOSE = 31\n" + + "USE_SYMGEN = 1\n" + + "TYPE = rnd\n" + + "DEFAULT_GOALS = core rofs3\n" + + "TARGET_PRODUCT = test_ui" + , "#iMaker properties\n" + "#Fri Sep 18 09:31:17 EEST 2009\n" + "PRODUCT=image_conf_dilbert_ui.mk\n" + @@ -74,40 +78,30 @@ protected void closeAndDeleteDefaultProject() throws CoreException { if(project!=null&&project.exists()) { project.close(null); - project.delete(true, null); + project.delete(true, true, null); } } - protected IFile[] addImakerImpFiles() { + protected IFile addImakerImpFiles(String content, String name) { IFolder folder = project.getFolder(TESTDATA_DIR); - IFile[] ifiles = new IFile[imp_file_names.length]; try { if(!folder.exists()) { folder.create(true, true, null); } - for (int i = 0; i < imp_file_names.length; i++) { - String f_name = imp_file_names[i]; - IFile file = folder.getFile(f_name); - if(!file.exists()) { - file.create(getContent(i), true, null); - } else { - file.setContents(getContent(i), true, false, null); - } - ifiles[i]=file; + ByteArrayInputStream input = new ByteArrayInputStream(content.getBytes()); + IFile file = folder.getFile(name); + if(!file.exists()) { + file.create(input, true, null); + } else { + file.setContents(input, true, false, null); } - return ifiles; + return file; } catch (CoreException e) { e.printStackTrace(); } return null; } - private InputStream getContent(int file) { - String contents = imp_file_contents[file]; - ByteArrayInputStream input = new ByteArrayInputStream(contents.getBytes()); - return input; - } - public static File[] getTestFiles() { File f = new File(TESTDATA_DIR); File[] files = f.listFiles(new FilenameFilter() { diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectManagerTest.java --- a/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectManagerTest.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/src/com/nokia/s60tools/imaker/internal/tests/ProjectManagerTest.java Mon Jan 25 12:26:21 2010 +0200 @@ -39,7 +39,6 @@ public void setUp() throws Exception { createDefaultProject(); - addImakerImpFiles(); assertTrue(project.isAccessible()); projectManager = new ProjectManager(project); } @@ -51,7 +50,9 @@ public void testLocation() { assertTrue(!projectManager.getRoot().equals("")); } - public void testImplFiles() throws Exception { + + public void testImplFiles() throws Exception { + addImakerImpFiles("sample content", "test.imp"); assertTrue("No impl files found. There shoud be some in the testdata folder!",!projectManager.getImakerFiles().isEmpty()); } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub.pl --- a/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub.pl Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub.pl Mon Jan 25 12:26:21 2010 +0200 @@ -43,7 +43,7 @@ if($numArgs eq 0) { print " -iMaker 09.37.01, 07-Sep-2009. +iMaker 10.03.01, 07-Sep-2009. Print help data on documented iMaker API items; targets and variables. Wildcards *, ? and [..] can be used with % patterns. diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_091402.pl --- a/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_091402.pl Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_091402.pl Mon Jan 25 12:26:21 2010 +0200 @@ -44,7 +44,7 @@ if($numArgs eq 0) { print " -iMaker 09.14.02, 24-Apr-2009. +iMaker 10.03.01, 24-Apr-2009. Print help data on documented iMaker API items; targets and variables. Wildcards *, ? and [] can be used with % patterns. diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_093701.pl --- a/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_093701.pl Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMakerStub_093701.pl Mon Jan 25 12:26:21 2010 +0200 @@ -44,7 +44,7 @@ if($numArgs eq 0) { print " -iMaker 09.37.01, 07-Sep-2009. +iMaker 10.03.01, 07-Sep-2009. Print help data on documented iMaker API items; targets and variables. Wildcards *, ? and [..] can be used with % patterns. diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMaker_imp.pl --- a/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMaker_imp.pl Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker.tests/tools/iMaker_imp.pl Mon Jan 25 12:26:21 2010 +0200 @@ -28,6 +28,13 @@ $numArgs = $#ARGV + 1; +if($numArgs eq 0) { +print " +iMaker 10.03.01, 24-Apr-2009. +"; +exit(0); +} + sub printArgs { print "-----------------------\n"; print "Commandline arguments:\n"; diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/.settings/org.eclipse.core.resources.prefs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/.settings/org.eclipse.core.resources.prefs Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,3 @@ +#Mon Jan 11 15:08:47 EET 2010 +eclipse.preferences.version=1 +encoding//model/imp.ecorediag=UTF-8 diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/META-INF/MANIFEST.MF --- a/imakerplugin/com.nokia.s60tools.imaker/META-INF/MANIFEST.MF Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/META-INF/MANIFEST.MF Mon Jan 25 12:26:21 2010 +0200 @@ -41,6 +41,9 @@ org.eclipse.swt.widgets", com.nokia.s60tools.imaker.internal.console;x-friends:="com.nokia.s60tools.imaker.tests", com.nokia.s60tools.imaker.internal.dialogs;x-friends:="com.nokia.s60tools.imaker.tests", + com.nokia.s60tools.imaker.internal.impmodel;x-friends:="com.nokia.s60tools.imaker.tests", + com.nokia.s60tools.imaker.internal.impmodel.impl;x-friends:="com.nokia.s60tools.imaker.tests", + com.nokia.s60tools.imaker.internal.impmodel.util;x-friends:="com.nokia.s60tools.imaker.tests", com.nokia.s60tools.imaker.internal.iqrf;x-friends:="com.nokia.s60tools.imaker.tests"; uses:="org.eclipse.emf.ecore, org.eclipse.emf.common.util", diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/icons/content.gif Binary file imakerplugin/com.nokia.s60tools.imaker/icons/content.gif has changed diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/icons/debug.gif Binary file imakerplugin/com.nokia.s60tools.imaker/icons/debug.gif has changed diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/model/debug.ecore --- a/imakerplugin/com.nokia.s60tools.imaker/model/debug.ecore Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/model/debug.ecore Mon Jan 25 12:26:21 2010 +0200 @@ -19,6 +19,5 @@ - diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/model/debug.genmodel --- a/imakerplugin/com.nokia.s60tools.imaker/model/debug.genmodel Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/model/debug.genmodel Mon Jan 25 12:26:21 2010 +0200 @@ -7,6 +7,11 @@ debug.ecore + + + + + @@ -16,6 +21,7 @@ + diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/model/imp.ecore --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/model/imp.ecore Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/model/imp.ecorediag --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/model/imp.ecorediag Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,290 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/model/imp.genmodel --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/model/imp.genmodel Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,48 @@ + + + imp.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/plugin.xml --- a/imakerplugin/com.nokia.s60tools.imaker/plugin.xml Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/plugin.xml Mon Jan 25 12:26:21 2010 +0200 @@ -139,5 +139,19 @@ + + + + + + + + diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IEnvironmentManager.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IEnvironmentManager.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IEnvironmentManager.java Mon Jan 25 12:26:21 2010 +0200 @@ -17,6 +17,7 @@ package com.nokia.s60tools.imaker; +import java.io.File; import java.util.List; @@ -48,4 +49,11 @@ */ public abstract List getEnviroments(); + /** + * Last run file + * @param file + */ + public abstract void setLastRun(File file); + public abstract File getLastRun(); + } \ No newline at end of file diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IIMakerWrapper.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IIMakerWrapper.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IIMakerWrapper.java Mon Jan 25 12:26:21 2010 +0200 @@ -113,6 +113,13 @@ * @return */ public abstract String getBuildCommand(List params); + + /** + * Construct the full iMaker command that will be executed and return it as a String for convenience + * @param params, command line parameters for iMaker + * @return + */ + public abstract String getBuildCommand(File impFile); /** * Get full path to iMaker tool that will be run diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerKeyConstants.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerKeyConstants.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerKeyConstants.java Mon Jan 25 12:26:21 2010 +0200 @@ -30,6 +30,7 @@ public static final String ADDITIONAL_PARAMETERS = "ADDITIONAL_PARAMETERS"; public static final String MODIFIED_SETTINGS = "MODIFIED_SETTINGS"; public static final String PREFS_DIRECTORY = "imaker"; + public static final String DEBUGFILES = "DEBUG_FILES"; //platsim specific settings diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerUtils.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerUtils.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/IMakerUtils.java Mon Jan 25 12:26:21 2010 +0200 @@ -113,14 +113,17 @@ /** * Parses the version of imaker from the specified string - * @param output + * @param versionString * @return */ - public static String parseIMakerVersion(String output) { + public static String parseIMakerVersion(String versionString) { + if(versionString==null||versionString.equals("")) { + return null; + } String verpattern = "\\d{2}\\.\\d{2}\\.\\d{2}"; - Matcher matcher = Pattern.compile(verpattern).matcher(output); + Matcher matcher = Pattern.compile(verpattern).matcher(versionString); if(matcher.find()) { - String version = output.substring(matcher.start(), matcher.end()); + String version = versionString.substring(matcher.start(), matcher.end()); return version; } else { return null; diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/actions/Flashmenu.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/actions/Flashmenu.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/actions/Flashmenu.java Mon Jan 25 12:26:21 2010 +0200 @@ -16,11 +16,12 @@ */ package com.nokia.s60tools.imaker.internal.actions; +import java.io.File; +import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.List; import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; @@ -41,7 +42,6 @@ import org.eclipse.ui.IWorkbenchWindow; import org.eclipse.ui.IWorkbenchWindowPulldownDelegate; -import com.nokia.s60tools.imaker.IEnvironment; import com.nokia.s60tools.imaker.IEnvironmentManager; import com.nokia.s60tools.imaker.IIMakerWrapper; import com.nokia.s60tools.imaker.IMakerPlugin; @@ -69,7 +69,7 @@ /** private data members */ private MenuItem openDialogItem = null; private Shell shell; - private IProject selectedProject; + private IResource selectedResource; /* (non-Javadoc) * @see org.eclipse.ui.IWorkbenchWindowPulldownDelegate#getMenu(org.eclipse.swt.widgets.Control) @@ -85,7 +85,7 @@ menu = new Menu(parent); ImageDescriptor descriptor = IMakerPlugin.getImageDescriptor("icons/imakermenu16.png"); - ProjectManager pm = new ProjectManager(selectedProject); + ProjectManager pm = new ProjectManager(selectedResource.getProject()); List files = pm.getImakerFiles(); for(IResource file: files) { IFile f = (IFile) file; @@ -134,41 +134,46 @@ */ public void run(IAction action) { IEnvironmentManager manager = EnvironmentManager.getInstance(); - IEnvironment env = manager.getEnvironmentByDrive(getSelectionRoot()); - ImakerProperties run = env.getRunProperties(); - - if(env!=null&&!run.isUsed()) { - MessageDialog.openInformation(shell, "Unable To Launch iMaker", "The selection cannot be launched, and there are no recent " + - "launches.\n Create new lauch using Open iMaker Dialog... from the pulldown menu."); + if(selectedResource instanceof IFile) { + IFile file = (IFile) selectedResource; + if(file.getFileExtension().endsWith("imp")) { + runImpFile(file.getLocation().toFile()); + } } else { - executeProperties(run); + if (manager.getLastRun()!=null) { + runImpFile(manager.getLastRun()); + } else { + MessageDialog.openInformation(shell, "Unable To Launch iMaker", "The selection cannot be launched, please select an iMaker file (.imp) " + + "or\n create new lauch using Open iMaker Dialog action... from the pulldown menu."); + } } } + private void runImpFile(File file) { + IEnvironmentManager manager = EnvironmentManager.getInstance(); + manager.setLastRun(file); + List imaker = IMakerUtils.getImakerTool(getSelectionRoot()); + IIMakerWrapper wrapper = new IMakerWrapper(imaker); + IMakerJob job = new IMakerJob("Creating image", file ,wrapper); + job.setPriority(Job.LONG); + job.setRule(IMakerPlugin.getDefault().getImakerRule()); + job.schedule(); + } + public void selectionChanged(IAction action, ISelection selection) { if(selection instanceof IStructuredSelection) { IStructuredSelection ss = (IStructuredSelection) selection; Object elem = ss.getFirstElement(); if(elem instanceof IResource) { - selectedProject = ((IResource)elem).getProject(); + selectedResource = ((IResource)elem).getProject(); } } else { - selectedProject = null; + selectedResource = null; } } - private void initializeAndRunImaker(List command) { - String root = getSelectionRoot(); - List imaker = IMakerUtils.getImakerTool(root); - IIMakerWrapper wrapper = new IMakerWrapper(imaker); - IMakerJob job = new IMakerJob("Creating image", command,wrapper); - job.setPriority(Job.LONG); - job.setRule(IMakerPlugin.getDefault().getImakerRule()); - job.schedule(); - } - private String getSelectionRoot() { - return IMakerUtils.getProjectRootLocation(selectedProject); + return IMakerUtils.getProjectRootLocation(selectedResource); } /** @@ -183,8 +188,8 @@ public void widgetSelected(SelectionEvent e) { MenuItem selection = (MenuItem)e.widget; if(selection==openDialogItem) { - try { - ProjectManager projectManager = new ProjectManager(selectedProject); + try { + ProjectManager projectManager = new ProjectManager(selectedResource.getProject()); IEnvironmentManager manager = IMakerPlugin.getEnvironmentManager(); manager.setActiveEnvironment(getSelectionRoot()); @@ -211,30 +216,24 @@ ImakerProperties run = manager.getActiveEnvironment().getRunProperties(); if(!path.equals(ProjectManager.NEW_ITEM)) { IFile file = (IFile)projectManager.getImakerFile(new Path(path)); - ImakerProperties prop = ImakerProperties.createFromFile(file); - run.clear(); - run.putAll(prop); + runImpFile(file.getLocation().toFile()); + } else { + try { + File file = File.createTempFile("temp", ".imp"); + run.saveToFile(file); + runImpFile(file); + } catch (IOException e1) { + e1.printStackTrace(); + } } - executeProperties(run); - run.setUsed(true); } } catch(NullPointerException ne) { ne.printStackTrace(); } } else { IFile file = (IFile) selection.getData(); - if(file!=null) { - ImakerProperties props = ImakerProperties.createFromFile(file); - executeProperties(props); - } + runImpFile(file.getLocation().toFile()); } - } } - private void executeProperties(ImakerProperties prop) { - String tempDirectory = System.getProperty("java.io.tmpdir"); - String target = tempDirectory+ImakerProperties.GENERATED_FILES_FOLDER; - List command = prop.parseImakerCommand(selectedProject, new Path(target)); - initializeAndRunImaker(command); - } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/console/IMakerJob.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/console/IMakerJob.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/console/IMakerJob.java Mon Jan 25 12:26:21 2010 +0200 @@ -22,7 +22,6 @@ import java.io.IOException; import java.io.PipedInputStream; import java.io.PipedOutputStream; -import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -48,7 +47,7 @@ import com.nokia.s60tools.imaker.exceptions.IMakerCoreNotFoundException; public class IMakerJob extends Job { - private List command; + private File file; public volatile boolean done = false; private IIMakerWrapper wrapper; private String epocroot; @@ -62,9 +61,9 @@ public static final Pattern VARIABLE_PATTERN1 = Pattern.compile(".*\\s*=\\s*.([\\\\/].*)."); public static final Pattern VARIABLE_PATTERN2 = Pattern.compile(".*\\s*=\\s*.(.:.*)."); - public IMakerJob(String name, List cmd, IIMakerWrapper wrapper) { + public IMakerJob(String name, File file, IIMakerWrapper wrapper) { super(name); - this.command = cmd; + this.file = file; this.wrapper = wrapper; this.epocroot = IMakerUtils.getLocationDrive(wrapper.getTool().get(0)); } @@ -80,7 +79,7 @@ //print command infoStream.println(BUILD_START_MESSAGE); infoStream.print(BUILD_CMD); - infoStream.println(wrapper.getBuildCommand(command)); + infoStream.println(wrapper.getBuildCommand(file)); try { PipedInputStream pin = new PipedInputStream(); @@ -88,9 +87,9 @@ IMakerConsoleLogger logger = new IMakerConsoleLogger(pin); logger.start(); - + boolean success = false; - success = wrapper.buildImage(command,pout); + success = wrapper.buildImage(file,pout); // Stop the thread. logger.done = true; diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/Comment.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/Comment.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,64 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + + +/** + * + * A representation of the model object 'Comment'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.Comment#getComment Comment}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getComment() + * @model + * @generated + */ +public interface Comment extends LineNumberContainer { + /** + * Returns the value of the 'Comment' attribute. + * + *

+ * If the meaning of the 'Comment' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Comment' attribute. + * @see #setComment(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getComment_Comment() + * @model + * @generated + */ + String getComment(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.Comment#getComment Comment}' attribute. + * + * + * @param value the new value of the 'Comment' attribute. + * @see #getComment() + * @generated + */ + void setComment(String value); + +} // Comment diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/CommentContainer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/CommentContainer.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,57 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Comment Container'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer#getComments Comments}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getCommentContainer() + * @model interface="true" abstract="true" + * @generated + */ +public interface CommentContainer extends EObject { + /** + * Returns the value of the 'Comments' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.Comment}. + * + *

+ * If the meaning of the 'Comments' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Comments' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getCommentContainer_Comments() + * @model containment="true" + * @generated + */ + EList getComments(); + +} // CommentContainer diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ConfigEntry.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ConfigEntry.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,118 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + + +/** + * + * A representation of the model object 'Config Entry'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getTarget Target}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getAction Action}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getLocation Location}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getConfigEntry() + * @model + * @generated + */ +public interface ConfigEntry extends LineNumberContainer { + /** + * Returns the value of the 'Target' attribute. + * + *

+ * If the meaning of the 'Target' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Target' attribute. + * @see #setTarget(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getConfigEntry_Target() + * @model + * @generated + */ + String getTarget(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getTarget Target}' attribute. + * + * + * @param value the new value of the 'Target' attribute. + * @see #getTarget() + * @generated + */ + void setTarget(String value); + + /** + * Returns the value of the 'Action' attribute. + * + *

+ * If the meaning of the 'Action' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Action' attribute. + * @see #setAction(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getConfigEntry_Action() + * @model + * @generated + */ + String getAction(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getAction Action}' attribute. + * + * + * @param value the new value of the 'Action' attribute. + * @see #getAction() + * @generated + */ + void setAction(String value); + + /** + * Returns the value of the 'Location' attribute. + * + *

+ * If the meaning of the 'Location' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Location' attribute. + * @see #setLocation(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getConfigEntry_Location() + * @model + * @generated + */ + String getLocation(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getLocation Location}' attribute. + * + * + * @param value the new value of the 'Location' attribute. + * @see #getLocation() + * @generated + */ + void setLocation(String value); + +} // ConfigEntry diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/FileListEntry.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/FileListEntry.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,110 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.common.util.EList; + + +/** + * + * A representation of the model object 'File List Entry'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getSource Source}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getTarget Target}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getActions Actions}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getFileListEntry() + * @model + * @generated + */ +public interface FileListEntry extends LineNumberContainer { + /** + * Returns the value of the 'Source' attribute. + * + *

+ * If the meaning of the 'Source' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Source' attribute. + * @see #setSource(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getFileListEntry_Source() + * @model + * @generated + */ + String getSource(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getSource Source}' attribute. + * + * + * @param value the new value of the 'Source' attribute. + * @see #getSource() + * @generated + */ + void setSource(String value); + + /** + * Returns the value of the 'Target' attribute. + * + *

+ * If the meaning of the 'Target' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Target' attribute. + * @see #setTarget(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getFileListEntry_Target() + * @model + * @generated + */ + String getTarget(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getTarget Target}' attribute. + * + * + * @param value the new value of the 'Target' attribute. + * @see #getTarget() + * @generated + */ + void setTarget(String value); + + /** + * Returns the value of the 'Actions' reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry}. + * + *

+ * If the meaning of the 'Actions' reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Actions' reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getFileListEntry_Actions() + * @model + * @generated + */ + EList getActions(); + +} // FileListEntry diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpConstants.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpConstants.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,47 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +public class ImpConstants { + public static final String FILE_ENCODING = "UTF-8"; + public static final String DEFINE_END = "endef"; + + public static final String COMMENT_START = "#"; + public static final String VARIABLE_SEPARATOR = "="; + + public static final String ENTRY_SEPARATOR = " "; + + + public static final String ORIDEFILES_START = "define IMAGE_ORIDEFILES"; + public static final String ORIDECONF_START = "define IMAGE_ORIDECONF"; + + public static final String LINE_SPLITTER = "\\"; + + + //basic variable names + public static final String TARGET_PRODUCT = "TARGET_PRODUCT"; + public static final String DEFAULT_GOALS = "DEFAULT_GOALS"; + public static final String TYPE = "TYPE"; + public static final String VERBOSE = "VERBOSE"; + public static final String BLDROPT = "BLDROPT"; + public static final String USE_SYMGEN = "USE_SYMGEN"; + + //platsim variables + public static final String PLATSIM_RUN = "RUN_PLATSIM"; + public static final String PLATSIM_INSTANCE = "PLATSIM_INSTANCE"; +} diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpDocument.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpDocument.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,97 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Imp Document'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideFiles Oride Files}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideConfs Oride Confs}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getVariables Variables}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getImpDocument() + * @model + * @generated + */ +public interface ImpDocument extends CommentContainer { + /** + * Returns the value of the 'Oride Files' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles}. + * + *

+ * If the meaning of the 'Oride Files' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Oride Files' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getImpDocument_OrideFiles() + * @model containment="true" + * @generated + */ + EList getOrideFiles(); + + /** + * Returns the value of the 'Oride Confs' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration}. + * + *

+ * If the meaning of the 'Oride Confs' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Oride Confs' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getImpDocument_OrideConfs() + * @model containment="true" + * @generated + */ + EList getOrideConfs(); + + /** + * Returns the value of the 'Variables' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.Variable}. + * + *

+ * If the meaning of the 'Variables' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Variables' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getImpDocument_Variables() + * @model containment="true" + * @generated + */ + EList getVariables(); + + /** + * + * + * @model + * @generated + */ + Variable getVariable(String name); + +} // ImpDocument diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpmodelFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpmodelFactory.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,111 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage + * @generated + */ +public interface ImpmodelFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + ImpmodelFactory eINSTANCE = com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelFactoryImpl.init(); + + /** + * Returns a new object of class 'Imp Document'. + * + * + * @return a new object of class 'Imp Document'. + * @generated + */ + ImpDocument createImpDocument(); + + /** + * Returns a new object of class 'Override Files'. + * + * + * @return a new object of class 'Override Files'. + * @generated + */ + OverrideFiles createOverrideFiles(); + + /** + * Returns a new object of class 'Override Configuration'. + * + * + * @return a new object of class 'Override Configuration'. + * @generated + */ + OverrideConfiguration createOverrideConfiguration(); + + /** + * Returns a new object of class 'File List Entry'. + * + * + * @return a new object of class 'File List Entry'. + * @generated + */ + FileListEntry createFileListEntry(); + + /** + * Returns a new object of class 'Config Entry'. + * + * + * @return a new object of class 'Config Entry'. + * @generated + */ + ConfigEntry createConfigEntry(); + + /** + * Returns a new object of class 'Variable'. + * + * + * @return a new object of class 'Variable'. + * @generated + */ + Variable createVariable(); + + /** + * Returns a new object of class 'Comment'. + * + * + * @return a new object of class 'Comment'. + * @generated + */ + Comment createComment(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + ImpmodelPackage getImpmodelPackage(); + +} //ImpmodelFactory diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpmodelPackage.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/ImpmodelPackage.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,978 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory + * @model kind="package" + * @generated + */ +public interface ImpmodelPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "impmodel"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "http://www.s60.com/xml/imp/1"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "imp"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + ImpmodelPackage eINSTANCE = com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl.init(); + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer Comment Container}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.CommentContainer + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getCommentContainer() + * @generated + */ + int COMMENT_CONTAINER = 8; + + /** + * The feature id for the 'Comments' containment reference list. + * + * + * @generated + * @ordered + */ + int COMMENT_CONTAINER__COMMENTS = 0; + + /** + * The number of structural features of the 'Comment Container' class. + * + * + * @generated + * @ordered + */ + int COMMENT_CONTAINER_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl Imp Document}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getImpDocument() + * @generated + */ + int IMP_DOCUMENT = 0; + + /** + * The feature id for the 'Comments' containment reference list. + * + * + * @generated + * @ordered + */ + int IMP_DOCUMENT__COMMENTS = COMMENT_CONTAINER__COMMENTS; + + /** + * The feature id for the 'Oride Files' containment reference list. + * + * + * @generated + * @ordered + */ + int IMP_DOCUMENT__ORIDE_FILES = COMMENT_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Oride Confs' containment reference list. + * + * + * @generated + * @ordered + */ + int IMP_DOCUMENT__ORIDE_CONFS = COMMENT_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Variables' containment reference list. + * + * + * @generated + * @ordered + */ + int IMP_DOCUMENT__VARIABLES = COMMENT_CONTAINER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Imp Document' class. + * + * + * @generated + * @ordered + */ + int IMP_DOCUMENT_FEATURE_COUNT = COMMENT_CONTAINER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer Line Number Container}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getLineNumberContainer() + * @generated + */ + int LINE_NUMBER_CONTAINER = 6; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int LINE_NUMBER_CONTAINER__LINE_NUMBER = 0; + + /** + * The number of structural features of the 'Line Number Container' class. + * + * + * @generated + * @ordered + */ + int LINE_NUMBER_CONTAINER_FEATURE_COUNT = 1; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl Override Files}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getOverrideFiles() + * @generated + */ + int OVERRIDE_FILES = 1; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int OVERRIDE_FILES__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Comments' containment reference list. + * + * + * @generated + * @ordered + */ + int OVERRIDE_FILES__COMMENTS = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Entries' containment reference list. + * + * + * @generated + * @ordered + */ + int OVERRIDE_FILES__ENTRIES = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Override Files' class. + * + * + * @generated + * @ordered + */ + int OVERRIDE_FILES_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl Override Configuration}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getOverrideConfiguration() + * @generated + */ + int OVERRIDE_CONFIGURATION = 2; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int OVERRIDE_CONFIGURATION__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Comments' containment reference list. + * + * + * @generated + * @ordered + */ + int OVERRIDE_CONFIGURATION__COMMENTS = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Entries' containment reference list. + * + * + * @generated + * @ordered + */ + int OVERRIDE_CONFIGURATION__ENTRIES = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Override Configuration' class. + * + * + * @generated + * @ordered + */ + int OVERRIDE_CONFIGURATION_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl File List Entry}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getFileListEntry() + * @generated + */ + int FILE_LIST_ENTRY = 3; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int FILE_LIST_ENTRY__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Source' attribute. + * + * + * @generated + * @ordered + */ + int FILE_LIST_ENTRY__SOURCE = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Target' attribute. + * + * + * @generated + * @ordered + */ + int FILE_LIST_ENTRY__TARGET = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Actions' reference list. + * + * + * @generated + * @ordered + */ + int FILE_LIST_ENTRY__ACTIONS = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'File List Entry' class. + * + * + * @generated + * @ordered + */ + int FILE_LIST_ENTRY_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl Config Entry}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getConfigEntry() + * @generated + */ + int CONFIG_ENTRY = 4; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int CONFIG_ENTRY__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Target' attribute. + * + * + * @generated + * @ordered + */ + int CONFIG_ENTRY__TARGET = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Action' attribute. + * + * + * @generated + * @ordered + */ + int CONFIG_ENTRY__ACTION = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * The feature id for the 'Location' attribute. + * + * + * @generated + * @ordered + */ + int CONFIG_ENTRY__LOCATION = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 2; + + /** + * The number of structural features of the 'Config Entry' class. + * + * + * @generated + * @ordered + */ + int CONFIG_ENTRY_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 3; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl Variable}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getVariable() + * @generated + */ + int VARIABLE = 5; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int VARIABLE__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int VARIABLE__NAME = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Value' attribute. + * + * + * @generated + * @ordered + */ + int VARIABLE__VALUE = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Variable' class. + * + * + * @generated + * @ordered + */ + int VARIABLE_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 2; + + /** + * The meta object id for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl Comment}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getComment() + * @generated + */ + int COMMENT = 7; + + /** + * The feature id for the 'Line Number' attribute. + * + * + * @generated + * @ordered + */ + int COMMENT__LINE_NUMBER = LINE_NUMBER_CONTAINER__LINE_NUMBER; + + /** + * The feature id for the 'Comment' attribute. + * + * + * @generated + * @ordered + */ + int COMMENT__COMMENT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 0; + + /** + * The number of structural features of the 'Comment' class. + * + * + * @generated + * @ordered + */ + int COMMENT_FEATURE_COUNT = LINE_NUMBER_CONTAINER_FEATURE_COUNT + 1; + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument Imp Document}'. + * + * + * @return the meta object for class 'Imp Document'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument + * @generated + */ + EClass getImpDocument(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideFiles Oride Files}'. + * + * + * @return the meta object for the containment reference list 'Oride Files'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideFiles() + * @see #getImpDocument() + * @generated + */ + EReference getImpDocument_OrideFiles(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideConfs Oride Confs}'. + * + * + * @return the meta object for the containment reference list 'Oride Confs'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getOrideConfs() + * @see #getImpDocument() + * @generated + */ + EReference getImpDocument_OrideConfs(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getVariables Variables}'. + * + * + * @return the meta object for the containment reference list 'Variables'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument#getVariables() + * @see #getImpDocument() + * @generated + */ + EReference getImpDocument_Variables(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles Override Files}'. + * + * + * @return the meta object for class 'Override Files'. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles + * @generated + */ + EClass getOverrideFiles(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles#getEntries Entries}'. + * + * + * @return the meta object for the containment reference list 'Entries'. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles#getEntries() + * @see #getOverrideFiles() + * @generated + */ + EReference getOverrideFiles_Entries(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration Override Configuration}'. + * + * + * @return the meta object for class 'Override Configuration'. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration + * @generated + */ + EClass getOverrideConfiguration(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration#getEntries Entries}'. + * + * + * @return the meta object for the containment reference list 'Entries'. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration#getEntries() + * @see #getOverrideConfiguration() + * @generated + */ + EReference getOverrideConfiguration_Entries(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry File List Entry}'. + * + * + * @return the meta object for class 'File List Entry'. + * @see com.nokia.s60tools.imaker.internal.impmodel.FileListEntry + * @generated + */ + EClass getFileListEntry(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getSource Source}'. + * + * + * @return the meta object for the attribute 'Source'. + * @see com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getSource() + * @see #getFileListEntry() + * @generated + */ + EAttribute getFileListEntry_Source(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getTarget Target}'. + * + * + * @return the meta object for the attribute 'Target'. + * @see com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getTarget() + * @see #getFileListEntry() + * @generated + */ + EAttribute getFileListEntry_Target(); + + /** + * Returns the meta object for the reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getActions Actions}'. + * + * + * @return the meta object for the reference list 'Actions'. + * @see com.nokia.s60tools.imaker.internal.impmodel.FileListEntry#getActions() + * @see #getFileListEntry() + * @generated + */ + EReference getFileListEntry_Actions(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry Config Entry}'. + * + * + * @return the meta object for class 'Config Entry'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry + * @generated + */ + EClass getConfigEntry(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getTarget Target}'. + * + * + * @return the meta object for the attribute 'Target'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getTarget() + * @see #getConfigEntry() + * @generated + */ + EAttribute getConfigEntry_Target(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getAction Action}'. + * + * + * @return the meta object for the attribute 'Action'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getAction() + * @see #getConfigEntry() + * @generated + */ + EAttribute getConfigEntry_Action(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getLocation Location}'. + * + * + * @return the meta object for the attribute 'Location'. + * @see com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry#getLocation() + * @see #getConfigEntry() + * @generated + */ + EAttribute getConfigEntry_Location(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable Variable}'. + * + * + * @return the meta object for class 'Variable'. + * @see com.nokia.s60tools.imaker.internal.impmodel.Variable + * @generated + */ + EClass getVariable(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see com.nokia.s60tools.imaker.internal.impmodel.Variable#getName() + * @see #getVariable() + * @generated + */ + EAttribute getVariable_Name(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getValue Value}'. + * + * + * @return the meta object for the attribute 'Value'. + * @see com.nokia.s60tools.imaker.internal.impmodel.Variable#getValue() + * @see #getVariable() + * @generated + */ + EAttribute getVariable_Value(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer Line Number Container}'. + * + * + * @return the meta object for class 'Line Number Container'. + * @see com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer + * @generated + */ + EClass getLineNumberContainer(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer#getLineNumber Line Number}'. + * + * + * @return the meta object for the attribute 'Line Number'. + * @see com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer#getLineNumber() + * @see #getLineNumberContainer() + * @generated + */ + EAttribute getLineNumberContainer_LineNumber(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.Comment Comment}'. + * + * + * @return the meta object for class 'Comment'. + * @see com.nokia.s60tools.imaker.internal.impmodel.Comment + * @generated + */ + EClass getComment(); + + /** + * Returns the meta object for the attribute '{@link com.nokia.s60tools.imaker.internal.impmodel.Comment#getComment Comment}'. + * + * + * @return the meta object for the attribute 'Comment'. + * @see com.nokia.s60tools.imaker.internal.impmodel.Comment#getComment() + * @see #getComment() + * @generated + */ + EAttribute getComment_Comment(); + + /** + * Returns the meta object for class '{@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer Comment Container}'. + * + * + * @return the meta object for class 'Comment Container'. + * @see com.nokia.s60tools.imaker.internal.impmodel.CommentContainer + * @generated + */ + EClass getCommentContainer(); + + /** + * Returns the meta object for the containment reference list '{@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer#getComments Comments}'. + * + * + * @return the meta object for the containment reference list 'Comments'. + * @see com.nokia.s60tools.imaker.internal.impmodel.CommentContainer#getComments() + * @see #getCommentContainer() + * @generated + */ + EReference getCommentContainer_Comments(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + ImpmodelFactory getImpmodelFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl Imp Document}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getImpDocument() + * @generated + */ + EClass IMP_DOCUMENT = eINSTANCE.getImpDocument(); + + /** + * The meta object literal for the 'Oride Files' containment reference list feature. + * + * + * @generated + */ + EReference IMP_DOCUMENT__ORIDE_FILES = eINSTANCE.getImpDocument_OrideFiles(); + + /** + * The meta object literal for the 'Oride Confs' containment reference list feature. + * + * + * @generated + */ + EReference IMP_DOCUMENT__ORIDE_CONFS = eINSTANCE.getImpDocument_OrideConfs(); + + /** + * The meta object literal for the 'Variables' containment reference list feature. + * + * + * @generated + */ + EReference IMP_DOCUMENT__VARIABLES = eINSTANCE.getImpDocument_Variables(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl Override Files}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getOverrideFiles() + * @generated + */ + EClass OVERRIDE_FILES = eINSTANCE.getOverrideFiles(); + + /** + * The meta object literal for the 'Entries' containment reference list feature. + * + * + * @generated + */ + EReference OVERRIDE_FILES__ENTRIES = eINSTANCE.getOverrideFiles_Entries(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl Override Configuration}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getOverrideConfiguration() + * @generated + */ + EClass OVERRIDE_CONFIGURATION = eINSTANCE.getOverrideConfiguration(); + + /** + * The meta object literal for the 'Entries' containment reference list feature. + * + * + * @generated + */ + EReference OVERRIDE_CONFIGURATION__ENTRIES = eINSTANCE.getOverrideConfiguration_Entries(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl File List Entry}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getFileListEntry() + * @generated + */ + EClass FILE_LIST_ENTRY = eINSTANCE.getFileListEntry(); + + /** + * The meta object literal for the 'Source' attribute feature. + * + * + * @generated + */ + EAttribute FILE_LIST_ENTRY__SOURCE = eINSTANCE.getFileListEntry_Source(); + + /** + * The meta object literal for the 'Target' attribute feature. + * + * + * @generated + */ + EAttribute FILE_LIST_ENTRY__TARGET = eINSTANCE.getFileListEntry_Target(); + + /** + * The meta object literal for the 'Actions' reference list feature. + * + * + * @generated + */ + EReference FILE_LIST_ENTRY__ACTIONS = eINSTANCE.getFileListEntry_Actions(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl Config Entry}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getConfigEntry() + * @generated + */ + EClass CONFIG_ENTRY = eINSTANCE.getConfigEntry(); + + /** + * The meta object literal for the 'Target' attribute feature. + * + * + * @generated + */ + EAttribute CONFIG_ENTRY__TARGET = eINSTANCE.getConfigEntry_Target(); + + /** + * The meta object literal for the 'Action' attribute feature. + * + * + * @generated + */ + EAttribute CONFIG_ENTRY__ACTION = eINSTANCE.getConfigEntry_Action(); + + /** + * The meta object literal for the 'Location' attribute feature. + * + * + * @generated + */ + EAttribute CONFIG_ENTRY__LOCATION = eINSTANCE.getConfigEntry_Location(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl Variable}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getVariable() + * @generated + */ + EClass VARIABLE = eINSTANCE.getVariable(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute VARIABLE__NAME = eINSTANCE.getVariable_Name(); + + /** + * The meta object literal for the 'Value' attribute feature. + * + * + * @generated + */ + EAttribute VARIABLE__VALUE = eINSTANCE.getVariable_Value(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer Line Number Container}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getLineNumberContainer() + * @generated + */ + EClass LINE_NUMBER_CONTAINER = eINSTANCE.getLineNumberContainer(); + + /** + * The meta object literal for the 'Line Number' attribute feature. + * + * + * @generated + */ + EAttribute LINE_NUMBER_CONTAINER__LINE_NUMBER = eINSTANCE.getLineNumberContainer_LineNumber(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl Comment}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getComment() + * @generated + */ + EClass COMMENT = eINSTANCE.getComment(); + + /** + * The meta object literal for the 'Comment' attribute feature. + * + * + * @generated + */ + EAttribute COMMENT__COMMENT = eINSTANCE.getComment_Comment(); + + /** + * The meta object literal for the '{@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer Comment Container}' class. + * + * + * @see com.nokia.s60tools.imaker.internal.impmodel.CommentContainer + * @see com.nokia.s60tools.imaker.internal.impmodel.impl.ImpmodelPackageImpl#getCommentContainer() + * @generated + */ + EClass COMMENT_CONTAINER = eINSTANCE.getCommentContainer(); + + /** + * The meta object literal for the 'Comments' containment reference list feature. + * + * + * @generated + */ + EReference COMMENT_CONTAINER__COMMENTS = eINSTANCE.getCommentContainer_Comments(); + + } + +} //ImpmodelPackage diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/LineNumberContainer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/LineNumberContainer.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,65 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Line Number Container'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer#getLineNumber Line Number}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getLineNumberContainer() + * @model interface="true" abstract="true" + * @generated + */ +public interface LineNumberContainer extends EObject { + /** + * Returns the value of the 'Line Number' attribute. + * + *

+ * If the meaning of the 'Line Number' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Line Number' attribute. + * @see #setLineNumber(int) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getLineNumberContainer_LineNumber() + * @model + * @generated + */ + int getLineNumber(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer#getLineNumber Line Number}' attribute. + * + * + * @param value the new value of the 'Line Number' attribute. + * @see #getLineNumber() + * @generated + */ + void setLineNumber(int value); + +} // LineNumberContainer diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/OverrideConfiguration.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/OverrideConfiguration.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Override Configuration'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration#getEntries Entries}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getOverrideConfiguration() + * @model + * @generated + */ +public interface OverrideConfiguration extends LineNumberContainer, CommentContainer { + /** + * Returns the value of the 'Entries' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry}. + * + *

+ * If the meaning of the 'Entries' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Entries' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getOverrideConfiguration_Entries() + * @model containment="true" + * @generated + */ + EList getEntries(); + +} // OverrideConfiguration diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/OverrideFiles.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/OverrideFiles.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,55 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel; + +import org.eclipse.emf.common.util.EList; + +/** + * + * A representation of the model object 'Override Files'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles#getEntries Entries}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getOverrideFiles() + * @model + * @generated + */ +public interface OverrideFiles extends LineNumberContainer, CommentContainer { + /** + * Returns the value of the 'Entries' containment reference list. + * The list contents are of type {@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry}. + * + *

+ * If the meaning of the 'Entries' containment reference list isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Entries' containment reference list. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getOverrideFiles_Entries() + * @model containment="true" + * @generated + */ + EList getEntries(); + +} // OverrideFiles diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/Variable.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/Variable.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +package com.nokia.s60tools.imaker.internal.impmodel; + + +/** + * + * A representation of the model object 'Variable'. + * + * + *

+ * The following features are supported: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getName Name}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getValue Value}
  • + *
+ *

+ * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getVariable() + * @model + * @generated + */ +public interface Variable extends LineNumberContainer { + /** + * Returns the value of the 'Name' attribute. + * + *

+ * If the meaning of the 'Name' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getVariable_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Value' attribute. + * + *

+ * If the meaning of the 'Value' attribute isn't clear, + * there really should be more of a description here... + *

+ * + * @return the value of the 'Value' attribute. + * @see #setValue(String) + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#getVariable_Value() + * @model + * @generated + */ + String getValue(); + + /** + * Sets the value of the '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable#getValue Value}' attribute. + * + * + * @param value the new value of the 'Value' attribute. + * @see #getValue() + * @generated + */ + void setValue(String value); + +} // Variable diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/CommentImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/CommentImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,229 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Comment'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.CommentImpl#getComment Comment}
  • + *
+ *

+ * + * @generated + */ +public class CommentImpl extends EObjectImpl implements Comment { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The default value of the '{@link #getComment() Comment}' attribute. + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected static final String COMMENT_EDEFAULT = null; + + /** + * The cached value of the '{@link #getComment() Comment}' attribute. + * + * + * @see #getComment() + * @generated + * @ordered + */ + protected String comment = COMMENT_EDEFAULT; + + /** + * + * + * @generated + */ + protected CommentImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.COMMENT; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.COMMENT__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public String getComment() { + return comment; + } + + /** + * + * + * @generated + */ + public void setComment(String newComment) { + String oldComment = comment; + comment = newComment; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.COMMENT__COMMENT, oldComment, comment)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.COMMENT__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.COMMENT__COMMENT: + return getComment(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.COMMENT__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.COMMENT__COMMENT: + setComment((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.COMMENT__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.COMMENT__COMMENT: + setComment(COMMENT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.COMMENT__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.COMMENT__COMMENT: + return COMMENT_EDEFAULT == null ? comment != null : !COMMENT_EDEFAULT.equals(comment); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append("#"); + result.append(comment); + return result.toString(); + } + +} //CommentImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ConfigEntryImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ConfigEntryImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,334 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; + +/** + * + * An implementation of the model object 'Config Entry'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl#getTarget Target}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl#getAction Action}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ConfigEntryImpl#getLocation Location}
  • + *
+ *

+ * + * @generated + */ +public class ConfigEntryImpl extends EObjectImpl implements ConfigEntry { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The default value of the '{@link #getTarget() Target}' attribute. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected static final String TARGET_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTarget() Target}' attribute. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected String target = TARGET_EDEFAULT; + + /** + * The default value of the '{@link #getAction() Action}' attribute. + * + * + * @see #getAction() + * @generated + * @ordered + */ + protected static final String ACTION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getAction() Action}' attribute. + * + * + * @see #getAction() + * @generated + * @ordered + */ + protected String action = ACTION_EDEFAULT; + + /** + * The default value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected static final String LOCATION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLocation() Location}' attribute. + * + * + * @see #getLocation() + * @generated + * @ordered + */ + protected String location = LOCATION_EDEFAULT; + + /** + * + * + * @generated + */ + protected ConfigEntryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.CONFIG_ENTRY; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.CONFIG_ENTRY__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public String getTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(String newTarget) { + String oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.CONFIG_ENTRY__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + public String getAction() { + return action; + } + + /** + * + * + * @generated + */ + public void setAction(String newAction) { + String oldAction = action; + action = newAction; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.CONFIG_ENTRY__ACTION, oldAction, action)); + } + + /** + * + * + * @generated + */ + public String getLocation() { + return location; + } + + /** + * + * + * @generated + */ + public void setLocation(String newLocation) { + String oldLocation = location; + location = newLocation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.CONFIG_ENTRY__LOCATION, oldLocation, location)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.CONFIG_ENTRY__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.CONFIG_ENTRY__TARGET: + return getTarget(); + case ImpmodelPackage.CONFIG_ENTRY__ACTION: + return getAction(); + case ImpmodelPackage.CONFIG_ENTRY__LOCATION: + return getLocation(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.CONFIG_ENTRY__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.CONFIG_ENTRY__TARGET: + setTarget((String)newValue); + return; + case ImpmodelPackage.CONFIG_ENTRY__ACTION: + setAction((String)newValue); + return; + case ImpmodelPackage.CONFIG_ENTRY__LOCATION: + setLocation((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.CONFIG_ENTRY__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.CONFIG_ENTRY__TARGET: + setTarget(TARGET_EDEFAULT); + return; + case ImpmodelPackage.CONFIG_ENTRY__ACTION: + setAction(ACTION_EDEFAULT); + return; + case ImpmodelPackage.CONFIG_ENTRY__LOCATION: + setLocation(LOCATION_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.CONFIG_ENTRY__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.CONFIG_ENTRY__TARGET: + return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target); + case ImpmodelPackage.CONFIG_ENTRY__ACTION: + return ACTION_EDEFAULT == null ? action != null : !ACTION_EDEFAULT.equals(action); + case ImpmodelPackage.CONFIG_ENTRY__LOCATION: + return LOCATION_EDEFAULT == null ? location != null : !LOCATION_EDEFAULT.equals(location); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append(target); + result.append(" "); + result.append(action); + result.append(" "); + result.append(location); + return result.toString(); + } + +} //ConfigEntryImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/FileListEntryImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/FileListEntryImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,321 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; + +import java.util.Collection; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; + +/** + * + * An implementation of the model object 'File List Entry'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl#getSource Source}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl#getTarget Target}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.FileListEntryImpl#getActions Actions}
  • + *
+ *

+ * + * @generated + */ +public class FileListEntryImpl extends EObjectImpl implements FileListEntry { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The default value of the '{@link #getSource() Source}' attribute. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected static final String SOURCE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSource() Source}' attribute. + * + * + * @see #getSource() + * @generated + * @ordered + */ + protected String source = SOURCE_EDEFAULT; + + /** + * The default value of the '{@link #getTarget() Target}' attribute. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected static final String TARGET_EDEFAULT = null; + + /** + * The cached value of the '{@link #getTarget() Target}' attribute. + * + * + * @see #getTarget() + * @generated + * @ordered + */ + protected String target = TARGET_EDEFAULT; + + /** + * The cached value of the '{@link #getActions() Actions}' reference list. + * + * + * @see #getActions() + * @generated + * @ordered + */ + protected EList actions; + + /** + * + * + * @generated + */ + protected FileListEntryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.FILE_LIST_ENTRY; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.FILE_LIST_ENTRY__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public String getSource() { + return source; + } + + /** + * + * + * @generated + */ + public void setSource(String newSource) { + String oldSource = source; + source = newSource; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.FILE_LIST_ENTRY__SOURCE, oldSource, source)); + } + + /** + * + * + * @generated + */ + public String getTarget() { + return target; + } + + /** + * + * + * @generated + */ + public void setTarget(String newTarget) { + String oldTarget = target; + target = newTarget; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.FILE_LIST_ENTRY__TARGET, oldTarget, target)); + } + + /** + * + * + * @generated + */ + public EList getActions() { + if (actions == null) { + actions = new EObjectResolvingEList(ConfigEntry.class, this, ImpmodelPackage.FILE_LIST_ENTRY__ACTIONS); + } + return actions; + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.FILE_LIST_ENTRY__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.FILE_LIST_ENTRY__SOURCE: + return getSource(); + case ImpmodelPackage.FILE_LIST_ENTRY__TARGET: + return getTarget(); + case ImpmodelPackage.FILE_LIST_ENTRY__ACTIONS: + return getActions(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.FILE_LIST_ENTRY__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__SOURCE: + setSource((String)newValue); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__TARGET: + setTarget((String)newValue); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__ACTIONS: + getActions().clear(); + getActions().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.FILE_LIST_ENTRY__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__SOURCE: + setSource(SOURCE_EDEFAULT); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__TARGET: + setTarget(TARGET_EDEFAULT); + return; + case ImpmodelPackage.FILE_LIST_ENTRY__ACTIONS: + getActions().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.FILE_LIST_ENTRY__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.FILE_LIST_ENTRY__SOURCE: + return SOURCE_EDEFAULT == null ? source != null : !SOURCE_EDEFAULT.equals(source); + case ImpmodelPackage.FILE_LIST_ENTRY__TARGET: + return TARGET_EDEFAULT == null ? target != null : !TARGET_EDEFAULT.equals(target); + case ImpmodelPackage.FILE_LIST_ENTRY__ACTIONS: + return actions != null && !actions.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append(source); + result.append(" "); + result.append(target); + return result.toString(); + } + +} //FileListEntryImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpDocumentImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpDocumentImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,298 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Imp Document'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl#getComments Comments}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl#getOrideFiles Oride Files}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl#getOrideConfs Oride Confs}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.ImpDocumentImpl#getVariables Variables}
  • + *
+ *

+ * + * @generated + */ +public class ImpDocumentImpl extends EObjectImpl implements ImpDocument { + /** + * The cached value of the '{@link #getComments() Comments}' containment reference list. + * + * + * @see #getComments() + * @generated + * @ordered + */ + protected EList comments; + + /** + * The cached value of the '{@link #getOrideFiles() Oride Files}' containment reference list. + * + * + * @see #getOrideFiles() + * @generated + * @ordered + */ + protected EList orideFiles; + + /** + * The cached value of the '{@link #getOrideConfs() Oride Confs}' containment reference list. + * + * + * @see #getOrideConfs() + * @generated + * @ordered + */ + protected EList orideConfs; + + /** + * The cached value of the '{@link #getVariables() Variables}' containment reference list. + * + * + * @see #getVariables() + * @generated + * @ordered + */ + protected EList variables; + + /** + * + * + * @generated + */ + protected ImpDocumentImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.IMP_DOCUMENT; + } + + /** + * + * + * @generated + */ + public EList getComments() { + if (comments == null) { + comments = new EObjectContainmentEList(Comment.class, this, ImpmodelPackage.IMP_DOCUMENT__COMMENTS); + } + return comments; + } + + /** + * + * + * @generated + */ + public EList getOrideFiles() { + if (orideFiles == null) { + orideFiles = new EObjectContainmentEList(OverrideFiles.class, this, ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES); + } + return orideFiles; + } + + /** + * + * + * @generated + */ + public EList getOrideConfs() { + if (orideConfs == null) { + orideConfs = new EObjectContainmentEList(OverrideConfiguration.class, this, ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS); + } + return orideConfs; + } + + /** + * + * + * @generated + */ + public EList getVariables() { + if (variables == null) { + variables = new EObjectContainmentEList(Variable.class, this, ImpmodelPackage.IMP_DOCUMENT__VARIABLES); + } + return variables; + } + + /** + * + * + * @generated NOT + */ + public Variable getVariable(String name) { + Variable variable = null; + if(name==null||"".equals(name)) { + return variable; + } + name = name.toLowerCase(); + for (Variable v : getVariables()) { + if(name.equals(v.getName().toLowerCase())) { + variable = v; + break; + } + } + return variable; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ImpmodelPackage.IMP_DOCUMENT__COMMENTS: + return ((InternalEList)getComments()).basicRemove(otherEnd, msgs); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES: + return ((InternalEList)getOrideFiles()).basicRemove(otherEnd, msgs); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS: + return ((InternalEList)getOrideConfs()).basicRemove(otherEnd, msgs); + case ImpmodelPackage.IMP_DOCUMENT__VARIABLES: + return ((InternalEList)getVariables()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.IMP_DOCUMENT__COMMENTS: + return getComments(); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES: + return getOrideFiles(); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS: + return getOrideConfs(); + case ImpmodelPackage.IMP_DOCUMENT__VARIABLES: + return getVariables(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.IMP_DOCUMENT__COMMENTS: + getComments().clear(); + getComments().addAll((Collection)newValue); + return; + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES: + getOrideFiles().clear(); + getOrideFiles().addAll((Collection)newValue); + return; + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS: + getOrideConfs().clear(); + getOrideConfs().addAll((Collection)newValue); + return; + case ImpmodelPackage.IMP_DOCUMENT__VARIABLES: + getVariables().clear(); + getVariables().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.IMP_DOCUMENT__COMMENTS: + getComments().clear(); + return; + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES: + getOrideFiles().clear(); + return; + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS: + getOrideConfs().clear(); + return; + case ImpmodelPackage.IMP_DOCUMENT__VARIABLES: + getVariables().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.IMP_DOCUMENT__COMMENTS: + return comments != null && !comments.isEmpty(); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES: + return orideFiles != null && !orideFiles.isEmpty(); + case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS: + return orideConfs != null && !orideConfs.isEmpty(); + case ImpmodelPackage.IMP_DOCUMENT__VARIABLES: + return variables != null && !variables.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //ImpDocumentImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpmodelFactoryImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpmodelFactoryImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.*; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class ImpmodelFactoryImpl extends EFactoryImpl implements ImpmodelFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static ImpmodelFactory init() { + try { + ImpmodelFactory theImpmodelFactory = (ImpmodelFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.s60.com/xml/imp/1"); + if (theImpmodelFactory != null) { + return theImpmodelFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new ImpmodelFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public ImpmodelFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case ImpmodelPackage.IMP_DOCUMENT: return createImpDocument(); + case ImpmodelPackage.OVERRIDE_FILES: return createOverrideFiles(); + case ImpmodelPackage.OVERRIDE_CONFIGURATION: return createOverrideConfiguration(); + case ImpmodelPackage.FILE_LIST_ENTRY: return createFileListEntry(); + case ImpmodelPackage.CONFIG_ENTRY: return createConfigEntry(); + case ImpmodelPackage.VARIABLE: return createVariable(); + case ImpmodelPackage.COMMENT: return createComment(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public ImpDocument createImpDocument() { + ImpDocumentImpl impDocument = new ImpDocumentImpl(); + return impDocument; + } + + /** + * + * + * @generated + */ + public OverrideFiles createOverrideFiles() { + OverrideFilesImpl overrideFiles = new OverrideFilesImpl(); + return overrideFiles; + } + + /** + * + * + * @generated + */ + public OverrideConfiguration createOverrideConfiguration() { + OverrideConfigurationImpl overrideConfiguration = new OverrideConfigurationImpl(); + return overrideConfiguration; + } + + /** + * + * + * @generated + */ + public FileListEntry createFileListEntry() { + FileListEntryImpl fileListEntry = new FileListEntryImpl(); + return fileListEntry; + } + + /** + * + * + * @generated + */ + public ConfigEntry createConfigEntry() { + ConfigEntryImpl configEntry = new ConfigEntryImpl(); + return configEntry; + } + + /** + * + * + * @generated + */ + public Variable createVariable() { + VariableImpl variable = new VariableImpl(); + return variable; + } + + /** + * + * + * @generated + */ + public Comment createComment() { + CommentImpl comment = new CommentImpl(); + return comment; + } + + /** + * + * + * @generated + */ + public ImpmodelPackage getImpmodelPackage() { + return (ImpmodelPackage)getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static ImpmodelPackage getPackage() { + return ImpmodelPackage.eINSTANCE; + } + +} //ImpmodelFactoryImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpmodelPackageImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/ImpmodelPackageImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,540 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.CommentContainer; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; +import com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class ImpmodelPackageImpl extends EPackageImpl implements ImpmodelPackage { + /** + * + * + * @generated + */ + private EClass impDocumentEClass = null; + + /** + * + * + * @generated + */ + private EClass overrideFilesEClass = null; + + /** + * + * + * @generated + */ + private EClass overrideConfigurationEClass = null; + + /** + * + * + * @generated + */ + private EClass fileListEntryEClass = null; + + /** + * + * + * @generated + */ + private EClass configEntryEClass = null; + + /** + * + * + * @generated + */ + private EClass variableEClass = null; + + /** + * + * + * @generated + */ + private EClass lineNumberContainerEClass = null; + + /** + * + * + * @generated + */ + private EClass commentEClass = null; + + /** + * + * + * @generated + */ + private EClass commentContainerEClass = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage#eNS_URI + * @see #init() + * @generated + */ + private ImpmodelPackageImpl() { + super(eNS_URI, ImpmodelFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link ImpmodelPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static ImpmodelPackage init() { + if (isInited) return (ImpmodelPackage)EPackage.Registry.INSTANCE.getEPackage(ImpmodelPackage.eNS_URI); + + // Obtain or create and register package + ImpmodelPackageImpl theImpmodelPackage = (ImpmodelPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof ImpmodelPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new ImpmodelPackageImpl()); + + isInited = true; + + // Create package meta-data objects + theImpmodelPackage.createPackageContents(); + + // Initialize created meta-data + theImpmodelPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theImpmodelPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(ImpmodelPackage.eNS_URI, theImpmodelPackage); + return theImpmodelPackage; + } + + /** + * + * + * @generated + */ + public EClass getImpDocument() { + return impDocumentEClass; + } + + /** + * + * + * @generated + */ + public EReference getImpDocument_OrideFiles() { + return (EReference)impDocumentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EReference getImpDocument_OrideConfs() { + return (EReference)impDocumentEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getImpDocument_Variables() { + return (EReference)impDocumentEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getOverrideFiles() { + return overrideFilesEClass; + } + + /** + * + * + * @generated + */ + public EReference getOverrideFiles_Entries() { + return (EReference)overrideFilesEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getOverrideConfiguration() { + return overrideConfigurationEClass; + } + + /** + * + * + * @generated + */ + public EReference getOverrideConfiguration_Entries() { + return (EReference)overrideConfigurationEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getFileListEntry() { + return fileListEntryEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getFileListEntry_Source() { + return (EAttribute)fileListEntryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getFileListEntry_Target() { + return (EAttribute)fileListEntryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EReference getFileListEntry_Actions() { + return (EReference)fileListEntryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getConfigEntry() { + return configEntryEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getConfigEntry_Target() { + return (EAttribute)configEntryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getConfigEntry_Action() { + return (EAttribute)configEntryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EAttribute getConfigEntry_Location() { + return (EAttribute)configEntryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + public EClass getVariable() { + return variableEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getVariable_Name() { + return (EAttribute)variableEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getVariable_Value() { + return (EAttribute)variableEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EClass getLineNumberContainer() { + return lineNumberContainerEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getLineNumberContainer_LineNumber() { + return (EAttribute)lineNumberContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getComment() { + return commentEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getComment_Comment() { + return (EAttribute)commentEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getCommentContainer() { + return commentContainerEClass; + } + + /** + * + * + * @generated + */ + public EReference getCommentContainer_Comments() { + return (EReference)commentContainerEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public ImpmodelFactory getImpmodelFactory() { + return (ImpmodelFactory)getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + impDocumentEClass = createEClass(IMP_DOCUMENT); + createEReference(impDocumentEClass, IMP_DOCUMENT__ORIDE_FILES); + createEReference(impDocumentEClass, IMP_DOCUMENT__ORIDE_CONFS); + createEReference(impDocumentEClass, IMP_DOCUMENT__VARIABLES); + + overrideFilesEClass = createEClass(OVERRIDE_FILES); + createEReference(overrideFilesEClass, OVERRIDE_FILES__ENTRIES); + + overrideConfigurationEClass = createEClass(OVERRIDE_CONFIGURATION); + createEReference(overrideConfigurationEClass, OVERRIDE_CONFIGURATION__ENTRIES); + + fileListEntryEClass = createEClass(FILE_LIST_ENTRY); + createEAttribute(fileListEntryEClass, FILE_LIST_ENTRY__SOURCE); + createEAttribute(fileListEntryEClass, FILE_LIST_ENTRY__TARGET); + createEReference(fileListEntryEClass, FILE_LIST_ENTRY__ACTIONS); + + configEntryEClass = createEClass(CONFIG_ENTRY); + createEAttribute(configEntryEClass, CONFIG_ENTRY__TARGET); + createEAttribute(configEntryEClass, CONFIG_ENTRY__ACTION); + createEAttribute(configEntryEClass, CONFIG_ENTRY__LOCATION); + + variableEClass = createEClass(VARIABLE); + createEAttribute(variableEClass, VARIABLE__NAME); + createEAttribute(variableEClass, VARIABLE__VALUE); + + lineNumberContainerEClass = createEClass(LINE_NUMBER_CONTAINER); + createEAttribute(lineNumberContainerEClass, LINE_NUMBER_CONTAINER__LINE_NUMBER); + + commentEClass = createEClass(COMMENT); + createEAttribute(commentEClass, COMMENT__COMMENT); + + commentContainerEClass = createEClass(COMMENT_CONTAINER); + createEReference(commentContainerEClass, COMMENT_CONTAINER__COMMENTS); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + impDocumentEClass.getESuperTypes().add(this.getCommentContainer()); + overrideFilesEClass.getESuperTypes().add(this.getLineNumberContainer()); + overrideFilesEClass.getESuperTypes().add(this.getCommentContainer()); + overrideConfigurationEClass.getESuperTypes().add(this.getLineNumberContainer()); + overrideConfigurationEClass.getESuperTypes().add(this.getCommentContainer()); + fileListEntryEClass.getESuperTypes().add(this.getLineNumberContainer()); + configEntryEClass.getESuperTypes().add(this.getLineNumberContainer()); + variableEClass.getESuperTypes().add(this.getLineNumberContainer()); + commentEClass.getESuperTypes().add(this.getLineNumberContainer()); + + // Initialize classes and features; add operations and parameters + initEClass(impDocumentEClass, ImpDocument.class, "ImpDocument", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getImpDocument_OrideFiles(), this.getOverrideFiles(), null, "orideFiles", null, 0, -1, ImpDocument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getImpDocument_OrideConfs(), this.getOverrideConfiguration(), null, "orideConfs", null, 0, -1, ImpDocument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getImpDocument_Variables(), this.getVariable(), null, "variables", null, 0, -1, ImpDocument.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + EOperation op = addEOperation(impDocumentEClass, this.getVariable(), "getVariable", 0, 1, IS_UNIQUE, IS_ORDERED); + addEParameter(op, ecorePackage.getEString(), "name", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(overrideFilesEClass, OverrideFiles.class, "OverrideFiles", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getOverrideFiles_Entries(), this.getFileListEntry(), null, "entries", null, 0, -1, OverrideFiles.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(overrideConfigurationEClass, OverrideConfiguration.class, "OverrideConfiguration", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getOverrideConfiguration_Entries(), this.getConfigEntry(), null, "entries", null, 0, -1, OverrideConfiguration.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(fileListEntryEClass, FileListEntry.class, "FileListEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getFileListEntry_Source(), ecorePackage.getEString(), "source", null, 0, 1, FileListEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getFileListEntry_Target(), ecorePackage.getEString(), "target", null, 0, 1, FileListEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getFileListEntry_Actions(), this.getConfigEntry(), null, "actions", null, 0, -1, FileListEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(configEntryEClass, ConfigEntry.class, "ConfigEntry", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getConfigEntry_Target(), ecorePackage.getEString(), "target", null, 0, 1, ConfigEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getConfigEntry_Action(), ecorePackage.getEString(), "action", null, 0, 1, ConfigEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getConfigEntry_Location(), ecorePackage.getEString(), "location", null, 0, 1, ConfigEntry.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(variableEClass, Variable.class, "Variable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getVariable_Name(), ecorePackage.getEString(), "name", null, 0, 1, Variable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getVariable_Value(), ecorePackage.getEString(), "value", null, 0, 1, Variable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(lineNumberContainerEClass, LineNumberContainer.class, "LineNumberContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getLineNumberContainer_LineNumber(), ecorePackage.getEInt(), "lineNumber", null, 0, 1, LineNumberContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(commentEClass, Comment.class, "Comment", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getComment_Comment(), ecorePackage.getEString(), "comment", null, 0, 1, Comment.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(commentContainerEClass, CommentContainer.class, "CommentContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCommentContainer_Comments(), this.getComment(), null, "comments", null, 0, -1, CommentContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //ImpmodelPackageImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/OverrideConfigurationImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/OverrideConfigurationImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,308 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.CommentContainer; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpConstants; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; + +/** + * + * An implementation of the model object 'Override Configuration'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl#getComments Comments}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideConfigurationImpl#getEntries Entries}
  • + *
+ *

+ * + * @generated + */ +public class OverrideConfigurationImpl extends EObjectImpl implements OverrideConfiguration { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The cached value of the '{@link #getComments() Comments}' containment reference list. + * + * + * @see #getComments() + * @generated + * @ordered + */ + protected EList comments; + + /** + * The cached value of the '{@link #getEntries() Entries}' containment reference list. + * + * + * @see #getEntries() + * @generated + * @ordered + */ + protected EList entries; + + /** + * + * + * @generated + */ + protected OverrideConfigurationImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.OVERRIDE_CONFIGURATION; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.OVERRIDE_CONFIGURATION__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public EList getComments() { + if (comments == null) { + comments = new EObjectContainmentEList(Comment.class, this, ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS); + } + return comments; + } + + /** + * + * + * @generated + */ + public EList getEntries() { + if (entries == null) { + entries = new EObjectContainmentEList(ConfigEntry.class, this, ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES); + } + return entries; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: + return ((InternalEList)getComments()).basicRemove(otherEnd, msgs); + case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES: + return ((InternalEList)getEntries()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: + return getComments(); + case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES: + return getEntries(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: + getComments().clear(); + getComments().addAll((Collection)newValue); + return; + case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES: + getEntries().clear(); + getEntries().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: + getComments().clear(); + return; + case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES: + getEntries().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: + return comments != null && !comments.isEmpty(); + case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES: + return entries != null && !entries.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == CommentContainer.class) { + switch (derivedFeatureID) { + case ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS: return ImpmodelPackage.COMMENT_CONTAINER__COMMENTS; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == CommentContainer.class) { + switch (baseFeatureID) { + case ImpmodelPackage.COMMENT_CONTAINER__COMMENTS: return ImpmodelPackage.OVERRIDE_CONFIGURATION__COMMENTS; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append(ImpConstants.ORIDECONF_START); + result.append(System.getProperty("line.separator")); + for (ConfigEntry entry : getEntries()) { + result.append(entry.toString()); + result.append(System.getProperty("line.separator")); + } + result.append(ImpConstants.DEFINE_END); + return result.toString(); + } + +} //OverrideConfigurationImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/OverrideFilesImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/OverrideFilesImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,312 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.Comment; +import com.nokia.s60tools.imaker.internal.impmodel.CommentContainer; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpConstants; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Override Files'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl#getComments Comments}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.OverrideFilesImpl#getEntries Entries}
  • + *
+ *

+ * + * @generated + */ +public class OverrideFilesImpl extends EObjectImpl implements OverrideFiles { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The cached value of the '{@link #getComments() Comments}' containment reference list. + * + * + * @see #getComments() + * @generated + * @ordered + */ + protected EList comments; + + /** + * The cached value of the '{@link #getEntries() Entries}' containment reference list. + * + * + * @see #getEntries() + * @generated + * @ordered + */ + protected EList entries; + + /** + * + * + * @generated + */ + protected OverrideFilesImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.OVERRIDE_FILES; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.OVERRIDE_FILES__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public EList getComments() { + if (comments == null) { + comments = new EObjectContainmentEList(Comment.class, this, ImpmodelPackage.OVERRIDE_FILES__COMMENTS); + } + return comments; + } + + /** + * + * + * @generated + */ + public EList getEntries() { + if (entries == null) { + entries = new EObjectContainmentEList(FileListEntry.class, this, ImpmodelPackage.OVERRIDE_FILES__ENTRIES); + } + return entries; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: + return ((InternalEList)getComments()).basicRemove(otherEnd, msgs); + case ImpmodelPackage.OVERRIDE_FILES__ENTRIES: + return ((InternalEList)getEntries()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_FILES__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: + return getComments(); + case ImpmodelPackage.OVERRIDE_FILES__ENTRIES: + return getEntries(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_FILES__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: + getComments().clear(); + getComments().addAll((Collection)newValue); + return; + case ImpmodelPackage.OVERRIDE_FILES__ENTRIES: + getEntries().clear(); + getEntries().addAll((Collection)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_FILES__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: + getComments().clear(); + return; + case ImpmodelPackage.OVERRIDE_FILES__ENTRIES: + getEntries().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.OVERRIDE_FILES__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: + return comments != null && !comments.isEmpty(); + case ImpmodelPackage.OVERRIDE_FILES__ENTRIES: + return entries != null && !entries.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class baseClass) { + if (baseClass == CommentContainer.class) { + switch (derivedFeatureID) { + case ImpmodelPackage.OVERRIDE_FILES__COMMENTS: return ImpmodelPackage.COMMENT_CONTAINER__COMMENTS; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * + * + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class baseClass) { + if (baseClass == CommentContainer.class) { + switch (baseFeatureID) { + case ImpmodelPackage.COMMENT_CONTAINER__COMMENTS: return ImpmodelPackage.OVERRIDE_FILES__COMMENTS; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append(ImpConstants.ORIDEFILES_START); + result.append(System.getProperty("line.separator")); + for (FileListEntry entry : getEntries()) { + result.append(entry.toString()); + result.append(System.getProperty("line.separator")); + } + result.append(ImpConstants.DEFINE_END); + return result.toString(); + } + +} //OverrideFilesImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/VariableImpl.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/impl/VariableImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,282 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.impl; + +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.EObjectImpl; + +/** + * + * An implementation of the model object 'Variable'. + * + *

+ * The following features are implemented: + *

    + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl#getLineNumber Line Number}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl#getName Name}
  • + *
  • {@link com.nokia.s60tools.imaker.internal.impmodel.impl.VariableImpl#getValue Value}
  • + *
+ *

+ * + * @generated + */ +public class VariableImpl extends EObjectImpl implements Variable { + /** + * The default value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected static final int LINE_NUMBER_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getLineNumber() Line Number}' attribute. + * + * + * @see #getLineNumber() + * @generated + * @ordered + */ + protected int lineNumber = LINE_NUMBER_EDEFAULT; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected static final String VALUE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getValue() Value}' attribute. + * + * + * @see #getValue() + * @generated + * @ordered + */ + protected String value = VALUE_EDEFAULT; + + /** + * + * + * @generated + */ + protected VariableImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return ImpmodelPackage.Literals.VARIABLE; + } + + /** + * + * + * @generated + */ + public int getLineNumber() { + return lineNumber; + } + + /** + * + * + * @generated + */ + public void setLineNumber(int newLineNumber) { + int oldLineNumber = lineNumber; + lineNumber = newLineNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.VARIABLE__LINE_NUMBER, oldLineNumber, lineNumber)); + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.VARIABLE__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + public String getValue() { + return value; + } + + /** + * + * + * @generated + */ + public void setValue(String newValue) { + String oldValue = value; + value = newValue; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, ImpmodelPackage.VARIABLE__VALUE, oldValue, value)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case ImpmodelPackage.VARIABLE__LINE_NUMBER: + return getLineNumber(); + case ImpmodelPackage.VARIABLE__NAME: + return getName(); + case ImpmodelPackage.VARIABLE__VALUE: + return getValue(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case ImpmodelPackage.VARIABLE__LINE_NUMBER: + setLineNumber((Integer)newValue); + return; + case ImpmodelPackage.VARIABLE__NAME: + setName((String)newValue); + return; + case ImpmodelPackage.VARIABLE__VALUE: + setValue((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case ImpmodelPackage.VARIABLE__LINE_NUMBER: + setLineNumber(LINE_NUMBER_EDEFAULT); + return; + case ImpmodelPackage.VARIABLE__NAME: + setName(NAME_EDEFAULT); + return; + case ImpmodelPackage.VARIABLE__VALUE: + setValue(VALUE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case ImpmodelPackage.VARIABLE__LINE_NUMBER: + return lineNumber != LINE_NUMBER_EDEFAULT; + case ImpmodelPackage.VARIABLE__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case ImpmodelPackage.VARIABLE__VALUE: + return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(); + result.append(name); + result.append(" = "); + result.append(value); + return result.toString(); + } + +} //VariableImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/BasicTokenizer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/BasicTokenizer.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,146 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.util; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.List; + +@SuppressWarnings("unchecked") +public class BasicTokenizer implements Enumeration { + private String inputString; + private List tokens=null; + private int currentToken = 0; + + public BasicTokenizer(String str) { + if(str==null) { + str = ""; + } + inputString = str.trim(); + inputString = inputString.replaceAll("\\s+", " "); + inputString = inputString.replaceAll("\\s*=\\s*", "="); + tokens = new ArrayList(); + Tokenize(); + } + + private void Tokenize() { + int start = 0; + int end = 0; + while ((start = getStartIndex(start)) options) + throws IOException { + ImpDocument document = factory.createImpDocument(); + //load the contents of the resource here + InputStreamReader isr = new InputStreamReader(inputStream, ImpConstants.FILE_ENCODING); + BufferedReader br = new BufferedReader(isr); + String line = null; + int lineNumber = 0; + boolean breaked = false; + StringBuffer breakedBuilder = new StringBuffer(); + while ((line = br.readLine())!=null) { + ++lineNumber; + if(line.endsWith(ImpConstants.LINE_SPLITTER)) { + breaked = true; + breakedBuilder.append(line.substring(0, line.length()-1)); + continue; + } + if(breaked) { + breakedBuilder.append(line); + line = breakedBuilder.toString(); + breaked = false; + } + if(isComment(line)) { + addComment(document,line.substring(1)).setLineNumber(lineNumber); + } else if(isVariable(line)) { + addVariable(document,line).setLineNumber(lineNumber); + } else if(isOrideFilesStart(line)) { + int startLine = lineNumber; + List entries = new ArrayList(); + while((line = br.readLine())!=null) { + lineNumber++; + if (line.equals(ImpConstants.DEFINE_END)) { + break; + } + entries.add(line); + } + addOrideFiles(document,entries).setLineNumber(startLine); + } else if(isOrideConfsStart(line)) { + int startLine = lineNumber; + List entries = new ArrayList(); + while((line = br.readLine())!=null) { + lineNumber++; + if (line.equals(ImpConstants.DEFINE_END)) { + break; + } + entries.add(line); + } + addOrideConf(document,entries).setLineNumber(startLine); + } else {} + } + connectFilesAndConfigs(document); + getContents().add(document); + } + + private void connectFilesAndConfigs(ImpDocument document) { + EList files = document.getOrideFiles(); + EList confs = document.getOrideConfs(); + if(!files.isEmpty()&&!confs.isEmpty()) { + OverrideFiles of = files.get(0); + OverrideConfiguration oc = confs.get(0); + EList entries = of.getEntries(); + for (FileListEntry fEntry : entries) { + connect(fEntry,oc); + } + } + } + + private void connect(FileListEntry fEntry, OverrideConfiguration oc) { + EList entries = oc.getEntries(); + for (ConfigEntry cEntry : entries) { + if(fEntry.getTarget().endsWith(cEntry.getTarget())) { + fEntry.getActions().add(cEntry); + } + } + } + + private boolean isOrideConfsStart(String line) { + if(line.length()>1&&line.startsWith(ImpConstants.ORIDECONF_START)) { + return true; + } + return false; + } + + private LineNumberContainer addOrideConf(ImpDocument document, List entries) { + OverrideConfiguration oc = factory.createOverrideConfiguration(); + for (String entry : entries) { + ConfigEntry ce = factory.createConfigEntry(); + String[] parts = entry.split(ImpConstants.ENTRY_SEPARATOR); + ce.setTarget(parts[0].trim()); + ce.setAction(parts[1].trim()); + ce.setLocation(parts[2].trim()); + oc.getEntries().add(ce); + } + document.getOrideConfs().add(oc); + return oc; + } + + private boolean isOrideFilesStart(String line) { + if(line.length()>1&&line.startsWith(ImpConstants.ORIDEFILES_START)) { + return true; + } + return false; + } + + private LineNumberContainer addOrideFiles(ImpDocument document, List entries) { + OverrideFiles overrideFiles = factory.createOverrideFiles(); + for (String entry : entries) { + FileListEntry fle = factory.createFileListEntry(); + BasicTokenizer pt = new BasicTokenizer(entry); + if(pt.countTokens()==2) { + fle.setSource(pt.nextToken()); + fle.setTarget(pt.nextToken()); + overrideFiles.getEntries().add(fle); + } + } + document.getOrideFiles().add(overrideFiles); + return overrideFiles; + } + + + private boolean isVariable(String line) { + if(line.length()>1&&line.contains(ImpConstants.VARIABLE_SEPARATOR)) { + return true; + } + return false; + } + + private LineNumberContainer addVariable(ImpDocument document, String line) { + String[] parts = line.split(ImpConstants.VARIABLE_SEPARATOR); + Variable var = factory.createVariable(); + if(parts.length==2) { + var.setName(parts[0].trim()); + var.setValue(parts[1].trim()); + document.getVariables().add(var); + } + return var; + } + + private LineNumberContainer addComment(ImpDocument document, String content) { + Comment comment = factory.createComment(); + comment.setComment(content); + document.getComments().add(comment); + return comment; + } + + private boolean isComment(String line) { + if(line.length()>1&&line.startsWith(ImpConstants.COMMENT_START)) { + return true; + } + return false; + } + + @Override + protected void doSave(OutputStream outputStream, Map options) + throws IOException { + if(!getContents().isEmpty()) { + String separator = System.getProperty("line.separator"); + OutputStreamWriter ow = new OutputStreamWriter(outputStream, ImpConstants.FILE_ENCODING); + BufferedWriter bw = new BufferedWriter(ow); + ImpDocument doc = (ImpDocument) getContents().get(0); + List content = new ArrayList(); + //save comments + for (Comment comment : doc.getComments()) { + content.add(comment); + } + //save variables + for (Variable var : doc.getVariables()) { + content.add(var); + } + + //save override files + for (OverrideFiles orid : doc.getOrideFiles()) { + content.add(orid); + } + + //save override configurations + for (OverrideConfiguration orid : doc.getOrideConfs()) { + content.add(orid); + } + + int max = 0; + for (LineNumberContainer item : content) { + if(item.getLineNumber()>max) { + max = item.getLineNumber(); + } + } + List temp = new ArrayList(); + for (int i = 0; i < max; i++) { + temp.add(null); + } + for (LineNumberContainer item : content) { + temp.add(item.getLineNumber(), item); + } + + for (int i = 0; i < temp.size(); i++) { + Object item = temp.get(i); + if(item!=null) { + bw.write(item.toString()); + } + bw.write(separator); + } + bw.flush(); + bw.close(); + } + } + + public void save(OutputStream out) { + try { + doSave(out, null); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/ImpmodelAdapterFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/ImpmodelAdapterFactory.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,279 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.util; + +import com.nokia.s60tools.imaker.internal.impmodel.*; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage + * @generated + */ +public class ImpmodelAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static ImpmodelPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public ImpmodelAdapterFactory() { + if (modelPackage == null) { + modelPackage = ImpmodelPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected ImpmodelSwitch modelSwitch = + new ImpmodelSwitch() { + @Override + public Adapter caseImpDocument(ImpDocument object) { + return createImpDocumentAdapter(); + } + @Override + public Adapter caseOverrideFiles(OverrideFiles object) { + return createOverrideFilesAdapter(); + } + @Override + public Adapter caseOverrideConfiguration(OverrideConfiguration object) { + return createOverrideConfigurationAdapter(); + } + @Override + public Adapter caseFileListEntry(FileListEntry object) { + return createFileListEntryAdapter(); + } + @Override + public Adapter caseConfigEntry(ConfigEntry object) { + return createConfigEntryAdapter(); + } + @Override + public Adapter caseVariable(Variable object) { + return createVariableAdapter(); + } + @Override + public Adapter caseLineNumberContainer(LineNumberContainer object) { + return createLineNumberContainerAdapter(); + } + @Override + public Adapter caseComment(Comment object) { + return createCommentAdapter(); + } + @Override + public Adapter caseCommentContainer(CommentContainer object) { + return createCommentContainerAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.ImpDocument Imp Document}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpDocument + * @generated + */ + public Adapter createImpDocumentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles Override Files}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles + * @generated + */ + public Adapter createOverrideFilesAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration Override Configuration}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration + * @generated + */ + public Adapter createOverrideConfigurationAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.FileListEntry File List Entry}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.FileListEntry + * @generated + */ + public Adapter createFileListEntryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry Config Entry}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry + * @generated + */ + public Adapter createConfigEntryAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.Variable Variable}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.Variable + * @generated + */ + public Adapter createVariableAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer Line Number Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.LineNumberContainer + * @generated + */ + public Adapter createLineNumberContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.Comment Comment}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.Comment + * @generated + */ + public Adapter createCommentAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link com.nokia.s60tools.imaker.internal.impmodel.CommentContainer Comment Container}'. + * + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * + * @return the new adapter. + * @see com.nokia.s60tools.imaker.internal.impmodel.CommentContainer + * @generated + */ + public Adapter createCommentContainerAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //ImpmodelAdapterFactory diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/ImpmodelSwitch.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/impmodel/util/ImpmodelSwitch.java Mon Jan 25 12:26:21 2010 +0200 @@ -0,0 +1,318 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +package com.nokia.s60tools.imaker.internal.impmodel.util; + +import com.nokia.s60tools.imaker.internal.impmodel.*; + +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see com.nokia.s60tools.imaker.internal.impmodel.ImpmodelPackage + * @generated + */ +public class ImpmodelSwitch { + /** + * The cached model package + * + * + * @generated + */ + protected static ImpmodelPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public ImpmodelSwitch() { + if (modelPackage == null) { + modelPackage = ImpmodelPackage.eINSTANCE; + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + public T doSwitch(EObject theEObject) { + return doSwitch(theEObject.eClass(), theEObject); + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(EClass theEClass, EObject theEObject) { + if (theEClass.eContainer() == modelPackage) { + return doSwitch(theEClass.getClassifierID(), theEObject); + } + else { + List eSuperTypes = theEClass.getESuperTypes(); + return + eSuperTypes.isEmpty() ? + defaultCase(theEObject) : + doSwitch(eSuperTypes.get(0), theEObject); + } + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case ImpmodelPackage.IMP_DOCUMENT: { + ImpDocument impDocument = (ImpDocument)theEObject; + T result = caseImpDocument(impDocument); + if (result == null) result = caseCommentContainer(impDocument); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.OVERRIDE_FILES: { + OverrideFiles overrideFiles = (OverrideFiles)theEObject; + T result = caseOverrideFiles(overrideFiles); + if (result == null) result = caseLineNumberContainer(overrideFiles); + if (result == null) result = caseCommentContainer(overrideFiles); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.OVERRIDE_CONFIGURATION: { + OverrideConfiguration overrideConfiguration = (OverrideConfiguration)theEObject; + T result = caseOverrideConfiguration(overrideConfiguration); + if (result == null) result = caseLineNumberContainer(overrideConfiguration); + if (result == null) result = caseCommentContainer(overrideConfiguration); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.FILE_LIST_ENTRY: { + FileListEntry fileListEntry = (FileListEntry)theEObject; + T result = caseFileListEntry(fileListEntry); + if (result == null) result = caseLineNumberContainer(fileListEntry); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.CONFIG_ENTRY: { + ConfigEntry configEntry = (ConfigEntry)theEObject; + T result = caseConfigEntry(configEntry); + if (result == null) result = caseLineNumberContainer(configEntry); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.VARIABLE: { + Variable variable = (Variable)theEObject; + T result = caseVariable(variable); + if (result == null) result = caseLineNumberContainer(variable); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.LINE_NUMBER_CONTAINER: { + LineNumberContainer lineNumberContainer = (LineNumberContainer)theEObject; + T result = caseLineNumberContainer(lineNumberContainer); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.COMMENT: { + Comment comment = (Comment)theEObject; + T result = caseComment(comment); + if (result == null) result = caseLineNumberContainer(comment); + if (result == null) result = defaultCase(theEObject); + return result; + } + case ImpmodelPackage.COMMENT_CONTAINER: { + CommentContainer commentContainer = (CommentContainer)theEObject; + T result = caseCommentContainer(commentContainer); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Imp Document'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Imp Document'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseImpDocument(ImpDocument object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Override Files'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Override Files'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOverrideFiles(OverrideFiles object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Override Configuration'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Override Configuration'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOverrideConfiguration(OverrideConfiguration object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'File List Entry'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'File List Entry'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseFileListEntry(FileListEntry object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Config Entry'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Config Entry'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseConfigEntry(ConfigEntry object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Variable'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Variable'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseVariable(Variable object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Line Number Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Line Number Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseLineNumberContainer(LineNumberContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Comment'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Comment'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseComment(Comment object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Comment Container'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Comment Container'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCommentContainer(CommentContainer object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + public T defaultCase(EObject object) { + return null; + } + +} //ImpmodelSwitch diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/managers/EnvironmentManager.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/managers/EnvironmentManager.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/managers/EnvironmentManager.java Mon Jan 25 12:26:21 2010 +0200 @@ -17,6 +17,7 @@ package com.nokia.s60tools.imaker.internal.managers; +import java.io.File; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -30,6 +31,7 @@ private static IEnvironmentManager instance = null; private ArrayList environments; private IEnvironment activeEnvironment; + private File lastRun; public static IEnvironmentManager getInstance() { if(instance==null) { @@ -100,4 +102,12 @@ } return false; } + + public void setLastRun(File file) { + this.lastRun = file; + } + + public File getLastRun() { + return lastRun; + } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/ImakerProperties.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/ImakerProperties.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/ImakerProperties.java Mon Jan 25 12:26:21 2010 +0200 @@ -16,11 +16,9 @@ */ package com.nokia.s60tools.imaker.internal.model; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.FileNotFoundException; +import java.io.File; import java.io.IOException; -import java.io.InputStream; +import java.io.OutputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -28,21 +26,39 @@ import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; import com.nokia.s60tools.imaker.IMakerKeyConstants; import com.nokia.s60tools.imaker.IMakerUtils; import com.nokia.s60tools.imaker.Messages; import com.nokia.s60tools.imaker.UIVariable; +import com.nokia.s60tools.imaker.internal.impmodel.ConfigEntry; +import com.nokia.s60tools.imaker.internal.impmodel.FileListEntry; +import com.nokia.s60tools.imaker.internal.impmodel.ImpConstants; +import com.nokia.s60tools.imaker.internal.impmodel.ImpDocument; +import com.nokia.s60tools.imaker.internal.impmodel.ImpmodelFactory; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideConfiguration; +import com.nokia.s60tools.imaker.internal.impmodel.OverrideFiles; +import com.nokia.s60tools.imaker.internal.impmodel.Variable; +import com.nokia.s60tools.imaker.internal.impmodel.util.BasicTokenizer; +import com.nokia.s60tools.imaker.internal.impmodel.util.ImpResourceImpl; import com.nokia.s60tools.imaker.internal.managers.ProjectManager; import com.nokia.s60tools.imaker.internal.model.iContent.IContentFactory; +import com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION; import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry; import com.nokia.s60tools.imaker.internal.wrapper.IMakerWrapperPreferences; import com.nokia.s60tools.imaker.internal.wrapper.PlatsimManager; public class ImakerProperties extends Properties { public static final String SEPARATOR = ":;"; + public static final String IBYENTRY_FIELDS_SEPARATOR = ";"; public static final String GENERATED_FILES_FOLDER = "imakerplugin"; private static final long serialVersionUID = 1L; private List variables=null; @@ -50,26 +66,102 @@ private boolean used = false; /** - * Create imaker properties from file + * Create imaker properties from the given file * @param file * @return */ public static ImakerProperties createFromFile(IFile file) { - ImakerProperties imakerPreference = new ImakerProperties(); + if(file!=null) { + ImpDocument model = getModel(file); + return convertModelToProperties(model); + } + return null; + } - if(file!=null) { - try { - imakerPreference.load(file.getContents()); - } catch (FileNotFoundException e) { - imakerPreference = null; - } catch (IOException e) { - imakerPreference = null; - } catch (CoreException e) { - e.printStackTrace(); + private static ImakerProperties convertModelToProperties(ImpDocument model) { + ImakerProperties properties = new ImakerProperties(); + if(model!=null) { + //main tab basic + addProperty(properties, IMakerKeyConstants.PRODUCT, model + .getVariable(ImpConstants.TARGET_PRODUCT), model); + addProperty(properties, IMakerKeyConstants.TARGET_LIST, model + .getVariable(ImpConstants.DEFAULT_GOALS), model); + addProperty(properties, IMakerKeyConstants.TYPE, model + .getVariable(ImpConstants.TYPE), model); + addProperty(properties, IMakerKeyConstants.SYMBOLFILES, model + .getVariable(ImpConstants.USE_SYMGEN), model); + addProperty(properties, IMakerKeyConstants.VERBOSE, model + .getVariable(ImpConstants.VERBOSE), model); + + //platsim variables + addProperty(properties, IMakerKeyConstants.PLATSIM_INSTANCE, model + .getVariable(ImpConstants.PLATSIM_INSTANCE), model); + addProperty(properties, IMakerKeyConstants.PLATSIM_RUN, model + .getVariable(ImpConstants.PLATSIM_RUN), model); + + //additional variables + EList vars = model.getVariables(); + StringBuffer sb = new StringBuffer(); + Variable variable; + for (int i = 0; i < vars.size(); i++) { + variable = vars.get(i); + sb.append(variable.getName()+"="+variable.getValue()); + if(i files = model.getOrideFiles(); + List ibyEntries = new ArrayList(); + if (!files.isEmpty()) { + OverrideFiles of = files.get(0); + EList entries = of.getEntries(); + for (int i = 0; i < entries.size(); i++) { + FileListEntry fEntry = entries.get(i); + EList actions = fEntry.getActions(); + if (!actions.isEmpty()) { + ConfigEntry action = actions.get(0); + IbyEntry iby = IContentFactory.eINSTANCE.createIbyEntry(); + iby.setEnabled(true); + iby.setFile(fEntry.getSource()); + iby.setTarget(fEntry.getTarget()); + iby.setLocation(IMAGESECTION.get(action.getLocation())); + ibyEntries.add(iby); + } + } + } + if(!ibyEntries.isEmpty()) { + properties.put(IMakerKeyConstants.DEBUGFILES, ibyEntries); } } + return properties; + } - return imakerPreference; + private static void addProperty(ImakerProperties properties, + String key, Variable var, ImpDocument model) { + if(var!=null) { + model.getVariables().remove(var); + properties.put(key, var.getValue()); + } + } + + private static ImpDocument getModel(IFile file) { + ResourceSetImpl rs = new ResourceSetImpl(); + + URI uri = URI.createFileURI(file.getLocation().toFile().getAbsolutePath()); + Resource resource = rs.createResource(uri); + try { + resource.load(null); + EList contents = resource.getContents(); + return (ImpDocument) contents.get(0); + } catch (IOException e) { + e.printStackTrace(); + return null; + } } /** @@ -77,29 +169,128 @@ * @param file * @return */ - public void saveToFile(IFile file) { + public void saveToFile(File file) { if(file!=null) { - InputStream input = getAsInputStream(); + ImpDocument model = getModel(); + Resource resource = getResource(file); + resource.getContents().add(model); try { - file.setContents(input, true, false,null); - } catch (CoreException e) { + resource.save(null); + } catch (IOException e) { + // TODO log? e.printStackTrace(); - } + } } } + private Resource getResource(File file) { + ResourceSetImpl rs = new ResourceSetImpl(); + URI uri = URI.createFileURI(file.getAbsolutePath()); + Resource resource = rs.createResource(uri); + return resource; + } + + /** + * Constract Impmodel from these properties + * @return + */ + private ImpDocument getModel() { + Properties clone = (Properties) clone(); + ImpmodelFactory factory = ImpmodelFactory.eINSTANCE; + ImpDocument doc = factory.createImpDocument(); + + //save variables + addBasicVariables(clone, doc,factory); + addAdditionalVariables(clone, doc,factory); + + //save platsim variables + addPlatsimVariables(clone, doc,factory); + + //save override files + Object oEntries = clone.remove(IMakerKeyConstants.DEBUGFILES); + if(oEntries!=null) { + List entries = (List) oEntries; + OverrideFiles files = factory.createOverrideFiles(); + OverrideConfiguration confs = factory.createOverrideConfiguration(); + for (IbyEntry ibyEntry : entries) { + if(!ibyEntry.isEnabled()) { + continue; //Notice skipping disabled entries + } + FileListEntry fileEntry = factory.createFileListEntry(); + ConfigEntry configEntry = factory.createConfigEntry(); + fileEntry.setSource(ibyEntry.getFile()); + fileEntry.setTarget(ibyEntry.getTarget()); + files.getEntries().add(fileEntry); + + // + configEntry.setTarget(ibyEntry.getTarget()); + configEntry.setAction("replace-add"); + configEntry.setLocation(ibyEntry.getLocation().getName().toLowerCase()); + confs.getEntries().add(configEntry); + } + if(!files.getEntries().isEmpty()) { + doc.getOrideFiles().add(files); + doc.getOrideConfs().add(confs); + } + } + + //save override confs + return doc; + } + + private void addPlatsimVariables(Properties clone, ImpDocument doc, + ImpmodelFactory factory) { + addVariable(doc, factory, ImpConstants.PLATSIM_INSTANCE, (String) clone + .remove(IMakerKeyConstants.PLATSIM_INSTANCE)); + addVariable(doc, factory, ImpConstants.PLATSIM_RUN, (String) clone + .remove(IMakerKeyConstants.PLATSIM_RUN)); + } + + private void addAdditionalVariables(Properties clone, ImpDocument doc, + ImpmodelFactory factory) { + String adds = (String) clone.remove(IMakerKeyConstants.ADDITIONAL_PARAMETERS); + if(adds==null) return; + BasicTokenizer bt = new BasicTokenizer(adds); + while (bt.hasMoreTokens()) { + String token = bt.nextToken(); + String[] comps = token.split("="); + if(comps.length==2) { + int start = 0; + int end = comps[1].length(); + if(comps[1].charAt(0)=='"') start++; + if(comps[1].charAt(comps[1].length()-1)=='"') end--; + addVariable(doc, factory, comps[0], comps[1].substring(start,end)); + } + } + } + + private void addBasicVariables(Properties clone, ImpDocument doc, ImpmodelFactory factory) { + addVariable(doc, factory, ImpConstants.TARGET_PRODUCT, (String) clone + .remove(IMakerKeyConstants.PRODUCT)); + addVariable(doc, factory, ImpConstants.DEFAULT_GOALS, (String) clone + .remove(IMakerKeyConstants.TARGET_LIST)); + addVariable(doc, factory, ImpConstants.TYPE, (String) clone + .remove(IMakerKeyConstants.TYPE)); + addVariable(doc, factory, ImpConstants.USE_SYMGEN, (String) clone + .remove(IMakerKeyConstants.SYMBOLFILES)); + addVariable(doc, factory, ImpConstants.VERBOSE, (String) clone + .remove(IMakerKeyConstants.VERBOSE)); +// addVariable(doc, factory, ImpConstants.VERBOSE, (String) clone.remove(IMakerKeyConstants.VERBOSE)); +// addVariable(doc, factory, ImpConstants.VERBOSE, (String) clone.remove(IMakerKeyConstants.VERBOSE)); + } + + private void addVariable(ImpDocument doc, ImpmodelFactory factory, String name, String value) { + Variable var; + if (value!=null) { + var = factory.createVariable(); + var.setName(name); + var.setValue(value); + doc.getVariables().add(var); + } + } + public ImakerProperties() {} - public InputStream getAsInputStream() { - ByteArrayOutputStream bao = new ByteArrayOutputStream(); - try { - store(bao, "iMaker properties"); - } catch (IOException e) { - e.printStackTrace(); - } - ByteArrayInputStream bs = new ByteArrayInputStream(bao.toString().getBytes()); - return bs; - } /** * Parse the contents of this properties file and create imaker command that is executable @@ -237,4 +428,18 @@ public boolean isUsed() { return this.used; } + + @Override + public synchronized void store(OutputStream out, String comments) + throws IOException { + ImpDocument model = getModel(); + URI uri = URI.createFileURI("sample.imp"); + ImpResourceImpl res = new ImpResourceImpl(uri); + + res.getContents().add(model); + + res.save(out); + } + + } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/IMAGESECTION.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/IMAGESECTION.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/IMAGESECTION.java Mon Jan 25 12:26:21 2010 +0200 @@ -60,17 +60,7 @@ * @generated * @ordered */ - ROFS3(2, "ROFS3", "ROFS3"), - - /** - * The 'UDA' literal object. - * - * - * @see #UDA_VALUE - * @generated - * @ordered - */ - UDA(3, "UDA", "UDA"); + ROFS3(2, "ROFS3", "ROFS3"); /** * The 'CORE' literal value. @@ -118,21 +108,6 @@ public static final int ROFS3_VALUE = 2; /** - * The 'UDA' literal value. - * - *

- * If the meaning of 'UDA' literal object isn't clear, - * there really should be more of a description here... - *

- * - * @see #UDA - * @model - * @generated - * @ordered - */ - public static final int UDA_VALUE = 3; - - /** * An array of all the 'IMAGESECTION' enumerators. * * @@ -143,7 +118,6 @@ CORE, ROFS2, ROFS3, - UDA, }; /** @@ -158,12 +132,12 @@ * Returns the 'IMAGESECTION' literal with the specified literal value. * * - * @generated + * @generated NOT */ public static IMAGESECTION get(String literal) { for (int i = 0; i < VALUES_ARRAY.length; ++i) { IMAGESECTION result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) { + if (result.toString().equalsIgnoreCase(literal)) { return result; } } @@ -197,7 +171,6 @@ case CORE_VALUE: return CORE; case ROFS2_VALUE: return ROFS2; case ROFS3_VALUE: return ROFS3; - case UDA_VALUE: return UDA; } return null; } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentFactoryImpl.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentFactoryImpl.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentFactoryImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -16,7 +16,6 @@ */ package com.nokia.s60tools.imaker.internal.model.iContent.impl; -import com.nokia.s60tools.imaker.internal.model.iContent.*; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; @@ -24,6 +23,7 @@ import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import com.nokia.s60tools.imaker.internal.model.ImakerProperties; import com.nokia.s60tools.imaker.internal.model.iContent.IContentFactory; import com.nokia.s60tools.imaker.internal.model.iContent.IContentPackage; import com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION; @@ -172,15 +172,16 @@ } public IbyEntry createEntryFromString(String initialValue) { - String[] parts = initialValue.split(";"); - IbyEntry entry = IContentFactory.eINSTANCE.createIbyEntry(); - if(parts.length>=5) { + String[] parts = initialValue.split(ImakerProperties.IBYENTRY_FIELDS_SEPARATOR); + if(parts.length>=4) { + IbyEntry entry = IContentFactory.eINSTANCE.createIbyEntry(); entry.setEnabled(new Boolean(parts[0])); - entry.setDebug(new Boolean(parts[1])); - entry.setFile(parts[2]); - entry.setTarget(parts[3]); - entry.setLocation(IMAGESECTION.get(parts[4])); +// entry.setDebug(new Boolean(parts[1])); + entry.setFile(parts[1]); + entry.setTarget(parts[2]); + entry.setLocation(IMAGESECTION.get(parts[3])); + return entry; } - return entry; + return null; } } //IContentFactoryImpl diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentPackageImpl.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentPackageImpl.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/iContent/impl/IContentPackageImpl.java Mon Jan 25 12:26:21 2010 +0200 @@ -297,7 +297,6 @@ addEEnumLiteral(imagesectionEEnum, com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION.CORE); addEEnumLiteral(imagesectionEEnum, com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION.ROFS2); addEEnumLiteral(imagesectionEEnum, com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION.ROFS3); - addEEnumLiteral(imagesectionEEnum, com.nokia.s60tools.imaker.internal.model.iContent.IMAGESECTION.UDA); // Create resource createResource(eNS_URI); diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/providers/SettingsEditingSupport.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/providers/SettingsEditingSupport.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/providers/SettingsEditingSupport.java Mon Jan 25 12:26:21 2010 +0200 @@ -77,7 +77,7 @@ @Override protected void setValue(Object element, Object value) { - UIVariable variable = (UIVariable)element; + final UIVariable variable = (UIVariable)element; switch (this.column) { case 1: @@ -90,7 +90,7 @@ public void run() { if(PreferencesTab.currentPreferencesTab!=null) { - PreferencesTab.currentPreferencesTab.refreshSettingsTab(); + PreferencesTab.currentPreferencesTab.refreshSettingsTab(variable); } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/DebugTab.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/DebugTab.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/DebugTab.java Mon Jan 25 12:26:21 2010 +0200 @@ -18,6 +18,7 @@ package com.nokia.s60tools.imaker.internal.viewers; import java.io.File; +import java.util.List; import java.util.regex.Pattern; import org.eclipse.emf.common.util.EList; @@ -456,33 +457,14 @@ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { } } -// -// -// public void runPressed() { -// ImageContent ic = getInput(); -// List entries = new ArrayList(); -// entries.addAll(ic.getEntries()); -// IMakerUtils.createIbyFiles(entries,projectManager); -// } /* (non-Javadoc) * @see com.nokia.s60tools.imaker.internal.viewers.IPropertyViewer#addToProperties(com.nokia.s60tools.imaker.internal.model.ImakerProperties) */ public void addToProperties(ImakerProperties prop) { ImageContent input = getInput(); - StringBuffer sb = new StringBuffer(); - EList entries = input.getEntries(); - for (int i = 0; i < entries.size(); i++) { - IbyEntry entry=entries.get(i); - entry.append(sb); - if(i entries = input.getEntries(); - String str = (String)prop.get(IMakerKeyConstants.DEBUGFILES); - if(str!=null&&!str.equals("")) { - entries.clear(); - String[] entriesStr = str.split(ImakerProperties.SEPARATOR); - for (int i = 0; i < entriesStr.length; i++) { - String entryStr = entriesStr[i]; - if(entryStr!=null&&!entryStr.equals("")) { - entries.add(IContentFactory.eINSTANCE.createEntryFromString(entryStr)); - } - } - tableViewer.refresh(); + entries.clear(); + Object ents = prop.get(IMakerKeyConstants.DEBUGFILES); + if(ents!=null) { + List ls = (List) ents; + entries.addAll(ls); } + tableViewer.refresh(); } private ImageContent getInput() { diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/IMakerTabsViewer.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/IMakerTabsViewer.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/IMakerTabsViewer.java Mon Jan 25 12:26:21 2010 +0200 @@ -289,7 +289,7 @@ protected void handleRevertPressed() { if(fTabFolder.getSelection() == tabSettings) { - tabPreferences.refreshSettingsTab(); + tabPreferences.refreshSettingsTab(null); } else { // tabPreferences.revert(); } @@ -374,7 +374,7 @@ descriptor = IMakerPlugin.getImageDescriptor("icons/settings.gif"); //$NON-NLS-1$ return descriptor.createImage(); case 3: - descriptor = IMakerPlugin.getImageDescriptor("icons/debug.gif"); //$NON-NLS-1$ + descriptor = IMakerPlugin.getImageDescriptor("icons/content.gif"); //$NON-NLS-1$ return descriptor.createImage(); case 4: descriptor = IMakerPlugin.getImageDescriptor("icons/platsim.png"); //$NON-NLS-1$ diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PlatsimTab.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PlatsimTab.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PlatsimTab.java Mon Jan 25 12:26:21 2010 +0200 @@ -129,13 +129,28 @@ private String getInstance() { int index = instancesCombo.getSelectionIndex(); - return instancesCombo.getItem(index); + if(index!=-1) { + return instancesCombo.getItem(index); + } else { + String text = instancesCombo.getText(); + if(text!=null) { + return text; + } + } + return null; } public void addToProperties(ImakerProperties prop) { if(isActivated()) { - prop.put(IMakerKeyConstants.PLATSIM_INSTANCE, getInstance()); - prop.put(IMakerKeyConstants.PLATSIM_RUN, String.valueOf(run.getSelection())); + String instance = getInstance(); + if (instance!=null) { + prop.put(IMakerKeyConstants.PLATSIM_INSTANCE, instance); + } + if(run.getSelection()) { + prop.put(IMakerKeyConstants.PLATSIM_RUN, "1"); + } else { + prop.put(IMakerKeyConstants.PLATSIM_RUN, "0"); + } } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PreferencesTab.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PreferencesTab.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/viewers/PreferencesTab.java Mon Jan 25 12:26:21 2010 +0200 @@ -17,7 +17,6 @@ package com.nokia.s60tools.imaker.internal.viewers; -import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; import java.util.Arrays; @@ -25,11 +24,13 @@ import java.util.Properties; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IResource; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.viewers.IStructuredSelection; @@ -59,8 +60,8 @@ import com.nokia.s60tools.imaker.IEnvironment; import com.nokia.s60tools.imaker.IEnvironmentManager; import com.nokia.s60tools.imaker.IIMakerWrapper; +import com.nokia.s60tools.imaker.IMakerKeyConstants; import com.nokia.s60tools.imaker.IMakerPlugin; -import com.nokia.s60tools.imaker.IMakerKeyConstants; import com.nokia.s60tools.imaker.IMakerUtils; import com.nokia.s60tools.imaker.ImageFlasherHelpContextIDs; import com.nokia.s60tools.imaker.Messages; @@ -527,13 +528,6 @@ try { iMakerCoreVersion = activeEnvironment.getIMakerCoreVersion(); - //check imaker version here - if(!verifyIMakerVersion()) { - String msg = Messages.getString("Error.3"); //$NON-NLS-1$ - String minVersion = Messages.getString("PreferencesTab.22"); //$NON-NLS-1$ - StatusHandler.handle(IStatus.ERROR,msg.replace("xxx", minVersion),null); //$NON-NLS-1$ - return; - } fixVersionText(); activeEnvironment.load(); if(activeEnvironment.isLoaded()) { @@ -610,15 +604,6 @@ } - private boolean verifyIMakerVersion() { - String minVersion = Messages.getString("PreferencesTab.22"); //$NON-NLS-1$ - String curVersion = IMakerUtils.parseIMakerVersion(iMakerCoreVersion); - if(curVersion.compareTo(minVersion)>0) { - return true; - } - return false; - } - private void savePreferencesToFile(String filePath) { ImakerProperties uiValues = new ImakerProperties(); uiValues.putAll(getUIValues()); @@ -646,7 +631,14 @@ } } else { IFile file = (IFile)projectManager.getImakerFile(new Path(filePath)); - uiValues.saveToFile(file); + uiValues.saveToFile(file.getLocation().toFile()); + try { + file.refreshLocal(IResource.DEPTH_ZERO, null); + } catch (CoreException e) { + IStatus status = new Status(Status.WARNING,IMakerPlugin.PLUGIN_ID,"Refreshing file ("+file.getLocation().toOSString()+")failled!",e); + IMakerPlugin.getDefault().getLog().log(status); + e.printStackTrace(); + } } } @@ -655,8 +647,7 @@ try { UIConfiguration config = (UIConfiguration) textProduct.getData(); if(config!=null) { - addField(prop,IMakerKeyConstants.MAKEFILE,config.getFilePath()); - addField(prop,IMakerKeyConstants.PRODUCT,config.getMakeFileName()); + addField(prop,IMakerKeyConstants.PRODUCT,config.getConfigurationName()); } StringBuilder sb = new StringBuilder(); for (int i = 0; i < listTarget.getItemCount(); i++) { @@ -683,12 +674,9 @@ } addField(prop, IMakerKeyConstants.ADDITIONAL_PARAMETERS, textUserDefinedParameters.getText()); - settingsTab.addChangedSettings(prop); platsimTab.addToProperties(prop); tabDebug.addToProperties(prop); - } catch(Exception e) { - - } + } catch(Exception e) {} return prop; } @@ -700,17 +688,24 @@ } private void fillUIForm(ImakerProperties prop) throws InvocationTargetException { - String filePath = (String) prop.remove(IMakerKeyConstants.MAKEFILE); - if(filePath==null) return; - filePath = filePath.replaceAll("\\\\", "/"); + String targetProduct = (String) prop.remove(IMakerKeyConstants.PRODUCT); + if(targetProduct==null) return; + boolean found = false; List configs = activeEnvironment.getConfigurations(); for (UIConfiguration config : configs) { - if(config.getFilePath().equals(filePath)) { + if(config.getConfigurationName().equals(targetProduct)) { refreshProduct(config); + found = true; break; } } + if (!found) { + IStatus status = new Status(Status.WARNING,IMakerPlugin.PLUGIN_ID,"Unable to fill dialog ui, because product: "+targetProduct+" not found!"); + IMakerPlugin.getDefault().getLog().log(status); + return; + } + String targets = (String) prop.remove(IMakerKeyConstants.TARGET_LIST); if((targets!=null)&&!(targets.equals(""))) { //$NON-NLS-1$ String[] tars = targets.split(" "); //$NON-NLS-1$ @@ -774,14 +769,38 @@ /** * Called when something changed in the settingsTab. + * @param modVariable */ - public void refreshSettingsTab() { + public void refreshSettingsTab(UIVariable modVariable) { if(!settingsTab.isDirty()) { return; } String drive = activeEnvironment.getDrive(); IRunnableWithProgress op = new IMakerSettingsUpdater(null,drive); executeRunnable(op); + if (modVariable!=null) { + String text = textUserDefinedParameters.getText(); + if(text!=null) { + text = text.trim(); + if(!"".equals(text)) { + text = text +" " + getVariableString(modVariable); + } else { + text = getVariableString(modVariable); + } + } else { + text = getVariableString(modVariable); + } + textUserDefinedParameters.setText(text); + } + } + + private String getVariableString(UIVariable variable) { + String value = variable.getValue(); + if(value.contains(" ")) { + return variable.getName()+"=\""+value+"\""; + } else { + return variable.getName()+"="+value; + } } private void executeRunnable(IRunnableWithProgress op) { @@ -880,15 +899,11 @@ public void loadImakerFile(String item) throws InvocationTargetException { if(!item.equals(ProjectManager.NEW_ITEM)) { IFile file = (IFile)projectManager.getImakerFile(new Path(item)); - ImakerProperties prop = new ImakerProperties(); - try { - prop.load(file.getContents()); - fillUIForm(prop); - } catch (IOException e) { - e.printStackTrace(); - } catch (CoreException e) { - e.printStackTrace(); - }; + if(file!=null) { + ImakerProperties prop = null; + prop = ImakerProperties.createFromFile(file); + fillUIForm(prop); + } } else { loadDefaults(); fillUIForm(activeEnvironment.getRunProperties()); diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wizards/NewImakerFileWizardPage.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wizards/NewImakerFileWizardPage.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wizards/NewImakerFileWizardPage.java Mon Jan 25 12:26:21 2010 +0200 @@ -21,7 +21,6 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.InputStream; -import java.io.StringWriter; import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.ui.dialogs.WizardNewFileCreationPage; diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wrapper/IMakerWrapper.java --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wrapper/IMakerWrapper.java Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/wrapper/IMakerWrapper.java Mon Jan 25 12:26:21 2010 +0200 @@ -78,7 +78,6 @@ // private String dTarget = null; private Pattern blockBegin = Pattern.compile("-{30,}"); - private OutputStream outputStream; private List tool; private IMakerCoreExecutionException lastImakerException; @@ -102,7 +101,7 @@ verifyExists(); params.clear(); params.add(IMakerWrapperPreferences.CMD_FETCH_VERSION); - List version = executeCommand(params); + List version = executeCommand(params,null); String vers = ""; for (String line : version) { if(line.startsWith("iMaker")) { @@ -121,13 +120,26 @@ } } + private void verifyCompatibility() throws IMakerCoreNotFoundException, IMakerCoreExecutionException { + //verify exists + String minVersion = Messages.getString("PreferencesTab.22"); //$NON-NLS-1$ + String curVersion = IMakerUtils.parseIMakerVersion(getIMakerCoreVersion()); + if(curVersion==null) throw new IMakerCoreExecutionException("Unable to query version information!"); + if(minVersion.compareTo(curVersion)>0) { + String msg = Messages.getString("Error.3"); + msg = msg.replace("xxx", minVersion); + msg = msg.replace("yyy", curVersion); + throw new IMakerCoreExecutionException(msg); + } + } + /* (non-Javadoc) * @see com.nokia.s60tools.imakerplugin.wrapper.IIMakerWrapper#getConfigurations(java.lang.String, org.eclipse.core.runtime.IProgressMonitor) */ public List getConfigurations(IProgressMonitor monitor) throws IMakerCoreExecutionException, IMakerCoreNotFoundException { this.monitor = monitor; - verifyExists(); + verifyCompatibility(); List configurations = getConfigurations((String)null); return configurations; } @@ -166,7 +178,6 @@ String pname = config.getConfigurationName(); if(pname != null && pname.equals(dProduct)) { config.setDefaultConfig(true); -// config.setDefaultTarget(dTarget); break; } } @@ -183,7 +194,7 @@ Pattern product = Pattern.compile("\\s*IMAKER_CONFMK.*image_conf_(.*)\\.mk.\\s*"); // Pattern target = Pattern.compile("\\s*TARGET_DEFAULT\\s*=\\s*.(.*).\\s*"); try { - List lines = executeCommand(params); + List lines = executeCommand(params,null); for (String line : lines) { Matcher matcher = product.matcher(line); if(matcher.matches()) { @@ -212,7 +223,7 @@ List makeFiles; params.clear(); params.add(IMakerWrapperPreferences.CMD_FETCH_CONFIGURATIONS);// + configPath - makeFiles = executeCommand(params); + makeFiles = executeCommand(params,null); // Remove redundant lines of information from makeFile list if ((makeFiles != null) && (makeFiles.size() > 0)) { @@ -235,7 +246,7 @@ IProgressMonitor mon) throws IMakerCoreExecutionException, IMakerCoreNotFoundException { this.monitor = mon; - verifyExists(); + verifyCompatibility(); if(parameters==null||parameters.size()<2) { return null; } @@ -252,7 +263,7 @@ params.addAll(parameters); builderRunning=true; - List settingsList = executeCommand(params); + List settingsList = executeCommand(params,null); builderRunning=false; ArrayList elements = new ArrayList(); @@ -289,10 +300,9 @@ */ public boolean buildImage(List cmdParams, OutputStream out) throws IMakerCoreExecutionException, IMakerCoreAlreadyRunningException, IMakerCoreNotFoundException { - this.outputStream = out; - verifyExists(); + verifyCompatibility(); builderRunning = true; - List ret = executeCommand(cmdParams); + List ret = executeCommand(cmdParams,out); builderRunning = false; return getReturnStatus(ret); } @@ -343,11 +353,12 @@ /** * Calls the iMaker on a command line and reads the output. + * @param out * * @param cmd additional arguments to be passed to the iMaker core. * @return Output of iMaker as list of Strings. */ - private List executeCommand(List params) throws IMakerCoreExecutionException { + private List executeCommand(List params, OutputStream out) throws IMakerCoreExecutionException { List cmd = prepareCommand(params); // Try to start a process to execute iMaker @@ -369,7 +380,7 @@ Process process = builder.start(); // Start reading the output - StreamGobbler gobbler = new StreamGobbler(process.getInputStream(), outputStream); + StreamGobbler gobbler = new StreamGobbler(process.getInputStream(), out); gobbler.start(); ArrayList output; @@ -622,7 +633,7 @@ params.add(makeFile); List prodTargets; try { - prodTargets = executeCommand(params); + prodTargets = executeCommand(params,null); } catch (IMakerCoreExecutionException e) { this.lastImakerException = e; if(monitor != null) { @@ -659,7 +670,7 @@ params.set(0, IMakerWrapperPreferences.CMD_FETCH_CONFIGURATION); List settingsList; try { - settingsList = executeCommand(params); + settingsList = executeCommand(params,null); } catch (IMakerCoreExecutionException e) { this.lastImakerException = e; if(monitor != null) { @@ -760,13 +771,13 @@ public String getWorkdir(String makefile) throws IMakerCoreNotFoundException, IMakerCoreAlreadyRunningException, IMakerCoreExecutionException { String target = "help-variable-WORKDIR*-value"; String retValue = null; - verifyExists(); + verifyCompatibility(); List parameters = new ArrayList(); parameters.add("-f"); parameters.add(makefile); parameters.add(target); - List ret = executeCommand(parameters); + List ret = executeCommand(parameters,null); String output = ret.get(0); for (String str : ret) { if(str.startsWith("WORK")) { @@ -817,7 +828,7 @@ monitor.subTask(Messages.getString("IMakerWrapper.26")); } StringBuilder sb = new StringBuilder(); - List ret = executeCommand(cmd); + List ret = executeCommand(cmd,null); for (String str : ret) { Matcher matcher = pattern.matcher(str); if(matcher.find()) { @@ -850,15 +861,29 @@ if(impFile==null||!impFile.exists()) { throw new IMakerCoreExecutionException("Invalid imp file given!"); } - this.outputStream = out; - verifyExists(); + verifyCompatibility(); params.clear(); params.add("-f"); - params.add("\""+impFile.getAbsolutePath()+"\""); + params.add(getFilePath(impFile)); builderRunning = true; - List ret = executeCommand(params); + List ret = executeCommand(params,out); builderRunning = false; return getReturnStatus(ret); + } + + private String getFilePath(File impFile) { + String path = impFile.getAbsolutePath(); + if (path.contains(" ")) { + return "\""+path+"\""; + } else { + return path; + } + } + + public String getBuildCommand(File impFile) { + StringBuffer sb = new StringBuffer(); + sb.append(tool.get(0) + " -f " + getFilePath(impFile)); + return sb.toString(); } } diff -r 61163b28edca -r 7ff23301fe22 imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/messages.properties --- a/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/messages.properties Tue Jan 12 13:17:53 2010 -0600 +++ b/imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/messages.properties Mon Jan 25 12:26:21 2010 +0200 @@ -31,8 +31,8 @@ IMakerTabsViewer.4=Edit main image creation parameters IMakerTabsViewer.5=Settings IMakerTabsViewer.6=Edit detailed image creation parameters -IMakerTabsViewer.7=Debug -IMakerTabsViewer.8=Add debug files to the image +IMakerTabsViewer.7=Content +IMakerTabsViewer.8=Add content to the image IMakerTabsViewer.9=PlatSim IMakerTabsViewer.10=Configure PlatSim instance settings IMakerTabsViewer.11=Restore default configuration @@ -107,7 +107,7 @@ PreferencesTab.18=Save as... PreferencesTab.19=Save UI values to a new file under selected project PreferencesTab.20=Version informations of iMaker Extension and iMaker cmd -PreferencesTab.22=08.01.01 +PreferencesTab.22=10.03.01 PreferencesTab.23=prd PreferencesTab.24=subcon PreferencesTab.25=rnd @@ -151,4 +151,4 @@ Error.0=iMaker Core was not found. Error.1=An error has occured while executing iMaker Core. Make sure that imaker.cmd can be run without problems. Error.2=Commandline tool imaker.cmd not found. Make sure that imaker.cmd is in the path environment variable. -Error.3=The iMaker Plugin is not compatible with the selected underlying iMaker Core version. iMaker Core version should be xxx or newer. \ No newline at end of file +Error.3=This version of iMaker Plugin is not compatible with the selected underlying iMaker cmd version. iMaker cmd version should be xxx or newer, current version is yyy. Please update your iMaker cmd \ No newline at end of file