JBoss Tools SVN: r23957 - workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-08-05 22:26:56 -0400 (Thu, 05 Aug 2010)
New Revision: 23957
Modified:
workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java
Log:
JBIDE-6791 - also changing hostname property
Modified: workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-08-06 00:38:56 UTC (rev 23956)
+++ workspace/rstryker/rse/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/rse/ui/RSEDeploymentPreferenceUI.java 2010-08-06 02:26:56 UTC (rev 23957)
@@ -136,6 +136,9 @@
modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
modeSection.getServer(), RSEUtils.RSE_SERVER_HOST, hostName,
"Change RSE Host"));
+ modeSection.getCommandManager().execute(new ChangeServerPropertyCommand(
+ modeSection.getServer(), "hostname", combo.getHost().getHostName(),
+ "Change Hostname"));
}
}
15 years, 4 months
JBoss Tools SVN: r23956 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-08-05 20:38:56 -0400 (Thu, 05 Aug 2010)
New Revision: 23956
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java
Log:
@Override removed
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java 2010-08-06 00:38:15 UTC (rev 23955)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java 2010-08-06 00:38:56 UTC (rev 23956)
@@ -61,7 +61,6 @@
uidText.setText(uid);
}
uidText.addModifyListener(new ModifyListener() {
- @Override
public void modifyText(ModifyEvent e) {
uid = uidText.getText();
}
@@ -77,7 +76,6 @@
pwdText.setText(pwd);
}
pwdText.addModifyListener(new ModifyListener() {
- @Override
public void modifyText(ModifyEvent e) {
pwd = pwdText.getText();
}
15 years, 4 months
JBoss Tools SVN: r23955 - trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2010-08-05 20:38:15 -0400 (Thu, 05 Aug 2010)
New Revision: 23955
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
Log:
@Override removed
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2010-08-05 21:51:34 UTC (rev 23954)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2010-08-06 00:38:15 UTC (rev 23955)
@@ -534,7 +534,6 @@
toolkit.adapt(urlCombo);
urlCombo.addModifyListener(new ModifyListener() {
- @Override
public void modifyText(ModifyEvent e) {
setControlsForSelectedURL();
getCurrentHistoryEntry().setUrl(urlCombo.getText());
15 years, 4 months
JBoss Tools SVN: r23954 - branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-08-05 17:51:34 -0400 (Thu, 05 Aug 2010)
New Revision: 23954
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6790
AbstractSmooksFormEditor creating multiple CommandStack listeners
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2010-08-05 21:51:25 UTC (rev 23953)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2010-08-05 21:51:34 UTC (rev 23954)
@@ -114,7 +114,6 @@
protected void initEditingDomain() {
adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
- handleCommandStack(commandStack);
editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
}
@@ -196,9 +195,10 @@
filePath = file.getFullPath().toPortableString();
}
- if (filePath == null)
- throw new PartInitException(
- Messages.AbstractSmooksFormEditor_Exception_Cannot_Get_Input_File);
+ if (filePath == null) {
+ throw new PartInitException(Messages.AbstractSmooksFormEditor_Exception_Cannot_Get_Input_File);
+ }
+
handleCommandStack(commandStack);
super.init(site, input);
}
15 years, 4 months
JBoss Tools SVN: r23953 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-08-05 17:51:25 -0400 (Thu, 05 Aug 2010)
New Revision: 23953
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java
Log:
2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java (getKind): Fix to
upper-case the low-level value before converting to an enum.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-08-05 21:49:50 UTC (rev 23952)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-08-05 21:51:25 UTC (rev 23953)
@@ -1,3 +1,8 @@
+2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java (getKind): Fix to
+ upper-case the low-level value before converting to an enum.
+
2010-08-04 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProfile.java: New file.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java 2010-08-05 21:49:50 UTC (rev 23952)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudHardwareProperty.java 2010-08-05 21:51:25 UTC (rev 23953)
@@ -33,7 +33,7 @@
}
public Kind getKind() {
- return Kind.valueOf(property.getKind());
+ return Kind.valueOf(property.getKind().toUpperCase());
}
public Range getRange() {
15 years, 4 months
JBoss Tools SVN: r23952 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-08-05 17:49:50 -0400 (Thu, 05 Aug 2010)
New Revision: 23952
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
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/WizardMessages.properties
Log:
2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java (createControl): Use a group
to distinguish Profile properties.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java (ProfileComposite): Do some
tweaking of the layout and add unit support.
(.modifyText): Compact so there is one combo modify listener and one spinner modify
listener.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add message for
properties group.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-05 20:37:55 UTC (rev 23951)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-05 21:49:50 UTC (rev 23952)
@@ -1,5 +1,16 @@
2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java (createControl): Use a group
+ to distinguish Profile properties.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java (ProfileComposite): Do some
+ tweaking of the layout and add unit support.
+ (.modifyText): Compact so there is one combo modify listener and one spinner modify
+ listener.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add message for
+ properties group.
+
+2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
+
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java (.modifyText): Add
logic to switch ProfileComposite.
(createControl): Add logic for setting up the ProfileComposite.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-08-05 20:37:55 UTC (rev 23951)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-08-05 21:49:50 UTC (rev 23952)
@@ -16,7 +16,6 @@
import org.eclipse.swt.widgets.Text;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
-import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProperty;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
public class NewInstancePage extends WizardPage {
@@ -28,7 +27,8 @@
private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
private static final String IMAGE_LABEL = "Image.label"; //$NON-NLS-1$
private static final String ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
- private static final String HARDWARE_LABEL = "Profiles.label"; //$NON-NLS-1$
+ private static final String HARDWARE_LABEL = "Profile.label"; //$NON-NLS-1$
+ private static final String PROPERTIES_LABEL = "Properties.label"; //$NON-NLS-1$
private static final String NAME_ALREADY_IN_USE = "ErrorNameInUse.text"; //$NON-NLS-1$
@@ -143,7 +143,8 @@
hardwareLabel.setText(WizardMessages.getString(HARDWARE_LABEL));
hardware = new Combo(container, SWT.READ_ONLY);
- Composite groupContainer = new Composite(container, SWT.NULL);
+ Group groupContainer = new Group(container, SWT.BORDER);
+ groupContainer.setText(WizardMessages.getString(PROPERTIES_LABEL));
FormLayout groupLayout = new FormLayout();
groupLayout.marginHeight = 0;
groupLayout.marginWidth = 0;
@@ -208,7 +209,7 @@
hardware.setLayoutData(f);
f = new FormData();
- f.top = new FormAttachment(hardwareLabel, 8);
+ f.top = new FormAttachment(hardware, 10);
f.left = new FormAttachment(0, 0);
f.right = new FormAttachment(100, 0);
f.bottom = new FormAttachment(100, 0);
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-08-05 20:37:55 UTC (rev 23951)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-08-05 21:49:50 UTC (rev 23952)
@@ -5,13 +5,10 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
@@ -30,107 +27,74 @@
private String cpu;
private String cpuDefaultValue;
private Label cpuLabel;
- private Button[] cpuButtons;
+ private Spinner cpuSpinner;
+ private Combo cpuCombo;
private String memory;
private String memoryDefaultValue;
private Label memoryLabel;
- private Button[] memoryButtons;
+ private Spinner memorySpinner;
+ private Combo memoryCombo;
private int memoryDecDigits;
private String storage;
private String storageDefaultValue;
private Label storageLabel;
- private Button[] storageButtons;
+ private Spinner storageSpinner;
+ private Combo storageCombo;
private int storageDecDigits;
- private ModifyListener cpuSpinnerListener = new ModifyListener() {
+ private ModifyListener spinnerListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
- cpu = ((Spinner)e.widget).getText();
+ String value = ((Spinner)e.widget).getText();
+ if (e.widget == cpuSpinner)
+ cpu = value;
+ else if (e.widget == memorySpinner)
+ memory = value;
+ else if (e.widget == storageSpinner)
+ storage = value;
}
};
- private SelectionListener cpuButtonListener = new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- for (int i = 0; i < cpuButtons.length; ++i) {
- Button b = cpuButtons[i];
- if (b != e.widget) {
- b.setSelection(false);
- } else {
- b.setSelection(true);
- cpu = b.getText();
- }
- }
- }
+ private ModifyListener comboListener = new ModifyListener() {
- };
-
- private ModifyListener memorySpinnerListener = new ModifyListener() {
-
@Override
public void modifyText(ModifyEvent e) {
- memory = ((Spinner)e.widget).getText();
+ String value = ((Combo)e.widget).getText();
+ if (e.widget == cpuCombo)
+ cpu = value;
+ else if (e.widget == memoryCombo)
+ memory = value;
+ else if (e.widget == storageCombo)
+ storage = value;
}
- };
- private SelectionListener memoryButtonListener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- for (int i = 0; i < memoryButtons.length; ++i) {
- Button b = memoryButtons[i];
- if (b != e.widget) {
- b.setSelection(false);
- } else {
- b.setSelection(true);
- memory = b.getText();
- }
- }
- }
-
};
-
- private ModifyListener storageSpinnerListener = new ModifyListener() {
- @Override
- public void modifyText(ModifyEvent e) {
- storage = ((Spinner)e.widget).getText();
- }
- };
- private SelectionListener storageButtonListener = new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- for (int i = 0; i < storageButtons.length; ++i) {
- Button b = storageButtons[i];
- if (b != e.widget) {
- b.setSelection(false);
- } else {
- b.setSelection(true);
- storage = b.getText();
- }
- }
- }
-
- };
-
public ProfileComposite(DeltaCloudHardwareProfile p, Composite parent) {
this.profile = p;
container = new Composite(parent, SWT.NULL);
FormLayout layout = new FormLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 5;
+ layout.marginHeight = 10;
+ layout.marginWidth = 10;
container.setLayout(layout);
Control cpuControl = null;
Control memoryControl = null;
+ Control storageControl = null;
+ cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel.setText(WizardMessages.getString(CPU_LABEL));
+
+ memoryLabel = new Label(container, SWT.NULL);
+ memoryLabel.setText(WizardMessages.getString(MEMORY_LABEL));
+
+ storageLabel = new Label(container, SWT.NULL);
+ storageLabel.setText(WizardMessages.getString(STORAGE_LABEL));
+
DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu"); //$NON-NLS-1$
if (cpuProperty != null) {
- cpuLabel = new Label(container, SWT.NULL);
- cpuLabel.setText(WizardMessages.getString(CPU_LABEL));
FormData fd = new FormData();
fd.left = new FormAttachment(0, 0);
fd.top = new FormAttachment(0, 0);
@@ -139,53 +103,47 @@
Label cpu = new Label(container, SWT.NULL);
cpu.setText(cpuProperty.getValue());
FormData f = new FormData();
- f.left = new FormAttachment(cpuLabel, 5);
+ f.left = new FormAttachment(storageLabel, 50);
f.right = new FormAttachment(100, 0);
cpu.setLayoutData(f);
cpuControl = cpu;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
cpuDefaultValue = cpuProperty.getValue();
- Spinner cpuSpinner = new Spinner(container, SWT.READ_ONLY);
+ cpuSpinner = new Spinner(container, SWT.READ_ONLY);
cpuSpinner.setMinimum(Integer.valueOf(cpuProperty.getRange().getFirst()));
cpuSpinner.setMaximum(Integer.valueOf(cpuProperty.getRange().getLast()));
- cpuSpinner.addModifyListener(cpuSpinnerListener);
+ cpuSpinner.addModifyListener(spinnerListener);
cpuSpinner.setSelection(Integer.valueOf(cpuDefaultValue));
FormData f = new FormData();
- f.left = new FormAttachment(cpuLabel, 5);
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
cpuSpinner.setLayoutData(f);
cpuControl = cpuSpinner;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
cpuDefaultValue = cpuProperty.getValue();
List<String> values = cpuProperty.getEnums();
- cpuButtons = new Button[values.size()];
- for (int i = 0; i < values.size(); ++i) {
- Button button = new Button(container, SWT.RADIO);
- String value = values.get(i);
- button.setText(value);
- if (value.equals(cpuDefaultValue))
- button.setSelection(true);
- button.addSelectionListener(cpuButtonListener);
- cpuButtons[i] = button;
- cpuControl = button;
- FormData f = new FormData();
- if (i % 3 == 0) {
- f.left = new FormAttachment(cpuLabel, 5);
- if (i > 2) {
- f.top = new FormAttachment(cpuButtons[i-3]);
- }
- } else {
- f.left = new FormAttachment(cpuButtons[i-1]);
- if (i > 3)
- f.top = new FormAttachment(cpuButtons[i-3]);
- }
- button.setLayoutData(f);
- }
+ cpuCombo = new Combo(container, SWT.READ_ONLY | SWT.BORDER);
+ String[] items = new String[values.size()];
+ cpuCombo.setItems(values.toArray(items));
+ cpuCombo.setText(items[0]);
+ cpuCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ cpuCombo.setLayoutData(f);
+ cpuControl = cpuCombo;
}
+ String cpuUnit = cpuProperty.getUnit();
+ if (cpuUnit != null && !cpuUnit.equals("label")) { //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(cpuProperty.getUnit());
+ FormData f = new FormData();
+ f.left = new FormAttachment(cpuControl, 5);
+ unitLabel.setLayoutData(f);
+ }
}
DeltaCloudHardwareProperty memoryProperty = profile.getNamedProperty("memory"); //$NON-NLS-1$
if (memoryProperty != null) {
- memoryLabel = new Label(container, SWT.NULL);
- memoryLabel.setText(WizardMessages.getString(MEMORY_LABEL));
FormData fd = new FormData();
fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
fd.top = new FormAttachment(cpuLabel, 8);
@@ -195,7 +153,7 @@
memory.setText(memoryProperty.getValue());
FormData f = new FormData();
f.top = new FormAttachment(cpuControl, 8);
- f.left = new FormAttachment(memoryLabel, 5);
+ f.left = new FormAttachment(storageLabel, 50);
f.right = new FormAttachment(100, 0);
memory.setLayoutData(f);
memoryControl = memory;
@@ -207,7 +165,7 @@
decDigitsDefault = memoryDefaultValue.length() - indexDefault - 1;
memoryDefaultValue = memoryDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
}
- Spinner memorySpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
+ memorySpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
String first = memoryProperty.getRange().getFirst();
int indexFirst = first.indexOf('.');
int decDigitsFirst = 0;
@@ -239,62 +197,55 @@
memorySpinner.setMinimum(Integer.valueOf(first));
memorySpinner.setMaximum(Integer.valueOf(last));
memorySpinner.setDigits(memoryDecDigits);
- memorySpinner.addModifyListener(memorySpinnerListener);
+ memorySpinner.addModifyListener(spinnerListener);
memorySpinner.setSelection(Integer.valueOf(memoryDefaultValue));
FormData f = new FormData();
- f.left = new FormAttachment(memoryLabel, 5);
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
f.top = new FormAttachment(cpuControl, 5);
memorySpinner.setLayoutData(f);
memoryControl = memorySpinner;
} else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
memoryDefaultValue = memoryProperty.getValue();
List<String> values = memoryProperty.getEnums();
- memoryButtons = new Button[values.size()];
- for (int i = 0; i < values.size(); ++i) {
- Button button = new Button(container, SWT.RADIO);
- String value = values.get(i);
- button.setText(value);
- if (value.equals(memoryDefaultValue))
- button.setSelection(true);
- button.addSelectionListener(memoryButtonListener);
- memoryButtons[i] = button;
- memoryControl = button;
- FormData f = new FormData();
- if (i % 3 == 0) {
- f.left = new FormAttachment(memoryLabel, 5);
- if (i > 2) {
- f.top = new FormAttachment(memoryButtons[i-3]);
- } else {
- f.top = new FormAttachment(cpuControl);
- }
- } else {
- f.left = new FormAttachment(memoryButtons[i-1]);
- if (i > 3)
- f.top = new FormAttachment(memoryButtons[i-3]);
- else
- f.top = new FormAttachment(cpuControl);
- }
- button.setLayoutData(f);
- }
+ memoryCombo = new Combo(container, SWT.READ_ONLY | SWT.BORDER);
+ String[] items = new String[values.size()];
+ memoryCombo.setItems(values.toArray(items));
+ memoryCombo.setText(items[0]);
+ memoryCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.top = new FormAttachment(cpuControl, 5);
+ memoryCombo.setLayoutData(f);
+ memoryControl = memoryCombo;
}
+ String memoryUnit = memoryProperty.getUnit();
+ if (memoryUnit != null && !memoryUnit.equals("label")) { //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(memoryUnit);
+ FormData f = new FormData();
+ f.left = new FormAttachment(memoryControl, 3);
+ f.top = new FormAttachment(cpuControl, 8);
+ unitLabel.setLayoutData(f);
+ }
}
DeltaCloudHardwareProperty storageProperty = profile.getNamedProperty("storage"); //$NON-NLS-1$
if (storageProperty != null) {
- storageLabel = new Label(container, SWT.NULL);
- storageLabel.setText(WizardMessages.getString(STORAGE_LABEL));
FormData fd = new FormData();
fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
- fd.top = new FormAttachment(memoryLabel, 8);
+ fd.top = new FormAttachment(memoryControl, 8);
storageLabel.setLayoutData(fd);
if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
Label storage = new Label(container, SWT.NULL);
storage.setText(storageProperty.getValue());
FormData f = new FormData();
- f.left = new FormAttachment(storageLabel, 5);
+ f.left = new FormAttachment(storageLabel, 50);
f.top = new FormAttachment(memoryControl, 8);
f.right = new FormAttachment(100, 0);
storage.setLayoutData(f);
storage.setVisible(true);
+ storageControl = storage;
} else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
storageDefaultValue = storageProperty.getValue();
int indexDefault = storageDefaultValue.indexOf('.');
@@ -335,46 +286,40 @@
storageSpinner.setMinimum(Integer.valueOf(first));
storageSpinner.setMaximum(Integer.valueOf(last));
storageSpinner.setDigits(storageDecDigits);
- storageSpinner.addModifyListener(storageSpinnerListener);
+ storageSpinner.addModifyListener(spinnerListener);
storageSpinner.setSelection(Integer.valueOf(storageDefaultValue));
FormData f = new FormData();
+ f.width = 80;
f.top = new FormAttachment(memoryControl, 5);
- f.left = new FormAttachment(storageLabel, 5);
+ f.left = new FormAttachment(storageLabel, 50);
storageSpinner.setLayoutData(f);
+ storageControl = storageSpinner;
} else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
storageDefaultValue = storageProperty.getValue();
List<String> values = storageProperty.getEnums();
- storageButtons = new Button[values.size()];
- for (int i = 0; i < values.size(); ++i) {
- Button button = new Button(container, SWT.RADIO);
- String value = values.get(i);
- button.setText(value);
- if (value.equals(storageDefaultValue))
- button.setSelection(true);
- button.addSelectionListener(storageButtonListener);
- storageButtons[i] = button;
- FormData f = new FormData();
- if (i % 3 == 0) {
- f.left = new FormAttachment(storageLabel, 5);
- if (i > 2) {
- f.top = new FormAttachment(storageButtons[i-3]);
- } else {
- f.top = new FormAttachment(memoryControl);
- }
- } else {
- f.left = new FormAttachment(storageButtons[i-1]);
- if (i > 3)
- f.top = new FormAttachment(storageButtons[i-3]);
- else
- f.top = new FormAttachment(memoryControl);
- }
- button.setLayoutData(f);
- }
+ storageCombo = new Combo(container, SWT.READ_ONLY | SWT.BORDER);
+ String[] items = new String[values.size()];
+ storageCombo.setItems(values.toArray(items));
+ storageCombo.setText(items[0]);
+ storageCombo.addModifyListener(comboListener);
+ FormData f = new FormData();
+ f.width = 80;
+ f.left = new FormAttachment(storageLabel, 50);
+ f.top = new FormAttachment(memoryControl, 5);
+ storageCombo.setLayoutData(f);
+ storageControl = storageCombo;
}
+ String storageUnit = storageProperty.getUnit();
+ if (storageUnit != null && !storageUnit.equals("label")) { //$NON-NLS-1$
+ Label unitLabel = new Label(container, SWT.NULL);
+ unitLabel.setText(storageUnit);
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageControl, 3);
+ f.top = new FormAttachment(memoryControl, 8);
+ unitLabel.setLayoutData(f);
+ }
+
}
- Label dummyLabel = new Label(container, SWT.NULL);
- FormData fd = new FormData();
- fd.top = new FormAttachment(storageLabel, 0);
}
public void setVisible(boolean visible) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-08-05 20:37:55 UTC (rev 23951)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-08-05 21:49:50 UTC (rev 23952)
@@ -13,7 +13,8 @@
UnknownType.label=Unknown
Image.label=Image:
Arch.label=Architecture:
-Profiles.label=Hardware Profiles:
+Profile.label=Hardware Profile:
+Properties.label=Profile Properties
Cpu.label=CPUs:
Memory.label=Memory:
Storage.label=Storage:
15 years, 4 months
JBoss Tools SVN: r23951 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/internal/deltacloud/ui/wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-08-05 16:37:55 -0400 (Thu, 05 Aug 2010)
New Revision: 23951
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
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/WizardMessages.properties
Log:
2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java (.modifyText): Add
logic to switch ProfileComposite.
(createControl): Add logic for setting up the ProfileComposite.
(getProfileIds): Set up currPage.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java (ProfileComposite): Add
logic to set up CPUs, Memory, and Storage settings.
(getMemory): Add check for decimal digits.
(getStorage): Ditto.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new messages
for ProfileComposite.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-05 19:17:40 UTC (rev 23950)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-08-05 20:37:55 UTC (rev 23951)
@@ -1,3 +1,16 @@
+2010-08-05 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java (.modifyText): Add
+ logic to switch ProfileComposite.
+ (createControl): Add logic for setting up the ProfileComposite.
+ (getProfileIds): Set up currPage.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java (ProfileComposite): Add
+ logic to set up CPUs, Memory, and Storage settings.
+ (getMemory): Add check for decimal digits.
+ (getStorage): Ditto.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new messages
+ for ProfileComposite.
+
2010-08-04 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java: New file.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-08-05 19:17:40 UTC (rev 23950)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage.java 2010-08-05 20:37:55 UTC (rev 23951)
@@ -57,7 +57,8 @@
public void modifyText(ModifyEvent e) {
int index = hardware.getSelectionIndex();
currPage.setVisible(false);
- profilePages[index].setVisible(true);
+ currPage = profilePages[index];
+ currPage.setVisible(true);
}
};
@@ -104,7 +105,9 @@
DeltaCloudHardwareProfile p = profiles.get(i);
ids[i] = p.getId();
profilePages[i] = new ProfileComposite(p, container);
+ profilePages[i].setVisible(false);
}
+ currPage = profilePages[0];
return ids;
}
@@ -144,14 +147,16 @@
FormLayout groupLayout = new FormLayout();
groupLayout.marginHeight = 0;
groupLayout.marginWidth = 0;
- groupContainer.setLayout(groupLayout);
+ groupContainer.setLayout(groupLayout);
+
profileIds = getProfileIds(groupContainer);
if (profileIds.length > 0) {
hardware.setItems(profileIds);
hardware.setText(profileIds[0]);
-// hardware.addModifyListener(comboListener);
+ profilePages[0].setVisible(true);
+ hardware.addModifyListener(comboListener);
}
FormData f = new FormData();
@@ -202,6 +207,13 @@
f.right = new FormAttachment(100, 0);
hardware.setLayoutData(f);
+ f = new FormData();
+ f.top = new FormAttachment(hardwareLabel, 8);
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ f.bottom = new FormAttachment(100, 0);
+ groupContainer.setLayoutData(f);
+
setControl(container);
}
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-08-05 19:17:40 UTC (rev 23950)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ProfileComposite.java 2010-08-05 20:37:55 UTC (rev 23951)
@@ -8,8 +8,12 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Spinner;
import org.jboss.tools.deltacloud.core.DeltaCloudHardwareProfile;
@@ -18,12 +22,25 @@
public class ProfileComposite {
private static final String CPU_LABEL = "Cpu.label"; //$NON-NLS-1$
+ private static final String MEMORY_LABEL = "Memory.label"; //$NON-NLS-1$
+ private static final String STORAGE_LABEL = "Storage.label"; //$NON-NLS-1$
private Composite container;
private DeltaCloudHardwareProfile profile;
private String cpu;
private String cpuDefaultValue;
+ private Label cpuLabel;
private Button[] cpuButtons;
+ private String memory;
+ private String memoryDefaultValue;
+ private Label memoryLabel;
+ private Button[] memoryButtons;
+ private int memoryDecDigits;
+ private String storage;
+ private String storageDefaultValue;
+ private Label storageLabel;
+ private Button[] storageButtons;
+ private int storageDecDigits;
private ModifyListener cpuSpinnerListener = new ModifyListener() {
@@ -50,17 +67,82 @@
};
- public ProfileComposite(DeltaCloudHardwareProfile profile, Composite parent) {
- this.profile = profile;
+ private ModifyListener memorySpinnerListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ memory = ((Spinner)e.widget).getText();
+ }
+ };
+
+ private SelectionListener memoryButtonListener = new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ for (int i = 0; i < memoryButtons.length; ++i) {
+ Button b = memoryButtons[i];
+ if (b != e.widget) {
+ b.setSelection(false);
+ } else {
+ b.setSelection(true);
+ memory = b.getText();
+ }
+ }
+ }
+
+ };
+
+ private ModifyListener storageSpinnerListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ storage = ((Spinner)e.widget).getText();
+ }
+ };
+
+ private SelectionListener storageButtonListener = new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ for (int i = 0; i < storageButtons.length; ++i) {
+ Button b = storageButtons[i];
+ if (b != e.widget) {
+ b.setSelection(false);
+ } else {
+ b.setSelection(true);
+ storage = b.getText();
+ }
+ }
+ }
+
+ };
+
+ public ProfileComposite(DeltaCloudHardwareProfile p, Composite parent) {
+ this.profile = p;
container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ container.setLayout(layout);
+ Control cpuControl = null;
+ Control memoryControl = null;
- DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu");
+ DeltaCloudHardwareProperty cpuProperty = profile.getNamedProperty("cpu"); //$NON-NLS-1$
if (cpuProperty != null) {
- Label cpuLabel = new Label(container, SWT.NULL);
+ cpuLabel = new Label(container, SWT.NULL);
cpuLabel.setText(WizardMessages.getString(CPU_LABEL));
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(0, 0);
+ fd.top = new FormAttachment(0, 0);
+ cpuLabel.setLayoutData(fd);
if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
Label cpu = new Label(container, SWT.NULL);
cpu.setText(cpuProperty.getValue());
+ FormData f = new FormData();
+ f.left = new FormAttachment(cpuLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ cpu.setLayoutData(f);
+ cpuControl = cpu;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
cpuDefaultValue = cpuProperty.getValue();
Spinner cpuSpinner = new Spinner(container, SWT.READ_ONLY);
@@ -68,6 +150,10 @@
cpuSpinner.setMaximum(Integer.valueOf(cpuProperty.getRange().getLast()));
cpuSpinner.addModifyListener(cpuSpinnerListener);
cpuSpinner.setSelection(Integer.valueOf(cpuDefaultValue));
+ FormData f = new FormData();
+ f.left = new FormAttachment(cpuLabel, 5);
+ cpuSpinner.setLayoutData(f);
+ cpuControl = cpuSpinner;
} else if (cpuProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
cpuDefaultValue = cpuProperty.getValue();
List<String> values = cpuProperty.getEnums();
@@ -79,10 +165,216 @@
if (value.equals(cpuDefaultValue))
button.setSelection(true);
button.addSelectionListener(cpuButtonListener);
- cpuButtons[i] = button;
+ cpuButtons[i] = button;
+ cpuControl = button;
+ FormData f = new FormData();
+ if (i % 3 == 0) {
+ f.left = new FormAttachment(cpuLabel, 5);
+ if (i > 2) {
+ f.top = new FormAttachment(cpuButtons[i-3]);
+ }
+ } else {
+ f.left = new FormAttachment(cpuButtons[i-1]);
+ if (i > 3)
+ f.top = new FormAttachment(cpuButtons[i-3]);
+ }
+ button.setLayoutData(f);
}
}
}
+ DeltaCloudHardwareProperty memoryProperty = profile.getNamedProperty("memory"); //$NON-NLS-1$
+ if (memoryProperty != null) {
+ memoryLabel = new Label(container, SWT.NULL);
+ memoryLabel.setText(WizardMessages.getString(MEMORY_LABEL));
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
+ fd.top = new FormAttachment(cpuLabel, 8);
+ memoryLabel.setLayoutData(fd);
+ if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
+ Label memory = new Label(container, SWT.NULL);
+ memory.setText(memoryProperty.getValue());
+ FormData f = new FormData();
+ f.top = new FormAttachment(cpuControl, 8);
+ f.left = new FormAttachment(memoryLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ memory.setLayoutData(f);
+ memoryControl = memory;
+ } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
+ memoryDefaultValue = memoryProperty.getValue();
+ int indexDefault = memoryDefaultValue.indexOf('.');
+ int decDigitsDefault = 0;
+ if (indexDefault >= 0) {
+ decDigitsDefault = memoryDefaultValue.length() - indexDefault - 1;
+ memoryDefaultValue = memoryDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ Spinner memorySpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
+ String first = memoryProperty.getRange().getFirst();
+ int indexFirst = first.indexOf('.');
+ int decDigitsFirst = 0;
+ if (indexFirst >= 0) {
+ decDigitsFirst = first.length() - indexFirst - 1;
+ first = first.replace(".", ""); //$NON-NLS-1$ $NON-NLS-2$
+ }
+ String last = memoryProperty.getRange().getLast();
+ int indexLast = first.indexOf('.');
+ int decDigitsLast = 0;
+ if (indexLast >= 0) {
+ decDigitsLast = last.length() - indexLast - 1;
+ last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int decDigits = Math.max(decDigitsFirst, decDigitsLast);
+ memoryDecDigits = Math.max(decDigits, decDigitsDefault);
+ if (decDigitsFirst < memoryDecDigits) {
+ for (int i= 0; i < memoryDecDigits - decDigitsFirst; ++i)
+ first = first.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsLast < memoryDecDigits) {
+ for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
+ last = last.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsDefault < memoryDecDigits) {
+ for (int i = 0; i < memoryDecDigits - decDigitsLast; ++i)
+ memoryDefaultValue = memoryDefaultValue.concat("0"); //$NON-NLS-1$
+ }
+ memorySpinner.setMinimum(Integer.valueOf(first));
+ memorySpinner.setMaximum(Integer.valueOf(last));
+ memorySpinner.setDigits(memoryDecDigits);
+ memorySpinner.addModifyListener(memorySpinnerListener);
+ memorySpinner.setSelection(Integer.valueOf(memoryDefaultValue));
+ FormData f = new FormData();
+ f.left = new FormAttachment(memoryLabel, 5);
+ f.top = new FormAttachment(cpuControl, 5);
+ memorySpinner.setLayoutData(f);
+ memoryControl = memorySpinner;
+ } else if (memoryProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
+ memoryDefaultValue = memoryProperty.getValue();
+ List<String> values = memoryProperty.getEnums();
+ memoryButtons = new Button[values.size()];
+ for (int i = 0; i < values.size(); ++i) {
+ Button button = new Button(container, SWT.RADIO);
+ String value = values.get(i);
+ button.setText(value);
+ if (value.equals(memoryDefaultValue))
+ button.setSelection(true);
+ button.addSelectionListener(memoryButtonListener);
+ memoryButtons[i] = button;
+ memoryControl = button;
+ FormData f = new FormData();
+ if (i % 3 == 0) {
+ f.left = new FormAttachment(memoryLabel, 5);
+ if (i > 2) {
+ f.top = new FormAttachment(memoryButtons[i-3]);
+ } else {
+ f.top = new FormAttachment(cpuControl);
+ }
+ } else {
+ f.left = new FormAttachment(memoryButtons[i-1]);
+ if (i > 3)
+ f.top = new FormAttachment(memoryButtons[i-3]);
+ else
+ f.top = new FormAttachment(cpuControl);
+ }
+ button.setLayoutData(f);
+ }
+ }
+ }
+ DeltaCloudHardwareProperty storageProperty = profile.getNamedProperty("storage"); //$NON-NLS-1$
+ if (storageProperty != null) {
+ storageLabel = new Label(container, SWT.NULL);
+ storageLabel.setText(WizardMessages.getString(STORAGE_LABEL));
+ FormData fd = new FormData();
+ fd.left = new FormAttachment(cpuLabel, 0, SWT.LEFT);
+ fd.top = new FormAttachment(memoryLabel, 8);
+ storageLabel.setLayoutData(fd);
+ if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.FIXED) {
+ Label storage = new Label(container, SWT.NULL);
+ storage.setText(storageProperty.getValue());
+ FormData f = new FormData();
+ f.left = new FormAttachment(storageLabel, 5);
+ f.top = new FormAttachment(memoryControl, 8);
+ f.right = new FormAttachment(100, 0);
+ storage.setLayoutData(f);
+ storage.setVisible(true);
+ } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.RANGE) {
+ storageDefaultValue = storageProperty.getValue();
+ int indexDefault = storageDefaultValue.indexOf('.');
+ int decDigitsDefault = 0;
+ if (indexDefault >= 0) {
+ decDigitsDefault = storageDefaultValue.length() - indexDefault - 1;
+ storageDefaultValue = storageDefaultValue.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ Spinner storageSpinner = new Spinner(container, SWT.READ_ONLY | SWT.BORDER);
+ String first = memoryProperty.getRange().getFirst();
+ int indexFirst = first.indexOf('.');
+ int decDigitsFirst = 0;
+ if (indexFirst >= 0) {
+ decDigitsFirst = first.length() - indexFirst - 1;
+ first = first.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ String last = memoryProperty.getRange().getLast();
+ int indexLast = first.indexOf('.');
+ int decDigitsLast = 0;
+ if (indexLast >= 0) {
+ decDigitsLast = last.length() - indexLast - 1;
+ last = last.replace(".", ""); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ int decDigits = Math.max(decDigitsFirst, decDigitsLast);
+ storageDecDigits = Math.max(decDigits, decDigitsDefault);
+ if (decDigitsFirst < storageDecDigits) {
+ for (int i= 0; i < storageDecDigits - decDigitsFirst; ++i)
+ first = first.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsLast < storageDecDigits) {
+ for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
+ last = last.concat("0"); //$NON-NLS-1$
+ }
+ if (decDigitsDefault < storageDecDigits) {
+ for (int i = 0; i < storageDecDigits - decDigitsLast; ++i)
+ storageDefaultValue = storageDefaultValue.concat("0"); //$NON-NLS-1$
+ }
+ storageSpinner.setMinimum(Integer.valueOf(first));
+ storageSpinner.setMaximum(Integer.valueOf(last));
+ storageSpinner.setDigits(storageDecDigits);
+ storageSpinner.addModifyListener(storageSpinnerListener);
+ storageSpinner.setSelection(Integer.valueOf(storageDefaultValue));
+ FormData f = new FormData();
+ f.top = new FormAttachment(memoryControl, 5);
+ f.left = new FormAttachment(storageLabel, 5);
+ storageSpinner.setLayoutData(f);
+ } else if (storageProperty.getKind() == DeltaCloudHardwareProperty.Kind.ENUM) {
+ storageDefaultValue = storageProperty.getValue();
+ List<String> values = storageProperty.getEnums();
+ storageButtons = new Button[values.size()];
+ for (int i = 0; i < values.size(); ++i) {
+ Button button = new Button(container, SWT.RADIO);
+ String value = values.get(i);
+ button.setText(value);
+ if (value.equals(storageDefaultValue))
+ button.setSelection(true);
+ button.addSelectionListener(storageButtonListener);
+ storageButtons[i] = button;
+ FormData f = new FormData();
+ if (i % 3 == 0) {
+ f.left = new FormAttachment(storageLabel, 5);
+ if (i > 2) {
+ f.top = new FormAttachment(storageButtons[i-3]);
+ } else {
+ f.top = new FormAttachment(memoryControl);
+ }
+ } else {
+ f.left = new FormAttachment(storageButtons[i-1]);
+ if (i > 3)
+ f.top = new FormAttachment(storageButtons[i-3]);
+ else
+ f.top = new FormAttachment(memoryControl);
+ }
+ button.setLayoutData(f);
+ }
+ }
+ }
+ Label dummyLabel = new Label(container, SWT.NULL);
+ FormData fd = new FormData();
+ fd.top = new FormAttachment(storageLabel, 0);
}
public void setVisible(boolean visible) {
@@ -94,4 +386,30 @@
return cpu;
return null;
}
+
+ public String getMemory() {
+ if (memory != null && !memory.equals(memoryDefaultValue)) {
+ String retVal = memory;
+ if (memoryDecDigits > 0) {
+ // Need to put back decimal point in returned value when we used the spinner
+ retVal = retVal.substring(0, retVal.length() - memoryDecDigits).concat(".").
+ concat(memory.substring(memory.length() - memoryDecDigits));
+ }
+ return retVal;
+ }
+ return null;
+ }
+
+ public String getStorage() {
+ if (storage != null && !storage.equals(storageDefaultValue)) {
+ String retVal = storage;
+ if (storageDecDigits > 0) {
+ // Need to put back decimal point in returned value when we used the spinner
+ retVal = retVal.substring(0, retVal.length() - storageDecDigits).concat(".").
+ concat(storage.substring(storage.length() - storageDecDigits));
+ }
+ return retVal;
+ }
+ return null;
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-08-05 19:17:40 UTC (rev 23950)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-08-05 20:37:55 UTC (rev 23951)
@@ -15,6 +15,8 @@
Arch.label=Architecture:
Profiles.label=Hardware Profiles:
Cpu.label=CPUs:
+Memory.label=Memory:
+Storage.label=Storage:
EC2UserNameLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access ID</a>
EC2PasswordLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access Secret Key</a>
15 years, 4 months
JBoss Tools SVN: r23950 - in branches/smooks-dmb/plugins: org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-08-05 15:17:40 -0400 (Thu, 05 Aug 2010)
New Revision: 23950
Removed:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/libs/commons-logging-1.1.1.jar
Modified:
branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/SmooksEditorModelBuilder.java
branches/smooks-dmb/plugins/org.jboss.tools.smooks.runtime/libs/milyn-smooks-all-1.4-SNAPSHOT.jar
Log:
https://jira.jboss.org/browse/JBIDE-6789
Sort out ClassLoader issues in SmooksEditorModelBuilder
Deleted: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/libs/commons-logging-1.1.1.jar
===================================================================
(Binary files differ)
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/SmooksEditorModelBuilder.java
===================================================================
--- branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/SmooksEditorModelBuilder.java 2010-08-05 17:19:10 UTC (rev 23949)
+++ branches/smooks-dmb/plugins/org.jboss.tools.smooks.ecore.model/src/org/jboss/tools/smooks/model/SmooksEditorModelBuilder.java 2010-08-05 19:17:40 UTC (rev 23950)
@@ -22,10 +22,15 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.Reader;
+import java.util.List;
+import java.util.Properties;
import org.milyn.SmooksException;
+import org.milyn.javabean.dynamic.Descriptor;
import org.milyn.javabean.dynamic.Model;
import org.milyn.javabean.dynamic.ModelBuilder;
+import org.milyn.javabean.dynamic.resolvers.DefaultBindingConfigResolver;
+import org.milyn.javabean.dynamic.resolvers.DefaultSchemaResolver;
import org.xml.sax.SAXException;
/**
@@ -37,17 +42,22 @@
*/
public class SmooksEditorModelBuilder {
- private ModelBuilder modelBuilder;
+ private static ModelBuilder modelBuilder;
- public SmooksEditorModelBuilder() {
- ClassLoader contextClassloader = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(SmooksEditorModelBuilder.class.getClassLoader());
- modelBuilder = new ModelBuilder(SmooksModel.MODEL_DESCRIPTOR, false);
+ static {
+ ClassLoader modelClassLoader = SmooksEditorModelBuilder.class.getClassLoader();
+ List<Properties> descriptors = Descriptor.loadDescriptors(SmooksModel.MODEL_DESCRIPTOR, modelClassLoader);
+ DefaultSchemaResolver schemaResolver = new DefaultSchemaResolver(descriptors);
+ DefaultBindingConfigResolver bindingResolver = new DefaultBindingConfigResolver(descriptors);
+
+ schemaResolver.setClassLoader(modelClassLoader);
+ bindingResolver.setClassLoader(modelClassLoader);
+
+ try {
+ Descriptor descriptor = new Descriptor(descriptors, schemaResolver, bindingResolver, modelClassLoader);
+ modelBuilder = new ModelBuilder(descriptor, false);
} catch (Exception e) {
throw new SmooksException("Failed to create ModelBuilder instance for descriptor '" + SmooksModel.MODEL_DESCRIPTOR + "'.", e);
- } finally {
- Thread.currentThread().setContextClassLoader(contextClassloader);
}
}
@@ -60,22 +70,10 @@
}
public Model<SmooksModel> readModel(InputStream configStream) throws SAXException, IOException {
- ClassLoader contextClassloader = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(SmooksEditorModelBuilder.class.getClassLoader());
- return modelBuilder.readModel(configStream, SmooksModel.class);
- } finally {
- Thread.currentThread().setContextClassLoader(contextClassloader);
- }
+ return modelBuilder.readModel(configStream, SmooksModel.class);
}
public Model<SmooksModel> readModel(Reader configStream) throws SAXException, IOException {
- ClassLoader contextClassloader = Thread.currentThread().getContextClassLoader();
- try {
- Thread.currentThread().setContextClassLoader(SmooksEditorModelBuilder.class.getClassLoader());
- return modelBuilder.readModel(configStream, SmooksModel.class);
- } finally {
- Thread.currentThread().setContextClassLoader(contextClassloader);
- }
+ return modelBuilder.readModel(configStream, SmooksModel.class);
}
}
Modified: branches/smooks-dmb/plugins/org.jboss.tools.smooks.runtime/libs/milyn-smooks-all-1.4-SNAPSHOT.jar
===================================================================
(Binary files differ)
15 years, 4 months
JBoss Tools SVN: r23949 - in trunk/ws/plugins/org.jboss.tools.ws.ui: src/org/jboss/tools/ws/ui/messages and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bfitzpat
Date: 2010-08-05 13:19:10 -0400 (Thu, 05 Aug 2010)
New Revision: 23949
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester2.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
Log:
OPEN - issue JBIDE-6660: [tester] does not handle password protected services
https://jira.jboss.org/browse/JBIDE-6660
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/META-INF/MANIFEST.MF 2010-08-05 17:19:10 UTC (rev 23949)
@@ -34,7 +34,8 @@
org.eclipse.ui.forms,
org.eclipse.emf.common,
org.eclipse.jdt.ui,
- org.eclipse.osgi
+ org.eclipse.osgi,
+ org.apache.commons.codec
Bundle-ActivationPolicy: lazy
Export-Package: org.jboss.tools.ws.ui,
org.jboss.tools.ws.ui.messages,
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUI.properties 2010-08-05 17:19:10 UTC (rev 23949)
@@ -156,3 +156,7 @@
DelimitedStringList_Msg_Yes_Btn=Yes
DelimitedStringList_NO_COMMAS_WARNING=There are no commas delimiting the name and value for this key/value pair.
DelimitedStringList_NO_EQUALS_DELIMITER_WARNING=Parameters should be in 'name=value' format.
+UidPwdDialog_Description=Specify the user name and password to access this web service via basic authentication.
+UidPwdDialog_PWD_Label=Password:
+UidPwdDialog_Title=User Name/ Password
+UidPwdDialog_UID_Label=User Name:
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JBossWSUIMessages.java 2010-08-05 17:19:10 UTC (rev 23949)
@@ -156,6 +156,10 @@
public static String JAXRSWSTestView2_Title_Msg_May_Be_Out_of_Date;
public static String ResultsXMLStorageInput_WS_Invocation_Results_Prefix;
+ public static String UidPwdDialog_Description;
+ public static String UidPwdDialog_PWD_Label;
+ public static String UidPwdDialog_Title;
+ public static String UidPwdDialog_UID_Label;
public static String WSDLBrowseDialog_Dialog_Title;
public static String WSDLBrowseDialog_Error_Msg_Invalid_URL;
public static String WSDLBrowseDialog_Error_Msg_Parse_Error;
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXRSTester.java 2010-08-05 17:19:10 UTC (rev 23949)
@@ -24,6 +24,8 @@
import java.util.Map;
import java.util.Map.Entry;
+import org.apache.commons.codec.binary.Base64;
+
/**
* Tester class for JAX-RS services
* @author bfitzpat
@@ -96,7 +98,7 @@
* @throws Exception
*/
public void doTest (String address, Map<String, String> parameters, Map<String, String> headers) throws Exception {
- doTest(address, parameters, headers, "GET", null, null, 0); //$NON-NLS-1$
+ doTest(address, parameters, headers, "GET", null, null, 0, null, null); //$NON-NLS-1$
}
/**
@@ -109,7 +111,7 @@
* @throws Exception
*/
public void doTest (String address, Map<String, String> parameters, Map<String, String> headers, String methodType, String requestBody) throws Exception {
- doTest (address, parameters, headers, methodType, requestBody, null, 0);
+ doTest (address, parameters, headers, methodType, requestBody, null, 0, null, null);
}
/**
@@ -124,7 +126,7 @@
* @throws Exception
*/
public void doTest(String address, Map<String, String> parameters, Map<String, String> headers, String methodType, String requestBody, String proxy, String port) throws Exception {
- doTest(address, parameters, headers, methodType, requestBody, proxy, Integer.parseInt(port));
+ doTest(address, parameters, headers, methodType, requestBody, proxy, Integer.parseInt(port), null, null);
}
/**
@@ -138,7 +140,7 @@
* @param port
* @throws Exception
*/
- public void doTest(String address, Map<String, String> parameters, Map<String, String> headers, String methodType, String requestBody, String proxy, int port) throws Exception {
+ public void doTest(String address, Map<String, String> parameters, Map<String, String> headers, String methodType, String requestBody, String proxy, int port, String uid, String pwd) throws Exception {
// handle the proxy
Proxy proxyObject = null;
@@ -210,6 +212,14 @@
}
}
+ // if we have basic authentication to add, add it!
+ if (uid != null && pwd != null) {
+ String authStr = uid + ':' + pwd;
+ byte[] authEncByte = Base64.encodeBase64(authStr.getBytes());
+ String authStringEnc = new String(authEncByte);
+ httpurlc.addRequestProperty("Authorization", "Basic " + authStringEnc); //$NON-NLS-1$//$NON-NLS-2$
+ }
+
requestHeaders = httpurlc.getRequestProperties();
// Check if task has been interrupted
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester2.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester2.java 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/utils/JAXWSTester2.java 2010-08-05 17:19:10 UTC (rev 23949)
@@ -76,6 +76,10 @@
return this.resultSOAP;
}
+ public void doTest( IProgressMonitor monitor, String endpointurl, String actionurl, String ns,
+ String serviceName, String messageName, String body ) throws Exception {
+ doTest(monitor, endpointurl, actionurl, ns, serviceName, messageName, body, null, null);
+ }
/**
* Invoke the JAX-WS service
* @param endpointurl
@@ -85,7 +89,7 @@
*/
@SuppressWarnings("unchecked")
public void doTest( IProgressMonitor monitor, String endpointurl, String actionurl, String ns,
- String serviceName, String messageName, String body ) throws Exception {
+ String serviceName, String messageName, String body, String uid, String pwd ) throws Exception {
this.resultBody = EMPTY_STRING;
@@ -105,7 +109,13 @@
d.getRequestContext().put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
d.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, actionurl); //"http://www.ecubicle.net/webservices/GetSearchResults");
}
-
+
+ if (uid != null && pwd != null) {
+ Map<String, Object> requestContext = d.getRequestContext();
+ requestContext.put(BindingProvider.USERNAME_PROPERTY, uid);
+ requestContext.put(BindingProvider.PASSWORD_PROPERTY, pwd);
+ }
+
SOAPMessage m = mf.createMessage( null, new ByteArrayInputStream(body.getBytes()));
m.saveChanges();
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2010-08-05 17:13:27 UTC (rev 23948)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/JAXRSWSTestView2.java 2010-08-05 17:19:10 UTC (rev 23949)
@@ -533,6 +533,14 @@
urlCombo.setLayoutData(gdURL);
toolkit.adapt(urlCombo);
+ urlCombo.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ setControlsForSelectedURL();
+ getCurrentHistoryEntry().setUrl(urlCombo.getText());
+ getCurrentHistoryEntry().setAction(null);
+ }
+ });
urlCombo.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
}
@@ -1153,23 +1161,30 @@
final String method = getCurrentHistoryEntry().getMethod();
final String headers = getCurrentHistoryEntry().getHeaders();
final String parms = getCurrentHistoryEntry().getParms();
+
+ String tempUID = null;
+ String tempPwd = null;
+ // temp workaround to handle JAX-RS authenticated services
+ if (wsTech.contentEquals(JAX_RS) && url.startsWith("https")) { //$NON-NLS-1$
+ UidPwdDialog authDialog = new UidPwdDialog(getSite().getShell());
+ int rtnCode = authDialog.open();
+ if (rtnCode == Window.OK) {
+ tempUID = authDialog.getUID();
+ tempPwd = authDialog.getPwd();
+ }
+ }
+ final String uid = tempUID;
+ final String pwd = tempPwd;
-// final String url = urlCombo.getText();
-// final String action = actionText;
-// final String body = bodyText.getText();
-// final String method = methodCombo.getText();
-// final String headers = dlsList.getSelection();
-// final String parms = parmsList.getSelection();
-
Job aJob = new Job(JBossWSUIMessages.JAXRSWSTestView_Invoking_WS_Status) {
protected IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
// execute the task ...
if (wsTech.equalsIgnoreCase(JAX_RS)) {
- status = handleRSTest(monitor, url, method, body, parms, headers);
+ status = handleRSTest(monitor, url, method, body, parms, headers, uid, pwd);
}
else if (wsTech.equalsIgnoreCase(JAX_WS)) {
- status = handleWSTest(monitor, url, action, body);
+ status = handleWSTest(monitor, url, action, body, uid, pwd);
}
monitor.done();
return status;
@@ -1225,7 +1240,7 @@
/*
* Actually call the WS and displays the result
*/
- private IStatus handleWSTest(final IProgressMonitor monitor, String url, String action, String body) {
+ private IStatus handleWSTest(final IProgressMonitor monitor, String url, String action, String body, String uid, String pwd) {
try {
envelope = null;
@@ -1239,7 +1254,7 @@
if (!itRan && serviceNSMessage != null && serviceNSMessage.length == 3) {
itRan = true;
// call the service
- tester.doTest(monitor, url, action, serviceNSMessage[0], serviceNSMessage[1], serviceNSMessage[2], body);
+ tester.doTest(monitor, url, action, serviceNSMessage[0], serviceNSMessage[1], serviceNSMessage[2], body, uid, pwd);
} else {
break;
}
@@ -1303,7 +1318,7 @@
/*
* Actually call the RESTful WS to test it
*/
- private IStatus handleRSTest(final IProgressMonitor monitor, String address, String method, String body, String parms, String headersStr) {
+ private IStatus handleRSTest(final IProgressMonitor monitor, String address, String method, String body, String parms, String headersStr, String uid, String pwd) {
if (method.equalsIgnoreCase(GET))
body = EMPTY_STRING;
@@ -1350,7 +1365,7 @@
try {
// call the service
- tester.doTest(address, parameters, headers, method, body);
+ tester.doTest(address, parameters, headers, method, body, null, -1, uid, pwd);
String result = tester.getResultBody();
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java 2010-08-05 17:19:10 UTC (rev 23949)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.ws.ui.views;
+
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.ws.ui.messages.JBossWSUIMessages;
+
+/**
+ * Simple UID/PWD dialog for authentication
+ * @author bfitzpat
+ *
+ */
+public class UidPwdDialog extends TitleAreaDialog {
+ private Text uidText;
+ private Text pwdText;
+
+ private static String uid;
+ private static String pwd;
+
+ public UidPwdDialog(Shell parentShell) {
+ super(parentShell);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ setTitle(JBossWSUIMessages.UidPwdDialog_Title);
+ setMessage(JBossWSUIMessages.UidPwdDialog_Description);
+
+ Composite comp = new Composite (parent,SWT.NONE);
+
+ GridLayout layout = new GridLayout(2, false);
+ GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ gridData.horizontalSpan = 2;
+ comp.setLayoutData(gridData);
+ comp.setLayout(layout);
+
+ Label usernameLabel = new Label(comp, SWT.RIGHT);
+ usernameLabel.setText(JBossWSUIMessages.UidPwdDialog_UID_Label);
+
+ uidText = new Text(comp, SWT.SINGLE | SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_HORIZONTAL);
+ uidText.setLayoutData(data);
+ if (uid != null && uid.trim().length() > 0) {
+ uidText.setText(uid);
+ }
+ uidText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ uid = uidText.getText();
+ }
+ });
+
+ Label passwordLabel = new Label(comp, SWT.RIGHT);
+ passwordLabel.setText(JBossWSUIMessages.UidPwdDialog_PWD_Label);
+
+ pwdText = new Text(comp, SWT.SINGLE | SWT.PASSWORD | SWT.BORDER);
+ data = new GridData(GridData.FILL_HORIZONTAL);
+ pwdText.setLayoutData(data);
+ if (pwd != null && pwd.trim().length() > 0) {
+ pwdText.setText(pwd);
+ }
+ pwdText.addModifyListener(new ModifyListener() {
+ @Override
+ public void modifyText(ModifyEvent e) {
+ pwd = pwdText.getText();
+ }
+ });
+
+ return comp;
+ }
+
+ public String getUID() {
+ return uid;
+ }
+
+ public String getPwd() {
+ return pwd;
+ }
+}
\ No newline at end of file
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/views/UidPwdDialog.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months
JBoss Tools SVN: r23948 - trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-08-05 13:13:27 -0400 (Thu, 05 Aug 2010)
New Revision: 23948
Added:
trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/testSeamPdfAndMail.jsp
Log:
https://jira.jboss.org/browse/JBIDE-5231
Added: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/testSeamPdfAndMail.jsp
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/testSeamPdfAndMail.jsp (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/testSeamPdfAndMail.jsp 2010-08-05 17:13:27 UTC (rev 23948)
@@ -0,0 +1,30 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://jboss.com/products/seam/pdf" prefix="p" %>
+<%@ taglib uri="http://jboss.com/products/seam/mail" prefix="m" %>
+
+<f:loadBundle var="Message" basename="demo.Messages"/>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+
+ <f:view>
+ <h1><h:outputText value="#{Message.header}"/></h1>
+
+ <h:messages style="color: red"/>
+
+ <h:form id="greetingForm">
+ <h:outputText value="#{Message.prompt_message}"/>
+ <h:inputText value="#{user.name}" required="true">
+ <f:validateLength maximum="30" minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton action="hello" value="Say Hello!" />
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.kb.test/projects/TestKbModel/WebContent/pages/testSeamPdfAndMail.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 4 months