import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
-import org.tizen.emulator.manager.ui.detail.item.OptionType;
-import org.tizen.emulator.manager.vms.EmulatorVMList;
import org.tizen.emulator.manager.vms.SKIN_SHAPE;
-import org.tizen.emulator.manager.vms.xml.template.DeviceList;
-import org.tizen.emulator.manager.vms.xml.template.Item;
+import org.tizen.emulator.manager.vms.VMProperty;
+import org.tizen.emulator.manager.vms.option.IOption;
import org.tizen.emulator.manager.vms.xml.template.ItemList;
-import org.tizen.emulator.manager.vms.xml.template.ObjectFactory;
-import org.tizen.emulator.manager.vms.xml.template.Option;
-import org.tizen.emulator.manager.vms.xml.template.PropertyList;
public class CustomBaseImage extends BaseImage {
- public static ObjectFactory factory = new ObjectFactory();
-
public CustomBaseImage(Platform platform, String path) throws IOException {
if (platform == null) {
throw new IOException("Failed to create custom base image "
// TODO
initLastCreatedPropertyPath();
- //loadProperty();
- //createTemplate();
}
private void settingProperty(Platform platform) {
binaryVersion = "";
}
+ @Override
protected void initLastCreatedPropertyPath() {
StringBuilder sb = new StringBuilder();
sb.append(FilePathResources.getTizenVmsPath()).append(File.separator)
lastCreatedPropertyPath = sb.toString();
}
- // Create template from standard platform's template.
- private void createTemplate() {
- if (PlatformList.getPlatformList() != null) {
- for (Platform p : PlatformList.getPlatformList()) {
- if (p.getProfile().equals(profile)) {
- List<ItemList> templateList = new ArrayList<ItemList>();
- for(BaseImage i : p.getImageList()) {
- if (i.getItemList() != null) {
- templateList.add(i.getItemList());
- }
- }
- itemList = createCustomTemplate(templateList);
- }
- }
- }
+ @Override
+ public List<IOption> getOptionList() {
+ return platform.getCustomOptionList();
}
-
-
- private void loadProperty() {
- // load default
- File propertyFile = new File(platform.platformPath + File.separator
- + FilePathResources.getPlatformTemplatePath()
- + File.separator
- + imageName + "." + PlatformStringResources.CONFIG_EXTENSION);
- if (propertyFile.exists()) {
- EmulatorVMList vmList = EmulatorVMList.getInstance();
- defaultProperty = vmList.parseXML(propertyFile);
-
- } else {
- // If custom default property not exist, load standard property
- if (PlatformList.getPlatformList() != null) {
- Platform latest = null;
- for (Platform p : PlatformList.getPlatformList()) {
- if (p.getProfile().equals(profile)) {
- if (latest == null) {
- latest = p;
- } else {
- if (p.getVersion().compareTo(latest.getVersion()) > 0) {
- latest = p;
- }
- }
- }
- }
-
- if (latest != null) {
- for (BaseImage image : latest.getImageList()) {
- if (image.getType() != null && image.getType().equals("default")) {
- defaultProperty = image.getDefaultProperty();
- }
- }
- if (defaultProperty == null) {
- if (latest.getImageList().size() > 0) {
- defaultProperty = latest.getImageList().get(0).getDefaultProperty();
- }
- }
- }
- // TODO if defaultProperty == null ???
- }
- }
+ @Override
+ public VMProperty getDefaultProperty() {
+ return platform.getCustomDefaultProperty();
}
- private ItemList createCustomTemplate(List<ItemList> templateList) {
-
- if (templateList.size() == 0) {
- return null;
-
- } else if (templateList.size() == 1) {
- ItemList template = cloneTemplate(templateList.get(0));
- template.setImage(null);
- return template;
-
- } else { // Make union set
- ItemList base = cloneTemplate(templateList.get(0));
- for (int i=1 ; i < templateList.size() ; i++) {
- addToBase(base,templateList.get(i));
- }
- return base;
- }
- }
-
- private void addToBase(ItemList base, ItemList newOne) {
- // Property list add
- PropertyList newPropertyList = newOne.getPropertyList();
- PropertyList basePropertyList = base.getPropertyList();
- if (newPropertyList != null) {
- if (basePropertyList == null) {
- basePropertyList = factory.createPropertyList();
- base.setPropertyList(basePropertyList);
- }
- for (Item newItem : newPropertyList.getItem()) {
- boolean itemExistInBase = false;
- for (Item baseItem : basePropertyList.getItem()) {
- if (baseItem.getName().equals(newItem.getName())) {
- itemExistInBase = true;
- joinItem(baseItem, newItem);
- }
- }
- if (!itemExistInBase) {
- basePropertyList.getItem().add(cloneItem(newItem));
- }
- }
- }
-
- // Device list add
- DeviceList newDeviceList = newOne.getDeviceList();
- DeviceList baseDeviceList = base.getDeviceList();
- if (newDeviceList != null) {
- if (baseDeviceList == null) {
- baseDeviceList = factory.createDeviceList();
- base.setDeviceList(baseDeviceList);
- }
- for (Item newItem : newDeviceList.getItem()) {
- boolean itemExistInBase = false;
- for (Item baseItem : baseDeviceList.getItem()) {
- if (baseItem.getName().equals(newItem.getName())) {
- itemExistInBase = true;
- joinItem(baseItem, newItem);
- }
- }
- if (!itemExistInBase) {
- baseDeviceList.getItem().add(cloneItem(newItem));
- }
- }
- }
- }
-
-
- private void joinItem(Item baseItem, Item newItem) {
- // join sub items
- for (Item newSub : newItem.getItem()) {
- boolean itemExistInBase = false;
- for (Item baseSub : baseItem.getItem()) {
- if (baseSub.getName().equals(newSub.getName())) {
- itemExistInBase = true;
- joinItem(baseSub, newSub);
- }
- }
- if (!itemExistInBase) {
- baseItem.getItem().add(cloneItem(newSub));
- }
- }
- // join options
- for (Option newOption : newItem.getOption()) {
- boolean optionExistInBase = false;
- for (Option baseOption : baseItem.getOption()) {
- if (baseOption.getName().equals(newOption.getName())) {
- optionExistInBase = true;
- if (isListOption(baseOption, newOption)) {
- joinOption(baseOption, newOption);
- }
- }
- }
-
- if (!optionExistInBase) {
- baseItem.getOption().add(cloneOption(newOption));
- }
- }
-
- }
-
- private void joinOption(Option baseOption, Option newOption) {
- baseOption.setValue(joinCommaString(baseOption.getValue(), newOption.getValue()));
- }
-
-
- private String joinCommaString(String base, String newOne) {
- List<String> optionList = new ArrayList<String>();
- if (base != null) {
- String[] split = base.split(",");
- for (String str : split) {
- optionList.add(str.trim());
- }
- }
- if (newOne != null) {
- String[] split = newOne.split(",");
- for (String str : split) {
- optionList.add(str.trim());
- }
- }
-
- if (optionList.size() > 0) {
- Set<String> optionSet = new HashSet<String>();
- optionSet.addAll(optionList);
- optionList.clear();
- optionList.addAll(optionSet);
-// Collections.sort(optionList);
- StringBuilder sb = new StringBuilder();
-
- for (int i=0 ; i<optionList.size() ; i++) {
- sb.append(optionList.get(i));
- if (i < optionList.size()-1) {
- sb.append(",");
- }
- }
-
- return sb.toString();
- }
-
- return null;
- }
-
- private ItemList cloneTemplate(ItemList template) {
- ItemList newTemplate = factory.createItemList();
- newTemplate.setProfile(template.getProfile());
- newTemplate.setImage(template.getImage());
-
- // clone property list
- PropertyList propertyList = template.getPropertyList();
- if (propertyList != null) {
- PropertyList newPropertyList = factory.createPropertyList();
- newTemplate.setPropertyList(newPropertyList);
-
- for (Item item : propertyList.getItem()) {
- newPropertyList.getItem().add(cloneItem(item));
- }
- }
-
- // clone device list.
- DeviceList deviceList = template.getDeviceList();
- if (deviceList != null) {
- DeviceList newDeviceList = factory.createDeviceList();
- newTemplate.setDeviceList(newDeviceList);
-
- for (Item item : deviceList.getItem()) {
- newDeviceList.getItem().add(cloneItem(item));
- }
- }
-
- return newTemplate;
- }
-
- private Item cloneItem(Item item) {
- Item newItem = factory.createItem();
- newItem.setType(item.getType());
- newItem.setName(item.getName());
- newItem.setTitle(item.getTitle());
-
- for (Option option : item.getOption()) {
- newItem.getOption().add(cloneOption(option));
- }
-
- for (Item subItem : item.getItem()) {
- newItem.getItem().add(cloneItem(subItem));
- }
-
- return newItem;
- }
-
- private Option cloneOption(Option option) {
- Option newOption = factory.createOption();
- newOption.setName(option.getName());
- newOption.setValue(option.getValue());
- return newOption;
- }
-
- private boolean isListOption(Option baseOption, Option newOption) {
- if (baseOption.getName().equals(OptionType.COMBO_LIST.getName())
- && newOption.getName().equals(OptionType.COMBO_LIST.getName())) {
- return true;
- }
-
- return false;
+ @Override
+ public ItemList getItemList() {
+ return platform.getCustomItemList();
}
}
}
}
}
-
+/*
if (latest != null) {
template = latest.getTemplate();
}
+ */
}
private void loadPlugin() {
import java.io.FileFilter;
import java.io.IOException;
import java.util.ArrayList;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.plugin.EMPlugin;
import org.tizen.emulator.manager.resources.FilePathResources;
import org.tizen.emulator.manager.resources.StringResources;
import org.tizen.emulator.manager.tool.SettingInfoFile;
-import org.tizen.emulator.manager.vms.EmulatorVMList;
+import org.tizen.emulator.manager.ui.detail.item.OptionType;
import org.tizen.emulator.manager.vms.RESOLUTION;
import org.tizen.emulator.manager.vms.VMProperty;
import org.tizen.emulator.manager.vms.option.IOptionFactory;
+import org.tizen.emulator.manager.vms.xml.template.DeviceList;
+import org.tizen.emulator.manager.vms.xml.template.Item;
import org.tizen.emulator.manager.vms.xml.template.ItemList;
+import org.tizen.emulator.manager.vms.xml.template.ObjectFactory;
+import org.tizen.emulator.manager.vms.xml.template.Option;
+import org.tizen.emulator.manager.vms.xml.template.PropertyList;
import org.tizen.emulator.manager.vms.option.IOption;
public class Platform {
protected static int id = 1;
protected boolean isOldVersion = false;
- // TODO : for skins
protected ArrayList<Skin>skinList = new ArrayList<Skin>();
- // TODO : for template
- //private ArrayList<VMProperty> templateList = new ArrayList<VMProperty>();
- protected VMProperty template;
protected EMPlugin plugin;
+ // for custom base image
+ private ItemList customItemList;
+ private VMProperty customDefaultProperty;
+ private List<IOption> customOptionList;
+
protected ArrayList<BaseImage> imageList = new ArrayList<BaseImage>();
protected int currentImageIndex = -1;
protected Platform() {
loadProperties();
if (!imageList.isEmpty()) {
loadSkins();
- loadTemplate();
loadPlugin();
}
}
return null;
}
+ // Load option list for each image.
+ public List<IOption> getCustomOptionList() {
+ if (customOptionList == null) {
+ if (plugin != null) {
+ ExtensionItem exItem = getPlugin().getExtensionItem(PluginStringResources.OptionFactory);
+ IOptionFactory f = (IOptionFactory)(exItem.createClass());
+ if (f != null) {
+ customOptionList = f.makeOptionList(getCustomItemList());
+ }
+ }
+ }
+ return customOptionList;
+ }
+
private void loadProperties() {
if (platformPath == null) {
return;
}
}
+
+ private void createCustomDefaultProperty() {
+ // If custom default property not exist, load standard property
+ for (BaseImage image : getProfileClass().getImageList()) {
+ if (image.getPlatform() == this) {
+ if (image.getType() != null && image.getType().equals("default")) {
+ customDefaultProperty = image.getDefaultProperty();
+ }
+ }
+ }
+
+ if (customDefaultProperty == null) {
+ for (BaseImage image : getProfileClass().getImageList()) {
+ if (image.getPlatform() == this) {
+ customDefaultProperty = image.getDefaultProperty();
+ }
+ }
+ }
+ // TODO: if customDefaultProperty is still null ???
+ }
+
+ private void createCustomItemList() {
+ List<ItemList> templateList = new ArrayList<ItemList>();
+ for (BaseImage image : getProfileClass().getImageList()) {
+ if (image.getPlatform() == this) {
+ templateList.add(image.getItemList());
+ }
+ }
+ customItemList = createCustomTemplate(templateList);
+ }
+
+ private ItemList createCustomTemplate(List<ItemList> templateList) {
+
+ if (templateList.size() == 0) {
+ return null;
+
+ } else if (templateList.size() == 1) {
+ ItemList template = cloneTemplate(templateList.get(0));
+ template.setImage(null);
+ return template;
+
+ } else { // Make union set
+ ItemList base = cloneTemplate(templateList.get(0));
+ for (int i=1 ; i < templateList.size() ; i++) {
+ addToBase(base,templateList.get(i));
+ }
+ return base;
+ }
+ }
+
private void loadPlugin() {
File pluginJar = new File(platformPath + File.separator
+ FilePathResources.getPlatformPluginsPath()
}
}
- private void loadTemplate() {
- File templateFile = new File(platformPath + File.separator
- + FilePathResources.getPlatformTemplatePath()
- + File.separator
- + PlatformStringResources.TemplateFile);
- if (templateFile.exists()) {
- EmulatorVMList vmList = EmulatorVMList.getInstance();
- VMProperty property = vmList.parseXML(templateFile);
- template = property;
- }
- }
-
private void loadSkins() {
File dir = new File(platformPath + File.separator
+ FilePathResources.getPlatformSkinsPath());
return SkinList.getInstance().findGeneralSkinList(skinList);
}
-/*
- public ArrayList<VMProperty> getTemplates() {
- return templateList;
- }
-*/
- public VMProperty getTemplate() {
- return template;
- }
-
- public void setTemplate(VMProperty template) {
- this.template = template;
- }
-
public EMPlugin getPlugin() {
return plugin;
}
public void setProfileClass(Profile profileClass) {
this.profileClass = profileClass;
}
+
+ public ItemList getCustomItemList() {
+ if (customItemList == null) {
+ createCustomItemList();
+ }
+
+ return customItemList;
+ }
+
+ public VMProperty getCustomDefaultProperty() {
+ if (customDefaultProperty == null) {
+ createCustomDefaultProperty();
+ }
+ return customDefaultProperty;
+ }
+
+ public static ObjectFactory factory = new ObjectFactory();
+ private void addToBase(ItemList base, ItemList newOne) {
+ // Property list add
+ PropertyList newPropertyList = newOne.getPropertyList();
+ PropertyList basePropertyList = base.getPropertyList();
+ if (newPropertyList != null) {
+ if (basePropertyList == null) {
+ basePropertyList = factory.createPropertyList();
+ base.setPropertyList(basePropertyList);
+ }
+ for (Item newItem : newPropertyList.getItem()) {
+ boolean itemExistInBase = false;
+ for (Item baseItem : basePropertyList.getItem()) {
+ if (baseItem.getName().equals(newItem.getName())) {
+ itemExistInBase = true;
+ joinItem(baseItem, newItem);
+ }
+ }
+ if (!itemExistInBase) {
+ basePropertyList.getItem().add(cloneItem(newItem));
+ }
+ }
+ }
+
+ // Device list add
+ DeviceList newDeviceList = newOne.getDeviceList();
+ DeviceList baseDeviceList = base.getDeviceList();
+ if (newDeviceList != null) {
+ if (baseDeviceList == null) {
+ baseDeviceList = factory.createDeviceList();
+ base.setDeviceList(baseDeviceList);
+ }
+ for (Item newItem : newDeviceList.getItem()) {
+ boolean itemExistInBase = false;
+ for (Item baseItem : baseDeviceList.getItem()) {
+ if (baseItem.getName().equals(newItem.getName())) {
+ itemExistInBase = true;
+ joinItem(baseItem, newItem);
+ }
+ }
+ if (!itemExistInBase) {
+ baseDeviceList.getItem().add(cloneItem(newItem));
+ }
+ }
+ }
+ }
+
+
+ private void joinItem(Item baseItem, Item newItem) {
+ // join sub items
+ for (Item newSub : newItem.getItem()) {
+ boolean itemExistInBase = false;
+ for (Item baseSub : baseItem.getItem()) {
+ if (baseSub.getName().equals(newSub.getName())) {
+ itemExistInBase = true;
+ joinItem(baseSub, newSub);
+ }
+ }
+ if (!itemExistInBase) {
+ baseItem.getItem().add(cloneItem(newSub));
+ }
+ }
+ // join options
+ for (Option newOption : newItem.getOption()) {
+ boolean optionExistInBase = false;
+ for (Option baseOption : baseItem.getOption()) {
+ if (baseOption.getName().equals(newOption.getName())) {
+ optionExistInBase = true;
+ if (isListOption(baseOption, newOption)) {
+ joinOption(baseOption, newOption);
+ }
+ }
+ }
+
+ if (!optionExistInBase) {
+ baseItem.getOption().add(cloneOption(newOption));
+ }
+ }
+
+ }
+
+ private void joinOption(Option baseOption, Option newOption) {
+ baseOption.setValue(joinCommaString(baseOption.getValue(), newOption.getValue()));
+ }
+
+
+ private String joinCommaString(String base, String newOne) {
+ List<String> optionList = new ArrayList<String>();
+ if (base != null) {
+ String[] split = base.split(",");
+ for (String str : split) {
+ optionList.add(str.trim());
+ }
+ }
+ if (newOne != null) {
+ String[] split = newOne.split(",");
+ for (String str : split) {
+ optionList.add(str.trim());
+ }
+ }
+
+ if (optionList.size() > 0) {
+ Set<String> optionSet = new HashSet<String>();
+ optionSet.addAll(optionList);
+ optionList.clear();
+ optionList.addAll(optionSet);
+// Collections.sort(optionList);
+ StringBuilder sb = new StringBuilder();
+
+ for (int i=0 ; i<optionList.size() ; i++) {
+ sb.append(optionList.get(i));
+ if (i < optionList.size()-1) {
+ sb.append(",");
+ }
+ }
+
+ return sb.toString();
+ }
+
+ return null;
+ }
+
+ private ItemList cloneTemplate(ItemList template) {
+ ItemList newTemplate = factory.createItemList();
+ newTemplate.setProfile(template.getProfile());
+ newTemplate.setImage(template.getImage());
+
+ // clone property list
+ PropertyList propertyList = template.getPropertyList();
+ if (propertyList != null) {
+ PropertyList newPropertyList = factory.createPropertyList();
+ newTemplate.setPropertyList(newPropertyList);
+
+ for (Item item : propertyList.getItem()) {
+ newPropertyList.getItem().add(cloneItem(item));
+ }
+ }
+
+ // clone device list.
+ DeviceList deviceList = template.getDeviceList();
+ if (deviceList != null) {
+ DeviceList newDeviceList = factory.createDeviceList();
+ newTemplate.setDeviceList(newDeviceList);
+
+ for (Item item : deviceList.getItem()) {
+ newDeviceList.getItem().add(cloneItem(item));
+ }
+ }
+
+ return newTemplate;
+ }
+
+ private Item cloneItem(Item item) {
+ Item newItem = factory.createItem();
+ newItem.setType(item.getType());
+ newItem.setName(item.getName());
+ newItem.setTitle(item.getTitle());
+
+ for (Option option : item.getOption()) {
+ newItem.getOption().add(cloneOption(option));
+ }
+
+ for (Item subItem : item.getItem()) {
+ newItem.getItem().add(cloneItem(subItem));
+ }
+
+ return newItem;
+ }
+
+ private Option cloneOption(Option option) {
+ Option newOption = factory.createOption();
+ newOption.setName(option.getName());
+ newOption.setValue(option.getValue());
+ return newOption;
+ }
+
+ private boolean isListOption(Option baseOption, Option newOption) {
+ if (baseOption.getName().equals(OptionType.COMBO_LIST.getName())
+ && newOption.getName().equals(OptionType.COMBO_LIST.getName())) {
+ return true;
+ }
+
+ return false;
+ }
}
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.tizen.emulator.manager.platform.CustomBaseImage;
+import org.tizen.emulator.manager.platform.Platform;
import org.tizen.emulator.manager.plugin.ExtensionItem;
import org.tizen.emulator.manager.resources.ColorResources;
import org.tizen.emulator.manager.resources.FontResources;
// ArrayList<IInfoViewItem> itemList;
// ArrayList<IModifyViewItem> itemList;
// ArrayList<? extends IViewItem> itemList;
- String profile;
+ Platform platform;
String imageName;
boolean isCustom;
- public ViewItemList(ExtensionItem exItem, String profile, String imageName, boolean isCustom) {
+ public ViewItemList(ExtensionItem exItem, Platform platform, String imageName, boolean isCustom) {
this.exItem = exItem;
- this.profile = profile;
+ this.platform = platform;
this.imageName = imageName;
this.isCustom = isCustom;
}
public boolean matchesWith(VMPropertyValue propertyValue) {
- if (!profile.equals(propertyValue.profile)) {
+ if (platform != propertyValue.baseImage.getPlatform()) {
return false;
} else {
if (imageName != null && !imageName.equals(propertyValue.baseImage.getName())) {
if (template != null) {
templateList.add(template);
infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(),
- template, platform.getProfile(), image.getName(), false));
+ template, platform, image.getName(), false));
}
}
-
- // TODO
- // add itemlist for custom.
- /*
- for (Platform custom : PlatformList.getCustomPlatform()) {
- if (custom.getProfile().equals(platform.getProfile())) {
- infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(),
- custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true));
- }
- }
- */
+ // add item list for custom.
+ infoItemList.add(new InfoViewItemList(item, this.getItemListComposite(),
+ platform.getCustomItemList(), platform, null, true));
}
}
}
ArrayList<IInfoViewItem> itemList;
InfoViewItemList(ExtensionItem item, Composite parent, ItemList template,
- String profile, String imageName, boolean isCustom) {
- super(item, profile, imageName, isCustom);
+ Platform platform, String imageName, boolean isCustom) {
+ super(item, platform, imageName, isCustom);
makeItemList(parent, template, isCustom);
initItemList(parent);
}
- InfoViewItemList(ExtensionItem item, Composite parent, List<ItemList> list, String profile) {
- super(item, profile, null, true);
- makeCustomItemList(parent, list);
- initItemList(parent);
- }
-
-
private void makeItemList(Composite parent, ItemList templateList, boolean isCustom) {
IItemListFactory f = (IItemListFactory)(exItem.createClass());
itemList = new ArrayList<IInfoViewItem>();
// itemList = f.getInfoItemList(deviceItemList);
}
- private void makeCustomItemList(Composite parent, List<ItemList> list) {
- IItemListFactory f = (IItemListFactory)(exItem.createClass());
- itemList = new ArrayList<IInfoViewItem>();
- f.makeCustomItemList(itemList, list);
- }
-
private void initItemList(Composite parent){
comp = new Composite(parent, SWT.NONE);
comp.setLayout(new FormLayout());
import org.tizen.emulator.manager.logging.EMLogger;
import org.tizen.emulator.manager.platform.BaseImage;
import org.tizen.emulator.manager.platform.Platform;
-import org.tizen.emulator.manager.platform.PlatformList;
import org.tizen.emulator.manager.platform.Profile;
import org.tizen.emulator.manager.platform.ProfileList;
import org.tizen.emulator.manager.plugin.ExtensionItem;
if (template != null) {
templateList.add(template);
modifyItemList.add(new ModifyViewItemList(item, this,
- template, platform.getProfile(), image.getName(), false));
+ template, platform, image.getName(), false));
}
}
-
- // TODO
- // add itemlist for custom.
- /*
- for (Platform custom : PlatformList.getCustomPlatform()) {
- if (custom.getProfile().equals(platform.getProfile())) {
- modifyItemList.add(new ModifyViewItemList(item, this,
- custom.getImageList().get(0).getItemList(), custom.getProfile(), null, true));
- }
- }
- */
+ // add item list for custom.
+ modifyItemList.add(new ModifyViewItemList(item, this,
+ platform.getCustomItemList(), platform, null, true));
}
}
}
ArrayList<IModifyViewItem> itemList;
ModifyViewItemList(ExtensionItem item, PModifyViewPage page, ItemList template
- ,String profile, String imageName, boolean isCustom) {
- super(item, profile, imageName, isCustom);
+ ,Platform platform, String imageName, boolean isCustom) {
+ super(item, platform, imageName, isCustom);
makeItemList(page, template, isCustom);
initItemList(page);
}
- ModifyViewItemList(ExtensionItem item, PModifyViewPage page, List<ItemList> list, String profile) {
- super(item, profile, null, true);
- makeCustomItemList(page, list);
- initItemList(page);
- }
-
private void makeItemList(PModifyViewPage page, ItemList deviceItemList, boolean isCustom) {
IItemListFactory f = (IItemListFactory)(exItem.createClass());
itemList = new ArrayList<IModifyViewItem>();
}
}
- private void makeCustomItemList(PModifyViewPage page, List<ItemList> list) {
- IItemListFactory f = (IItemListFactory)(exItem.createClass());
- itemList = new ArrayList<IModifyViewItem>();
- f.makeCustomItemList(itemList, list);
- }
-
private void initItemList(PModifyViewPage page) {
comp = new Composite(page.getItemListComposite(), SWT.NONE);
comp.setLayout(new FormLayout());