Author: adietish
Date: 2010-12-15 10:17:08 -0500 (Wed, 15 Dec 2010)
New Revision: 27510
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
Log:
cleanup
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15
15:11:00 UTC (rev 27509)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-12-15
15:17:08 UTC (rev 27510)
@@ -107,6 +107,7 @@
fd.top = new FormAttachment(0, 0);
cpuLabel.setLayoutData(fd);
DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu");
//$NON-NLS-1$
+ setCPU(cpuProperty.getValue());
Control cpuControl = createCpuControls(cpuProperty, storageLabel, container);
fd = new FormData();
@@ -114,6 +115,7 @@
fd.top = new FormAttachment(cpuLabel, 8);
memoryLabel.setLayoutData(fd);
DeltaCloudHardwareProperty memoryProperty =
profile.getNamedProperty("memory"); //$NON-NLS-1$
+ setMemody(memoryProperty.getValue());
Control memoryControl = createMemoyControl(cpuControl, memoryProperty, storageLabel,
container);
fd = new FormData();
@@ -121,6 +123,7 @@
fd.top = new FormAttachment(memoryControl, 8);
storageLabel.setLayoutData(fd);
DeltaCloudHardwareProperty storageProperty =
profile.getNamedProperty("storage"); //$NON-NLS-1$
+ setStorage(storageProperty.getValue());
createStorageControls(memoryControl, memoryProperty, storageProperty, storageLabel,
container);
}
@@ -129,14 +132,14 @@
Control storageControl = null;
if (storageProperty != null) {
if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label storage = new Label(container, SWT.NULL);
- storage.setText(storageProperty.getValue());
+ Label storageValueLabel = new Label(container, SWT.NULL);
+ storageValueLabel.setText(storageProperty.getValue());
FormData f = new FormData();
f.left = new FormAttachment(storageLabel, 50);
f.top = new FormAttachment(memoryControl, 8);
- storage.setLayoutData(f);
- storage.setVisible(true);
- storageControl = storage;
+ storageValueLabel.setLayoutData(f);
+ storageValueLabel.setVisible(true);
+ storageControl = storageValueLabel;
} else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
storageDefaultValue = storageProperty.getValue();
int indexDefault = storageDefaultValue.indexOf('.');
@@ -328,13 +331,13 @@
Control cpuControl = null;
if (cpuProperty != null) {
if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
- Label cpu = new Label(container, SWT.NULL);
- cpu.setText(cpuProperty.getValue());
+ Label cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel.setText(cpuProperty.getValue());
FormData f = new FormData();
f.left = new FormAttachment(storageLabel, 50);
f.right = new FormAttachment(100, 0);
- cpu.setLayoutData(f);
- cpuControl = cpu;
+ cpuLabel.setLayoutData(f);
+ cpuControl = cpuLabel;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
cpuDefaultValue = cpuProperty.getValue();
cpuSpinner = new Spinner(container, SWT.READ_ONLY);
@@ -387,12 +390,21 @@
container.setVisible(visible);
}
+ private void setCPU(String value) {
+ this.cpu = value;
+ }
+
public String getCPU() {
- if (cpu != null && !cpu.equals(cpuDefaultValue))
+ if (cpu != null && !cpu.equals(cpuDefaultValue)) {
return cpu;
+ }
return null;
}
+ private void setMemody(String value) {
+ this.memory = value;
+ }
+
public String getMemory() {
if (memory != null && !memory.equals(memoryDefaultValue)) {
return memory;
@@ -400,6 +412,10 @@
return null;
}
+ private void setStorage(String value) {
+ this.storage = value;
+ }
+
public String getStorage() {
if (storage != null && !storage.equals(storageDefaultValue)) {
return storage;
Show replies by date