Author: adietish
Date: 2010-12-08 07:25:25 -0500 (Wed, 08 Dec 2010)
New Revision: 27223
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java
Log:
various cleanups
Modified:
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 2010-12-08
12:04:18 UTC (rev 27222)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java 2010-12-08
12:25:25 UTC (rev 27223)
@@ -46,10 +46,7 @@
private DeltaCloud cloud;
private TableViewer viewer;
- private Composite container;
- private ImageViewLabelAndContentProvider contentProvider;
-
private Text nameText;
private Text idText;
private Text archText;
@@ -120,13 +117,7 @@
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;
- }
+ hasError = validateFilters(hasError, name, id, arch, desc);
if (selectedElement == null)
isComplete = false;
@@ -148,10 +139,20 @@
setPageComplete(isComplete && !hasError);
}
+ private boolean validateFilters(boolean hasError, String name, String id, String arch,
String desc) {
+ 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;
+ }
+ return hasError;
+ }
+
@Override
public void createControl(Composite parent) {
- // TODO Auto-generated method stub
- container = new Composite(parent, SWT.NULL);
+ Composite container = new Composite(parent, SWT.NULL);
FormLayout layout = new FormLayout();
layout.marginHeight = 5;
layout.marginWidth = 5;
@@ -193,7 +194,7 @@
Table table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
- contentProvider = new ImageViewLabelAndContentProvider();
+ ImageViewLabelAndContentProvider contentProvider = new
ImageViewLabelAndContentProvider();
viewer.setContentProvider(contentProvider);
viewer.setLabelProvider(contentProvider);
TableViewerColumnComparator comparator = new TableViewerColumnComparator();