Author: jjohnstn
Date: 2010-10-22 19:46:26 -0400 (Fri, 22 Oct 2010)
New Revision: 26014
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
* src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java: New file.
* src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
(setFilter): Allow
use of a temporary filter that isn't saved in the cloud.
(filter): Ditto.
*
src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java
(validate):
Make the message a warning rather than an error as a field will be unfilled in at first
and
shouldn't be listed as in error.
(createControl): Add support for finding an image.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-22 21:46:37
UTC (rev 26013)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-22 23:46:26
UTC (rev 26014)
@@ -1,9 +1,18 @@
2010-10-22 Jeff Johnston <jjohnstn(a)redhat.com>
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java: New file.
+ * src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
(setFilter): Allow
+ use of a temporary filter that isn't saved in the cloud.
+ (filter): Ditto.
+ *
src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java
(validate):
+ Make the message a warning rather than an error as a field will be unfilled in at first
and
+ shouldn't be listed as in error.
* src/org/jboss/tools/deltacloud/ui/commands/CreateInstanceHandler2.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance2.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java: New file.
+ (createControl): Add support for finding an image.
* plugin.xml: Add menu item for launching an instance when the selected item(s) are not
images that will require entry of the image id.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-10-22
21:46:37 UTC (rev 26013)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-10-22
23:46:26 UTC (rev 26014)
@@ -27,6 +27,7 @@
public class ImageViewLabelAndContentProvider extends BaseLabelProvider implements
IStructuredContentProvider, ITableLabelProvider {
private DeltaCloud cloud;
+ private IImageFilter localFilter;
private DeltaCloudImage[] images;
public enum Column {
@@ -91,9 +92,16 @@
}
}
+ // Allow override of filter for Finding Images
+ public void setFilter(IImageFilter filter) {
+ this.localFilter = filter;
+ }
+
private DeltaCloudImage[] filter(DeltaCloudImage[] input) {
ArrayList<DeltaCloudImage> array = new ArrayList<DeltaCloudImage>();
- IImageFilter f = cloud.getImageFilter();
+ IImageFilter f = localFilter;
+ if (localFilter == null)
+ f = cloud.getImageFilter();
for (int i = 0; i < input.length; ++i) {
DeltaCloudImage image = input[i];
if (f.isVisible(image))
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java 2010-10-22
21:46:37 UTC (rev 26013)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/common/databinding/validator/MandatoryStringValidator.java 2010-10-22
23:46:26 UTC (rev 26014)
@@ -33,7 +33,7 @@
*/
public IStatus validate(Object value) {
if (!((value instanceof String) && ((String) value).length() > 0)) {
- return ValidationStatus.error(errorMessage);
+ return ValidationStatus.warning(errorMessage);
}
return ValidationStatus.ok();
}
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java 2010-10-22
23:46:26 UTC (rev 26014)
@@ -0,0 +1,38 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+
+public class FindImage extends Wizard {
+
+ private DeltaCloud cloud;
+ private FindImagePage mainPage;
+ private String imageId;
+
+ public FindImage(DeltaCloud cloud) {
+ this.cloud = cloud;
+ }
+
+ public String getImageId() {
+ return imageId;
+ }
+
+ @Override
+ public void addPages() {
+ // TODO Auto-generated method stub
+ mainPage = new FindImagePage(cloud);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ @Override
+ public boolean performFinish() {
+ imageId = mainPage.getImageId();
+ return true;
+ }
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
(rev 0)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java 2010-10-22
23:46:26 UTC (rev 26014)
@@ -0,0 +1,305 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardPage;
+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.graphics.Point;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.deltacloud.core.AllImageFilter;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.IImageFilter;
+import org.jboss.tools.deltacloud.core.ImageFilter;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import org.jboss.tools.deltacloud.ui.views.CVMessages;
+import org.jboss.tools.deltacloud.ui.views.ImageComparator;
+import org.jboss.tools.deltacloud.ui.views.ImageViewLabelAndContentProvider;
+
+public class FindImagePage extends WizardPage {
+
+ private final static String NAME = "FindImage.name"; //$NON-NLS-1$
+ private final static String TITLE = "FindImage.title"; //$NON-NLS-1$
+ private final static String DESC = "FindImage.desc"; //$NON-NLS-1$
+ private final static String FILTER_LABEL = "Filter.label"; //$NON-NLS-1$
+ private final static String NAME_LABEL = "Name.label"; //$NON-NLS-1$
+ private final static String ID_LABEL = "Id.label"; //$NON-NLS-1$
+ private final static String ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
+ private final static String DESC_LABEL = "Desc.label"; //$NON-NLS-1$
+ private final static String EMPTY_RULE = "ErrorFilterEmptyRule.msg";
//$NON-NLS-1$
+ private final static String INVALID_SEMICOLON = "ErrorFilterSemicolon.msg";
//$NON-NLS-1$
+
+ private DeltaCloud cloud;
+ private TableViewer viewer;
+ private Composite container;
+
+ private ImageViewLabelAndContentProvider contentProvider;
+
+ private Text nameText;
+ private Text idText;
+ private Text archText;
+ private Text descText;
+
+ private IImageFilter filter;
+ private DeltaCloudImage selectedElement;
+ private String oldRules;
+
+ private ModifyListener textListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ // TODO Auto-generated method stub
+ validate();
+ }
+
+ };
+
+ private class ColumnListener extends SelectionAdapter {
+
+ private int column;
+ private TableViewer viewer;
+
+ public ColumnListener(int column, TableViewer viewer) {
+ this.column = column;
+ this.viewer = viewer;
+ }
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ ImageComparator comparator = (ImageComparator)viewer.getComparator();
+ Table t = viewer.getTable();
+ if (comparator.getColumn() == column) {
+ comparator.reverseDirection();
+ }
+ comparator.setColumn(column);
+ TableColumn tc = (TableColumn)e.getSource();
+ t.setSortColumn(tc);
+ t.setSortDirection(SWT.NONE);
+ viewer.refresh();
+ }
+
+ };
+
+ public FindImagePage(DeltaCloud cloud) {
+ super(WizardMessages.getString(NAME));
+ this.cloud = cloud;
+ filter = new AllImageFilter();
+ setDescription(WizardMessages.getString(DESC));
+ setTitle(WizardMessages.getString(TITLE));
+ setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
+ setPageComplete(false);
+ }
+
+ public String getImageId() {
+ if (selectedElement != null)
+ return selectedElement.getId();
+ return "";
+ }
+
+ private void validate() {
+ boolean hasError = false;
+ boolean isComplete = true;
+
+ String name = nameText.getText();
+ String id = idText.getText();
+ String arch = archText.getText();
+ String desc = descText.getText();
+
+ if (name.contains(";") || //$NON-NLS-1$
+ id.contains(";") || //$NON-NLS-1$
+ arch.contains(";") || //$NON-NLS-1$
+ desc.contains(";")) { //$NON-NLS-1$
+ setErrorMessage(WizardMessages.getString(INVALID_SEMICOLON));
+ hasError = true;
+ }
+
+ if (selectedElement == null)
+ isComplete = false;
+
+ if (!hasError) {
+ setErrorMessage(null);
+ String newRules = name + "*;" //$NON-NLS-1$
+ + id + "*;" //$NON-NLS-1$
+ + arch + "*;" //$NON-NLS-1$
+ + desc + "*"; //$NON-NLS-1$
+
+ if (!newRules.equals(oldRules)) {
+ filter = new ImageFilter();
+ filter.setRules(newRules);
+ oldRules = newRules;
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ contentProvider.setFilter(filter);
+ viewer.setInput(cloud.getCurrImages());
+ viewer.refresh();
+ }
+
+ });
+ }
+ }
+ setPageComplete(isComplete && !hasError);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ // TODO Auto-generated method stub
+ container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ container.setLayout(layout);
+
+
+ Label nameLabel = new Label(container, SWT.NULL);
+ nameLabel.setText(WizardMessages.getString(NAME_LABEL));
+
+ nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ nameText.setText(filter.getNameRule().toString());
+ nameText.addModifyListener(textListener);
+
+ Label idLabel = new Label(container, SWT.NULL);
+ idLabel.setText(WizardMessages.getString(ID_LABEL));
+
+ idText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ idText.setText(filter.getIdRule().toString());
+ idText.addModifyListener(textListener);
+
+ Label archLabel = new Label(container, SWT.NULL);
+ archLabel.setText(WizardMessages.getString(ARCH_LABEL));
+
+ archText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ archText.setText(filter.getArchRule().toString());
+ archText.addModifyListener(textListener);
+
+ Label descLabel = new Label(container, SWT.NULL);
+ descLabel.setText(WizardMessages.getString(DESC_LABEL));
+
+ descText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ descText.setText(filter.getDescRule().toString());
+ descText.addModifyListener(textListener);
+
+ Composite tableArea = new Composite(container, SWT.NULL);
+ TableColumnLayout tableLayout = new TableColumnLayout();
+ tableArea.setLayout(tableLayout);
+
+ viewer = new TableViewer(tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL |
SWT.BORDER);
+ Table table = viewer.getTable();
+ table.setHeaderVisible(true);
+ table.setLinesVisible(true);
+ contentProvider = new ImageViewLabelAndContentProvider();
+ viewer.setContentProvider(contentProvider);
+ viewer.setLabelProvider(contentProvider);
+ ImageComparator comparator = new ImageComparator(0);
+ viewer.setComparator(comparator);
+
+ for (int i = 0; i < ImageViewLabelAndContentProvider.Column.getSize(); ++i) {
+ ImageViewLabelAndContentProvider.Column c =
+ ImageViewLabelAndContentProvider.Column.getColumn(i);
+ TableColumn tc = new TableColumn(table, SWT.NONE);
+ if (i == 0)
+ table.setSortColumn(tc);
+ tc.setText(CVMessages.getString(c.name()));
+ tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
+ tc.addSelectionListener(new ColumnListener(i, viewer));
+ }
+ table.setSortDirection(SWT.NONE);
+
+ Point p1 = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ int centering = (p2.y - p1.y + 1) / 2;
+
+ FormData f = new FormData();
+// f.left = new FormAttachment(0, 5);
+// f.top = new FormAttachment(0, 5 + centering);
+// filterLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(0, 10);
+ f.top = new FormAttachment(0, 5 + centering);
+ nameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(nameLabel, 5);
+ f.top = new FormAttachment(0, 5);
+ f.right = new FormAttachment(22, -10);
+ nameText.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(22);
+ f.top = new FormAttachment(0, 5 + centering);
+ idLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(idLabel, 5);
+ f.top = new FormAttachment(0, 5);
+ f.right = new FormAttachment(40, -10);
+ idText.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(40);
+ f.top = new FormAttachment(0, 5 + centering);
+ archLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(archLabel, 5);
+ f.top = new FormAttachment(0, 5);
+ f.right = new FormAttachment(67, -10);
+ archText.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(67);
+ f.top = new FormAttachment(0, 5 + centering);
+ descLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(descLabel, 5);
+ f.top = new FormAttachment(0, 5);
+ f.right = new FormAttachment(100, -10);
+ descText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameText, 13);
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ f.bottom = new FormAttachment(100, 0);
+ tableArea.setLayoutData(f);
+
+ setControl(container);
+
+ hookSelection();
+ validate();
+ }
+
+ private void hookSelection() {
+ viewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ handleSelection();
+ }
+ });
+ }
+
+ private void handleSelection() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ selectedElement = (DeltaCloudImage)selection.getFirstElement();
+ validate();
+ }
+
+}
Property changes on:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-10-22
21:46:37 UTC (rev 26013)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-10-22
23:46:26 UTC (rev 26014)
@@ -69,6 +69,7 @@
private static final String REALM_LABEL = "Realm.label"; //$NON-NLS-1$
private static final String KEY_LABEL = "Key.label"; //$NON-NLS-1$
private static final String MANAGE_BUTTON_LABEL = "ManageButton.label";
//$NON-NLS-1$
+ private static final String FIND_BUTTON_LABEL = "FindButton.label";
//$NON-NLS-1$
private static final String PROPERTIES_LABEL = "Properties.label";
//$NON-NLS-1$
private static final String MUST_ENTER_A_NAME = "ErrorMustProvideName.text";
//$NON-NLS-1$
private static final String MUST_ENTER_A_KEYNAME =
"ErrorMustProvideKeyName.text"; //$NON-NLS-1$
@@ -85,6 +86,7 @@
private Text keyText;
private Combo hardware;
private Button keyManage;
+ private Button findImage;
private Control realm;
private ProfileComposite currPage;
private Map<String, ProfileComposite> profilePages;
@@ -117,7 +119,23 @@
}
};
+
+ private SelectionListener findListener = new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent event) {
+ Shell shell = getShell();
+ FindImage wizard = new FindImage(cloud);
+ WizardDialog dialog = new CustomWizardDialog(shell, wizard,
+ IDialogConstants.OK_LABEL);
+ dialog.create();
+ dialog.open();
+ String imageId = wizard.getImageId();
+ if (imageId != null)
+ imageText.setText(imageId);
+ }
+ };
+
public NewInstancePage2(DeltaCloud cloud) {
super(WizardMessages.getString(NAME));
this.cloud = cloud;
@@ -247,6 +265,10 @@
WizardMessages.getString(MUST_ENTER_IMAGE_ID))),
null);
+ findImage = new Button(container, SWT.NULL);
+ findImage.setText(WizardMessages.getString(FIND_BUTTON_LABEL));
+ findImage.addSelectionListener(findListener);
+
arch = new Label(container, SWT.NULL);
bindArchLabel(dbc, imageText, arch, this);
@@ -299,10 +321,18 @@
profilePages.put(p.getId(), pc);
pc.setVisible(false);
}
+
+ keyManage = new Button(container, SWT.NULL);
+ keyManage.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
+ keyManage.addSelectionListener(manageListener);
+ if (cloud.getType().equals(DeltaCloudInstance.MOCK_TYPE))
+ keyManage.setEnabled(false);
Point p1 = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p3 = findImage.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int centering = (p2.y - p1.y + 1) / 2;
+ int centering2 = (p3.y - p2.y + 1) / 2;
FormData f = new FormData();
f.left = new FormAttachment(0, 0);
@@ -321,14 +351,26 @@
nameText.setLayoutData(f);
f = new FormData();
- f.top = new FormAttachment(nameText, 8 + centering);
+ f.top = new FormAttachment(nameText, 8 + centering + centering2);
f.left = new FormAttachment(0, 0);
imageLabel.setLayoutData(f);
+ int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
+ Point minSize1 = findImage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ Point minSize2 = keyManage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
+ int buttonWidth = Math.max(widthHint, minSize1.x);
+ buttonWidth = Math.max(buttonWidth, minSize2.x);
+
f = new FormData();
+ f.width = buttonWidth;
f.top = new FormAttachment(nameText, 8);
+ f.right = new FormAttachment(realm, 0, SWT.RIGHT);
+ findImage.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameText, 8 + centering2);
f.left = new FormAttachment(hardwareLabel, 5);
- f.right = new FormAttachment(100, 0);
+ f.right = new FormAttachment(findImage, -10);
imageText.setLayoutData(f);
f = new FormData();
@@ -353,6 +395,7 @@
f.right = new FormAttachment(100, 0);
realm.setLayoutData(f);
+
Control control = realm;
Label keyLabel = new Label(container, SWT.NULL);
@@ -361,13 +404,6 @@
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
bindText(dbc, keyText, NewInstanceModel.PROPERTY_KEYNAME, MUST_ENTER_A_KEYNAME);
- keyManage = new Button(container, SWT.NULL);
- keyManage.setText(WizardMessages.getString(MANAGE_BUTTON_LABEL));
- keyManage.addSelectionListener(manageListener);
- if (cloud.getType().equals(DeltaCloudInstance.MOCK_TYPE))
- keyManage.setEnabled(false);
- Point p3 = keyManage.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int centering2 = (p3.y - p2.y + 1) / 2;
f = new FormData();
f.top = new FormAttachment(realm, 8 + centering + centering2);
@@ -375,9 +411,7 @@
keyLabel.setLayoutData(f);
f = new FormData();
- int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
- Point minSize = keyManage.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
- f.width = Math.max(widthHint, minSize.x);
+ f.width = buttonWidth;
f.top = new FormAttachment(realm, 8);
f.right = new FormAttachment(realm, 0, SWT.RIGHT);
keyManage.setLayoutData(f);
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-10-22
21:46:37 UTC (rev 26013)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-22
23:46:26 UTC (rev 26014)
@@ -39,6 +39,7 @@
Key.label=Key Name:
BrowseButton.label=Browse...
ManageButton.label=Manage...
+FindButton.label=Find...
NewButton.label=New...
DeleteButton.label=Delete
DefaultButton.label=Default
@@ -83,10 +84,16 @@
ManageKeys.title=Manage Keys
ManageKeys.name=Manage Keys
+FindImage.desc=Select an image to use. Use the filters to narrow down your choice.
+FindImage.title=Find Image
+FindImage.name=Find Image
+
ImageFilter.desc=Specify rules to determine which Images will appear in the dialog.
ImageFilter.title=Image Filter
ImageFilter.name=Image Filter
+Filter.label=Filter:
+
ImageFilter.label=Show all images which match the following rules (* \= wildcard)\:
ErrorFilterEmptyRule.msg=Rules cannot be empty strings
ErrorFilterSemicolon.msg=Rules cannot contain a semi-colon character