(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 extends Comment>)newValue);
+ return;
+ case ImpmodelPackage.IMP_DOCUMENT__ORIDE_FILES:
+ getOrideFiles().clear();
+ getOrideFiles().addAll((Collection extends OverrideFiles>)newValue);
+ return;
+ case ImpmodelPackage.IMP_DOCUMENT__ORIDE_CONFS:
+ getOrideConfs().clear();
+ getOrideConfs().addAll((Collection extends OverrideConfiguration>)newValue);
+ return;
+ case ImpmodelPackage.IMP_DOCUMENT__VARIABLES:
+ getVariables().clear();
+ getVariables().addAll((Collection extends Variable>)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 extends Comment>)newValue);
+ return;
+ case ImpmodelPackage.OVERRIDE_CONFIGURATION__ENTRIES:
+ getEntries().clear();
+ getEntries().addAll((Collection extends ConfigEntry>)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 extends Comment>)newValue);
+ return;
+ case ImpmodelPackage.OVERRIDE_FILES__ENTRIES:
+ getEntries().clear();
+ getEntries().addAll((Collection extends FileListEntry>)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