- public static Widget getWidget(Type type) {
-
- switch (type) {
- case SERVICE:
- return new ServiceWidget();
- case VF:
- return new VfWidget();
- case VFC:
- return new VfcWidget();
- case VSERVER:
- return new VServerWidget();
- case VOLUME:
- return new VolumeWidget();
- case FLAVOR:
- return new FlavorWidget();
- case TENANT:
- return new TenantWidget();
- case VOLUME_GROUP:
- return new VolumeGroupWidget();
- case LINT:
- return new LIntfWidget();
- case L3_NET:
- return new L3NetworkWidget();
- case VFMODULE:
- return new VfModuleWidget();
- case IMAGE:
- return new ImageWidget();
- case OAM_NETWORK:
- return new OamNetwork();
- case ALLOTTED_RESOURCE:
- return new AllotedResourceWidget();
- case TUNNEL_XCONNECT:
- return new TunnelXconnectWidget();
- default:
- return null;
+ public Widget(Widget baseWidget) throws XmlArtifactGenerationException {
+ this(baseWidget.getWidgetType(), baseWidget.getName(), baseWidget.getDeleteFlag());
+ if (type == Type.VSERVER) {
+ widgets.add(getWidget(Type.FLAVOR));
+ widgets.add(getWidget(Type.IMAGE));
+ widgets.add(getWidget(Type.TENANT));
+ widgets.add(getWidget(Type.VFC));