JBoss Tools SVN: r26727 - 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-11-18 12:17:46 -0500 (Thu, 18 Nov 2010)
New Revision: 26727
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
[JBIDE-7628] renamed notification method (to better reflect what it notifies)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-11-18 17:17:15 UTC (rev 26726)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-11-18 17:17:46 UTC (rev 26727)
@@ -105,7 +105,7 @@
}
@Override
- public void changeEvent(int type) {
+ public void cloudsChanged(int type) {
viewer.setInput(new CVRootElement(viewer));
}
15 years, 5 months
JBoss Tools SVN: r26726 - 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-11-18 12:17:15 -0500 (Thu, 18 Nov 2010)
New Revision: 26726
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
Log:
[JBIDE-7628] getClouds() can throw DeltaCloudException now (since it may trigger cloud loading) -> added proper exception catching & reporting
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-11-18 17:16:14 UTC (rev 26725)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVRootElement.java 2010-11-18 17:17:15 UTC (rev 26726)
@@ -27,21 +27,8 @@
public CVRootElement(TreeViewer viewer) {
super(DeltaCloudManager.getDefault(), "root"); //$NON-NLS-1$
this.viewer = viewer;
- loadClouds();
}
- private void loadClouds() {
- try {
- DeltaCloudManager.getDefault().loadClouds();
- } catch (DeltaCloudException e) {
- // TODO: internationalize strings
- ErrorUtils.openErrorDialog(
- "Error",
- "Errors occurred while loading all clouds",
- e, Display.getDefault().getActiveShell());
- }
- }
-
@Override
public IPropertySource getPropertySource() {
// no property source for the root element
@@ -52,14 +39,23 @@
public Object[] getChildren() {
if (!initialized) {
DeltaCloudManager m = DeltaCloudManager.getDefault();
- DeltaCloud[] clouds = m.getClouds();
- for (int i = 0; i < clouds.length; ++i) {
- DeltaCloud cloud = clouds[i];
- CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
- addChild(e);
+ m.removeCloudManagerListener(this);
+ try {
+ DeltaCloud[] clouds = m.getClouds();
+ for (int i = 0; i < clouds.length; ++i) {
+ DeltaCloud cloud = clouds[i];
+ CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
+ addChild(e);
+ }
+ m.addCloudManagerListener(this);
+ initialized = true;
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ ErrorUtils.openErrorDialog(
+ "Error",
+ "Could not get all clouds",
+ e, Display.getDefault().getActiveShell());
}
- m.addCloudManagerListener(this);
- initialized = true;
}
return super.getChildren();
}
@@ -70,23 +66,31 @@
super.finalize();
}
- public void changeEvent(int type) {
+ public void cloudsChanged(int type) {
DeltaCloudManager m = DeltaCloudManager.getDefault();
- m.removeCloudManagerListener(this);
- DeltaCloud[] clouds = m.getClouds();
- for (int i = 0; i < clouds.length; ++i) {
- DeltaCloud cloud = clouds[i];
- CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
- addChild(e);
+ try {
+ m.removeCloudManagerListener(this);
+ DeltaCloud[] clouds = m.getClouds();
+ for (int i = 0; i < clouds.length; ++i) {
+ DeltaCloud cloud = clouds[i];
+ CVCloudElement e = new CVCloudElement(cloud, cloud.getName(), viewer);
+ addChild(e);
+ }
+ initialized = true;
+ m.addCloudManagerListener(this);
+ Display.getDefault().asyncExec(new Runnable() {
+ @Override
+ public void run() {
+ ((TreeViewer) viewer).refresh(this, false);
+ }
+ });
+ } catch (DeltaCloudException e) {
+ // TODO: internationalize strings
+ ErrorUtils.openErrorDialog(
+ "Error",
+ "Could not get all clouds",
+ e, Display.getDefault().getActiveShell());
}
- initialized = true;
- m.addCloudManagerListener(this);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- ((TreeViewer) viewer).refresh(this, false);
- }
- });
}
}
15 years, 5 months
JBoss Tools SVN: r26725 - 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-11-18 12:16:14 -0500 (Thu, 18 Nov 2010)
New Revision: 26725
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVTypeMapper.java
Log:
[JBIDE-7628] cleanup: removed warning
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVTypeMapper.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVTypeMapper.java 2010-11-18 17:13:04 UTC (rev 26724)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVTypeMapper.java 2010-11-18 17:16:14 UTC (rev 26725)
@@ -15,7 +15,7 @@
public class CVTypeMapper extends AbstractTypeMapper {
- @SuppressWarnings("unchecked")
+ @SuppressWarnings("rawtypes")
@Override
public Class mapType(Object object) {
if (object instanceof TreeNode) {
15 years, 5 months
JBoss Tools SVN: r26724 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-18 12:13:04 -0500 (Thu, 18 Nov 2010)
New Revision: 26724
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ServerTypeMockIntegrationTest.java
Log:
[JBIDE-7625] adapted to fake to comply to interface again
Modified: trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ServerTypeMockIntegrationTest.java
===================================================================
--- trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ServerTypeMockIntegrationTest.java 2010-11-18 17:12:07 UTC (rev 26723)
+++ trunk/deltacloud/tests/org.jboss.tools.deltacloud.test/src/org/jboss/tools/internal/deltacloud/test/core/client/ServerTypeMockIntegrationTest.java 2010-11-18 17:13:04 UTC (rev 26724)
@@ -94,8 +94,8 @@
sendRequest(new DeltaCloudRequest() {
@Override
- public String getUrl() {
- return MockIntegrationTestContext.DELTACLOUD_URL + "/DUMMY";
+ public URL getUrl() throws MalformedURLException {
+ return new URL(MockIntegrationTestContext.DELTACLOUD_URL + "/DUMMY");
}
@Override
15 years, 5 months
JBoss Tools SVN: r26723 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-18 12:12:07 -0500 (Thu, 18 Nov 2010)
New Revision: 26723
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
Log:
[JBIDE-7628]
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-18 17:11:48 UTC (rev 26722)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-18 17:12:07 UTC (rev 26723)
@@ -1,5 +1,14 @@
2010-11-18 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/deltacloud/core/ICloudManagerListener.java (cloudsChanged):
+ [JBIDE-7628] renamed notification method (to better reflect what it notifies)
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (removeCloud):
+ [JBIDE-7628] loadClouds made private -> no explicit loading by clients, clouds should be loaded if needed
+ (saveClouds):
+ (notifyCloudRename):
+ [JBIDE-7628] added proper throwing (no swallowing any more)
+ * src/org/jboss/tools/deltacloud/core/DeltaCloud.java (DeltaCloud):
+ [JBIDE-7628] cleanup (removed duplicate notification code)
* src/org/jboss/tools/deltacloud/core/client/request/DeltaCloudRequest.java (getUrl):
* src/org/jboss/tools/deltacloud/core/client/request/AbstractDeltaCloudRequest.java (getUrl):
[JBIDE-7593] need to return URL (not String)
@@ -12,11 +21,11 @@
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (DeltaCloud):
[JBIDE-7625] store password in the constructor
(editCloud):
- [JBIDE-7625] have to create new client when cloud was edited
+ [JBIDE-7625] have to create new client when cloud was edited
* src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (removeCloud):
[JBIDE-7625] removed check for pw on identical url any more since we now save the pw with the name of the cloud
- (loadCloud):
[JBIDE-7627] reinitialize cloud list when loading clouds (otherwise clouds loaded will simply get added to the existing ones)
+ (loadClouds):
2010-11-17 André Dietisheim <adietish(a)redhat.com>
15 years, 5 months
JBoss Tools SVN: r26722 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-18 12:11:48 -0500 (Thu, 18 Nov 2010)
New Revision: 26722
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudManagerListener.java
Log:
[JBIDE-7628] renamed notification method (to better reflect what it notifies)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudManagerListener.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudManagerListener.java 2010-11-18 17:10:50 UTC (rev 26721)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudManagerListener.java 2010-11-18 17:11:48 UTC (rev 26722)
@@ -16,5 +16,5 @@
public static int REMOVE_EVENT = 2;
public static int RENAME_EVENT = 3;
- void changeEvent(int type);
+ void cloudsChanged(int type);
}
15 years, 5 months
JBoss Tools SVN: r26721 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-18 12:10:50 -0500 (Thu, 18 Nov 2010)
New Revision: 26721
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
Log:
[JBIDE-7628] loadClouds made private -> no explicit loading by clients, clouds should be loaded if needed
[JBIDE-7628] added proper throwing (no swallowing any more)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-11-18 17:07:03 UTC (rev 26720)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-11-18 17:10:50 UTC (rev 26721)
@@ -35,13 +35,13 @@
private static final DeltaCloudManager INSTANCE = new DeltaCloudManager();
public final static String CLOUDFILE_NAME = "clouds.xml"; //$NON-NLS-1$
- private List<DeltaCloud> clouds = new ArrayList<DeltaCloud>();
+ private List<DeltaCloud> clouds;
private ListenerList cloudManagerListeners;
private DeltaCloudManager() {
}
- public void loadClouds() throws DeltaCloudException {
+ private void loadClouds() throws DeltaCloudException {
clouds = new ArrayList<DeltaCloud>(); // clear present clouds
DeltaCloudMultiException connectionException = new DeltaCloudMultiException("Errors occurred while loading clouds from the preferences");
IPath stateLocation = Activator.getDefault().getStateLocation();
@@ -121,7 +121,7 @@
return imageFilterRules;
}
- public void saveClouds() {
+ public void saveClouds() throws DeltaCloudException {
try {
File cloudFile = getOrCreateCloudFile();
if (cloudFile.exists()) {
@@ -135,7 +135,8 @@
p.close();
}
} catch (Exception e) {
- Activator.log(e);
+ // TODO: internationalize strings
+ throw new DeltaCloudException("Could not save clouds", e);
}
}
@@ -164,7 +165,10 @@
return INSTANCE;
}
- public DeltaCloud[] getClouds() {
+ public DeltaCloud[] getClouds() throws DeltaCloudException {
+ if (clouds == null) {
+ loadClouds();
+ }
return clouds.toArray(new DeltaCloud[clouds.size()]);
}
@@ -176,7 +180,7 @@
return null;
}
- public void addCloud(DeltaCloud d) {
+ public void addCloud(DeltaCloud d) throws DeltaCloudException {
clouds.add(d);
saveClouds();
notifyListeners(ICloudManagerListener.ADD_EVENT);
@@ -189,7 +193,7 @@
notifyListeners(ICloudManagerListener.REMOVE_EVENT);
}
- public void notifyCloudRename() {
+ public void notifyCloudRename() throws DeltaCloudException {
saveClouds();
notifyListeners(ICloudManagerListener.RENAME_EVENT);
}
@@ -209,7 +213,7 @@
if (cloudManagerListeners != null) {
Object[] listeners = cloudManagerListeners.getListeners();
for (int i = 0; i < listeners.length; ++i) {
- ((ICloudManagerListener) listeners[i]).changeEvent(type);
+ ((ICloudManagerListener) listeners[i]).cloudsChanged(type);
}
}
}
15 years, 5 months
JBoss Tools SVN: r26720 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-18 12:07:03 -0500 (Thu, 18 Nov 2010)
New Revision: 26720
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7628] cleanup (removed duplicate notification code)
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-11-18 16:28:11 UTC (rev 26719)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-18 17:07:03 UTC (rev 26720)
@@ -200,7 +200,7 @@
// save();
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
+ notifyInstanceListListeners();
}
}
@@ -296,13 +296,13 @@
imageListeners.remove(listener);
}
- public DeltaCloudImage[] notifyImageListeners() {
+ public DeltaCloudImage[] notifyImageListListeners() {
DeltaCloudImage[] images = cloneImagesArray();
notifyImageListListeners(images);
return images;
}
- public DeltaCloudInstance[] notifyInstanceListeners() {
+ public DeltaCloudInstance[] notifyInstanceListListeners() {
DeltaCloudInstance[] instances = cloneInstancesArray();
notifyInstanceListListeners(instances);
return instances;
@@ -407,7 +407,7 @@
}
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- return notifyInstanceListeners();
+ return notifyInstanceListListeners();
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(MessageFormat.format("Could not load instances of cloud {0}: {1}",
getName(), e.getMessage()), e);
@@ -418,7 +418,7 @@
private void clearInstances() {
synchronized (instanceLock) {
instances = new ArrayList<DeltaCloudInstance>();
- notifyInstanceListeners();
+ notifyInstanceListListeners();
}
}
@@ -427,9 +427,7 @@
if (instances == null) {
return loadInstances();
}
- DeltaCloudInstance[] instanceArray = new DeltaCloudInstance[instances.size()];
- instanceArray = instances.toArray(instanceArray);
- return instanceArray;
+ return cloneInstancesArray();
}
}
@@ -439,9 +437,7 @@
instances.remove(instance);
// TODO: remove notification with all instances, replace by notifying
// the changed instance
- DeltaCloudInstance[] instances = cloneInstancesArray();
- notifyInstanceListListeners(instances);
- return instances;
+ return notifyInstanceListListeners();
}
public void createKey(String keyname, String keystoreLocation) throws DeltaCloudException {
@@ -476,7 +472,7 @@
}
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
+ notifyInstanceListListeners();
}
}
@@ -493,8 +489,7 @@
if (!(retVal.getState().equals(DeltaCloudInstance.BOGUS))
&& !(inst.getState().equals(retVal.getState()))) {
instances.set(i, retVal);
- // TODO: is this correct? getCurrInstances notifies, too
- notifyInstanceListListeners(getCurrInstances());
+ notifyInstanceListListeners();
return retVal;
}
}
@@ -519,8 +514,7 @@
if (result) {
// TODO: remove notification with all instances, replace by
// notifying the changed instance
- notifyInstanceListListeners(instances
- .toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
+ notifyInstanceListListeners();
}
return result;
} catch (DeltaCloudClientException e) {
@@ -580,7 +574,7 @@
for (Iterator<Image> i = list.iterator(); i.hasNext();) {
addImage(i.next());
}
- return notifyImageListeners();
+ return notifyImageListListeners();
} catch (DeltaCloudClientException e) {
throw new DeltaCloudException(MessageFormat.format("Could not load images of cloud {0}: {1}",
getName(), e.getMessage()), e);
@@ -591,7 +585,7 @@
private void clearImages() {
synchronized (imageLock) {
images = new ArrayList<DeltaCloudImage>();
- notifyImageListeners();
+ notifyImageListListeners();
}
}
@@ -664,8 +658,7 @@
newInstance.setGivenName(name);
getCurrInstances(); // make sure instances are initialized
instances.add(newInstance);
- DeltaCloudInstance[] instanceArray = cloneInstancesArray();
- notifyInstanceListListeners(instanceArray);
+ notifyInstanceListListeners();
return newInstance;
}
} catch (DeltaCloudClientException e) {
15 years, 5 months
JBoss Tools SVN: r26719 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-18 11:28:11 -0500 (Thu, 18 Nov 2010)
New Revision: 26719
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
JBIDE-7616
https://jira.jboss.org/browse/JBIDE-7616
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2010-11-18 16:14:22 UTC (rev 26718)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2010-11-18 16:28:11 UTC (rev 26719)
@@ -553,6 +553,7 @@
assertTrue("Cannot find Rabbit among all animals, import 'animal.tame' is ignored", vs != null && !vs.isEmpty());
c = seamProject.getComponent("animals.wild");
+ d = c.getJavaDeclaration();
vs = d.getVariablesByName("Hare");
assertTrue("Cannot find Hare among wild animals, import 'animal.wild' is ignored", vs != null && !vs.isEmpty());
15 years, 5 months