use of com.sldeditor.ui.detail.vendor.VendorOptionFactoryInterface in project sldeditor by robward-scisys.
the class VendorOptionInfoManagerTest method testAddVendorOptionInfo.
/**
* Test method for
* {@link com.sldeditor.common.vendoroption.info.VendorOptionInfoManager#addVendorOptionInfo(com.sldeditor.ui.detail.vendor.VendorOptionFactoryInterface)}.
* {@link com.sldeditor.common.vendoroption.info.VendorOptionInfoManager#getPanel(java.lang.Class)}.
* {@link com.sldeditor.common.vendoroption.info.VendorOptionInfoManager#setSelectedVersion(java.lang.Class, com.sldeditor.common.vendoroption.VersionData)}.
*/
@Test
public void testAddVendorOptionInfo() {
VendorOptionInfoManager.getInstance().addVendorOptionInfo(null);
VendorOptionFactoryInterface f1 = new VendorOptionFactoryInterface() {
@Override
public List<VendorOptionInterface> getVendorOptionList() {
return null;
}
@Override
public List<VendorOptionInterface> getVendorOptionList(String className) {
return null;
}
@Override
public List<VendorOptionInfo> getVendorOptionInfoList() {
List<VendorOptionInfo> list = new ArrayList<VendorOptionInfo>();
return list;
}
};
VendorOptionInfoManager.getInstance().addVendorOptionInfo(f1);
VendorOptionInfoManager.getInstance().addVendorOptionInfo(f1);
VendorOptionInfoPanel panel1 = VendorOptionInfoManager.getInstance().getPanel(String.class);
VendorOptionInfoPanel panel2 = VendorOptionInfoManager.getInstance().getPanel(Double.class);
VendorOptionInfoPanel panel3 = VendorOptionInfoManager.getInstance().getPanel(String.class);
assertTrue(panel1 == panel3);
assertTrue(panel1 != panel2);
VendorOptionInfoManager.getInstance().setSelectedVersion(null, null);
VersionData versionData = VersionData.decode(GeoServerVendorOption.class, "3.1.4");
VendorOptionInfoManager.getInstance().setSelectedVersion(String.class, versionData);
}
use of com.sldeditor.ui.detail.vendor.VendorOptionFactoryInterface in project sldeditor by robward-scisys.
the class VendorOptionInfoManager method getPanel.
/**
* Gets the panel.
*
* @return the panel
*/
public VendorOptionInfoPanel getPanel(Class<?> instance) {
InstanceData data = instanceMap.get(instance);
if (data == null) {
data = new InstanceData();
List<VendorOptionInfo> infoList = new ArrayList<VendorOptionInfo>();
for (VendorOptionFactoryInterface vo : voFactoryList) {
List<VendorOptionInfo> vendorOptionInfoList = vo.getVendorOptionInfoList();
if (vendorOptionInfoList != null) {
infoList.addAll(vendorOptionInfoList);
}
}
data.infoModel = new VendorOptionInfoModel();
data.infoModel.addVendorOptionInfo(infoList);
data.panel = new VendorOptionInfoPanel(data.infoModel);
instanceMap.put(instance, data);
}
return data.panel;
}
Aggregations