JBoss Tools SVN: r25661 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-10-08 19:07:03 -0400 (Fri, 08 Oct 2010)
New Revision: 25661
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
Log:
2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java: New file.
* src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (getChildren): Add
filtering.
(listChanged): Ditto.
(filter): New method.
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new instance filtering
messages.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (handleSelection): Add enablement
of instances filter.
(fillLocalPullDown): Add instances filtering.
(fillContextMenu): Ditto.
(makeActions): Add instances filtering action. Disable all cloud-wide actions based on whether
an item is selected or not.
* src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (createPartControl): Add filtered
label.
(fillLocalPullDown): Add filtering action.
(makeActions): Ditto.
* src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (inputChanged):
Add filtering support.
(filter): New method.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java (.widgetSelected): Fix
default values to be wildcards.
(validate): Remove regex checking of input rules.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new messages.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-10-08 23:05:06 UTC (rev 25660)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-10-08 23:07:03 UTC (rev 25661)
@@ -16,7 +16,6 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
14 years, 3 months
JBoss Tools SVN: r25660 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/views and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-10-08 19:05:06 -0400 (Fri, 08 Oct 2010)
New Revision: 25660
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.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/CVInstancesCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java: New file.
* src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (getChildren): Add
filtering.
(listChanged): Ditto.
(filter): New method.
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new instance filtering
messages.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (handleSelection): Add enablement
of instances filter.
(fillLocalPullDown): Add instances filtering.
(fillContextMenu): Ditto.
(makeActions): Add instances filtering action. Disable all cloud-wide actions based on whether
an item is selected or not.
* src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (createPartControl): Add filtered
label.
(fillLocalPullDown): Add filtering action.
(makeActions): Ditto.
* src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (inputChanged):
Add filtering support.
(filter): New method.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java (.widgetSelected): Fix
default values to be wildcards.
(validate): Remove regex checking of input rules.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new messages.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-10-08 23:05:06 UTC (rev 25660)
@@ -1,3 +1,31 @@
+2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java: New file.
+ * src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (getChildren): Add
+ filtering.
+ (listChanged): Ditto.
+ (filter): New method.
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new instance filtering
+ messages.
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (handleSelection): Add enablement
+ of instances filter.
+ (fillLocalPullDown): Add instances filtering.
+ (fillContextMenu): Ditto.
+ (makeActions): Add instances filtering action. Disable all cloud-wide actions based on whether
+ an item is selected or not.
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceView.java (createPartControl): Add filtered
+ label.
+ (fillLocalPullDown): Add filtering action.
+ (makeActions): Ditto.
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (inputChanged):
+ Add filtering support.
+ (filter): New method.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java (.widgetSelected): Fix
+ default values to be wildcards.
+ (validate): Remove regex checking of input rules.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: Add new messages.
+
2010-10-07 Jeff Johnston <jjohnstn(a)redhat.com>
[JBIDE-7181]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -10,11 +10,15 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import java.util.ArrayList;
+
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
public class CVInstancesCategoryElement extends CVCategoryElement implements IInstanceListListener {
@@ -41,7 +45,7 @@
if (!initialized) {
DeltaCloud cloud = (DeltaCloud)getElement();
cloud.removeInstanceListListener(this);
- DeltaCloudInstance[] instances = cloud.getCurrInstances();
+ DeltaCloudInstance[] instances = filter(cloud.getCurrInstances());
for (int i = 0; i < instances.length; ++i) {
DeltaCloudInstance d = instances[i];
CVInstanceElement element = new CVInstanceElement(d, d.getName());
@@ -54,8 +58,9 @@
}
@Override
- public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] instances) {
+ public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] newInstances) {
clearChildren();
+ DeltaCloudInstance[] instances = filter(newInstances);
for (int i = 0; i < instances.length; ++i) {
DeltaCloudInstance d = instances[i];
CVInstanceElement element = new CVInstanceElement(d, d.getName());
@@ -70,4 +75,16 @@
});
}
+ private DeltaCloudInstance[] filter(DeltaCloudInstance[] input) {
+ ArrayList<DeltaCloudInstance> array = new ArrayList<DeltaCloudInstance>();
+ DeltaCloud cloud = (DeltaCloud)getElement();
+ IInstanceFilter f = cloud.getInstanceFilter();
+ for (int i = 0; i < input.length; ++i) {
+ DeltaCloudInstance instance = input[i];
+ if (f.isVisible(instance))
+ array.add(instance);
+ }
+ return array.toArray(new DeltaCloudInstance[array.size()]);
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-10-08 23:05:06 UTC (rev 25660)
@@ -37,6 +37,7 @@
Filtered.label=filtered
FilteredImages.tooltip=Images shown have been filtered
ImageFilter.label=Filter Images...
+InstanceFilter.label=Filter Instances...
CreateInstance.label=Launch Instance
DeleteInstance.label=Delete Instance
ShowInRSE.label=Show in Remote System Explorer
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -52,6 +52,7 @@
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.internal.deltacloud.ui.wizards.EditCloudConnection;
import org.jboss.tools.internal.deltacloud.ui.wizards.ImageFilter;
+import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
import org.jboss.tools.internal.deltacloud.ui.wizards.NewInstance;
@@ -82,6 +83,7 @@
private final static String DESTROYING_INSTANCE_TITLE = "DestroyingInstance.title"; //$NON-NLS-1$
private final static String DESTROYING_INSTANCE_MSG = "DestroyingInstance.msg"; //$NON-NLS-1$
private final static String IMAGE_FILTER = "ImageFilter.label"; //$NON-NLS-1$
+ private final static String INSTANCE_FILTER = "InstanceFilter.label"; //$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
@@ -97,6 +99,7 @@
private Action createInstance;
private Action editCloud;
private Action imageFilterAction;
+ private Action instanceFilterAction;
private Map<String, Action> instanceActions;
@@ -177,6 +180,7 @@
removeCloud.setEnabled(selectedElement != null);
refreshAction.setEnabled(selectedElement != null);
imageFilterAction.setEnabled(selectedElement != null);
+ instanceFilterAction.setEnabled(selectedElement != null);
}
private void fillLocalPullDown(IMenuManager manager) {
@@ -185,6 +189,7 @@
manager.add(removeCloud);
manager.add(refreshAction);
manager.add(imageFilterAction);
+ manager.add(instanceFilterAction);
}
private void fillContextMenu(IMenuManager manager) {
@@ -202,6 +207,7 @@
manager.add(editCloud);
manager.add(removeCloud);
manager.add(imageFilterAction);
+ manager.add(instanceFilterAction);
// Other plug-ins can contribute there actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
@@ -446,6 +452,35 @@
imageFilterAction.setText(CVMessages.getString(IMAGE_FILTER));
imageFilterAction.setToolTipText(CVMessages.getString(IMAGE_FILTER));
+ instanceFilterAction = new Action() {
+ public void run() {
+ IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
+ CloudViewElement element = (CloudViewElement)selection.getFirstElement();
+ while (element != null && !(element instanceof CVCloudElement)) {
+ element = (CloudViewElement)element.getParent();
+ }
+ if (element != null) {
+ CVCloudElement cve = (CVCloudElement)element;
+ final DeltaCloud cloud = (DeltaCloud)cve.getElement();
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ Shell shell = viewer.getControl().getShell();
+ IWizard wizard = new InstanceFilter(cloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ }
+
+ });
+ }
+ }
+ };
+ instanceFilterAction.setText(CVMessages.getString(INSTANCE_FILTER));
+ instanceFilterAction.setToolTipText(CVMessages.getString(INSTANCE_FILTER));
+
doubleClickAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
@@ -461,6 +496,12 @@
collapseall.setText(CVMessages.getString(COLLAPSE_ALL));
collapseall.setToolTipText(CVMessages.getString(COLLAPSE_ALL));
collapseall.setImageDescriptor(SWTImagesFactory.DESC_COLLAPSE_ALL);
+
+ editCloud.setEnabled(selectedElement != null);
+ removeCloud.setEnabled(selectedElement != null);
+ refreshAction.setEnabled(selectedElement != null);
+ imageFilterAction.setEnabled(selectedElement != null);
+ instanceFilterAction.setEnabled(selectedElement != null);
}
private void hookDoubleClickAction() {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceView.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -33,6 +33,8 @@
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.rse.core.IRSECoreRegistry;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
@@ -56,6 +58,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.IActionBars;
@@ -67,10 +70,12 @@
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
import org.jboss.tools.deltacloud.core.ICloudManagerListener;
+import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
import org.osgi.service.prefs.Preferences;
public class InstanceView extends ViewPart implements ICloudManagerListener, IInstanceListListener {
@@ -91,11 +96,15 @@
private final static String DESTROYING_INSTANCE_MSG = "DestroyingInstance.msg"; //$NON-NLS-1$
private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
+ private static final String FILTER = "Filter.label"; //$NON-NLS-1$
+ private static final String FILTERED_LABEL = "Filtered.label"; //$NON-NLS-1$
+ private static final String FILTERED_TOOLTIP = "FilteredImages.tooltip"; //$NON-NLS-1$
private TableViewer viewer;
private Composite container;
private Combo cloudSelector;
+ private Label filterLabel;
private DeltaCloudInstance selectedElement;
private DeltaCloud[] clouds;
@@ -104,6 +113,7 @@
private InstanceViewLabelAndContentProvider contentProvider;
private Action refreshAction;
+ private Action filterAction;
private Action startAction;
private Action stopAction;
private Action destroyAction;
@@ -205,6 +215,10 @@
}
});
+ filterLabel = new Label(container, SWT.NULL);
+ filterLabel.setText(CVMessages.getString(FILTERED_LABEL));
+ filterLabel.setToolTipText(CVMessages.getString(FILTERED_TOOLTIP));
+
Composite tableArea = new Composite(container, SWT.NULL);
TableColumnLayout tableLayout = new TableColumnLayout();
tableArea.setLayout(tableLayout);
@@ -313,6 +327,7 @@
private void fillLocalPullDown(IMenuManager manager) {
manager.add(refreshAction);
+ manager.add(filterAction);
}
private void fillContextMenu(IMenuManager manager) {
@@ -368,6 +383,30 @@
refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
+ filterAction = new Action() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ // TODO Auto-generated method stub
+ Shell shell = viewer.getControl().getShell();
+ IWizard wizard = new InstanceFilter(currCloud);
+ WizardDialog dialog = new WizardDialog(shell, wizard);
+ dialog.create();
+ dialog.open();
+ if (!currCloud.getInstanceFilter().toString().equals(IInstanceFilter.ALL_STRING))
+ filterLabel.setVisible(true);
+ else
+ filterLabel.setVisible(false);
+ }
+
+ });
+ }
+ };
+ filterAction.setText(CVMessages.getString(FILTER));
+ filterAction.setToolTipText(CVMessages.getString(FILTER));
+
startAction = new Action() {
public void run() {
ISelection selection = viewer.getSelection();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import java.util.ArrayList;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
@@ -21,6 +22,7 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.IInstanceFilter;
public class InstanceViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider, ITableLabelProvider {
@@ -81,14 +83,25 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput != null) {
if (newInput instanceof DeltaCloudInstance[]) {
- instances = (DeltaCloudInstance[])newInput;
+ instances = filter((DeltaCloudInstance[])newInput);
} else {
cloud = (DeltaCloud)newInput;
- instances = cloud.getCurrInstances();
+ instances = filter(cloud.getCurrInstances());
}
}
}
+ private DeltaCloudInstance[] filter(DeltaCloudInstance[] input) {
+ ArrayList<DeltaCloudInstance> array = new ArrayList<DeltaCloudInstance>();
+ IInstanceFilter f = cloud.getInstanceFilter();
+ for (int i = 0; i < input.length; ++i) {
+ DeltaCloudInstance instance = input[i];
+ if (f.isVisible(instance))
+ array.add(instance);
+ }
+ return array.toArray(new DeltaCloudInstance[array.size()]);
+ }
+
@Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java 2010-10-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -1,8 +1,5 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
-import java.util.regex.Pattern;
-import java.util.regex.PatternSyntaxException;
-
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
@@ -28,7 +25,6 @@
private final static String FILTER_LABEL = "ImageFilter.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 final static String FIELD_ERROR = "ErrorFieldError.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 ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
@@ -85,14 +81,13 @@
public void widgetSelected(SelectionEvent e) {
Button b = (Button)e.widget;
if (b == defaultName)
- nameText.setText(".*"); //$NON-NLS-1$
+ nameText.setText("*"); //$NON-NLS-1$
else if (b == defaultId)
- idText.setText(".*"); //$NON-NLS-1$
+ idText.setText("*"); //$NON-NLS-1$
else if (b == defaultArch)
- archText.setText(".*"); //$NON-NLS-1$
+ archText.setText("*"); //$NON-NLS-1$
else if (b == defaultDesc)
- descText.setText(".*"); //$NON-NLS-1$
-
+ descText.setText("*"); //$NON-NLS-1$
}
};
@@ -116,43 +111,6 @@
error = true;
}
- try {
- @SuppressWarnings("unused")
- Pattern p = Pattern.compile(nameText.getText());
- } catch (PatternSyntaxException e) {
- setErrorMessage(WizardMessages.getFormattedString(FIELD_ERROR,
- new String[]{WizardMessages.getString(NAME_LABEL),
- e.getLocalizedMessage()}));
- error = true;
- }
- try {
- @SuppressWarnings("unused")
- Pattern p = Pattern.compile(idText.getText());
- } catch (PatternSyntaxException e) {
- setErrorMessage(WizardMessages.getFormattedString(FIELD_ERROR,
- new String[]{WizardMessages.getString(ID_LABEL),
- e.getLocalizedMessage()}));
- error = true;
- }
- try {
- @SuppressWarnings("unused")
- Pattern p = Pattern.compile(archText.getText());
- } catch (PatternSyntaxException e) {
- setErrorMessage(WizardMessages.getFormattedString(FIELD_ERROR,
- new String[]{WizardMessages.getString(ARCH_LABEL),
- e.getLocalizedMessage()}));
- error = true;
- }
- try {
- @SuppressWarnings("unused")
- Pattern p = Pattern.compile(descText.getText());
- } catch (PatternSyntaxException e) {
- setErrorMessage(WizardMessages.getFormattedString(FIELD_ERROR,
- new String[]{WizardMessages.getString(DESC_LABEL),
- e.getLocalizedMessage()}));
- error = true;
- }
-
if (!error)
setErrorMessage(null);
setPageComplete(complete && !error);
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -0,0 +1,48 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+
+public class InstanceFilter extends Wizard {
+
+ private DeltaCloud cloud;
+ private InstanceFilterPage mainPage;
+
+ public InstanceFilter(DeltaCloud cloud) {
+ this.cloud = cloud;
+ }
+
+ @Override
+ public void addPages() {
+ // TODO Auto-generated method stub
+ mainPage = new InstanceFilterPage(cloud);
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ @Override
+ public boolean performFinish() {
+ String nameRule = mainPage.getNameRule();
+ String idRule = mainPage.getIdRule();
+ String imageIdRule = mainPage.getImageIdRule();
+ String ownerIdRule = mainPage.getOwnerIdRule();
+ String keyNameRule = mainPage.getKeyNameRule();
+ String realmRule = mainPage.getRealmRule();
+ String profileRule = mainPage.getProfileRule();
+
+ cloud.createInstanceFilter(nameRule + ";" + //$NON-NLS-1$
+ idRule + ";" + //$NON-NLS-1$
+ imageIdRule + ";" + //$NON-NLS-1$
+ ownerIdRule + ";" + //$NON-NLS-1$
+ keyNameRule + ";" + //$NON-NLS-1$
+ realmRule + ";" + //$NON-NLS-1$
+ profileRule); //$NON-NLS-1$
+
+ return true;
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java 2010-10-08 23:05:06 UTC (rev 25660)
@@ -0,0 +1,366 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+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.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
+
+public class InstanceFilterPage extends WizardPage {
+
+ private final static String NAME = "InstanceFilter.name"; //$NON-NLS-1$
+ private final static String TITLE = "InstanceFilter.title"; //$NON-NLS-1$
+ private final static String DESC = "InstanceFilter.desc"; //$NON-NLS-1$
+ private final static String FILTER_LABEL = "InstanceFilter.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 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 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$
+ private final static String REALM_LABEL = "Realm.label"; //$NON-NLS-1$
+ private final static String PROFILE_LABEL = "Profile.label"; //$NON-NLS-1$
+ private final static String DEFAULT_LABEL = "DefaultButton.label"; //$NON-NLS-1$
+
+ private DeltaCloud cloud;
+ private Text nameText;
+ private Text idText;
+ private Text imageIdText;
+ private Text ownerIdText;
+ private Text keyNameText;
+ private Text realmText;
+ private Text profileText;
+
+ private Button defaultName;
+ private Button defaultId;
+ private Button defaultImageId;
+ private Button defaultOwnerId;
+ private Button defaultKeyId;
+ private Button defaultRealm;
+ private Button defaultProfile;
+
+ public InstanceFilterPage(DeltaCloud cloud) {
+ super(WizardMessages.getString(NAME));
+ this.cloud = cloud;
+ setDescription(WizardMessages.getString(DESC));
+ setTitle(WizardMessages.getString(TITLE));
+ setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
+ setPageComplete(false);
+ }
+
+ public String getNameRule() {
+ return nameText.getText();
+ }
+
+ public String getIdRule() {
+ return idText.getText();
+ }
+
+ public String getImageIdRule() {
+ return imageIdText.getText();
+ }
+
+ public String getOwnerIdRule() {
+ return ownerIdText.getText();
+ }
+
+ public String getKeyNameRule() {
+ return keyNameText.getText();
+ }
+
+ public String getRealmRule() {
+ return realmText.getText();
+ }
+
+ public String getProfileRule() {
+ return profileText.getText();
+ }
+
+ private ModifyListener Listener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ // TODO Auto-generated method stub
+ validate();
+ }
+ };
+
+ private SelectionAdapter ButtonListener = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ Button b = (Button)e.widget;
+ if (b == defaultName)
+ nameText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultId)
+ idText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultImageId)
+ imageIdText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultOwnerId)
+ ownerIdText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultKeyId)
+ keyNameText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultRealm)
+ realmText.setText("*"); //$NON-NLS-1$
+ else if (b == defaultProfile)
+ profileText.setText("*"); //$NON-NLS-1$
+ }
+
+ };
+
+ private void validate() {
+ boolean complete = true;
+ boolean error = false;
+
+ if (nameText.getText().length() == 0 ||
+ idText.getText().length() == 0 ||
+ imageIdText.getText().length() == 0 ||
+ ownerIdText.getText().length() == 0 ||
+ keyNameText.getText().length() == 0 ||
+ realmText.getText().length() == 0 ||
+ profileText.getText().length() == 0) {
+
+ setErrorMessage(WizardMessages.getString(EMPTY_RULE));
+ error = true;
+ } else if (nameText.getText().contains(";") ||
+ idText.getText().contains(";") ||
+ imageIdText.getText().contains(";") ||
+ ownerIdText.getText().contains(";") ||
+ keyNameText.getText().contains(";") ||
+ realmText.getText().contains(";") ||
+ profileText.getText().contains(";")) {
+ setErrorMessage(WizardMessages.getString(INVALID_SEMICOLON));
+ error = true;
+ }
+
+ if (!error)
+ setErrorMessage(null);
+ setPageComplete(complete && !error);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ final Composite container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ container.setLayout(layout);
+
+ Label label = new Label(container, SWT.NULL);
+ label.setText(WizardMessages.getString(FILTER_LABEL));
+
+ Label nameLabel = new Label(container, SWT.NULL);
+ nameLabel.setText(WizardMessages.getString(NAME_LABEL));
+
+ nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ nameText.setText(cloud.getInstanceFilter().getNameRule().toString());
+ nameText.addModifyListener(Listener);
+
+ defaultName = new Button(container, SWT.NULL);
+ defaultName.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultName.addSelectionListener(ButtonListener);
+
+ Label idLabel = new Label(container, SWT.NULL);
+ idLabel.setText(WizardMessages.getString(ID_LABEL));
+
+ idText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ idText.setText(cloud.getInstanceFilter().getIdRule().toString());
+ idText.addModifyListener(Listener);
+
+ defaultId = new Button(container, SWT.NULL);
+ defaultId.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultId.addSelectionListener(ButtonListener);
+
+ Label imageIdLabel = new Label(container, SWT.NULL);
+ imageIdLabel.setText(WizardMessages.getString(IMAGE_ID_LABEL));
+
+ imageIdText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ imageIdText.setText(cloud.getInstanceFilter().getImageIdRule().toString());
+ imageIdText.addModifyListener(Listener);
+
+ defaultImageId = new Button(container, SWT.NULL);
+ defaultImageId.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultImageId.addSelectionListener(ButtonListener);
+
+ Label ownerIdLabel = new Label(container, SWT.NULL);
+ ownerIdLabel.setText(WizardMessages.getString(OWNER_ID_LABEL));
+
+ ownerIdText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ ownerIdText.setText(cloud.getInstanceFilter().getOwnerIdRule().toString());
+ ownerIdText.addModifyListener(Listener);
+
+ defaultOwnerId = new Button(container, SWT.NULL);
+ defaultOwnerId.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultOwnerId.addSelectionListener(ButtonListener);
+
+ Label keyNameLabel = new Label(container, SWT.NULL);
+ keyNameLabel.setText(WizardMessages.getString(KEYNAME_LABEL));
+
+ keyNameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ keyNameText.setText(cloud.getInstanceFilter().getKeyNameRule().toString());
+ keyNameText.addModifyListener(Listener);
+
+ defaultKeyId = new Button(container, SWT.NULL);
+ defaultKeyId.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultKeyId.addSelectionListener(ButtonListener);
+
+ Label realmLabel = new Label(container, SWT.NULL);
+ realmLabel.setText(WizardMessages.getString(REALM_LABEL));
+
+ realmText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ realmText.setText(cloud.getInstanceFilter().getRealmRule().toString());
+ realmText.addModifyListener(Listener);
+
+ defaultRealm = new Button(container, SWT.NULL);
+ defaultRealm.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultRealm.addSelectionListener(ButtonListener);
+
+ Label profileLabel = new Label(container, SWT.NULL);
+ profileLabel.setText(WizardMessages.getString(PROFILE_LABEL));
+
+ profileText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ profileText.setText(cloud.getInstanceFilter().getProfileRule().toString());
+ profileText.addModifyListener(Listener);
+
+ defaultProfile = new Button(container, SWT.NULL);
+ defaultProfile.setText(WizardMessages.getString(DEFAULT_LABEL));
+ defaultProfile.addSelectionListener(ButtonListener);
+
+ Point p1 = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ Point p3 = defaultName.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.top = new FormAttachment(0);
+ label.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(label, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ nameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(label, 11);
+ f.right = new FormAttachment(100);
+ defaultName.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(label, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultName, -10);
+ nameText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ idLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultId.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultId, -10);
+ idText.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();
+ f.top = new FormAttachment(idLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultImageId.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(idLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultImageId, -10);
+ imageIdText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(imageIdLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ ownerIdLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(imageIdLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultOwnerId.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(imageIdLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultOwnerId, -10);
+ ownerIdText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(ownerIdLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ keyNameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(ownerIdLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultKeyId.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(ownerIdLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultKeyId, -10);
+ keyNameText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(keyNameLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ realmLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(keyNameLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultRealm.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(keyNameLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultRealm, -10);
+ realmText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(realmLabel, 11 + centering + centering2);
+ f.left = new FormAttachment(0, 0);
+ profileLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(realmLabel, 11);
+ f.right = new FormAttachment(100);
+ defaultProfile.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(realmLabel, 11 + centering2);
+ f.left = new FormAttachment(profileLabel, 5);
+ f.right = new FormAttachment(defaultProfile, -10);
+ profileText.setLayoutData(f);
+
+ setControl(container);
+ setPageComplete(true);
+ }
+
+}
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-08 23:00:27 UTC (rev 25659)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-10-08 23:05:06 UTC (rev 25660)
@@ -24,6 +24,8 @@
TestButton.label=Test
UnknownType.label=Unknown
Id.label=ID:
+ImageId.label=Image ID:
+OwnerId.label=Owner ID:
Image.label=Image:
Arch.label=Architecture:
Desc.label=Description:
@@ -77,11 +79,16 @@
ImageFilter.title=Image Filter
ImageFilter.name=Image Filter
-ImageFilter.label=Show all images which match the following regex rules:
+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
ErrorFieldError.msg={0} {1}
+InstanceFilter.desc=Specify rules to determine which Instances will appear in the dialog.
+InstanceFilter.title=Instance Filter
+InstanceFilter.name=Instance Filter
+InstanceFilter.label=Show all instances which match the following rules (* = wildcard):
+
ErrorInvalidDirectory.text=Specified directory is not a valid existing directory
Directory.label=Directory
14 years, 3 months
JBoss Tools SVN: r25659 - 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-10-08 19:00:27 -0400 (Fri, 08 Oct 2010)
New Revision: 25659
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/FieldMatcher.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
Log:
2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java: New file.
* src/org/jboss/tools/deltacloud/core/IInstanceFilter.java: New file.
* src/org/jboss/tools/deltacloud/core/InstanceFilter.java: New file.
* src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java (toString): Switch back
to non-regex, just a wildcard.
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (DeltaCloud): Add instance
filter rules to constructor.
(getInstanceFilter): New method.
(createInstanceFilter): Ditto.
* src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (loadClouds): Add instance
filter support.
(saveClouds): Ditto.
* src/org/jboss/tools/deltacloud/core/FieldMatcher.java (FieldMatcher): Use the input
string to form a regex where all non-alphanumeric characters are escaped and wildcards
are expanded to a reluctant any character matcher.
(transform): New method to transform the input rule into a regex.
* src/org/jboss/tools/deltacloud/core/IImageFilter.java: Fix ALL_STRING.
* src/org/jboss/tools/deltacloud/core/ImageFilter.java (setRules): Fix checking for
AllFieldMatchers.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-10-08 23:00:27 UTC (rev 25659)
@@ -1,3 +1,25 @@
+2010-10-08 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java: New file.
+ * src/org/jboss/tools/deltacloud/core/IInstanceFilter.java: New file.
+ * src/org/jboss/tools/deltacloud/core/InstanceFilter.java: New file.
+ * src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java (toString): Switch back
+ to non-regex, just a wildcard.
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java (DeltaCloud): Add instance
+ filter rules to constructor.
+ (getInstanceFilter): New method.
+ (createInstanceFilter): Ditto.
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (loadClouds): Add instance
+ filter support.
+ (saveClouds): Ditto.
+ * src/org/jboss/tools/deltacloud/core/FieldMatcher.java (FieldMatcher): Use the input
+ string to form a regex where all non-alphanumeric characters are escaped and wildcards
+ are expanded to a reluctant any character matcher.
+ (transform): New method to transform the input rule into a regex.
+ * src/org/jboss/tools/deltacloud/core/IImageFilter.java: Fix ALL_STRING.
+ * src/org/jboss/tools/deltacloud/core/ImageFilter.java (setRules): Fix checking for
+ AllFieldMatchers.
+
2010-10-07 Jeff Johnston <jjohnstn(a)redhat.com>
[JBIDE-7181]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllFieldMatcher.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -9,7 +9,7 @@
@Override
public String toString() {
- return ".*"; //$NON-NLS-1$
+ return "*"; //$NON-NLS-1$
}
}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -0,0 +1,57 @@
+package org.jboss.tools.deltacloud.core;
+
+public class AllInstanceFilter implements IInstanceFilter {
+
+ private IFieldMatcher matcher = new AllFieldMatcher();
+
+ @Override
+ public boolean isVisible(DeltaCloudInstance instance) {
+ return true;
+ }
+
+ @Override
+ public void setRules(String ruleString) {
+ // ignore, never set the rules for this filter
+ }
+
+ @Override
+ public String toString() {
+ return ALL_STRING;
+ }
+
+ @Override
+ public IFieldMatcher getNameRule() {
+ return matcher; //$NON-NLS-1$
+ }
+
+ @Override
+ public IFieldMatcher getIdRule() {
+ return matcher; //$NON-NLS-1$
+ }
+
+ @Override
+ public IFieldMatcher getImageIdRule() {
+ return matcher;
+ }
+
+ @Override
+ public IFieldMatcher getKeyNameRule() {
+ return matcher;
+ }
+
+ @Override
+ public IFieldMatcher getOwnerIdRule() {
+ return matcher;
+ }
+
+ @Override
+ public IFieldMatcher getProfileRule() {
+ return matcher;
+ }
+
+ @Override
+ public IFieldMatcher getRealmRule() {
+ return matcher;
+ }
+
+}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -43,6 +43,7 @@
private ArrayList<DeltaCloudInstance> instances;
private ArrayList<DeltaCloudImage> images;
private IImageFilter imageFilter;
+ private IInstanceFilter instanceFilter;
private Map<String, Job> actionJobs;
private Object imageLock = new Object();
private Object instanceLock = new Object();
@@ -52,16 +53,17 @@
ListenerList imageListeners = new ListenerList();
public DeltaCloud(String name, String url, String username, String passwd) throws MalformedURLException {
- this(name, url, username, passwd, null, false, IImageFilter.ALL_STRING);
+ this(name, url, username, passwd, null, false, IImageFilter.ALL_STRING, IInstanceFilter.ALL_STRING);
}
public DeltaCloud(String name, String url, String username, String passwd,
String type, boolean persistent) throws MalformedURLException {
- this(name, url, username, passwd, null, persistent, IImageFilter.ALL_STRING);
+ this(name, url, username, passwd, null, persistent, IImageFilter.ALL_STRING, IInstanceFilter.ALL_STRING);
}
public DeltaCloud(String name, String url, String username, String passwd,
- String type, boolean persistent, String imageFilterRules) throws MalformedURLException {
+ String type, boolean persistent,
+ String imageFilterRules, String instanceFilterRules) throws MalformedURLException {
this.client = new DeltaCloudClient(new URL(url + "/api"), username, passwd); //$NON-NLS-1$
this.url = url;
this.name = name;
@@ -73,6 +75,12 @@
} catch (PatternSyntaxException e) {
imageFilter.setRules(IImageFilter.ALL_STRING);
}
+ instanceFilter = new InstanceFilter();
+ try {
+ instanceFilter.setRules(instanceFilterRules);
+ } catch (PatternSyntaxException e) {
+ instanceFilter.setRules(IInstanceFilter.ALL_STRING);
+ }
if (persistent) {
ISecurePreferences root = SecurePreferencesFactory.getDefault();
String key = DeltaCloud.getPreferencesKey(url, username);
@@ -123,6 +131,24 @@
return type;
}
+ public IInstanceFilter getInstanceFilter() {
+ return instanceFilter;
+ }
+
+ public void createInstanceFilter(String ruleString) {
+ String rules = getInstanceFilter().toString();
+ if (IInstanceFilter.ALL_STRING.equals(ruleString))
+ instanceFilter = new AllInstanceFilter();
+ else {
+ instanceFilter = new InstanceFilter();
+ instanceFilter.setRules(ruleString);
+ }
+ if (!rules.equals(ruleString)) {
+ save();
+ notifyInstanceListListeners(getCurrInstances());
+ }
+ }
+
public IImageFilter getImageFilter() {
return imageFilter;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -63,6 +63,7 @@
Node usernameNode = attrs.getNamedItem("username"); // $NON-NLS-1$
Node typeNode = attrs.getNamedItem("type"); // $NON-NLS-1$
Node imageFilterNode = attrs.getNamedItem("imagefilter"); //$NON-NLS-1$
+ Node instanceFilterNode = attrs.getNamedItem("instancefilter"); //$NON-NLS-1$
String name = nameNode.getNodeValue();
String url = urlNode.getNodeValue();
String username = usernameNode.getNodeValue();
@@ -73,13 +74,18 @@
imageFilterRules = imageFilterNode.getNodeValue();
else
imageFilterRules = IImageFilter.ALL_STRING;
+ String instanceFilterRules = null;
+ if (instanceFilterNode != null)
+ instanceFilterRules = instanceFilterNode.getNodeValue();
+ else
+ instanceFilterRules = IInstanceFilter.ALL_STRING;
ISecurePreferences root = SecurePreferencesFactory.getDefault();
ISecurePreferences node = root.node(key);
String password;
try {
password = node.get("password", null); //$NON-NLS-1$
DeltaCloud cloud = new DeltaCloud(name, url, username, password, type,
- false, imageFilterRules);
+ false, imageFilterRules, instanceFilterRules);
cloud.loadChildren();
clouds.add(cloud);
} catch (Exception e1) {
@@ -112,7 +118,8 @@
+ d.getURL() +
"\" username=\"" + d.getUsername() +
"\" type=\"" + d.getType() +
- "\" imagefilter=\"" + d.getImageFilter() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ "\" imagefilter=\"" + d.getImageFilter() +
+ "\" instancefilter=\"" + d.getInstanceFilter() + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
}
p.println("</clouds>"); //$NON-NLS-1$
p.close();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/FieldMatcher.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/FieldMatcher.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/FieldMatcher.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -11,8 +11,25 @@
public FieldMatcher(String rule) throws PatternSyntaxException {
this.rule = rule;
- pattern = Pattern.compile(rule);
+ String regexRule = transform(rule);
+ pattern = Pattern.compile(regexRule);
}
+
+ private String transform(String rule) {
+ StringBuffer buffer = new StringBuffer();
+ for (int i = 0; i < rule.length(); ++i) {
+ char ch = rule.charAt(i);
+ if (Character.isLetterOrDigit(ch))
+ buffer.append(ch);
+ else if (ch == '*') {
+ buffer.append(".*?");
+ } else {
+ buffer.append('\\');
+ buffer.append(ch);
+ }
+ }
+ return buffer.toString();
+ }
@Override
public boolean matches(String input) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -2,7 +2,7 @@
public interface IImageFilter {
- public final static String ALL_STRING = ".*;.*;.*;.*"; //$NON-NLS-1$
+ public final static String ALL_STRING = "*;*;*;*"; //$NON-NLS-1$
public boolean isVisible(DeltaCloudImage image);
public void setRules(String ruleString);
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -0,0 +1,16 @@
+package org.jboss.tools.deltacloud.core;
+
+public interface IInstanceFilter {
+
+ public final static String ALL_STRING = "*;*;*;*;*;*;*"; //$NON-NLS-1$
+
+ public boolean isVisible(DeltaCloudInstance instance);
+ public void setRules(String ruleString);
+ public IFieldMatcher getNameRule();
+ public IFieldMatcher getIdRule();
+ public IFieldMatcher getImageIdRule();
+ public IFieldMatcher getOwnerIdRule();
+ public IFieldMatcher getKeyNameRule();
+ public IFieldMatcher getRealmRule();
+ public IFieldMatcher getProfileRule();
+}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-10-08 22:39:22 UTC (rev 25658)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -20,22 +20,22 @@
@Override
public void setRules(String ruleString) throws PatternSyntaxException {
String[] tokens = ruleString.split(";");
- if (tokens[0].equals(".*")) { //$NON-NLS-1$
+ if (tokens[0].equals("*")) { //$NON-NLS-1$
nameRule = new AllFieldMatcher();
} else {
nameRule = new FieldMatcher(tokens[0]);
}
- if (tokens[1].equals(".*")) { //$NON-NLS-1$
+ if (tokens[1].equals("*")) { //$NON-NLS-1$
idRule = new AllFieldMatcher();
} else {
idRule = new FieldMatcher(tokens[1]);
}
- if (tokens[2].equals(".*")) { //$NON-NLS-1$
+ if (tokens[2].equals("*")) { //$NON-NLS-1$
archRule = new AllFieldMatcher();
} else {
archRule = new FieldMatcher(tokens[2]);
}
- if (tokens[3].equals(".*")) { //$NON-NLS-1$
+ if (tokens[3].equals("*")) { //$NON-NLS-1$
descRule = new AllFieldMatcher();
} else {
descRule = new FieldMatcher(tokens[3]);
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-10-08 23:00:27 UTC (rev 25659)
@@ -0,0 +1,112 @@
+package org.jboss.tools.deltacloud.core;
+
+import java.util.regex.PatternSyntaxException;
+
+public class InstanceFilter implements IInstanceFilter {
+
+ private IFieldMatcher nameRule;
+ private IFieldMatcher idRule;
+ private IFieldMatcher imageIdRule;
+ private IFieldMatcher realmRule;
+ private IFieldMatcher profileRule;
+ private IFieldMatcher ownerIdRule;
+ private IFieldMatcher keyNameRule;
+
+ @Override
+ public boolean isVisible(DeltaCloudInstance instance) {
+ return nameRule.matches(instance.getName()) &&
+ idRule.matches(instance.getId()) &&
+ imageIdRule.matches(instance.getImageId()) &&
+ ownerIdRule.matches(instance.getOwnerId()) &&
+ keyNameRule.matches(instance.getKey()) &&
+ realmRule.matches(instance.getRealmId()) &&
+ profileRule.matches(instance.getProfileId());
+ }
+
+ @Override
+ public void setRules(String ruleString) throws PatternSyntaxException {
+ String[] tokens = ruleString.split(";");
+ if (tokens[0].equals("*")) { //$NON-NLS-1$
+ nameRule = new AllFieldMatcher();
+ } else {
+ nameRule = new FieldMatcher(tokens[0]);
+ }
+ if (tokens[1].equals("*")) { //$NON-NLS-1$
+ idRule = new AllFieldMatcher();
+ } else {
+ idRule = new FieldMatcher(tokens[1]);
+ }
+ if (tokens[2].equals("*")) { //$NON-NLS-1$
+ imageIdRule = new AllFieldMatcher();
+ } else {
+ imageIdRule = new FieldMatcher(tokens[2]);
+ }
+ if (tokens[3].equals("*")) { //$NON-NLS-1$
+ ownerIdRule = new AllFieldMatcher();
+ } else {
+ ownerIdRule = new FieldMatcher(tokens[3]);
+ }
+ if (tokens[4].equals("*")) { //$NON-NLS-1$
+ keyNameRule = new AllFieldMatcher();
+ } else {
+ keyNameRule = new FieldMatcher(tokens[4]);
+ }
+ if (tokens[5].equals("*")) { //$NON-NLS-1$
+ realmRule = new AllFieldMatcher();
+ } else {
+ realmRule = new FieldMatcher(tokens[5]);
+ }
+ if (tokens[6].equals("*")) { //$NON-NLS-1$
+ profileRule = new AllFieldMatcher();
+ } else {
+ profileRule = new FieldMatcher(tokens[6]);
+ }
+ }
+
+ @Override
+ public String toString() {
+ return nameRule + ";" //$NON-NLS-1$
+ + idRule + ";" //$NON-NLS-1$
+ + imageIdRule + ";" //$NON-NLS-1$
+ + ownerIdRule + ";" //$NON-NLS-1$
+ + keyNameRule + ";" //$NON-NLS-1$
+ + realmRule + ";" //$NON-NLS-1$
+ + profileRule; //$NON-NLS-1$
+ }
+
+ @Override
+ public IFieldMatcher getNameRule() {
+ return nameRule;
+ }
+
+ @Override
+ public IFieldMatcher getIdRule() {
+ return idRule;
+ }
+
+
+ @Override
+ public IFieldMatcher getImageIdRule() {
+ return imageIdRule;
+ }
+
+ @Override
+ public IFieldMatcher getKeyNameRule() {
+ return keyNameRule;
+ }
+
+ @Override
+ public IFieldMatcher getOwnerIdRule() {
+ return ownerIdRule;
+ }
+
+ @Override
+ public IFieldMatcher getProfileRule() {
+ return profileRule;
+ }
+
+ @Override
+ public IFieldMatcher getRealmRule() {
+ return realmRule;
+ }
+}
14 years, 3 months
JBoss Tools SVN: r25658 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-08 18:39:22 -0400 (Fri, 08 Oct 2010)
New Revision: 25658
Modified:
trunk/build/target-platform/build.xml
Log:
add p2.director call to build.xml script (optional call to 'install' target)
Modified: trunk/build/target-platform/build.xml
===================================================================
--- trunk/build/target-platform/build.xml 2010-10-08 21:33:12 UTC (rev 25657)
+++ trunk/build/target-platform/build.xml 2010-10-08 22:39:22 UTC (rev 25658)
@@ -34,9 +34,10 @@
</condition>
<!-- if can't calculate where build/build.xml is located, must pass in path from parent when calling this script -->
- <property name="repoDir" value="${WORKINGDIR}/REPO"/>
+ <property name="repoDir" value="${WORKINGDIR}/REPO" />
- <target name="all" depends="build.local.target.platform.repo, test.local.target.platform.repo"/>
+ <target name="all" depends="build.local.target.platform.repo, test.local.target.platform.repo, install.local.target.platform.repo" />
+ <target name="install" depends="build.local.target.platform.repo, install.local.target.platform.repo" />
<target name="build.local.target.platform.repo" depends="init, get.arch, get.eclipse, gen.p2mirror.script, run.p2mirror.script, cleanup" />
@@ -113,10 +114,89 @@
<target name="test.local.target.platform.repo" description="test target platform completeness by running a build against it">
<exec executable="/opt/maven3/bin/mvn" dir="${WORKINGDIR}">
- <arg line=" -f ../parent/pom.xml clean install -B -U -fae -e -P helios-local-target,!helios -Dmaven.test.skip -Dtarget.platorm.URL=file:/${repoDir}"/>
+ <arg line=" -f ../parent/pom.xml clean install -B -U -fae -e -P helios-local-target,!helios -Dmaven.test.skip -Dtarget.platorm.URL=file:/${repoDir}" />
</exec>
<exec executable="/opt/maven3/bin/mvn" dir="${WORKINGDIR}">
- <arg line=" -f ../pom.xml clean install -B -U -fae -e -P helios-local-target,!helios -Dmaven.test.skip -Dtarget.platorm.URL=file:/${repoDir}"/>
+ <arg line=" -f ../pom.xml clean install -B -U -fae -e -P helios-local-target,!helios -Dmaven.test.skip -Dtarget.platorm.URL=file:/${repoDir}" />
</exec>
</target>
+
+ <target name="install.local.target.platform.repo" description="use p2.director to install target platform into local eclipse">
+ <!-- collect features to install -->
+ <var name="install" value="" />
+ <for param="featureJar">
+ <path>
+ <fileset dir="${repoDir}/features" includes="*.jar" />
+ </path>
+ <sequential>
+ <var name="feature.jarfile" unset="true" />
+ <var name="feature.id" unset="true" />
+ <propertyregex property="feature.jarfile"
+ defaultvalue="@{featureJar}"
+ input="@{featureJar}"
+ regexp=".+/features/([^/]+\.jar)"
+ replace="\1"
+ override="true" />
+ <propertyregex property="feature.id"
+ defaultvalue="${feature.jarfile}"
+ input="${feature.jarfile}"
+ regexp="([^_]+)_(\d+\.\d+\.\d+\..+)\.jar"
+ replace="\1"
+ override="true" />
+ <propertyregex property="feature.id"
+ defaultvalue="${feature.id}"
+ input="${feature.id}"
+ regexp="([^_]+)_(\d+\.\d+\.\d+)\.jar"
+ replace="\1"
+ override="true" />
+ <var name="install" value="${install},${feature.id}.feature.group" />
+ <var name="feature.jarfile" unset="true" />
+ <var name="feature.id" unset="true" />
+ </sequential>
+ </for>
+ <!-- trim prefix "," -->
+ <propertyregex property="install" input="${install}" defaultvalue="${install}" regexp=",(.+)" replace="\1" override="true" />
+
+ <!-- do install -->
+ <antcall target="run.director">
+ <param name="p2.director.installIU" value="${install}" />
+ <param name="p2.director.install.path" value="${WORKINGDIR}/eclipse" />
+ <param name="p2.director.input.repo" value="file:/${repoDir}/" />
+ </antcall>
+ </target>
+
+ <target name="run.director">
+ <property name="p2.director.extraArgs" value="" />
+ <property name="p2.director.installIU" value="${install}" />
+ <property name="p2.director.install.path" value="${targetDir}" />
+ <property name="p2.director.input.repo" value="jar:file:${sourceZip}!/" />
+ <echo>
+Source Repo(s): ${p2.director.input.repo}
+Install Path: ${p2.director.install.path}
+Feature(s) or Plugin(s) to Install:
+${install}
+ </echo>
+
+ <mkdir dir="${p2.director.install.path}" />
+ <chmod perm="ugo+rwx" file="${p2.director.install.path}/eclipse" />
+ <exec executable="${p2.director.install.path}/eclipse" failonerror="true" dir="${p2.director.install.path}" timeout="900000" taskname="p2.dir">
+ <!-- deprecated application for Eclipse 3.4: org.eclipse.equinox.p2.director.app.application -->
+ <arg line=" -application org.eclipse.equinox.p2.director" />
+ <arg line=" -nosplash" />
+ <arg line=" --launcher.suppressErrors" />
+ <arg line=" -consoleLog" />
+ <arg line=" -flavor tooling" />
+ <arg line=" -roaming" />
+ <arg line=" -profile SDKProfile" />
+ <arg line=" -destination ${p2.director.install.path}" />
+ <arg line=" -bundlepool ${p2.director.install.path}" />
+ <arg line=" -installIU ${p2.director.installIU}" />
+ <arg line=" -metadataRepository ${p2.director.input.repo},file:${p2.director.install.path}/p2/org.eclipse.equinox.p2.engine/profileRegistry/SDKProfile.profile" />
+ <arg line=" -artifactRepository ${p2.director.input.repo},file:${p2.director.install.path}" />
+ <arg line=" -profileProperties org.eclipse.update.install.features=true" />
+ <arg line=" -vmargs" />
+ <arg line=" -Declipse.p2.data.area=${p2.director.install.path}/p2" />
+ <arg line=" -Declipse.p2.MD5Check=false" />
+ </exec>
+ </target>
</project>
14 years, 3 months
JBoss Tools SVN: r25657 - in trunk/download.jboss.org/jbosstools/updates: staging and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-08 17:33:12 -0400 (Fri, 08 Oct 2010)
New Revision: 25657
Added:
trunk/download.jboss.org/jbosstools/updates/staging/
trunk/download.jboss.org/jbosstools/updates/staging/index.html
Modified:
trunk/download.jboss.org/jbosstools/updates/index.html
trunk/download.jboss.org/jbosstools/updates/target-platform/index.html
Log:
new/updates index.html pages for download.jboss.org
Modified: trunk/download.jboss.org/jbosstools/updates/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/index.html 2010-10-08 21:01:24 UTC (rev 25656)
+++ trunk/download.jboss.org/jbosstools/updates/index.html 2010-10-08 21:33:12 UTC (rev 25657)
@@ -57,10 +57,11 @@
<li><a class=link href=stable/galileo>JBoss Tools 3.1.x, Eclipse 3.5.2 (Galileo)</a></li>
<li><a class=link href=stable/ganymede>JBoss Tools 3.0.x, Eclipse 3.4.2 (Ganymede)</a></li>
<br/>
-<li><a class=link href=development>Development Milestones [toward JBoss Tools 3.2, Eclipse 3.6 (Helios)]</a></li>
+<li><a class=link href=development>Development Milestones</a> (toward JBoss Tools 3.2, Eclipse 3.6 (Helios))</li>
<li><a class=link href=nightly>Nightly Builds</a></li>
<br/>
-<li><a class=link href=JBossTools-Drools/jbosstools-drools-Update-5.1.zip>JBoss Tools Drools IDE 5.1.1 [for JBoss Tools 3.2, Eclipse 3.6 (Helios)]</a></li>
+<li><a class=link href=staging>Staging Update Site Zips</a> (for inclusion in JBDS)
+<li><a class=link href=target-platform>All JBoss Tools dependencies in one update site</a> (for installing or developing JBoss Tools)
</ul>
<br/>
Added: trunk/download.jboss.org/jbosstools/updates/staging/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/staging/index.html (rev 0)
+++ trunk/download.jboss.org/jbosstools/updates/staging/index.html 2010-10-08 21:33:12 UTC (rev 25657)
@@ -0,0 +1,146 @@
+<html>
+<head>
+<title>JBoss Tools Updates - Staging Zips</title>
+<style>
+@import url("../../web/site.css");
+</style>
+</head>
+<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">
+<table marginheight="0" marginwidth="0" leftmargin="0" topmargin="0"
+ cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2"><img
+ src="https://www.jboss.org/dms/tools/images/tools-banner.png" /></td>
+ </tr>
+ <tr>
+ <td>  </td>
+ </tr>
+ <tr>
+ <td>  </td>
+ <td>
+ <h2 class="title">JBoss Tools Updates - Staging Zips</h2>
+ <table width="100%">
+
+ <!-- <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText"></p>
+ </td>
+ </tr> -->
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <!-- <p class="bodyText"></p> -->
+
+<!-- to convert raw fish listing to links do this in vi
+
+:%s#^sftp://tools@filemgmt.jboss.org/downloads_htdocs/tools/updates/staging/\(.\+\)$#<li><a class=link href=\1>\1<\/a></li>#g
+
+Then sftp file into
+
+jbossqa(a)filemgmt.jboss.org/htdocs/jbosstools/updates/
+
+which becomes
+
+http://download.jboss.org/jbosstools/updates/
+
+-->
+ <br/>
+ <ul>
+<li><a class=link href=3.2.0.Beta1/jbosstools-drools-Update.zip>3.2.0.Beta1/jbosstools-drools-Update.zip</a></li>
+<li><a class=link href=3.2.0.Beta1/jbpm-Update.zip>3.2.0.Beta1/jbpm-Update.zip</a></li>
+<li><a class=link href=3.2.0.Beta1/usage-Update.zip>3.2.0.Beta1/usage-Update.zip</a></li>
+<br/>
+<li><a class=link href=3.2.0.Beta2/jbosstools-drools-Update.zip>3.2.0.Beta2/jbosstools-drools-Update.zip</a></li>
+<li><a class=link href=3.2.0.Beta2/jbpm-Update.zip>3.2.0.Beta2/jbpm-Update.zip</a></li>
+<li><a class=link href=3.2.0.Beta2/usage-Update.zip>3.2.0.Beta2/usage-Update.zip</a></li>
+<br/>
+<li><a class=link href=jbosstools-teiid-designer-Update.zip>jbosstools-teiid-designer-Update.zip</a></li>
+ </ul>
+ <br/>
+ </td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">You can also download JBoss Tools as
+ individual zips for offline installation. See <a class="link"
+ href="http://www.jboss.org/tools/download">JBoss Tools
+ Downloads</a>.</p>
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">For more information, see <a
+ href="http://www.jboss.org/tools/download/installation">Installation
+ methods</a>.</p>
+ </td>
+ </tr>
+ <tr>
+ <td class="spacer"><br />
+ </td>
+ <td class="spacer"><br />
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td></td>
+ <td>
+ <table width="100%">
+ <tr class="header">
+ <td class="sub-header" width="100%"><span> Installation
+ Types</span></td>
+ </tr>
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <p class="bodyText">Depending on how close to the bleeding edge
+ you like to be, there are several types of releases available.</p>
+ <br />
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Stable Releases</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/stable.html">Stable
+ releases</a> are - as indicated by their name - stable.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="light-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Development Milestones</h4>
+
+ <p><a href="https://www.jboss.org/tools/download/dev.html">Development
+ builds</a>, released once per milestone and only a few times a year, are
+ fairly stable, but there may be some things which do not yet work.
+ If you would like to try one of these milestones, we'd greatly
+ appreciate the assistance in testing and <a
+ href="https://jira.jboss.org/jira/browse/JBIDE">reporting of
+ issues in our issue tracker</a>.</p><br/>
+
+ </td>
+ </tr>
+
+ <tr class="dark-row" style="height: 30px">
+ <td class="bodyText">
+ <h4>Nightly Builds</h4>
+
+ <p>The <a
+ href="https://www.jboss.org/tools/download/nightly.html">bleeding
+ edge</a> contains the latest and greatest new features, but nothing is
+ stable or guaranteed - yet. If you're using a Milestone and need a
+ fix, you can update to the latest Nightly, or wait for the next
+ Milestone.</p><br/>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+</table>
+</html>
Modified: trunk/download.jboss.org/jbosstools/updates/target-platform/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/updates/target-platform/index.html 2010-10-08 21:01:24 UTC (rev 25656)
+++ trunk/download.jboss.org/jbosstools/updates/target-platform/index.html 2010-10-08 21:33:12 UTC (rev 25657)
@@ -1,6 +1,6 @@
<html>
<head>
-<title>JBoss Tools Build Target Platform Update Site - Helios (Eclipse 3.6 / Web Tools 3.2)</title>
+<title>JBoss Tools Build Target Platform Update Site</title>
<style>
@import url("../../web/site.css");
</style>
@@ -18,7 +18,7 @@
<tr>
<td>  </td>
<td>
- <h2 class="title">JBoss Tools Build Target Platform Update Site - Helios (Eclipse 3.6 / Web Tools 3.2)</h2>
+ <h2 class="title">JBoss Tools Build Target Platform Update Site</h2>
<table width="100%">
<!-- <tr class="light-row" style="height: 30px">
@@ -46,8 +46,11 @@
-->
<br/>
<ul>
-<li><a class=link href=latest>latest target platform build</a> - point Eclipse at this site and install the uncategorized features</li>
-<li><a class=link href=e361-wtp322.target.zip>zip of latest target platform</a> (692M)</li>
+<li>Eclipse Helios 3.6 / Web Tools 3.2 / others (692M) - point Eclipse at this site and install the uncategorized features
+<ul>
+<li><a class=link href=latest>latest</a> - target platform update site</li>
+<li><a class=link href=e361-wtp322.target.zip>e361-wtp322.target.zip</a> - target platform update site zip</a></li>
+</ul>
</ul>
<br/>
</td>
14 years, 3 months
JBoss Tools SVN: r25655 - trunk/download.jboss.org/jbosstools/examples.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-08 16:22:43 -0400 (Fri, 08 Oct 2010)
New Revision: 25655
Modified:
trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
Log:
./publishExample.sh https://anonsvn.jboss.org/repos/jbosstools/workspace/examples/project-exa...
Modified: trunk/download.jboss.org/jbosstools/examples/project-examples-community-3...
===================================================================
--- trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2010-10-08 18:46:50 UTC (rev 25654)
+++ trunk/download.jboss.org/jbosstools/examples/project-examples-community-3... 2010-10-08 20:22:43 UTC (rev 25655)
@@ -438,7 +438,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.51, org.jboss.ide.eclipse.as.runtime.50, org.jboss.ide.eclipse.as.runtime.42</property>
- <property name="eclipse-projects">photoalbum,photoalbum-ear,photoalbum-ejb</property>
+ <property name="eclipse-projects">simple</property>
<property name="description">This project example requires JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x</property>
</fix>
<fix type="plugin">
@@ -928,32 +928,4 @@
</fixes>
</project>
- <project>
- <category>RESTEasy</category>
- <name>simple</name>
- <included-projects>
- simple
- </included-projects>
-
- <shortDescription>RESTEasy Simple Example</shortDescription>
- <description>This project is a simple example showing usage of @Path, @GET, PUT, POST, and @PathParam. It uses pure streaming output and includes the 'simple' project.
-Requires m2eclipse and JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x.
- </description>
- <size>16939</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/resteasy-examp...
- </url>
- <fixes>
- <fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.51, org.jboss.ide.eclipse.as.runtime.50, org.jboss.ide.eclipse.as.runtime.42</property>
- <property name="eclipse-projects">photoalbum,photoalbum-ear,photoalbum-ejb</property>
- <property name="description">This project example requires JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x</property>
- </fix>
- <fix type="plugin">
- <property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions"> 0.10.0</property>
- <property name="description">This project example requires m2eclipse. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
- </fix>
- </fixes>
- </project>
</projects>
14 years, 3 months
JBoss Tools SVN: r25654 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-10-08 14:46:50 -0400 (Fri, 08 Oct 2010)
New Revision: 25654
Modified:
workspace/examples/project-examples-community-3.1.xml
Log:
JBIDE-7243 RESTEasy sample is listed twice
Modified: workspace/examples/project-examples-community-3.1.xml
===================================================================
--- workspace/examples/project-examples-community-3.1.xml 2010-10-08 16:02:57 UTC (rev 25653)
+++ workspace/examples/project-examples-community-3.1.xml 2010-10-08 18:46:50 UTC (rev 25654)
@@ -438,7 +438,7 @@
<fixes>
<fix type="wtpruntime">
<property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.51, org.jboss.ide.eclipse.as.runtime.50, org.jboss.ide.eclipse.as.runtime.42</property>
- <property name="eclipse-projects">photoalbum,photoalbum-ear,photoalbum-ejb</property>
+ <property name="eclipse-projects">simple</property>
<property name="description">This project example requires JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x</property>
</fix>
<fix type="plugin">
@@ -928,32 +928,4 @@
</fixes>
</project>
- <project>
- <category>RESTEasy</category>
- <name>simple</name>
- <included-projects>
- simple
- </included-projects>
-
- <shortDescription>RESTEasy Simple Example</shortDescription>
- <description>This project is a simple example showing usage of @Path, @GET, PUT, POST, and @PathParam. It uses pure streaming output and includes the 'simple' project.
-Requires m2eclipse and JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x.
- </description>
- <size>16939</size>
- <url>
- http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/resteasy-examp...
- </url>
- <fixes>
- <fix type="wtpruntime">
- <property name="allowed-types">org.jboss.ide.eclipse.as.runtime.eap.50, org.jboss.ide.eclipse.as.runtime.eap.43, org.jboss.ide.eclipse.as.runtime.51, org.jboss.ide.eclipse.as.runtime.50, org.jboss.ide.eclipse.as.runtime.42</property>
- <property name="eclipse-projects">photoalbum,photoalbum-ear,photoalbum-ejb</property>
- <property name="description">This project example requires JBoss EAP 4.3/JBoss EAP 5.0/JBoss AS 4.2.x/JBoss AS 5.x</property>
- </fix>
- <fix type="plugin">
- <property name="id">org.maven.ide.eclipse.wtp</property>
- <property name="versions"> 0.10.0</property>
- <property name="description">This project example requires m2eclipse. You can install it using the following update sites: http://m2eclipse.sonatype.org/sites/m2e and http://m2eclipse.sonatype.org/sites/m2e-extras</property>
- </fix>
- </fixes>
- </project>
</projects>
14 years, 3 months
JBoss Tools SVN: r25653 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-10-08 12:02:57 -0400 (Fri, 08 Oct 2010)
New Revision: 25653
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6690 , When XulRunner is not loaded VPE toolbar will be disabled.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-10-08 16:02:03 UTC (rev 25652)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-10-08 16:02:57 UTC (rev 25653)
@@ -637,7 +637,9 @@
* https://jira.jboss.org/browse/JBIDE-6690
* Disable VPE toolbar
*/
- verBar.setEnabled(false);
+ if (verBar != null) {
+ verBar.setEnabled(false);
+ }
/*
* Show the exception
*/
14 years, 3 months
JBoss Tools SVN: r25652 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-10-08 12:02:03 -0400 (Fri, 08 Oct 2010)
New Revision: 25652
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/browse/JBIDE-6690 , When XulRunner is not loaded VPE toolbar will be disabled.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-10-08 15:06:26 UTC (rev 25651)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2010-10-08 16:02:03 UTC (rev 25652)
@@ -633,6 +633,14 @@
xulRunnerEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
} catch (Throwable t) {
+ /*
+ * https://jira.jboss.org/browse/JBIDE-6690
+ * Disable VPE toolbar
+ */
+ verBar.setEnabled(false);
+ /*
+ * Show the exception
+ */
showXulRunnerException(cmpEd, t);
}
14 years, 3 months