import org.osgi.framework.Bundle;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import org.tizen.rt.ide.Activator;
import org.tizen.rt.ide.Messages;
import org.tizen.rt.ide.util.SDKUtil;
public class NewArtikProjectWizardPage2 extends WizardPage {
private final Logger logger = LoggerFactory.getLogger(NewArtikProjectWizardPage2.class);
+ private final static String TEMPLATE_HOME_PATH = "platforms/tizen-rt/templates";
+ private final static String TEMPLATE_DESC_FILE = "desc.xml";
+ private final static String TEMPLATE_DEFAULT_ICON = "icons/ic.png";
+
private Table table;
private Label lblBoardName;
private Browser browser;
String toolPath = SDKUtil.getSdkPath();
- File tempFile = new File(toolPath, "platforms/TizenRT/templates");
+ File tempFile = new File(toolPath, TEMPLATE_HOME_PATH);
File[] files = tempFile.listFiles(new FilenameFilter() {
@Override
public boolean accept(File arg0, String arg1) {
TemplateData tempData = null;
if (file.isDirectory()) {
- File descFile = new File(file, "desc.xml");
+ File descFile = new File(file, TEMPLATE_DESC_FILE);
if (descFile.exists()) {
tempData = TemplateData.read(file.toString(), descFile);
}
}
}
} else {
- Bundle bundle = Platform.getBundle("org.tizen.rt.product");
- URL url = FileLocator.find(bundle, new Path("icons/ic.png"), null);
+ Bundle bundle = Platform.getBundle(Activator.PLUGIN_ID);
+ URL url = FileLocator.find(bundle, new Path(TEMPLATE_DEFAULT_ICON), null);
ImageDescriptor imageDesc = ImageDescriptor.createFromURL(url);
img = imageDesc.createImage();
}
} else {
table.setData(String.valueOf(idx++), file.toString());
}
-
}
}
}