imakerplugin/com.nokia.s60tools.imaker/src/com/nokia/s60tools/imaker/internal/model/ImakerProperties.java
author dpodwall
Tue, 12 Jan 2010 13:17:53 -0600
changeset 0 61163b28edca
child 1 7ff23301fe22
permissions -rw-r--r--
initial EPL conversion
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     1
/*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     3
* All rights reserved.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     4
* This component and the accompanying materials are made available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     6
* which accompanies this distribution, and is available
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     8
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
     9
* Initial Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    11
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    12
* Contributors:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    13
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    14
* Description:
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    15
*
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    16
*/
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    17
package com.nokia.s60tools.imaker.internal.model;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    18
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    19
import java.io.ByteArrayInputStream;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    20
import java.io.ByteArrayOutputStream;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    21
import java.io.FileNotFoundException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    22
import java.io.IOException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    23
import java.io.InputStream;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    24
import java.util.ArrayList;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    25
import java.util.Iterator;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    26
import java.util.List;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    27
import java.util.Properties;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    28
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    29
import org.eclipse.core.resources.IFile;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    30
import org.eclipse.core.resources.IProject;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    31
import org.eclipse.core.runtime.CoreException;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    32
import org.eclipse.core.runtime.IPath;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    33
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    34
import com.nokia.s60tools.imaker.IMakerKeyConstants;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    35
import com.nokia.s60tools.imaker.IMakerUtils;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    36
import com.nokia.s60tools.imaker.Messages;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    37
import com.nokia.s60tools.imaker.UIVariable;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    38
import com.nokia.s60tools.imaker.internal.managers.ProjectManager;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    39
import com.nokia.s60tools.imaker.internal.model.iContent.IContentFactory;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    40
import com.nokia.s60tools.imaker.internal.model.iContent.IbyEntry;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    41
import com.nokia.s60tools.imaker.internal.wrapper.IMakerWrapperPreferences;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    42
import com.nokia.s60tools.imaker.internal.wrapper.PlatsimManager;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    43
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    44
public class ImakerProperties extends Properties {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    45
	public static final String SEPARATOR			  = ":;";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    46
	public static final String GENERATED_FILES_FOLDER = "imakerplugin";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    47
	private static final long serialVersionUID = 1L;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    48
	private List<UIVariable> variables=null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    49
	private String activeFile = null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    50
	private boolean used = false;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    51
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    52
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    53
	 * Create imaker properties from file
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    54
	 * @param file
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    55
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    56
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    57
	public static ImakerProperties createFromFile(IFile file) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    58
		ImakerProperties imakerPreference = new ImakerProperties();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    59
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    60
		if(file!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    61
			try {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    62
				imakerPreference.load(file.getContents());
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    63
			} catch (FileNotFoundException e) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    64
				imakerPreference = null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    65
			} catch (IOException e) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    66
				imakerPreference = null;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    67
			} catch (CoreException e) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    68
				e.printStackTrace();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    69
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    70
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    71
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    72
		return imakerPreference;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    73
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    74
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    75
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    76
	 * Create imaker properties from file
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    77
	 * @param file
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    78
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    79
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    80
	public void saveToFile(IFile file) {		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    81
		if(file!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    82
			InputStream input = getAsInputStream();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    83
			try {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    84
				file.setContents(input, true, false,null);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    85
			} catch (CoreException e) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    86
				e.printStackTrace();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    87
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    88
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    89
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    90
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    91
	public ImakerProperties() {}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    92
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    93
	public InputStream getAsInputStream() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    94
		ByteArrayOutputStream bao = new ByteArrayOutputStream();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    95
		try {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    96
			store(bao, "iMaker properties");
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    97
		} catch (IOException e) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    98
			e.printStackTrace();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
    99
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   100
		ByteArrayInputStream bs = new ByteArrayInputStream(bao.toString().getBytes());
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   101
		return bs;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   102
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   103
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   104
	/**
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   105
	 * Parse the contents of this properties file and create imaker command that is executable
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   106
	 * @param selectedProject
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   107
	 * @param workdir Place where the temporary iby/mk files will be placed
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   108
	 * @return
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   109
	 */
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   110
	public List<String> parseImakerCommand(IProject selectedProject, IPath workdir) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   111
		String drive = IMakerUtils.getProjectRootLocation(selectedProject);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   112
		ArrayList<String> command = new ArrayList<String>();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   113
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   114
		String makefile = (String) get(IMakerKeyConstants.MAKEFILE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   115
		if(makefile!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   116
			appendCommand(command,IMakerWrapperPreferences.ARG_FETCH_CONFIGURATION);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   117
			appendCommand(command,makefile);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   118
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   119
		addAdditionalParameters(command,(String) get(IMakerKeyConstants.TARGET_LIST)," ");
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   120
		String platsim = (String) get(IMakerKeyConstants.PLATSIM_INSTANCE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   121
		if(platsim!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   122
			command.add(IMakerKeyConstants.PLATSIM_INSTANCE +"="+parse(platsim,drive));
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   123
			String run = (String)get(IMakerKeyConstants.PLATSIM_RUN);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   124
			if(run!=null&&run.equals("true")) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   125
				command.add(IMakerKeyConstants.PLATSIM_RUN +"=1");		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   126
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   127
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   128
		addAdditionalParameters(command,(String) get(IMakerKeyConstants.ADDITIONAL_PARAMETERS),SEPARATOR);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   129
		addAdditionalParameters(command, (String) get(IMakerKeyConstants.MODIFIED_SETTINGS),SEPARATOR);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   130
		String type = (String) get(IMakerKeyConstants.TYPE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   131
		command.add(IMakerWrapperPreferences.TYPE+"="+type);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   132
		String verb = (String) get(IMakerKeyConstants.VERBOSE);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   133
		if(verb!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   134
			command.add(Messages.getString("Flashmenu.9"));
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   135
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   136
		
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   137
		// parse iby files and makefile
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   138
		String str = (String)get(IMakerKeyConstants.DEBUGFILES);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   139
		if(str!=null&&!str.equals("")) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   140
			List<IbyEntry> entries = new ArrayList<IbyEntry>();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   141
			String[] entriesStr = str.split(ImakerProperties.SEPARATOR);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   142
			for (int i = 0; i < entriesStr.length; i++) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   143
				String entryStr = entriesStr[i];
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   144
				if(entryStr!=null&&!entryStr.equals("")) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   145
					IbyEntry entry = IContentFactory.eINSTANCE.createEntryFromString(entryStr);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   146
					if(entry.isEnabled()) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   147
						entries.add(entry);						
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   148
					}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   149
				}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   150
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   151
			ProjectManager pm = new ProjectManager(selectedProject);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   152
			IPath mkfile = IMakerUtils.createIbyFiles(entries, pm, workdir);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   153
			if(mkfile!=null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   154
				appendCommand(command,IMakerWrapperPreferences.ARG_FETCH_CONFIGURATION);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   155
				appendCommand(command,"\""+mkfile.toOSString()+"\"");
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   156
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   157
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   158
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   159
		return command;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   160
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   161
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   162
	private String parse(String instance, String env) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   163
		if(instance==null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   164
			instance="1";
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   165
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   166
		if(instance.equals(Messages.getString("PlatsimTab.0"))) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   167
			PlatsimManager pm = new PlatsimManager(env);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   168
			int max = 1;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   169
			List<String> instances = pm.getInstances();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   170
			for (String ins : instances) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   171
				int intIns = Integer.parseInt(ins);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   172
				if(intIns>max) max = intIns;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   173
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   174
			return String.valueOf(max+1);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   175
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   176
		return instance;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   177
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   178
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   179
	private void addAdditionalParameters(ArrayList<String> command,
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   180
			String adds, String sep) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   181
		if(adds==null||adds.equals("")) { //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   182
			return;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   183
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   184
		String[] parts = adds.split(sep); //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   185
		for (int i = 0; i < parts.length; i++) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   186
			String part = parts[i];
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   187
			if(!part.equals("")) { //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   188
				appendCommand(command, part);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   189
			}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   190
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   191
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   192
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   193
	private void appendCommand(ArrayList<String> command, String value) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   194
		if((value!=null)&&!(value.equals(""))) { //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   195
			command.add(value.trim());
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   196
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   197
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   198
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   199
	private void updateVariables() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   200
		if(variables==null) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   201
			return;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   202
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   203
		List<UIVariable> includeVariables = IMakerUtils.getCommandlineIncludeVariables(variables);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   204
		List<String> variablesToStrings = IMakerUtils.convertVariablesToStrings(includeVariables);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   205
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   206
		StringBuilder settings = new StringBuilder();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   207
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   208
		for (Iterator<String> iterator = variablesToStrings.iterator(); iterator
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   209
		.hasNext();) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   210
			String setting = iterator.next();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   211
			settings.append(setting+SEPARATOR); //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   212
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   213
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   214
		String string = settings.toString();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   215
		if(!string.equals("")) { //$NON-NLS-1$
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   216
			put(IMakerKeyConstants.MODIFIED_SETTINGS, string);
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   217
		}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   218
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   219
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   220
	public void setVariables(List<UIVariable> variables) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   221
		this.variables = variables;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   222
		updateVariables();
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   223
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   224
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   225
	public void setActiveFile(String path) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   226
		this.activeFile = path;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   227
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   228
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   229
	public String getActiveFile() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   230
		return activeFile;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   231
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   232
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   233
	public void setUsed(boolean b) {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   234
		this.used  = b;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   235
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   236
	
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   237
	public boolean isUsed() {
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   238
		return this.used;
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   239
	}
61163b28edca initial EPL conversion
dpodwall
parents:
diff changeset
   240
}