JBoss Tools SVN: r27187 - trunk/documentation/whatsnew/drools.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2010-12-06 06:24:31 -0500 (Mon, 06 Dec 2010)
New Revision: 27187
Modified:
trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.Beta2.html
Log:
fix broken drools news link
Modified: trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.Beta2.html
===================================================================
--- trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.Beta2.html 2010-12-06 10:44:18 UTC (rev 27186)
+++ trunk/documentation/whatsnew/drools/guvnor-tools-news-5.1.0.Beta2.html 2010-12-06 11:24:31 UTC (rev 27187)
@@ -69,7 +69,7 @@
<td valign="top" align="right"><a name="itemname3" id="itemname3"></a><b>Not Allowed to Upload Two Resources with Same Name but a Different Extension</b></td>
<td valign="top">
<p>Guvnor server uses the resource name to identify a resource. So previously if there were two resources with the same file name but different extensions, it was confused and Guvnor considered them to be the same resource. Now we validate and don't allow uploading two resources with the same file name but different extensions.</p>
- <p><small><a href="https://jira.jboss.org/browse/JBIDE-7032">Related jira</a></p>
+ <p><small><a href="https://jira.jboss.org/browse/JBIDE-6659">Related jira</a></p>
</td>
</tr>
14 years, 1 month
JBoss Tools SVN: r27186 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 05:44:18 -0500 (Mon, 06 Dec 2010)
New Revision: 27186
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
Log:
[JBIDE-7688][JBIDE-7813] now getting images and instances in async manner by commands
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 10:31:10 UTC (rev 27185)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-12-06 10:44:18 UTC (rev 27186)
@@ -10,15 +10,10 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.views.properties.IPropertySource;
-import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.ui.Activator;
/**
* @author Jeff Johnston
@@ -69,21 +64,4 @@
public IPropertySource getPropertySource() {
return new CloudPropertySource(getElement());
}
-
- public void loadChildren() {
- DeltaCloud cloud = (DeltaCloud) getElement();
- try {
- cloud.loadChildren();
- } catch (Exception e) {
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- // TODO: internationalize strings
- ErrorDialog.openError(Display.getDefault().getActiveShell(),
- "Error",
- "Cloud not get load children for " + cloud.getName(), status);
- }
- }
}
14 years, 1 month
JBoss Tools SVN: r27185 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 05:31:10 -0500 (Mon, 06 Dec 2010)
New Revision: 27185
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
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/ImageViewLabelAndContentProvider.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/FindImagePage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
Log:
[JBIDE-7688][JBIDE-7813] now getting images and instances in async manner by commands
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-12-06 10:31:10 UTC (rev 27185)
@@ -1,3 +1,11 @@
+2010-12-06 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java (validate):
+ * src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java (asyncGetCloudElements):
+ * src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java (asyncGetCloudElements):
+ * src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java (getChildren):
+ * src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java (getChildren):
+
2010-12-03 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java (filter):
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/META-INF/MANIFEST.MF 2010-12-06 10:31:10 UTC (rev 27185)
@@ -6,19 +6,19 @@
Bundle-Activator: org.jboss.tools.deltacloud.ui.Activator
Bundle-Vendor: %Bundle-Vendor
Bundle-Localization: plugin
-Require-Bundle: org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
- org.eclipse.equinox.security;bundle-version="1.0.100",
+Require-Bundle: org.jboss.tools.common;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.ui;bundle-version="[3.6.0,4.0.0)",
+ org.eclipse.equinox.security;bundle-version="[1.0.100,2.0.0)",
org.eclipse.core.runtime;bundle-version="[3.6.0,4.0.0)",
org.eclipse.ui.views;bundle-version="[3.4.1,4.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="3.5.0",
+ org.eclipse.ui.views.properties.tabbed;bundle-version="[3.5.0,4.0.0)",
org.jboss.tools.deltacloud.core;bundle-version="[0.0.1,1.0.0]",
org.eclipse.rse.core;bundle-version="[3.1.1,4.0.0)",
org.eclipse.jface.databinding;bundle-version="[1.4.0,2.0.0)",
org.eclipse.core.databinding;bundle-version="[1.3.100,2.0.0)",
org.eclipse.core.databinding.observable;bundle-version="[1.3.0,2.0.0)",
org.eclipse.core.databinding.property;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.core.databinding.beans;bundle-version="1.2.100",
- org.jboss.tools.common;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.databinding.beans;bundle-version="[1.2.100,2.0.0)",
org.eclipse.core.expressions;bundle-version="[3.4.200,4.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/RSEUtils.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -31,7 +31,6 @@
import org.eclipse.ui.PartInitException;
import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-import org.jboss.tools.deltacloud.ui.commands.AbstractCloudJob;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
@@ -101,9 +100,9 @@
"Remote System Explorer could not connect: connection name is not defined");
Assert.isLegal(service != null, "Remote System Explorer could not connect: connector service not found.");
- Job job = new AbstractCloudJob(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
+ Job job = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
@Override
- protected IStatus doRun(IProgressMonitor monitor) {
+ protected IStatus run(IProgressMonitor monitor) {
try {
monitor.worked(1);
service.connect(monitor);
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.deltacloud.ui.commands;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.jobs.Job;
-
-public abstract class AbstractCloudJob extends Job {
-
- public AbstractCloudJob(String name) {
- super(name);
-// setUser(true);
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- monitor.beginTask(getName(), IProgressMonitor.UNKNOWN);
- monitor.worked(1);
- return doRun(monitor);
- }
-
- protected abstract IStatus doRun(IProgressMonitor monitor);
-
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -20,10 +20,10 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.common.log.StatusFactory;
+import org.jboss.tools.deltacloud.core.AbstractCloudJob;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudMultiException;
-import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
import org.jboss.tools.internal.deltacloud.ui.utils.CloudViewElementUtils;
@@ -53,17 +53,13 @@
new AbstractCloudJob("Refreshing images and instances on " + cloud.getName()) {
@Override
- protected IStatus doRun(IProgressMonitor monitor) {
+ protected IStatus doRun(IProgressMonitor monitor) throws DeltaCloudException {
try {
monitor.worked(1);
cloud.loadChildren();
monitor.done();
} catch (DeltaCloudMultiException e) {
return ErrorUtils.createMultiStatus(e);
- } catch (Exception e) {
- // TODO internationalize strings
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
- "Could not load children of cloud " + cloud.getName(), e);
}
return Status.OK_STATUS;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -20,10 +20,10 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.common.log.StatusFactory;
+import org.jboss.tools.deltacloud.core.AbstractCloudJob;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
-import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -50,16 +50,11 @@
new AbstractCloudJob("Refreshing images on cloud " + cloud.getName()) {
@Override
- protected IStatus doRun(IProgressMonitor monitor) {
- try {
+ protected IStatus doRun(IProgressMonitor monitor) throws DeltaCloudException {
monitor.worked(1);
cloud.loadChildren();
monitor.done();
return Status.OK_STATUS;
-
- } catch (Exception e) {
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- }
}
}.schedule();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -20,10 +20,10 @@
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.handlers.HandlerUtil;
-import org.jboss.tools.common.log.StatusFactory;
+import org.jboss.tools.deltacloud.core.AbstractCloudJob;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -50,15 +50,11 @@
new AbstractCloudJob("Refreshing instances on cloud " + cloud.getName()) {
@Override
- protected IStatus doRun(IProgressMonitor monitor) {
- try {
- monitor.worked(1);
- cloud.loadChildren();
- monitor.done();
- return Status.OK_STATUS;
- } catch (Exception e) {
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
- }
+ protected IStatus doRun(IProgressMonitor monitor) throws DeltaCloudException {
+ monitor.worked(1);
+ cloud.loadChildren();
+ monitor.done();
+ return Status.OK_STATUS;
}
}.setUser(true);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/AbstractCloudElementViewLabelAndContentProvider.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -10,23 +10,15 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
-import java.text.MessageFormat;
-
import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
-import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.core.IDeltaCloudElement;
-import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
/**
@@ -63,27 +55,7 @@
this.currentCloud = (DeltaCloud) newInput;
addListener(currentCloud);
// TODO internationalize strings
- final String workTitle = MessageFormat.format("Loading elements of cloud \"{0}\"", currentCloud.getName());
- new Job(workTitle) {
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- monitor.beginTask(workTitle, IProgressMonitor.UNKNOWN);
- /*
- * trigger load of elements, data will get in through
- * notification (#listChanged)
- */
- getCloudElements(currentCloud);
- monitor.done();
- return Status.OK_STATUS;
- } catch (DeltaCloudException e) {
- return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
- MessageFormat.format("Could not get elements of cloud \"{0}\"", currentCloud.getName()), e);
- }
- }
-
- }.schedule();
+ asyncGetCloudElements(currentCloud);
}
public void listChanged(final DeltaCloud cloud, final CLOUDELEMENT[] cloudElements) {
@@ -134,7 +106,7 @@
if (filter == null) {
return cloudElements;
} else {
- return filter.filter(cloudElements).toArray();
+ return filter.filter().toArray();
}
}
@@ -149,5 +121,5 @@
protected abstract ICloudElementFilter<CLOUDELEMENT> getCloudFilter(DeltaCloud cloud);
- protected abstract CLOUDELEMENT[] getCloudElements(DeltaCloud cloud) throws DeltaCloudException;
+ protected abstract void asyncGetCloudElements(DeltaCloud cloud);
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCategoryElement.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -176,5 +176,9 @@
};
}
+ protected DeltaCloud getCloud() {
+ return (DeltaCloud) getElement();
+ }
+
protected abstract void dispose();
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -10,9 +10,13 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import java.text.MessageFormat;
+
import org.eclipse.jface.viewers.TreeViewer;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.GetImagesCommand;
import org.jboss.tools.deltacloud.core.IImageFilter;
import org.jboss.tools.deltacloud.core.IImageListListener;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
@@ -27,7 +31,7 @@
public CVImagesCategoryElement(Object element, TreeViewer viewer) {
super(element, viewer);
- DeltaCloud cloud = (DeltaCloud) getElement();
+ DeltaCloud cloud = getCloud();
cloud.addImageListListener(this);
}
@@ -38,20 +42,7 @@
@Override
public synchronized Object[] getChildren() {
if (!initialized) {
- DeltaCloud cloud = (DeltaCloud) getElement();
- try {
- cloud.removeImageListListener(this);
- DeltaCloudImage[] images = filter(cloud.getImages());
- addChildren(images);
- initialized = true;
- } catch (Exception e) {
- ErrorUtils.handleError(
- "Error",
- "Colud not get images from cloud " + cloud.getName(),
- e, getViewer().getControl().getShell());
- } finally {
- cloud.addImageListListener(this);
- }
+ new GetImagesCommand(getCloud()).execute();
}
return super.getChildren();
}
@@ -64,25 +55,37 @@
}
return elements;
}
-
+
@Override
public synchronized void listChanged(DeltaCloud cloud, DeltaCloudImage[] newImages) {
- clearChildren();
- initialized = false;
- DeltaCloudImage[] images = filter(newImages);
- addChildren(images);
- initialized = true;
+ try {
+ clearChildren();
+ initialized = false;
+ DeltaCloudImage[] images = filter();
+ addChildren(images);
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ ErrorUtils.handleError(
+ "Error",
+ MessageFormat.format("Could not get images from cloud \"{0}\"", cloud.getName()), e,
+ getViewer().getControl().getShell());
+ } finally {
+ initialized = true;
+ }
// refresh();
}
- public DeltaCloudImage[] filter(DeltaCloudImage[] images) {
+ public DeltaCloudImage[] filter() throws DeltaCloudException {
DeltaCloud cloud = (DeltaCloud) getElement();
IImageFilter f = cloud.getImageFilter();
- return f.filter(images).toArray(new DeltaCloudImage[images.length]);
+ return f.filter().toArray(new DeltaCloudImage[] {});
}
+ @Override
protected void dispose() {
DeltaCloud cloud = (DeltaCloud) getElement();
- cloud.removeImageListListener(this);
+ if (cloud != null) {
+ cloud.removeImageListListener(this);
+ }
}
}
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-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVInstancesCategoryElement.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -10,10 +10,13 @@
*******************************************************************************/
package org.jboss.tools.deltacloud.ui.views;
+import java.text.MessageFormat;
+
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.widgets.Display;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.GetInstancesCommand;
import org.jboss.tools.deltacloud.core.IInstanceFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
import org.jboss.tools.deltacloud.ui.ErrorUtils;
@@ -35,26 +38,11 @@
public String getName() {
return CVMessages.getString(INSTANCE_CATEGORY_NAME);
}
-
@Override
public Object[] getChildren() {
if (!initialized) {
- DeltaCloud cloud = (DeltaCloud) getElement();
- try {
- cloud.removeInstanceListListener(this);
- DeltaCloudInstance[] instances = filter(cloud.getInstances());
- addChildren(instances);
- initialized = true;
- } catch (Exception e) {
- // TODO: internationalize strings
- ErrorUtils.handleError(
- "Error",
- "Colud not get instances from cloud " + cloud.getName(),
- e, Display.getDefault().getActiveShell());
- } finally {
- cloud.addInstanceListListener(this);
- }
+ new GetInstancesCommand(getCloud()).execute();
}
return super.getChildren();
}
@@ -76,19 +64,27 @@
@Override
public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] newInstances) {
- clearChildren();
- final DeltaCloudInstance[] instances = filter(newInstances);
- addChildren(instances);
- initialized = true;
-// refresh();
+ try {
+ clearChildren();
+ final DeltaCloudInstance[] instances = filter();
+ addChildren(instances);
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ ErrorUtils.handleError(
+ "Error",
+ MessageFormat.format("Could not get instanceso from cloud \"{0}\"", cloud.getName()), e,
+ getViewer().getControl().getShell());
+ } finally {
+ initialized = true;
+ }
}
- public DeltaCloudInstance[] filter(DeltaCloudInstance[] instances) {
- DeltaCloud cloud = (DeltaCloud) getElement();
- IInstanceFilter f = cloud.getInstanceFilter();
- return f.filter(instances).toArray(new DeltaCloudInstance[instances.length]);
+ public DeltaCloudInstance[] filter() throws DeltaCloudException {
+ IInstanceFilter f = getCloud().getInstanceFilter();
+ return f.filter().toArray(new DeltaCloudInstance[] {});
}
+ @Override
protected void dispose() {
DeltaCloud cloud = (DeltaCloud) getElement();
if (cloud != null) {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -16,8 +16,8 @@
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.GetImagesCommand;
import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.core.IImageListListener;
@@ -93,8 +93,8 @@
}
@Override
- protected DeltaCloudImage[] getCloudElements(DeltaCloud cloud) throws DeltaCloudException {
- return cloud.getImages();
+ protected void asyncGetCloudElements(DeltaCloud cloud) {
+ new GetImagesCommand(cloud).execute();
}
@Override
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-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/InstanceViewLabelAndContentProvider.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -18,8 +18,8 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudException;
import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.core.GetInstancesCommand;
import org.jboss.tools.deltacloud.core.ICloudElementFilter;
import org.jboss.tools.deltacloud.core.IInstanceListListener;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
@@ -122,8 +122,8 @@
}
@Override
- protected DeltaCloudInstance[] getCloudElements(DeltaCloud cloud) throws DeltaCloudException {
- return cloud.getInstances();
+ protected void asyncGetCloudElements(DeltaCloud cloud) {
+ new GetInstancesCommand(cloud).execute();
}
@Override
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-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -1,7 +1,5 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.layout.TableColumnLayout;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -19,24 +17,23 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.AllImageFilter;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
+import org.jboss.tools.deltacloud.core.GetImagesCommand;
import org.jboss.tools.deltacloud.core.IImageFilter;
+import org.jboss.tools.deltacloud.core.IImageListListener;
import org.jboss.tools.deltacloud.core.ImageFilter;
-import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
import org.jboss.tools.deltacloud.ui.views.CVMessages;
import org.jboss.tools.deltacloud.ui.views.ImageViewLabelAndContentProvider;
import org.jboss.tools.deltacloud.ui.views.TableViewerColumnComparator;
-public class FindImagePage extends WizardPage {
+public class FindImagePage extends WizardPage implements IImageListListener {
private final static String NAME = "FindImage.name"; //$NON-NLS-1$
private final static String TITLE = "FindImage.title"; //$NON-NLS-1$
@@ -46,22 +43,22 @@
private final static String ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
private final static String DESC_LABEL = "Desc.label"; //$NON-NLS-1$
private final static String INVALID_SEMICOLON = "ErrorFilterSemicolon.msg"; //$NON-NLS-1$
-
+
private DeltaCloud cloud;
private TableViewer viewer;
private Composite container;
private ImageViewLabelAndContentProvider contentProvider;
-
+
private Text nameText;
private Text idText;
private Text archText;
private Text descText;
-
+
private IImageFilter filter;
private DeltaCloudImage selectedElement;
private String oldRules;
-
+
private ModifyListener textListener = new ModifyListener() {
@Override
@@ -69,59 +66,60 @@
// TODO Auto-generated method stub
validate();
}
-
+
};
-
+
private class ColumnListener extends SelectionAdapter {
-
+
private int column;
private TableViewer viewer;
-
+
public ColumnListener(int column, TableViewer viewer) {
this.column = column;
this.viewer = viewer;
}
+
@Override
public void widgetSelected(SelectionEvent e) {
- TableViewerColumnComparator comparator = (TableViewerColumnComparator)viewer.getComparator();
+ TableViewerColumnComparator comparator = (TableViewerColumnComparator) viewer.getComparator();
Table t = viewer.getTable();
if (comparator.getColumn() == column) {
comparator.reverseDirection();
}
comparator.setColumn(column);
- TableColumn tc = (TableColumn)e.getSource();
+ TableColumn tc = (TableColumn) e.getSource();
t.setSortColumn(tc);
t.setSortDirection(SWT.NONE);
viewer.refresh();
}
-
+
};
public FindImagePage(DeltaCloud cloud) {
super(WizardMessages.getString(NAME));
this.cloud = cloud;
- filter = new AllImageFilter();
+ filter = new AllImageFilter(cloud);
setDescription(WizardMessages.getString(DESC));
setTitle(WizardMessages.getString(TITLE));
setImageDescriptor(SWTImagesFactory.DESC_DELTA_LARGE);
setPageComplete(false);
}
-
+
public String getImageId() {
if (selectedElement != null)
return selectedElement.getId();
return "";
}
-
+
private void validate() {
boolean hasError = false;
boolean isComplete = true;
-
+
String name = nameText.getText();
String id = idText.getText();
String arch = archText.getText();
String desc = descText.getText();
-
+
if (name.contains(";") || //$NON-NLS-1$
id.contains(";") || //$NON-NLS-1$
arch.contains(";") || //$NON-NLS-1$
@@ -129,48 +127,27 @@
setErrorMessage(WizardMessages.getString(INVALID_SEMICOLON));
hasError = true;
}
-
+
if (selectedElement == null)
isComplete = false;
-
+
if (!hasError) {
setErrorMessage(null);
String newRules = name + "*;" //$NON-NLS-1$
- + id + "*;" //$NON-NLS-1$
- + arch + "*;" //$NON-NLS-1$
- + desc + "*"; //$NON-NLS-1$
-
+ + id + "*;" //$NON-NLS-1$
+ + arch + "*;" //$NON-NLS-1$
+ + desc + "*"; //$NON-NLS-1$
+
if (!newRules.equals(oldRules)) {
- filter = new ImageFilter();
+ filter = new ImageFilter(cloud);
filter.setRules(newRules);
oldRules = newRules;
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- contentProvider.setFilter(filter);
- viewer.setInput(cloud.getImages());
- viewer.refresh();
- } catch (Exception e) {
- IStatus status = StatusFactory.getInstance(
- IStatus.ERROR,
- Activator.PLUGIN_ID,
- e.getMessage(),
- e);
- // TODO: internationalize strings
- ErrorDialog.openError(viewer.getControl().getShell(),
- "Error",
- "Cloud not get images from cloud " + cloud.getName(), status);
- }
- }
-
- });
+ new GetImagesCommand(cloud).execute();
}
}
setPageComplete(isComplete && !hasError);
}
-
+
@Override
public void createControl(Composite parent) {
// TODO Auto-generated method stub
@@ -179,18 +156,17 @@
layout.marginHeight = 5;
layout.marginWidth = 5;
container.setLayout(layout);
-
Label nameLabel = new Label(container, SWT.NULL);
nameLabel.setText(WizardMessages.getString(NAME_LABEL));
-
+
nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
nameText.setText(filter.getNameRule().toString());
nameText.addModifyListener(textListener);
Label idLabel = new Label(container, SWT.NULL);
idLabel.setText(WizardMessages.getString(ID_LABEL));
-
+
idText = new Text(container, SWT.BORDER | SWT.SINGLE);
idText.setText(filter.getIdRule().toString());
idText.addModifyListener(textListener);
@@ -208,11 +184,11 @@
descText = new Text(container, SWT.BORDER | SWT.SINGLE);
descText.setText(filter.getDescRule().toString());
descText.addModifyListener(textListener);
-
+
Composite tableArea = new Composite(container, SWT.NULL);
TableColumnLayout tableLayout = new TableColumnLayout();
tableArea.setLayout(tableLayout);
-
+
viewer = new TableViewer(tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Table table = viewer.getTable();
table.setHeaderVisible(true);
@@ -222,10 +198,10 @@
viewer.setLabelProvider(contentProvider);
TableViewerColumnComparator comparator = new TableViewerColumnComparator();
viewer.setComparator(comparator);
-
+
for (int i = 0; i < ImageViewLabelAndContentProvider.Column.getSize(); ++i) {
- ImageViewLabelAndContentProvider.Column c =
- ImageViewLabelAndContentProvider.Column.getColumn(i);
+ ImageViewLabelAndContentProvider.Column c =
+ ImageViewLabelAndContentProvider.Column.getColumn(i);
TableColumn tc = new TableColumn(table, SWT.NONE);
if (i == 0)
table.setSortColumn(tc);
@@ -234,21 +210,21 @@
tc.addSelectionListener(new ColumnListener(i, viewer));
}
table.setSortDirection(SWT.NONE);
-
+
Point p1 = nameLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
int centering = (p2.y - p1.y + 1) / 2;
FormData f = new FormData();
-// f.left = new FormAttachment(0, 5);
-// f.top = new FormAttachment(0, 5 + centering);
-// filterLabel.setLayoutData(f);
+ // f.left = new FormAttachment(0, 5);
+ // f.top = new FormAttachment(0, 5 + centering);
+ // filterLabel.setLayoutData(f);
f = new FormData();
f.left = new FormAttachment(0, 10);
f.top = new FormAttachment(0, 5 + centering);
nameLabel.setLayoutData(f);
-
+
f = new FormData();
f.left = new FormAttachment(nameLabel, 5);
f.top = new FormAttachment(0, 5);
@@ -287,7 +263,7 @@
f.top = new FormAttachment(0, 5);
f.right = new FormAttachment(100, -10);
descText.setLayoutData(f);
-
+
f = new FormData();
f.top = new FormAttachment(nameText, 13);
f.left = new FormAttachment(0, 0);
@@ -300,7 +276,7 @@
hookSelection();
validate();
}
-
+
private void hookSelection() {
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
@@ -312,8 +288,18 @@
private void handleSelection() {
IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- selectedElement = (DeltaCloudImage)selection.getFirstElement();
+ selectedElement = (DeltaCloudImage) selection.getFirstElement();
validate();
}
+ @Override
+ public void listChanged(DeltaCloud cloud, final DeltaCloudImage[] images) {
+ viewer.getControl().getDisplay().asyncExec(new Runnable() {
+
+ @Override
+ public void run() {
+ viewer.setInput(images);
+ }});
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -77,7 +77,7 @@
private String getArch(String imageId) throws DeltaCloudException {
String arch = "";
if (imageId != null && imageId.length() > 0) {
- DeltaCloudImage image = getImage(imageId, arch);
+ DeltaCloudImage image = cloud.getImage(imageId);
if (image != null) {
imageContainer.setImage(image);
arch = image.getArchitecture();
@@ -85,25 +85,6 @@
}
return arch;
}
-
- private DeltaCloudImage getImage(String imageId, String arch) throws DeltaCloudException {
- DeltaCloudImage image = getFromcachedImage(imageId, cloud.getImages());
- if (image == null) {
- image = cloud.loadImage(imageId);
- }
- return image;
- }
-
- private DeltaCloudImage getFromcachedImage(String id, DeltaCloudImage[] images) {
- for (int i = 0; i < images.length; ++i) {
- DeltaCloudImage image = images[i];
- if (image.getId().equals(id)) {
- return image;
- }
- }
- return null;
- }
-
}
public static class ArchValidator implements IValidator {
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-12-06 10:23:19 UTC (rev 27184)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstancePage2.java 2010-12-06 10:31:10 UTC (rev 27185)
@@ -106,16 +106,15 @@
private Label imageLabel, archLabel, nameLabel, realmLabel;
private Group groupContainer;
-
private ModifyListener comboListener = new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
int index = hardware.getSelectionIndex();
String id = index > -1 ? hardware.getItem(hardware.getSelectionIndex()) : null;
- if( currPage != null )
+ if (currPage != null)
currPage.setVisible(false);
- if( id != null ) {
+ if (id != null) {
currPage = profilePages.get(id);
currPage.setVisible(true);
}
@@ -236,12 +235,12 @@
}
public void filterProfiles() {
- if( allProfiles == null )
+ if (allProfiles == null)
return;
-
+
ArrayList<DeltaCloudHardwareProfile> profiles = new ArrayList<DeltaCloudHardwareProfile>();
for (DeltaCloudHardwareProfile p : allProfiles) {
- if (p.getArchitecture() == null || image.getArchitecture().equals(p.getArchitecture())) {
+ if (p.getArchitecture() == null || image == null || image.getArchitecture().equals(p.getArchitecture())) {
profiles.add(p);
}
}
@@ -260,8 +259,7 @@
hardware.addModifyListener(comboListener);
}
}
-
-
+
@Override
public void createControl(Composite parent) {
DataBindingContext dbc = new DataBindingContext();
@@ -271,21 +269,21 @@
launchFetchRealms();
launchFetchProfiles();
-
+
// We have to set the image id here instead of in the constructor
// of the model because the image id triggers other items to fill
// in their values such as the architecture and hardware profiles.
String defaultImage = cloud.getLastImageId();
model.setImageId(defaultImage);
setControl(container);
-
+
// lastly, if there's already an image set, use it
- if( image != null ) {
+ if (image != null) {
imageText.setText(image.getId());
filterProfiles();
}
}
-
+
private void bindWidgets(DataBindingContext dbc) {
bindText(dbc, nameText, NewInstanceModel.PROPERTY_NAME, MUST_ENTER_A_NAME);
dbc.bindValue(
@@ -310,7 +308,7 @@
model));
bindText(dbc, keyText, NewInstanceModel.PROPERTY_KEYNAME, MUST_ENTER_A_KEYNAME);
}
-
+
private Composite createWidgets(Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
FormLayout layout = new FormLayout();
@@ -333,9 +331,9 @@
nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
- //createRealmsControl(container, getRealmNames(realms));
+ // createRealmsControl(container, getRealmNames(realms));
createRealmsControl(container);
-
+
imageText = new Text(container, SWT.BORDER | SWT.SINGLE);
findImage = new Button(container, SWT.NULL);
@@ -349,7 +347,7 @@
hardware = new Combo(container, SWT.READ_ONLY);
hardware.setEnabled(false);
- hardware.setItems(new String[]{WizardMessages.getString(LOADING_VALUE)});
+ hardware.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
hardware.select(0);
groupContainer = new Group(container, SWT.BORDER);
@@ -359,11 +357,11 @@
groupLayout.marginWidth = 0;
groupContainer.setLayout(groupLayout);
hardware.setEnabled(false);
-
+
// add invisible dummy widget to guarantee a min size
dummyLabel = new Label(groupContainer, SWT.NONE);
dummyLabel.setText("\n\n\n\n\n");
- FormData dummyData = UIUtils.createFormData(0,0,0,150,null,0,null,0);
+ FormData dummyData = UIUtils.createFormData(0, 0, 0, 150, null, 0, null, 0);
dummyLabel.setLayoutData(dummyData);
dummyLabel.setVisible(false);
@@ -379,16 +377,16 @@
int centering = (p2.y - p1.y + 1) / 2;
int centering2 = (p3.y - p2.y + 1) / 2;
- FormData f = UIUtils.createFormData(null,0,null,0,0,0,100,0);
+ FormData f = UIUtils.createFormData(null, 0, null, 0, 0, 0, 100, 0);
dummyLabel.setLayoutData(f);
- f = UIUtils.createFormData(dummyLabel, 8+centering, null, 0, 0,0,null,0);
+ f = UIUtils.createFormData(dummyLabel, 8 + centering, null, 0, 0, 0, null, 0);
nameLabel.setLayoutData(f);
f = UIUtils.createFormData(dummyLabel, 8, null, 0, hardwareLabel, 5, 100, 0);
nameText.setLayoutData(f);
- f = UIUtils.createFormData(nameText, 8+centering+centering2, null, 0, 0,0,null,0);
+ f = UIUtils.createFormData(nameText, 8 + centering + centering2, null, 0, 0, 0, null, 0);
imageLabel.setLayoutData(f);
int widthHint = convertHorizontalDLUsToPixels(IDialogConstants.BUTTON_WIDTH);
@@ -403,16 +401,16 @@
f.width = buttonWidth;
findImage.setLayoutData(f);
- f = UIUtils.createFormData(nameText, 8+centering2, null, 0, hardwareLabel, 5, findImage, -10);
+ f = UIUtils.createFormData(nameText, 8 + centering2, null, 0, hardwareLabel, 5, findImage, -10);
imageText.setLayoutData(f);
- f = UIUtils.createFormData(imageLabel, 8+centering, null, 0, 0, 0, null, 0);
+ f = UIUtils.createFormData(imageLabel, 8 + centering, null, 0, 0, 0, null, 0);
archLabel.setLayoutData(f);
- f = UIUtils.createFormData(imageLabel, 8+centering, null, 0, hardwareLabel, 5, 100, 0);
+ f = UIUtils.createFormData(imageLabel, 8 + centering, null, 0, hardwareLabel, 5, 100, 0);
arch.setLayoutData(f);
- f = UIUtils.createFormData(arch, 8+centering, null, 0, 0, 0, null, 0);
+ f = UIUtils.createFormData(arch, 8 + centering, null, 0, 0, 0, null, 0);
realmLabel.setLayoutData(f);
f = UIUtils.createFormData(arch, 8, null, 0, hardwareLabel, 5, 100, 0);
@@ -425,7 +423,7 @@
keyText = new Text(container, SWT.BORDER | SWT.SINGLE);
- f = UIUtils.createFormData(realmCombo, 8+centering+centering2, null, 0, 0,0,null,0);
+ f = UIUtils.createFormData(realmCombo, 8 + centering + centering2, null, 0, 0, 0, null, 0);
keyLabel.setLayoutData(f);
f = new FormData();
@@ -434,22 +432,22 @@
f.right = new FormAttachment(realmCombo, 0, SWT.RIGHT);
keyManage.setLayoutData(f);
- f = UIUtils.createFormData(realmCombo, 8+centering2, null, 0, hardwareLabel, 5, keyManage, -10);
+ f = UIUtils.createFormData(realmCombo, 8 + centering2, null, 0, hardwareLabel, 5, keyManage, -10);
keyText.setLayoutData(f);
control = keyText;
- f = UIUtils.createFormData(control, 8+centering, null,0, 0,0, null,0);
+ f = UIUtils.createFormData(control, 8 + centering, null, 0, 0, 0, null, 0);
hardwareLabel.setLayoutData(f);
- f = UIUtils.createFormData(control,8, null,0, hardwareLabel,5, 100,0);
+ f = UIUtils.createFormData(control, 8, null, 0, hardwareLabel, 5, 100, 0);
hardware.setLayoutData(f);
- f = UIUtils.createFormData(hardware,10, 100,0, 0,0, 100,0);
+ f = UIUtils.createFormData(hardware, 10, 100, 0, 0, 0, 100, 0);
groupContainer.setLayoutData(f);
return container;
}
-
+
private void createProfileComposites() {
for (DeltaCloudHardwareProfile p : allProfiles) {
ProfileComposite pc = new ProfileComposite(p, groupContainer);
@@ -463,7 +461,7 @@
Thread t = new Thread() {
public void run() {
realms = getRealms();
- Display.getDefault().asyncExec(new Runnable(){
+ Display.getDefault().asyncExec(new Runnable() {
public void run() {
updateRealmCombo();
}
@@ -472,7 +470,7 @@
};
t.start();
}
-
+
private void launchFetchProfiles() {
Thread t = new Thread() {
public void run() {
@@ -482,7 +480,7 @@
public void run() {
createProfileComposites();
clearProfiles();
- if( allProfiles.length > 0 )
+ if (allProfiles.length > 0)
hardware.setEnabled(true);
filterProfiles();
}
@@ -491,7 +489,7 @@
};
t.start();
}
-
+
/**
* Displays the arch in the given label if the given binding is valid.
*
@@ -617,18 +615,18 @@
Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
realmCombo = combo;
combo.setEnabled(false);
- combo.setItems(new String[]{WizardMessages.getString(LOADING_VALUE)});
+ combo.setItems(new String[] { WizardMessages.getString(LOADING_VALUE) });
combo.select(0);
}
-
+
private void updateRealmCombo() {
List<String> names = getRealmNames(realms != null ? realms : new ArrayList<DeltaCloudRealm>());
- if( names.size() > 0 ) {
+ if (names.size() > 0) {
realmCombo.setItems(names.toArray(new String[names.size()]));
realmCombo.setEnabled(true);
realmCombo.select(0);
} else {
- realmCombo.setItems(new String[]{WizardMessages.getString(NONE_RESPONSE)});
+ realmCombo.setItems(new String[] { WizardMessages.getString(NONE_RESPONSE) });
realmCombo.select(0);
}
}
14 years, 1 month
JBoss Tools SVN: r27184 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 05:23:19 -0500 (Mon, 06 Dec 2010)
New Revision: 27184
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF
Log:
[JBIDE-7688][JBIDE-7813]
now getting images and instances in async manner by commands,
CloudElementFilter#filter is now cloud instance specific (is instantiated with a reference to a cloud)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-06 10:21:22 UTC (rev 27183)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-12-06 10:23:19 UTC (rev 27184)
@@ -1,3 +1,28 @@
+2010-12-06 André Dietisheim <adietish(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/InstanceFilter.java (InstanceFilter):
+ * src/org/jboss/tools/deltacloud/core/GetImagesCommand.java:
+ * src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java:
+ [JBIDE-7688][JBIDE-7813] now getting images and instances in async manner by commands
+ * src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
+ (filter):
+ (AbstractCloudElementFilter):
+ (getCloud):
+ (getCloudElements):
+ * src/org/jboss/tools/deltacloud/core/AllImageFilter.java (AllImageFilter):
+ * src/org/jboss/tools/deltacloud/core/ImageFilter.java
+ (ImageFilter):
+ (getCloudElements):
+ * src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java (AllInstanceFilter):
+ * src/org/jboss/tools/deltacloud/core/InstanceFilter.java
+ (InstanceFilter):
+ (getCloudElements):
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java
+ (createInstanceFilter):
+ (createImageFilter):
+ * src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java (filter):
+ [JBIDE-7688][JBIDE-7813] CloudElementFilter#filter is now cloud instance specific (is instantiated with a reference to a cloud)
+
2010-12-03 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/AllImageFilter.java:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF 2010-12-06 10:21:22 UTC (rev 27183)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/META-INF/MANIFEST.MF 2010-12-06 10:23:19 UTC (rev 27184)
@@ -5,9 +5,9 @@
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: org.jboss.tools.deltacloud.core.Activator
Bundle-Vendor: Red Hat Inc.
-Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.equinox.security;bundle-version="1.0.100",
- org.jboss.tools.usage;bundle-version="1.0.0";resolution:=optional
+Require-Bundle: org.jboss.tools.common;bundle-version="[3.2.0,4.0.0)",
+ org.eclipse.core.runtime,
+ org.eclipse.equinox.security;bundle-version="[1.0.100,2.0.0)"
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Export-Package: org.apache.http.client.methods;x-friends:="org.jboss.tools.deltacloud.test",
14 years, 1 month
JBoss Tools SVN: r27183 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 05:21:22 -0500 (Mon, 06 Dec 2010)
New Revision: 27183
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudJob.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetImagesCommand.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetInstancesCommand.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/command/
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java
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/DeltaCloud.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageListListener.java
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/InstanceFilter.java
Log:
[JBIDE-7688][JBIDE-7813]
now getting images and instances in async manner by commands,
CloudElementFilter#filter is now cloud instance specific (is instantiated with a reference to a cloud)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudElementFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -26,12 +26,18 @@
public abstract class AbstractCloudElementFilter<CLOUDELEMENT extends IDeltaCloudElement> implements
ICloudElementFilter<CLOUDELEMENT> {
+ private DeltaCloud cloud;
+
+ public AbstractCloudElementFilter(DeltaCloud cloud) {
+ this.cloud = cloud;
+ }
+
private IFieldMatcher nameRule;
private IFieldMatcher idRule;
- public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements) {
+ public Collection<CLOUDELEMENT> filter() throws DeltaCloudException {
List<CLOUDELEMENT> filteredElements = new ArrayList<CLOUDELEMENT>();
- for (CLOUDELEMENT cloudElement : cloudElements) {
+ for (CLOUDELEMENT cloudElement : getCloudElements()) {
if (matches(cloudElement)) {
filteredElements.add(cloudElement);
}
@@ -39,6 +45,8 @@
return filteredElements;
}
+ protected abstract CLOUDELEMENT[] getCloudElements() throws DeltaCloudException;
+
protected boolean matches(CLOUDELEMENT cloudElement) {
return nameRule.matches(cloudElement.getName())
&& idRule.matches(cloudElement.getId());
@@ -67,6 +75,10 @@
}
}
+ protected DeltaCloud getCloud() {
+ return cloud;
+ }
+
@Override
public String toString() {
return nameRule + ";" //$NON-NLS-1$
Copied: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudJob.java (from rev 27061, trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/AbstractCloudJob.java)
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudJob.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudJob.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.jobs.Job;
+import org.jboss.tools.common.log.StatusFactory;
+
+public abstract class AbstractCloudJob extends Job {
+
+ public AbstractCloudJob(String name) {
+ super(name);
+ // setUser(true);
+ }
+
+ @Override
+ protected IStatus run(IProgressMonitor monitor) {
+ monitor.beginTask(getName(), IProgressMonitor.UNKNOWN);
+ monitor.worked(1);
+ try {
+ return doRun(monitor);
+ } catch (Exception e) {
+ return StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID,
+ MessageFormat.format("Could not {0}", getName()));
+ }
+ }
+
+ protected abstract IStatus doRun(IProgressMonitor monitor) throws Exception;
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractCloudJob.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * @author André Dietishiem
+ */
+public abstract class AbstractDeltaCloudCommand {
+
+ private DeltaCloud cloud;
+
+ public AbstractDeltaCloudCommand(DeltaCloud cloud) {
+ Assert.isLegal(cloud != null);
+ this.cloud = cloud;
+ }
+
+ protected DeltaCloud getCloud() {
+ return cloud;
+ }
+
+ public abstract void execute();
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AbstractDeltaCloudCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllImageFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -23,6 +23,15 @@
private IFieldMatcher matcher = new AllFieldMatcher();
+
+ public AllImageFilter(DeltaCloud cloud) {
+ super(cloud);
+ }
+
+ protected DeltaCloudImage[] getCloudElements() throws DeltaCloudException {
+ return getCloud().getImages();
+ }
+
@Override
public boolean matches(DeltaCloudImage image) {
return true;
Modified: 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 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/AllInstanceFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -11,9 +11,18 @@
*/
public class AllInstanceFilter extends AbstractCloudElementFilter<DeltaCloudInstance> implements IInstanceFilter {
+ public AllInstanceFilter(DeltaCloud cloud) {
+ super(cloud);
+ }
+
private IFieldMatcher matcher = new AllFieldMatcher();
@Override
+ protected DeltaCloudInstance[] getCloudElements() throws DeltaCloudException {
+ return getCloud().getInstances();
+ }
+
+ @Override
public boolean matches(DeltaCloudInstance instance) {
return true;
}
@@ -52,5 +61,4 @@
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-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -167,10 +167,10 @@
private IInstanceFilter createInstanceFilter(String ruleString) {
IInstanceFilter instanceFilter = null;
if (IInstanceFilter.ALL_STRING.equals(ruleString)) {
- instanceFilter = new AllInstanceFilter();
+ instanceFilter = new AllInstanceFilter(this);
} else {
try {
- instanceFilter = new InstanceFilter();
+ instanceFilter = new InstanceFilter(this);
instanceFilter.setRules(ruleString);
} catch (PatternSyntaxException e) {
instanceFilter.setRules(IInstanceFilter.ALL_STRING);
@@ -194,10 +194,10 @@
private IImageFilter createImageFilter(String ruleString) {
IImageFilter imageFilter = null;
if (IImageFilter.ALL_STRING.equals(ruleString)) {
- imageFilter = new AllImageFilter();
+ imageFilter = new AllImageFilter(this);
} else {
try {
- imageFilter = new ImageFilter();
+ imageFilter = new ImageFilter(this);
imageFilter.setRules(ruleString);
} catch (PatternSyntaxException e) {
imageFilter.setRules(IImageFilter.ALL_STRING);
@@ -340,22 +340,26 @@
*
* @see #notifyInstanceListListeners(DeltaCloudInstance[])
*/
- private DeltaCloudInstance[] loadInstances() throws DeltaCloudException {
+ private void loadInstances() throws DeltaCloudException {
try {
clearInstances();
if (instances == null) {
instances = new DeltaCloudInstancesRepository();
}
instances.add(client.listInstances(), this);
- // TODO: remove notification with all instances, replace by
- // notifying the changed instance
- return notifyInstanceListListeners(instances.get());
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(MessageFormat.format("Could not load instances of cloud {0}: {1}",
getName(), e.getMessage()), e);
}
}
+ private void clearImages() {
+ if (images != null) {
+ images.clear();
+ notifyImageListListeners(images.get());
+ }
+ }
+
private void clearInstances() {
if (instances != null) {
instances.clear();
@@ -363,27 +367,47 @@
}
}
- private void clearImages() {
- if (images != null) {
- images.clear();
- notifyImageListListeners(images.get());
+ protected DeltaCloudInstance[] getInstances() throws DeltaCloudException {
+ if (instances == null) {
+ loadInstances();
}
+ return instances.get();
}
- public DeltaCloudInstance[] getInstances() throws DeltaCloudException {
+ protected void asyncGetInstances() throws DeltaCloudException {
if (instances == null) {
- return loadInstances();
+ loadInstances();
}
- return instances.get();
+ notifyInstanceListListeners(instances.get());
}
- public DeltaCloudImage[] getImages() throws DeltaCloudException {
+ protected DeltaCloudImage[] getImages() throws DeltaCloudException {
if (images == null) {
- return loadImages();
+ loadImages();
}
return images.get();
}
+ protected void asyncGetImages() throws DeltaCloudException {
+ if (images == null) {
+ loadImages();
+ }
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
+ notifyImageListListeners(images.get());
+ }
+
+ public DeltaCloudImage getImage(String id) throws DeltaCloudException {
+ DeltaCloudImage matchingImage = null;
+ for (DeltaCloudImage image : getImages()) {
+ if (id.equals(image.getId())) {
+ matchingImage = image;
+ break;
+ }
+ }
+ return matchingImage;
+ }
+
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
try {
client.createKey(keyname, keystoreLocation);
@@ -496,16 +520,13 @@
*
* @see #notifyImageListListeners(DeltaCloudImage[])
*/
- private DeltaCloudImage[] loadImages() throws DeltaCloudException {
+ private void loadImages() throws DeltaCloudException {
try {
clearImages();
if (images == null) {
images = new DeltaCloudImagesRepository();
}
images.add(client.listImages(), this);
- // TODO: remove notification with all instances, replace by
- // notifying the changed instance
- return notifyImageListListeners(images.get());
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(MessageFormat.format("Could not load images of cloud {0}: {1}",
getName(), e.getMessage()), e);
@@ -521,7 +542,7 @@
throw new DeltaCloudException(e);
}
}
-
+
public boolean testConnection() throws DeltaCloudException {
String instanceId = "nonexistingInstance"; //$NON-NLS-1$
try {
@@ -563,7 +584,7 @@
getInstances(); // make sure instances are initialized
DeltaCloudInstance deltaCloudInstance = instances.add(instance, this);
deltaCloudInstance.setGivenName(name);
- notifyInstanceListListeners(getInstances());
+ notifyInstanceListListeners(instances.get());
return deltaCloudInstance;
}
} catch (DeltaCloudClientException e) {
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetImagesCommand.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetImagesCommand.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetImagesCommand.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class GetImagesCommand extends AbstractDeltaCloudCommand {
+
+ public GetImagesCommand(DeltaCloud cloud) {
+ super(cloud);
+ }
+
+ public void execute() {
+ // TODO: internationalize strings
+ new AbstractCloudJob(
+ MessageFormat.format("Get images from cloud {0}", getCloud().getName())) {
+
+ @Override
+ protected IStatus doRun(IProgressMonitor monitor) throws DeltaCloudException {
+ getCloud().asyncGetImages();
+ return Status.OK_STATUS;
+ }
+
+ }.schedule();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetImagesCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetInstancesCommand.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetInstancesCommand.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetInstancesCommand.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+import java.text.MessageFormat;
+
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+
+/**
+ * @author Andre Dietisheim
+ */
+public class GetInstancesCommand extends AbstractDeltaCloudCommand {
+
+ public GetInstancesCommand(DeltaCloud cloud) {
+ super(cloud);
+ }
+
+ public void execute() {
+ // TODO: internationalize strings
+ new AbstractCloudJob(
+ MessageFormat.format("Get instances from cloud {0}", getCloud().getName())) {
+
+ @Override
+ protected IStatus doRun(IProgressMonitor monitor) throws DeltaCloudException {
+ getCloud().asyncGetInstances();
+ return Status.OK_STATUS;
+ }
+
+ }.schedule();
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/GetInstancesCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -35,10 +35,8 @@
+ ALL_MATCHER_EXPRESSION + EXPRESSION_DELIMITER // arch
+ ALL_MATCHER_EXPRESSION; // desc
- public Collection<CLOUDELEMENT> filter(CLOUDELEMENT[] cloudElements);
+ public Collection<CLOUDELEMENT> filter() throws DeltaCloudException;
-// public boolean matches(CLOUDELEMENT cloudElement);
-
public void setRules(String ruleString);
public IFieldMatcher getNameRule();
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageListListener.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageListListener.java 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageListListener.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -12,6 +12,6 @@
public interface IImageListListener {
- public void listChanged(DeltaCloud cloud, DeltaCloudImage[] list);
+ public void listChanged(DeltaCloud cloud, DeltaCloudImage[] imges);
}
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-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -24,6 +24,11 @@
public class ImageFilter extends AbstractCloudElementFilter<DeltaCloudImage> implements IImageFilter {
private IFieldMatcher archRule;
+
+ public ImageFilter(DeltaCloud cloud) {
+ super(cloud);
+ }
+
private IFieldMatcher descRule;
@Override
@@ -55,4 +60,9 @@
public IFieldMatcher getDescRule() {
return descRule;
}
+
+ @Override
+ protected DeltaCloudImage[] getCloudElements() throws DeltaCloudException {
+ return getCloud().getImages();
+ }
}
Modified: 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 2010-12-06 09:55:37 UTC (rev 27182)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/InstanceFilter.java 2010-12-06 10:21:22 UTC (rev 27183)
@@ -23,6 +23,10 @@
*/
public class InstanceFilter extends AbstractCloudElementFilter<DeltaCloudInstance> implements IInstanceFilter {
+ public InstanceFilter(DeltaCloud cloud) {
+ super(cloud);
+ }
+
private IFieldMatcher imageIdRule;
private IFieldMatcher realmRule;
private IFieldMatcher profileRule;
@@ -83,4 +87,9 @@
public IFieldMatcher getRealmRule() {
return realmRule;
}
+
+ @Override
+ protected DeltaCloudInstance[] getCloudElements() throws DeltaCloudException {
+ return getCloud().getInstances();
+ }
}
14 years, 1 month
JBoss Tools SVN: r27182 - in trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: fixes and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-12-06 04:55:37 -0500 (Mon, 06 Dec 2010)
New Revision: 27182
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-7816 NewProjectExamplesWizard blocks UI for a long time!
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2010-12-06 07:57:39 UTC (rev 27181)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2010-12-06 09:55:37 UTC (rev 27182)
@@ -77,6 +77,7 @@
public static String ProjectUtil_Invalid_property;
public static String ProjectUtil_Invalid_URL;
public static String ProjectUtil_Invalid_welcome_element;
+ public static String ProjectUtil_Parsing_project_description_files;
public static String ProjectUtil_Test;
public static String SeamRuntimeFix_Invalid_seam_runtime_fix;
public static String SiteDialog_Add_Project_Example_Site;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-12-06 07:57:39 UTC (rev 27181)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2010-12-06 09:55:37 UTC (rev 27182)
@@ -45,7 +45,7 @@
private static final String ESB = "esb"; //$NON-NLS-1$
private static final String PORTLET = "portlet"; //$NON-NLS-1$
private static final String REQUIRED_COMPONENTS = "required-components"; //$NON-NLS-1$
- private static final IPath ESB_SERVER_SUPPLIED_CONTAINER_PATH = new Path("org.jboss.esb.runtime.classpath/server.supplied");
+ private static final IPath ESB_SERVER_SUPPLIED_CONTAINER_PATH = new Path("org.jboss.esb.runtime.classpath/server.supplied"); //$NON-NLS-1$
public boolean canFix(Project project, ProjectFix fix) {
if (!ProjectFix.WTP_RUNTIME.equals(fix.getType())) {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2010-12-06 07:57:39 UTC (rev 27181)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2010-12-06 09:55:37 UTC (rev 27182)
@@ -64,6 +64,7 @@
ProjectUtil_Invalid_property=Invalid property.
ProjectUtil_Invalid_URL=Invalid URL\: {0}
ProjectUtil_Invalid_welcome_element=The welcome element has invalid the url attribute
+ProjectUtil_Parsing_project_description_files=Parsing project description files...
ProjectUtil_Test=Test
NewProjectExamplesWizardPage_Site=Site\:
SeamRuntimeFix_Invalid_seam_runtime_fix=Invalid Seam runtime fix in {0}.
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-12-06 07:57:39 UTC (rev 27181)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2010-12-06 09:55:37 UTC (rev 27182)
@@ -23,7 +23,6 @@
import java.net.URI;
import java.net.URL;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@@ -209,7 +208,8 @@
return null;
}
- public static List<Category> getProjects() {
+ public static List<Category> getProjects(IProgressMonitor monitor) {
+ monitor.setTaskName(Messages.ProjectUtil_Parsing_project_description_files);
Set<ProjectExampleSite> sites = getSites();
List<Category> list = new ArrayList<Category>();
invalidSites.clear();
@@ -220,13 +220,22 @@
if (!showExperimentalSites && site.isExperimental()) {
continue;
}
+ if (monitor.isCanceled()) {
+ invalidSites.add(site);
+ continue;
+ }
File file = getProjectExamplesFile(site.getUrl(),
- "projectExamples", ".xml", null); //$NON-NLS-1$ //$NON-NLS-2$
+ "projectExamples", ".xml", monitor); //$NON-NLS-1$ //$NON-NLS-2$
+ if (monitor.isCanceled()) {
+ invalidSites.add(site);
+ continue;
+ }
if (file == null || !file.exists() || !file.isFile()) {
ProjectExamplesActivator.log(NLS.bind(Messages.ProjectUtil_Invalid_URL,site.getUrl().toString()));
invalidSites.add(site);
continue;
}
+
DocumentBuilderFactory dbf = DocumentBuilderFactory
.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
@@ -419,10 +428,19 @@
return null;
} else {
try {
+ if (monitor.isCanceled()) {
+ return null;
+ }
file = File.createTempFile(prefix, suffix);
file.deleteOnExit();
+ if (monitor.isCanceled()) {
+ return null;
+ }
BufferedOutputStream destination = new BufferedOutputStream(
new FileOutputStream(file));
+ if (monitor.isCanceled()) {
+ return null;
+ }
IStatus result = getTransport().download(prefix,
url.toExternalForm(), destination, monitor);
if (!result.isOK()) {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-12-06 07:57:39 UTC (rev 27181)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2010-12-06 09:55:37 UTC (rev 27182)
@@ -11,6 +11,7 @@
package org.jboss.tools.project.examples.wizard;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
@@ -18,8 +19,11 @@
import java.util.Set;
import java.util.TreeSet;
+import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
+import org.eclipse.jface.dialogs.ProgressMonitorDialog;
+import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.util.Geometry;
@@ -80,6 +84,7 @@
private PageBook notesPageBook;
private Composite noteEmptyComposite;
private Composite noteComposite;
+ private List<Category> categories;
public NewProjectExamplesWizardPage() {
super("org.jboss.tools.project.examples"); //$NON-NLS-1$
@@ -116,8 +121,7 @@
new Label(siteComposite,SWT.NONE).setText(Messages.NewProjectExamplesWizardPage_Site);
siteCombo = new Combo(siteComposite,SWT.READ_ONLY);
siteCombo.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
- String[] items = getItems();
- siteCombo.setItems(items);
+
siteCombo.setText(ProjectExamplesActivator.ALL_SITES);
new Label(composite,SWT.NONE).setText(Messages.NewProjectExamplesWizardPage_Projects);
@@ -141,7 +145,6 @@
viewer.setLabelProvider(new ProjectLabelProvider());
viewer.setContentProvider(new ProjectContentProvider());
- refresh(viewer, false);
final SiteFilter siteFilter = new SiteFilter();
viewer.addFilter(siteFilter);
@@ -303,6 +306,7 @@
setControl(composite);
configureSizeAndLocation();
+ refresh(viewer, false);
}
private void configureSizeAndLocation() {
@@ -409,10 +413,22 @@
AdaptableList input = new AdaptableList(getCategories(show));
viewer.setInput(input);
viewer.refresh();
+ String[] items = getItems();
+ siteCombo.setItems(items);
}
private List<Category> getCategories(boolean show) {
- List<Category> categories = ProjectUtil.getProjects();
+ IRunnableWithProgress op = new IRunnableWithProgress() {
+
+ public void run(IProgressMonitor monitor) {
+ categories = ProjectUtil.getProjects(monitor);
+ }
+ };
+ try {
+ new ProgressMonitorDialog(getShell()).run(true, true, op);
+ } catch (Exception e) {
+ ProjectExamplesActivator.log(e);
+ }
HashSet<ProjectExampleSite> invalidSites = ProjectUtil.getInvalidSites();
boolean showInvalidSites = ProjectExamplesActivator.getDefault().getPreferenceStore().getBoolean(ProjectExamplesActivator.SHOW_INVALID_SITES);
if (invalidSites.size() > 0 && showInvalidSites && show) {
@@ -428,7 +444,7 @@
}
private String[] getItems() {
- List<Category> categories = getCategories(true);
+ //List<Category> categories = getCategories(true);
Set<String> sites = new TreeSet<String>();
sites.add(ProjectExamplesActivator.ALL_SITES);
for (Category category:categories) {
14 years, 1 month
JBoss Tools SVN: r27181 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-12-06 02:57:39 -0500 (Mon, 06 Dec 2010)
New Revision: 27181
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7688] cleanup
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-12-06 04:51:08 UTC (rev 27180)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-12-06 07:57:39 UTC (rev 27181)
@@ -187,7 +187,7 @@
String rules = getImageFilter().toString();
this.imageFilter = createImageFilter(ruleString);
if (!rules.equals(ruleString)) {
- notifyImageListListeners(getImages());
+ notifyImageListListeners(images.get());
}
}
14 years, 1 month
JBoss Tools SVN: r27180 - in trunk: archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-05 23:51:08 -0500 (Sun, 05 Dec 2010)
New Revision: 27180
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
Log:
JBIDE-7199 - jdtCompilerAdapter issue - whew
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2010-12-06 04:48:21 UTC (rev 27179)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2010-12-06 04:51:08 UTC (rev 27180)
@@ -57,7 +57,7 @@
public static boolean copyFile(String source, de.schlichtherle.io.File file) {
file.getParentFile().mkdirs();
- boolean b = new de.schlichtherle.io.File(source).archiveCopyAllTo(file);
+ boolean b = new de.schlichtherle.io.File(source, ArchiveDetector.NULL).archiveCopyAllTo(file);
return b && updateParentTimestamps(file);
}
Modified: trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java
===================================================================
--- trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java 2010-12-06 04:48:21 UTC (rev 27179)
+++ trunk/archives/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/projects/InnerZipResourceTimestampTest.java 2010-12-06 04:51:08 UTC (rev 27180)
@@ -65,15 +65,14 @@
} catch(IOException ioe){}
return null;
}
-
+
public void testRawTruezipTimestamps() {
java.io.File someJar = findSomeJar();
IPath src = new Path(someJar.getAbsolutePath());
IPath dest = ArchivesTest.getDefault().getStateLocation().append("some.jar");
- //File destFile = new de.schlichtherle.io.File(dest.toOSString(), new PureSourceArchiveDetector());
- File destFile = new de.schlichtherle.io.File(dest.toOSString(), ArchiveDetector.NULL);
+ File destFile = new de.schlichtherle.io.File(dest.toOSString(), ArchiveDetector.DEFAULT);
- boolean copySuccess = new de.schlichtherle.io.File(someJar).archiveCopyAllTo(destFile);
+ boolean copySuccess = new de.schlichtherle.io.File(someJar, ArchiveDetector.NULL).archiveCopyAllTo(destFile);
destFile.setLastModified(new Date().getTime());
TrueZipUtil.umount();
assertTrue(copySuccess);
@@ -146,11 +145,4 @@
e.printStackTrace();
}
}
-
-
- private static class PureSourceArchiveDetector extends AbstractArchiveDetector {
- public ArchiveDriver getArchiveDriver(String path) {
- return null;
- }
- }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-12-06 04:48:21 UTC (rev 27179)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2010-12-06 04:51:08 UTC (rev 27180)
@@ -264,7 +264,7 @@
IModuleFile mf = (IModuleFile)children[i];
java.io.File source = getFile(mf);
de.schlichtherle.io.File destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
- boolean b = new de.schlichtherle.io.File(source).archiveCopyAllTo(destination);
+ boolean b = new de.schlichtherle.io.File(source, ArchiveDetector.NULL).archiveCopyAllTo(destination);
if( !b )
results.add(generateCopyFailStatus(source, destination));
} else if( children[i] instanceof IModuleFolder ) {
@@ -290,7 +290,7 @@
protected de.schlichtherle.io.File getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
while(relative.segmentCount() > 0 ) {
root = new de.schlichtherle.io.File(root,
- relative.segment(0), ArchiveDetector.DEFAULT);
+ relative.segment(0), ArchiveDetector.NULL);
relative = relative.removeFirstSegments(1);
}
return root;
14 years, 1 month
JBoss Tools SVN: r27179 - trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/META-INF.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2010-12-05 23:48:21 -0500 (Sun, 05 Dec 2010)
New Revision: 27179
Modified:
trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF
Log:
JBIDE-7812 build error
Modified: trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2010-12-04 20:37:57 UTC (rev 27178)
+++ trunk/archives/plugins/org.jboss.ide.eclipse.archives.core/META-INF/MANIFEST.MF 2010-12-06 04:48:21 UTC (rev 27179)
@@ -24,6 +24,7 @@
lib/jboss-common-core-2.2.1.GA.jar,
lib/truezip-6.6.jar
Export-Package: de.schlichtherle.io;x-friends:="org.jboss.ide.eclipse.archives.test",
+ de.schlichtherle.io.archive.spi,
org.jboss.ide.eclipse.archives.core,
org.jboss.ide.eclipse.archives.core.ant,
org.jboss.ide.eclipse.archives.core.asf,
14 years, 1 month
JBoss Tools SVN: r27178 - trunk/download.jboss.org/jbosstools/requirements.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-12-04 15:37:57 -0500 (Sat, 04 Dec 2010)
New Revision: 27178
Modified:
trunk/download.jboss.org/jbosstools/requirements/index.html
Log:
make index.html a redirect into helios/
Modified: trunk/download.jboss.org/jbosstools/requirements/index.html
===================================================================
--- trunk/download.jboss.org/jbosstools/requirements/index.html 2010-12-04 20:26:35 UTC (rev 27177)
+++ trunk/download.jboss.org/jbosstools/requirements/index.html 2010-12-04 20:37:57 UTC (rev 27178)
@@ -1,98 +1,5 @@
<html>
<head>
-<title>JBoss Tools Build Requirements - Helios (Eclipse 3.6 / Web Tools 3.2)</title>
-<style>
-@import url("../web/site.css");
-</style>
+<meta http-equiv="refresh" content="0;url=helios/">
</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 Build Requirements - Helios (Eclipse 3.6 / Web Tools 3.2)</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/requirements/helios/\(.\+\)$#<li><a class=link href=helios/\1>\1<\/a></li>#g
-
-Then sftp file into
-
-tools(a)filemgmt.jboss.org/downloads_htdocs/tools/requirements/helios/
-
-which becomes
-
-http://download.jboss.org/jbosstools/requirements/helios/
-
--->
- <br/>
- <ul>
-<li><a class=link href=helios/GEF-runtime-M201007121555.zip>GEF-runtime-M201007121555.zip</a></li>
-<li><a class=link href=helios/GEF-zest-M201007121555.zip>GEF-zest-M201007121555.zip</a></li>
-<li><a class=link href=helios/README.txt>README.txt</a></li>
-<li><a class=link href=helios/Subvsve079.I201005121900_SVNconn222.I201005121900_SVNKit133.6648_JNA323_ECF310.v201005082345-Update.zip>Subvsve079.I201005121900_SVNconn222.I201005121900_SVNKit133.6648_JNA323_ECF310.v201005082345-Update.zip</a></li>
-<li><a class=link href=helios/b3.aggregator-repo-0.1.0.r01001_e36.zip>b3.aggregator-repo-0.1.0.r01001_e36.zip</a></li>
-<li><a class=link href=helios/birt-report-framework-2_6_0.zip>birt-report-framework-2_6_0.zip</a></li>
-<li><a class=link href=helios/birt-wtp-integration-sdk-2_6_0.zip>birt-wtp-integration-sdk-2_6_0.zip</a></li>
-<li><a class=link href=helios/buckminster-repo-1.3.0.r11439_e36.zip>buckminster-repo-1.3.0.r11439_e36.zip</a></li>
-<li><a class=link href=helios/buckminster-updates-3.5_20100125-r11098.zip>buckminster-updates-3.5_20100125-r11098.zip</a></li>
-<li><a class=link href=helios/dtp_1.8.0.zip>dtp_1.8.0.zip</a></li>
-<li><a class=link href=helios/eclipse-SDK-3.6-linux-gtk-x86_64.tar.gz>eclipse-SDK-3.6-linux-gtk-x86_64.tar.gz</a></li>
-<li><a class=link href=helios/eclipse-SDK-3.6-linux-gtk.tar.gz>eclipse-SDK-3.6-linux-gtk.tar.gz</a></li>
-<li><a class=link href=helios/eclipse-SDK-3.6-macosx-carbon.tar.gz>eclipse-SDK-3.6-macosx-carbon.tar.gz</a></li>
-<li><a class=link href=helios/eclipse-SDK-3.6-macosx-cocoa.tar.gz>eclipse-SDK-3.6-macosx-cocoa.tar.gz</a></li>
-<li><a class=link href=helios/eclipse-SDK-3.6-win32.zip>eclipse-SDK-3.6-win32.zip</a></li>
-<li><a class=link href=helios/eclipse-test-framework-3.6.zip>eclipse-test-framework-3.6.zip</a></li>
-<li><a class=link href=helios/emf-runtime-2.6.0.zip>emf-runtime-2.6.0.zip</a></li>
-<li><a class=link href=helios/m2eclipse/build.xml>m2eclipse/build.xml</a></li>
-<li><a class=link href=helios/m2eclipse-0.10.0.20100209-0800.zip>m2eclipse-0.10.0.20100209-0800.zip</a></li>
-<li><a class=link href=helios/org.eclipse.equinox.transforms.hook_1.0.200.v20100503.jar>org.eclipse.equinox.transforms.hook_1.0.200.v20100503.jar</a></li>
-<li><a class=link href=helios/org.eclipse.equinox.transforms.xslt_1.0.200.v20100503.jar>org.eclipse.equinox.transforms.xslt_1.0.200.v20100503.jar</a></li>
-<li><a class=link href=helios/org.eclipse.releng.basebuilder_R36_RC4.zip>org.eclipse.releng.basebuilder_R36_RC4.zip</a></li>
-<li><a class=link href=helios/org.eclipse.swtbot.eclipse-2.0.1.20101106_1831-73ca7af-dev-e36.zip>org.eclipse.swtbot.eclipse-2.0.1.20101106_1831-73ca7af-dev-e36.zip</a></li>
-<li><a class=link href=helios/org.eclipse.swtbot.eclipse.gef-2.0.1.20101106_1831-73ca7af-dev-e36.zip>org.eclipse.swtbot.eclipse.gef-2.0.1.20101106_1831-73ca7af-dev-e36.zip</a></li>
-<li><a class=link href=helios/org.eclipse.swtbot.eclipse.test.junit4-2.0.1.20101106_1831-73ca7af-dev-e36.zip>org.eclipse.swtbot.eclipse.test.junit4-2.0.1.20101106_1831-73ca7af-dev-e36.zip</a></li>
-<li><a class=link href=helios/swtbot-update-site-2.0.1.20101106_1831-73ca7af-dev-e36.zip>swtbot-update-site-2.0.1.20101106_1831-73ca7af-dev-e36.zip</a></li>
-<li><a class=link href=helios/svn/build.xml>svn/build.xml</a></li>
-<li><a class=link href=helios/tptp.runtime-TPTP-4.7.0.zip>tptp.runtime-TPTP-4.7.0.zip</a></li>
-<li><a class=link href=helios/wtp-R-3.2.0-20100615235519.zip>wtp-R-3.2.0-20100615235519.zip</a></li>
-<li><a class=link href=helios/xsd-runtime-2.6.0.zip>xsd-runtime-2.6.0.zip</a></li>
-<li><a class=link href=helios/xulrunner/README.txt>xulrunner</a></li>
- </ul>
- <br/>
- </td>
- </tr>
-
- <tr class="light-row" style="height: 30px">
- <td class="bodyText">
- <p class="bodyText">Looking to download JBoss Tools? See <a class="link"
- href="http://www.jboss.org/tools/download">JBoss Tools
- Downloads</a>. See also <a
- href="http://www.jboss.org/tools/download/installation">Installation
- methods</a>.</p>
- </td>
- </tr>
- </table>
- </td>
- </tr>
-</table>
-</html>
+<body></body></html>
14 years, 1 month