|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 package init; |
|
18 |
|
19 import interfaces.IPluginInitializer; |
|
20 |
|
21 import java.io.File; |
|
22 |
|
23 import org.eclipse.core.runtime.preferences.ConfigurationScope; |
|
24 import org.eclipse.core.runtime.preferences.IEclipsePreferences; |
|
25 import org.osgi.service.prefs.Preferences; |
|
26 |
|
27 import constants.IS60CTCommonConstants; |
|
28 |
|
29 public class CRPluginInitializer implements IPluginInitializer { |
|
30 |
|
31 //preferences file support |
|
32 private static final String CR_CONF_NODE="CenRep"; |
|
33 private static final String CR_CONF_PATH="PATH"; |
|
34 public CRPluginInitializer() { |
|
35 |
|
36 } |
|
37 |
|
38 public void init() { |
|
39 IEclipsePreferences ePref= new ConfigurationScope().getNode(IS60CTCommonConstants.S60_PREFERENCES); |
|
40 Preferences pref=ePref.node(CRPluginInitializer.CR_CONF_NODE); |
|
41 String[] paths = pref.get(CRPluginInitializer.CR_CONF_PATH, "").trim().split(File.pathSeparator); |
|
42 for(int i=0;i<paths.length;i++){ |
|
43 File file=new File(paths[i]); |
|
44 openCRMLs(file); |
|
45 |
|
46 } |
|
47 } |
|
48 private void openCRMLs(File file){ |
|
49 // ResourceSet resourceSet = DomainManager.instance().getEditingDomain().getResourceSet(); |
|
50 // if(file.exists()){ |
|
51 // if(file.isDirectory()){ |
|
52 // String[] files=file.list(); |
|
53 // for(int j=0;j<files.length;j++)openCRMLs(new File(file.getAbsolutePath()+File.separator+files[j])); |
|
54 // }else if(file.isFile()&&file.getAbsolutePath().endsWith(DomainManager.EMPTY_FILE_URL)) |
|
55 // resourceSet.getResource(URI.createFileURI(file.getAbsolutePath()), true); |
|
56 // } |
|
57 } |
|
58 } |