Author: adietish
Date: 2011-03-29 04:55:22 -0400 (Tue, 29 Mar 2011)
New Revision: 30091
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterWizard.java
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-8187] added capability to filter instance on behalf of alias
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2011-03-29
08:55:22 UTC (rev 30091)
@@ -40,6 +40,11 @@
}
@Override
+ public IFieldMatcher getAliasRule() {
+ return matcher;
+ }
+
+ @Override
public IFieldMatcher getImageIdRule() {
return matcher;
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2011-03-29
08:55:22 UTC (rev 30091)
@@ -19,12 +19,14 @@
public static final String ALL_STRING =
ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // name
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // id
+ + ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // alias
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // imageId
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // ownerId
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // keynameId
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // realm
+ ALL_MATCHER_EXPRESSION; // profile
+ public IFieldMatcher getAliasRule();
public IFieldMatcher getImageIdRule();
public IFieldMatcher getOwnerIdRule();
public IFieldMatcher getKeyNameRule();
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2011-03-29
08:55:22 UTC (rev 30091)
@@ -23,6 +23,7 @@
*/
public class InstanceFilter extends AbstractCloudElementFilter<DeltaCloudInstance>
implements IInstanceFilter {
+ private IFieldMatcher aliasRule;
private IFieldMatcher imageIdRule;
private IFieldMatcher realmRule;
private IFieldMatcher profileRule;
@@ -37,6 +38,7 @@
@Override
public boolean matches(DeltaCloudInstance instance) {
return super.matches(instance) &&
+ aliasRule.matches(instance.getAlias()) &&
imageIdRule.matches(instance.getImageId()) &&
ownerIdRule.matches(instance.getOwnerId()) &&
keyNameRule.matches(instance.getKeyId()) &&
@@ -47,6 +49,7 @@
@Override
public void setRules(String ruleString) throws PatternSyntaxException {
Iterator<String> rulesIterator = super.setRules(ruleString,
getRulesIterator(ruleString));
+ this.aliasRule = createRule(rulesIterator);
this.imageIdRule = createRule(rulesIterator);
this.ownerIdRule = createRule(rulesIterator);
this.keyNameRule = createRule(rulesIterator);
@@ -57,6 +60,7 @@
@Override
public String toString() {
return super.toString()
+ + aliasRule + ";" //$NON-NLS-1$
+ imageIdRule + ";" //$NON-NLS-1$
+ ownerIdRule + ";" //$NON-NLS-1$
+ keyNameRule + ";" //$NON-NLS-1$
@@ -65,6 +69,11 @@
}
@Override
+ public IFieldMatcher getAliasRule() {
+ return aliasRule;
+ }
+
+ @Override
public IFieldMatcher getImageIdRule() {
return imageIdRule;
}
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java 2011-03-29
08:55:22 UTC (rev 30091)
@@ -40,6 +40,7 @@
private final static String INVALID_SEMICOLON = "ErrorFilterSemicolon.msg";
//$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 ALIAS_LABEL = "Alias.label"; //$NON-NLS-1$
private final static String OWNER_ID_LABEL = "OwnerId.label"; //$NON-NLS-1$
private final static String IMAGE_ID_LABEL = "ImageId.label"; //$NON-NLS-1$
private final static String KEYNAME_LABEL = "Key.label"; //$NON-NLS-1$
@@ -50,6 +51,7 @@
private DeltaCloud cloud;
private Text nameText;
private Text idText;
+ private Text aliasText;
private Text imageIdText;
private Text ownerIdText;
private Text keyNameText;
@@ -58,6 +60,7 @@
private Button defaultName;
private Button defaultId;
+ private Button defaultAlias;
private Button defaultImageId;
private Button defaultOwnerId;
private Button defaultKeyId;
@@ -81,6 +84,10 @@
return idText.getText();
}
+ public String getAliasRule() {
+ return aliasText.getText();
+ }
+
public String getImageIdRule() {
return imageIdText.getText();
}
@@ -118,6 +125,8 @@
nameText.setText("*"); //$NON-NLS-1$
else if (b == defaultId)
idText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultAlias)
+ aliasText.setText("*"); //$NON-NLS-1$
else if (b == defaultImageId)
imageIdText.setText("*"); //$NON-NLS-1$
else if (b == defaultOwnerId)
@@ -138,6 +147,7 @@
if (nameText.getText().length() == 0 ||
idText.getText().length() == 0 ||
+ aliasText.getText().length() == 0 ||
imageIdText.getText().length() == 0 ||
ownerIdText.getText().length() == 0 ||
keyNameText.getText().length() == 0 ||
@@ -148,6 +158,7 @@
error = true;
} else if (nameText.getText().contains(";") ||
idText.getText().contains(";") ||
+ aliasText.getText().contains(";") ||
imageIdText.getText().contains(";") ||
ownerIdText.getText().contains(";") ||
keyNameText.getText().contains(";") ||
@@ -195,6 +206,17 @@
defaultId.setText(WizardMessages.getString(DEFAULT_LABEL));
defaultId.addSelectionListener(ButtonListener);
+ Label aliasLabel = new Label(container, SWT.NULL);
+ idLabel.setText(WizardMessages.getString(ALIAS_LABEL));
+
+ aliasText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ aliasText.setText(cloud.getInstanceFilter().getAliasRule().toString());
+ aliasText.addModifyListener(Listener);
+
+ defaultAlias = new Button(container, SWT.NULL);
+ defaultAlias.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultAlias.addSelectionListener(ButtonListener);
+
Label imageIdLabel = new Label(container, SWT.NULL);
imageIdLabel.setText(WizardMessages.getString(IMAGE_ID_LABEL));
@@ -295,6 +317,22 @@
f = new FormData();
f.top = new FormAttachment(idLabel, 11 + centering + centering2);
f.left = new FormAttachment(0, 0);
+ aliasLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(idLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultAlias.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(idLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultAlias, -10);
+ aliasText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(idLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
imageIdLabel.setLayoutData(f);
f = new FormData();
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterWizard.java
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterWizard.java 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterWizard.java 2011-03-29
08:55:22 UTC (rev 30091)
@@ -43,6 +43,7 @@
public boolean performFinish() {
String nameRule = mainPage.getNameRule();
String idRule = mainPage.getIdRule();
+ String aliasRule = mainPage.getAliasRule();
String imageIdRule = mainPage.getImageIdRule();
String ownerIdRule = mainPage.getOwnerIdRule();
String keyNameRule = mainPage.getKeyNameRule();
@@ -52,6 +53,7 @@
try {
cloud.updateInstanceFilter(nameRule + ";" + //$NON-NLS-1$
idRule + ";" + //$NON-NLS-1$
+ aliasRule + ";" + //$NON-NLS-1$
imageIdRule + ";" + //$NON-NLS-1$
ownerIdRule + ";" + //$NON-NLS-1$
keyNameRule + ";" + //$NON-NLS-1$
Modified:
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
---
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-29
08:52:31 UTC (rev 30090)
+++
branches/jbosstools-3.2.x/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-29
08:55:22 UTC (rev 30091)
@@ -29,6 +29,7 @@
Url.label=URL:
Name.label=Name:
+Alias.label=Alias:
Type.label=Type:
UserName.label=Username:
Password.label=Password: