JBoss Tools SVN: r26567 - trunk/thirdparty.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-11-15 12:05:53 -0500 (Mon, 15 Nov 2010)
New Revision: 26567
Added:
trunk/thirdparty/README.txt
Log:
add readme
Added: trunk/thirdparty/README.txt
===================================================================
--- trunk/thirdparty/README.txt (rev 0)
+++ trunk/thirdparty/README.txt 2010-11-15 17:05:53 UTC (rev 26567)
@@ -0,0 +1,7 @@
+THIS FOLDER IS OBSOLETE AND SAFE TO DELETE.
+
+Its purpose was to create a subset of Orbit for use w/ JBoss Tools, but that's no longer needed since we have the Target Platform repo:
+
+http://download.jboss.org/jbosstools/updates/target-platform/latest/
+
+~nickboldt, 2010/11/15 12:00 EST
15 years, 5 months
JBoss Tools SVN: r26566 - workspace/bbrodt.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-11-15 11:25:36 -0500 (Mon, 15 Nov 2010)
New Revision: 26566
Added:
workspace/bbrodt/org.eclipse.bpel.jboss.riftsaw.runtime/
Log:
Initial import.
15 years, 5 months
JBoss Tools SVN: r26565 - in trunk/vpe/plugins/org.jboss.tools.vpe: src/org/jboss/tools/vpe/editor/menu and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2010-11-15 11:15:16 -0500 (Mon, 15 Nov 2010)
New Revision: 26565
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties
trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
https://jira.jboss.org/browse/JBIDE-7584 , context menu was fixed.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties 2010-11-15 16:11:15 UTC (rev 26564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.properties 2010-11-15 16:15:16 UTC (rev 26565)
@@ -13,7 +13,7 @@
exportUserTagsTemplatesWizardDescription=Export User specified tag templates to the local file system
importUserTagsTemplatesWizardName=User specified tag templates
importUserTagsTemplatesWizardDescription=Import User specified tag templates from the local file system
-vpe.menu.preferences=Vpe Preferences
+vpe.menu.preferences=Visual Page Editor Preferences
vpe.toolbar.preferences=Preferences
vpe.toolbar.refresh=Refresh
vpe.toolbar.page_design_options=Page Design Options
@@ -22,4 +22,4 @@
vpe.toolbar.show_non_visual_tags=Show non-visual tags
vpe.toolbar.show_text_formatting=Show text formatting bar
vpe.toolbar.show_bundle_as_el=Show bundle's messages as EL expressions
-vpe.toolbar.name=VPE Toolbar
\ No newline at end of file
+vpe.toolbar.name=Visual Page Editor Toolbar
\ No newline at end of file
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-11-15 16:11:15 UTC (rev 26564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/plugin.xml 2010-11-15 16:15:16 UTC (rev 26565)
@@ -117,46 +117,6 @@
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.jboss.tools.vpe.editorContext"
sequence="M1+M2+Tab"/>
- <key
- commandId="org.jboss.tools.vpe.commands.preferencesCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+1"/>
- <key
- commandId="org.jboss.tools.vpe.commands.refreshCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+2"/>
- <key
- commandId="org.jboss.tools.vpe.commands.pageDesignOptionsCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+3"/>
- <key
- commandId="org.jboss.tools.vpe.commands.rotateEditorsCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+4"/>
- <key
- commandId="org.jboss.tools.vpe.commands.showBorderCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+5"/>
- <key
- commandId="org.jboss.tools.vpe.commands.showNonVisualTagsCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+6"/>
- <key
- commandId="org.jboss.tools.vpe.commands.showTextFormattingCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+7"/>
- <key
- commandId="org.jboss.tools.vpe.commands.showBundleAsELCommand"
- schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
- contextId="org.eclipse.ui.contexts.window"
- sequence="M1+M2+8"/>
</extension>
<extension
point="org.jboss.tools.jst.jsp.visulaEditorImplementations" id="org.jboss.tools.vpe.editor.VpeEditorPartFactory">
@@ -222,63 +182,6 @@
</dynamic>
</menuContribution>
<menuContribution
- locationURI="popup:org.eclipse.ui.popup.any?after=additions">
- <separator
- name="org.jboss.tools.separator.vpePrefs" visible="true" >
- </separator>
- <menu
- id="org.jboss.tools.vpe.menus.VpePreferences"
- label="%vpe.menu.preferences"
- mnemonic="M">
- <command
- commandId="org.jboss.tools.vpe.commands.preferencesCommand"
- icon="icons/preferences.gif"
- id="org.jboss.tools.vpe.menus.preferencesCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.refreshCommand"
- icon="icons/refresh.gif"
- id="org.jboss.tools.vpe.menus.refreshCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.pageDesignOptionsCommand"
- icon="icons/point_to_css.gif"
- id="org.jboss.tools.vpe.menus.pageDesignOptionsCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.rotateEditorsCommand"
- id="org.jboss.tools.vpe.menus.rotateEditorsCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.showBorderCommand"
- icon="icons/border.gif"
- style="toggle"
- id="org.jboss.tools.vpe.menus.showBorderCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.showNonVisualTagsCommand"
- icon="icons/non-visual-tags.gif"
- style="toggle"
- id="org.jboss.tools.vpe.menus.showNonVisualTagsCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.showTextFormattingCommand"
- icon="icons/text-formatting.gif"
- style="toggle"
- id="org.jboss.tools.vpe.menus.showTextFormattingCommand"
- mnemonic="S"/>
- <command
- commandId="org.jboss.tools.vpe.commands.showBundleAsELCommand"
- icon="icons/bundle-as-el.gif"
- style="toggle"
- id="org.jboss.tools.vpe.menus.showBundleAsELCommand"
- mnemonic="S"/>
- <visibleWhen checkEnabled="false">
- <reference definitionId="org.jboss.tools.ui.vpe.editor"/>
- </visibleWhen>
- </menu>
- </menuContribution>
- <menuContribution
locationURI="toolbar:org.jboss.tools.jst.jsp.toolbars.sampleToolbar?after=org.jboss.tools.jst.jsp.toolbars.i18">
<command
commandId="org.jboss.tools.vpe.commands.preferencesCommand"
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2010-11-15 16:11:15 UTC (rev 26564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/menu/VpeMenuCreator.java 2010-11-15 16:15:16 UTC (rev 26565)
@@ -13,12 +13,18 @@
import java.text.MessageFormat;
import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.widgets.Event;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.menus.IMenuService;
@@ -35,6 +41,7 @@
import org.jboss.tools.vpe.editor.menu.action.SelectThisTagAction;
import org.jboss.tools.vpe.editor.menu.action.StripTagAction;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.preferences.VpeEditorPreferencesPage;
import org.jboss.tools.vpe.editor.template.IZoomEventManager;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
@@ -95,8 +102,8 @@
menuManager.add(new InsertContributionItem(node));
addIfEnabled(new StripTagAction(node));
/*
- * https://jira.jboss.org/browse/JBIDE-7222 Adding ExternalizeStrings
- * dialog to the VPE context menu
+ * https://jira.jboss.org/browse/JBIDE-7222
+ * Adding ExternalizeStrings dialog to the VPE context menu
*/
if (ExternalizeStringsUtils.isSelectionCorrect(vpeMenuUtil
.getSelection())) {
@@ -105,7 +112,22 @@
addSeparator();
if (topLevelMenu) {
addZoomActions();
+ addSeparator();
}
+ /*
+ * https://jira.jboss.org/browse/JBIDE-7584
+ * Add Visual Page Editor Preferences Item to the context menu
+ */
+ menuManager.add(new ActionContributionItem(new Action() {
+ @Override
+ public void run() {
+ VpeEditorPreferencesPage.openPreferenceDialog();
+ }
+ @Override
+ public String getText() {
+ return VpeUIMessages.VPE_PREFERENCES_MENU_LABEL;
+ }
+ }));
addSeparator();
if (topLevelMenu) {
addIfEnabled(new DumpSourceAction());
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-11-15 16:11:15 UTC (rev 26564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2010-11-15 16:15:16 UTC (rev 26565)
@@ -163,6 +163,5 @@
public static String LIST_IS_EMPTY;
public static String COULD_NOT_OPEN_VPE_RESOURCES_DIALOG;
-
-
+ public static String VPE_PREFERENCES_MENU_LABEL;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-11-15 16:11:15 UTC (rev 26564)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2010-11-15 16:15:16 UTC (rev 26565)
@@ -153,4 +153,5 @@
# Other messages
CANNOT_LOAD_TAGLIBS_FROM_PAGE_CONTEXT=Cannot load taglibs from PageContext!
-COULD_NOT_OPEN_VPE_RESOURCES_DIALOG=Could not open Vpe Resources Dialog!
\ No newline at end of file
+COULD_NOT_OPEN_VPE_RESOURCES_DIALOG=Could not open Vpe Resources Dialog!
+VPE_PREFERENCES_MENU_LABEL=Preferences..
\ No newline at end of file
15 years, 5 months
JBoss Tools SVN: r26564 - 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-15 11:11:15 -0500 (Mon, 15 Nov 2010)
New Revision: 26564
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7581] fixed NPE with uninitialized instances list
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-15 16:06:18 UTC (rev 26563)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-15 16:11:15 UTC (rev 26564)
@@ -235,16 +235,21 @@
}
public DeltaCloudImage[] notifyImageListListeners() {
- DeltaCloudImage[] images = cloneImages();
+ DeltaCloudImage[] images = cloneImagesArray();
notifyImageListListeners(images);
return images;
}
- private DeltaCloudImage[] cloneImages() {
+ private DeltaCloudImage[] cloneImagesArray() {
DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
return images.toArray(imageArray);
}
+ private DeltaCloudInstance[] cloneInstancesArray() {
+ DeltaCloudInstance[] instanceArray = new DeltaCloudInstance[instances.size()];
+ return instances.toArray(instanceArray);
+ }
+
public void notifyImageListListeners(DeltaCloudImage[] array) {
Object[] listeners = imageListeners.getListeners();
for (int i = 0; i < listeners.length; ++i)
@@ -485,7 +490,7 @@
if (images == null) {
return loadImages();
}
- return cloneImages();
+ return cloneImagesArray();
}
}
@@ -539,9 +544,9 @@
if (instance != null) {
DeltaCloudInstance newInstance = new DeltaCloudInstance(this, instance);
newInstance.setGivenName(name);
+ getCurrInstances(); // make sure instances are initialized
instances.add(newInstance);
- DeltaCloudInstance[] instanceArray = new DeltaCloudInstance[instances.size()];
- instanceArray = instances.toArray(instanceArray);
+ DeltaCloudInstance[] instanceArray = cloneInstancesArray();
notifyInstanceListListeners(instanceArray);
return newInstance;
}
15 years, 5 months
JBoss Tools SVN: r26563 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-15 11:06:18 -0500 (Mon, 15 Nov 2010)
New Revision: 26563
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java
Log:
[JBIDE-7581] cleanup, added copyright header
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java 2010-11-15 15:43:57 UTC (rev 26562)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeys.java 2010-11-15 16:06:18 UTC (rev 26563)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.internal.deltacloud.ui.wizards;
import org.eclipse.jface.wizard.Wizard;
@@ -9,34 +19,31 @@
private String fileExtension;
private ManageKeysPage mainPage;
private String keyname;
-
+
public ManageKeys(DeltaCloud cloud, String fileExtension) {
this.cloud = cloud;
this.fileExtension = fileExtension;
}
-
+
public String getKeyName() {
return keyname;
}
-
+
@Override
public void addPages() {
- // TODO Auto-generated method stub
mainPage = new ManageKeysPage(cloud, fileExtension);
addPage(mainPage);
}
-
+
@Override
public boolean canFinish() {
return mainPage.isPageComplete();
}
-
+
@Override
public boolean performFinish() {
String currFile = mainPage.getCurrFile();
- keyname = currFile.substring(0,
- currFile.length() - fileExtension.length());
- // TODO Auto-generated method stub
+ keyname = currFile.substring(0, currFile.length() - fileExtension.length());
return true;
}
15 years, 5 months
JBoss Tools SVN: r26562 - workspace.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-11-15 10:43:57 -0500 (Mon, 15 Nov 2010)
New Revision: 26562
Added:
workspace/bbrodt/
Log:
15 years, 5 months
JBoss Tools SVN: r26561 - in trunk/deltacloud/plugins: org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-15 10:37:10 -0500 (Mon, 15 Nov 2010)
New Revision: 26561
Removed:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.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/CVCloudElement.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/ImageViewLabelAndContentProvider.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/CloudViewElementUtils.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.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/ImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java
Log:
[JBIDE-7581] corrected image lookup to lookup locally and on the server. launch instance unfortunately still fails.
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-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -82,7 +82,7 @@
}
public void editCloud(String name, String url, String username, String passwd, String type)
- throws MalformedURLException {
+ throws MalformedURLException, DeltaCloudException {
this.client = new DeltaCloudClientImpl(url, username, passwd); //$NON-NLS-1$
this.url = url;
this.name = name;
@@ -147,7 +147,7 @@
return instanceFilter;
}
- public void updateInstanceFilter(String ruleString) {
+ public void updateInstanceFilter(String ruleString) throws Exception {
String rules = getInstanceFilter().toString();
instanceFilter = createInstanceFilter(ruleString);
if (!rules.equals(ruleString)) {
@@ -177,7 +177,7 @@
return imageFilter;
}
- public void updateImageFilter(String ruleString) {
+ public void updateImageFilter(String ruleString) throws Exception {
String rules = getImageFilter().toString();
this.imageFilter = createImageFilter(ruleString);
if (!rules.equals(ruleString)) {
@@ -201,17 +201,9 @@
return imageFilter;
}
- public void loadChildren() {
- Thread t = new Thread(new Runnable() {
-
- @Override
- public void run() {
- loadImages();
- loadInstances();
- }
-
- });
- t.start();
+ public void loadChildren() throws DeltaCloudException {
+ loadImages();
+ loadInstances();
}
public void save() {
@@ -242,6 +234,17 @@
imageListeners.remove(listener);
}
+ public DeltaCloudImage[] notifyImageListListeners() {
+ DeltaCloudImage[] images = cloneImages();
+ notifyImageListListeners(images);
+ return images;
+ }
+
+ private DeltaCloudImage[] cloneImages() {
+ DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
+ return images.toArray(imageArray);
+ }
+
public void notifyImageListListeners(DeltaCloudImage[] array) {
Object[] listeners = imageListeners.getListeners();
for (int i = 0; i < listeners.length; ++i)
@@ -437,40 +440,52 @@
return profileArray;
}
+ public DeltaCloudImage loadImage(String imageId) throws DeltaCloudException {
+ try {
+ Image image = client.listImages(imageId);
+ DeltaCloudImage deltaCloudImage = addImage(image);
+ return deltaCloudImage;
+ } catch (DeltaCloudClientException e) {
+ throw new DeltaCloudException(e);
+ }
+ }
+
/**
* Loads the available images from the server and stores them locally.
* Furthermore listeners get informed.
*
* @return the delta cloud image[]
+ * @throws DeltaCloudClientException
*
* @see #notifyImageListListeners(DeltaCloudImage[])
*/
- public DeltaCloudImage[] loadImages() {
+ public DeltaCloudImage[] loadImages() throws DeltaCloudException {
synchronized (imageLock) {
- images = new ArrayList<DeltaCloudImage>();
try {
+ images = new ArrayList<DeltaCloudImage>();
List<Image> list = client.listImages();
for (Iterator<Image> i = list.iterator(); i.hasNext();) {
- DeltaCloudImage image = new DeltaCloudImage(i.next(), this);
- images.add(image);
+ addImage(i.next());
}
+ return notifyImageListListeners();
} catch (DeltaCloudClientException e) {
- Activator.log(e);
+ throw new DeltaCloudException(e);
}
- DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
- imageArray = images.toArray(imageArray);
- notifyImageListListeners(imageArray);
- return imageArray;
}
}
- public DeltaCloudImage[] getCurrImages() {
+ private DeltaCloudImage addImage(Image image) {
+ DeltaCloudImage deltaCloudImage = new DeltaCloudImage(image, this);
+ images.add(deltaCloudImage);
+ return deltaCloudImage;
+ }
+
+ public DeltaCloudImage[] getCurrImages() throws DeltaCloudException {
synchronized (imageLock) {
- if (images == null)
+ if (images == null) {
return loadImages();
- DeltaCloudImage[] imageArray = new DeltaCloudImage[images.size()];
- imageArray = images.toArray(imageArray);
- return imageArray;
+ }
+ return cloneImages();
}
}
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshCloudHandler.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -14,11 +14,17 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
+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.ui.Activator;
import org.jboss.tools.deltacloud.ui.views.CloudViewElement;
import org.jboss.tools.internal.deltacloud.ui.utils.CloudViewElementUtils;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
@@ -32,14 +38,35 @@
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
- CloudViewElement cvImage = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
- refresh(cvImage);
+ CloudViewElement cloudViewElement = UIUtils.getFirstAdaptedElement(selection, CloudViewElement.class);
+ try {
+ refresh(cloudViewElement);
+ } 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 " + getCloudName(cloudViewElement), status);
+ }
}
return Status.OK_STATUS;
}
- private void refresh(CloudViewElement cloudViewElement) {
+ private String getCloudName(CloudViewElement cloudViewElement) {
+ DeltaCloud cloud = CloudViewElementUtils.getCloud(cloudViewElement);
+ if (cloud == null) {
+ return "";
+ } else {
+ return cloud.getName();
+ }
+ }
+
+ private void refresh(CloudViewElement cloudViewElement) throws DeltaCloudException {
if (cloudViewElement != null) {
DeltaCloud cloud = CloudViewElementUtils.getCloud(cloudViewElement);
if (cloud != null) {
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshImagesHandler.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -14,12 +14,18 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
+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.DeltaCloudImage;
+import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -32,13 +38,25 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
DeltaCloudImage deltaCloudImage = UIUtils.getFirstAdaptedElement(selection, DeltaCloudImage.class);
- refresh(deltaCloudImage);
+ try {
+ refresh(deltaCloudImage);
+ } 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 " + deltaCloudImage.getDeltaCloud().getName(), status);
+ }
}
return Status.OK_STATUS;
}
- private void refresh(DeltaCloudImage deltaCloudImage) {
+ private void refresh(DeltaCloudImage deltaCloudImage) throws DeltaCloudException {
if (deltaCloudImage != null) {
DeltaCloud cloud = deltaCloudImage.getDeltaCloud();
if (cloud != null) {
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/RefreshInstancesHandler.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -14,12 +14,18 @@
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
+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.DeltaCloudInstance;
+import org.jboss.tools.deltacloud.ui.Activator;
import org.jboss.tools.internal.deltacloud.ui.utils.UIUtils;
/**
@@ -32,13 +38,25 @@
ISelection selection = HandlerUtil.getCurrentSelection(event);
if (selection instanceof IStructuredSelection) {
DeltaCloudInstance deltaCloudInstance = UIUtils.getFirstAdaptedElement(selection, DeltaCloudInstance.class);
- refresh(deltaCloudInstance);
+ try {
+ refresh(deltaCloudInstance);
+ } 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 " + deltaCloudInstance.getDeltaCloud().getName(), status);
+ }
}
return Status.OK_STATUS;
}
- private void refresh(DeltaCloudInstance deltaCloudInstance) {
+ private void refresh(DeltaCloudInstance deltaCloudInstance) throws DeltaCloudException {
if (deltaCloudInstance != null) {
DeltaCloud cloud = deltaCloudInstance.getDeltaCloud();
if (cloud != null) {
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVCloudElement.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -10,10 +10,15 @@
*******************************************************************************/
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;
public class CVCloudElement extends CloudViewElement {
@@ -59,6 +64,18 @@
public void loadChildren() {
DeltaCloud cloud = (DeltaCloud)getElement();
- cloud.loadChildren();
+ 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);
+ }
}
}
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVImagesCategoryElement.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -12,11 +12,16 @@
import java.util.ArrayList;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.TreeViewer;
+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.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.IImageFilter;
import org.jboss.tools.deltacloud.core.IImageListListener;
+import org.jboss.tools.deltacloud.ui.Activator;
public class CVImagesCategoryElement extends CVCategoryElement implements IImageListListener {
@@ -67,11 +72,24 @@
public Object[] getChildren() {
if (!initialized) {
DeltaCloud cloud = (DeltaCloud)getElement();
- cloud.removeImageListListener(this);
- DeltaCloudImage[] images = filter(cloud.getCurrImages());
- addImages(images);
- initialized = true;
- cloud.addImageListListener(this);
+ DeltaCloudImage[] images;
+ try {
+ images = filter(cloud.getCurrImages());
+ cloud.removeImageListListener(this);
+ addImages(images);
+ initialized = true;
+ cloud.addImageListListener(this);
+ } 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 images from cloud " + cloud.getName(), status);
+ }
}
return super.getChildren();
}
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/ImageViewLabelAndContentProvider.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -15,34 +15,38 @@
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.viewers.BaseLabelProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudImage;
import org.jboss.tools.deltacloud.core.IImageFilter;
+import org.jboss.tools.deltacloud.ui.Activator;
-public class ImageViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider, ITableLabelProvider {
+public class ImageViewLabelAndContentProvider extends BaseLabelProvider implements IStructuredContentProvider,
+ ITableLabelProvider {
private DeltaCloud cloud;
private IImageFilter localFilter;
private DeltaCloudImage[] images;
public enum Column {
- NAME(0, 20),
- ID(1, 20),
- ARCH(2, 20),
+ NAME(0, 20),
+ ID(1, 20),
+ ARCH(2, 20),
DESC(3, 40);
-
+
private int column;
private int weight;
- private static final Map<Integer,Column> lookup
- = new HashMap<Integer,Column>();
+ private static final Map<Integer, Column> lookup = new HashMap<Integer, Column>();
static {
- for(Column c : EnumSet.allOf(Column.class))
+ for (Column c : EnumSet.allOf(Column.class))
lookup.put(c.getColumnNumber(), c);
}
@@ -54,7 +58,7 @@
public int getColumnNumber() {
return column;
}
-
+
public int getWeight() {
return weight;
}
@@ -62,13 +66,13 @@
public static Column getColumn(int number) {
return lookup.get(number);
}
-
+
public static int getSize() {
return lookup.size();
}
-
+
};
-
+
@Override
public Object[] getElements(Object inputElement) {
return images;
@@ -84,10 +88,22 @@
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
if (newInput != null) {
if (newInput instanceof DeltaCloudImage[]) {
- images = filter((DeltaCloudImage[])newInput);
+ images = filter((DeltaCloudImage[]) newInput);
} else {
- cloud = (DeltaCloud)newInput;
- images = filter(cloud.getCurrImages());
+ try {
+ cloud = (DeltaCloud) newInput;
+ images = filter(cloud.getCurrImages());
+ } 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);
+ }
}
}
}
@@ -96,7 +112,7 @@
public void setFilter(IImageFilter filter) {
this.localFilter = filter;
}
-
+
private DeltaCloudImage[] filter(DeltaCloudImage[] input) {
ArrayList<DeltaCloudImage> array = new ArrayList<DeltaCloudImage>();
IImageFilter f = localFilter;
@@ -109,7 +125,7 @@
}
return array.toArray(new DeltaCloudImage[array.size()]);
}
-
+
@Override
public Image getColumnImage(Object element, int columnIndex) {
return null;
@@ -118,7 +134,7 @@
@Override
public String getColumnText(Object element, int columnIndex) {
Column c = Column.getColumn(columnIndex);
- DeltaCloudImage i = (DeltaCloudImage)element;
+ DeltaCloudImage i = (DeltaCloudImage) element;
switch (c) {
case NAME:
return i.getName();
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/OriginalInstanceView.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -1,646 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc..
- * All rights reserved. This program and the accompanying materials
- * are 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 Incorporated - initial API and implementation
- *******************************************************************************/
-package org.jboss.tools.deltacloud.ui.views;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-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.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.rse.core.IRSECoreRegistry;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.model.SystemStartHere;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.VerifyEvent;
-import org.eclipse.swt.events.VerifyListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-import org.jboss.tools.deltacloud.core.DeltaCloud;
-import org.jboss.tools.deltacloud.core.DeltaCloudInstance;
-import org.jboss.tools.deltacloud.core.DeltaCloudManager;
-import org.jboss.tools.deltacloud.core.ICloudManagerListener;
-import org.jboss.tools.deltacloud.core.IInstanceFilter;
-import org.jboss.tools.deltacloud.core.IInstanceListListener;
-import org.jboss.tools.deltacloud.ui.Activator;
-import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
-import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
-import org.jboss.tools.internal.deltacloud.ui.wizards.InstanceFilter;
-import org.osgi.service.prefs.Preferences;
-
-public class OriginalInstanceView extends ViewPart implements ICloudManagerListener, IInstanceListListener {
-
- private final static String CLOUD_SELECTOR_LABEL = "CloudSelector.label"; //$NON-NLS-1$
- private final static String START_LABEL = "Start.label"; //$NON-NLS-1$
- private final static String STOP_LABEL = "Stop.label"; //$NON-NLS-1$
- private final static String REBOOT_LABEL = "Reboot.label"; //$NON-NLS-1$
- private final static String DESTROY_LABEL = "Destroy.label"; //$NON-NLS-1$
- private final static String RSE_LABEL = "ShowInRSE.label"; //$NON-NLS-1$
- private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
- private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
- private final static String STOPPING_INSTANCE_TITLE = "StoppingInstance.title"; //$NON-NLS-1$
- private final static String STOPPING_INSTANCE_MSG = "StoppingInstance.msg"; //$NON-NLS-1$
- private final static String REBOOTING_INSTANCE_TITLE = "RebootingInstance.title"; //$NON-NLS-1$
- private final static String REBOOTING_INSTANCE_MSG = "RebootingInstance.msg"; //$NON-NLS-1$
- private final static String DESTROYING_INSTANCE_TITLE = "DestroyingInstance.title"; //$NON-NLS-1$
- private final static String DESTROYING_INSTANCE_MSG = "DestroyingInstance.msg"; //$NON-NLS-1$
- private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
- private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
- private static final String FILTER = "Filter.label"; //$NON-NLS-1$
- private static final String FILTERED_LABEL = "Filtered.label"; //$NON-NLS-1$
- private static final String FILTERED_TOOLTIP = "FilteredImages.tooltip"; //$NON-NLS-1$
-
-
- private TableViewer viewer;
- private Composite container;
- private Combo cloudSelector;
- private Label filterLabel;
- private DeltaCloudInstance selectedElement;
-
- private DeltaCloud[] clouds;
- private DeltaCloud currCloud;
-
- private InstanceViewLabelAndContentProvider contentProvider;
-
- private Action refreshAction;
- private Action filterAction;
- private Action startAction;
- private Action stopAction;
- private Action destroyAction;
- private Action rebootAction;
- private Action rseAction;
-
- private Map<String, Action> instanceActions;
-
- private OriginalInstanceView parentView;
-
- public OriginalInstanceView() {
- parentView = this;
- }
-
- private ModifyListener cloudModifyListener = new ModifyListener() {
-
- @Override
- public void modifyText(ModifyEvent e) {
- int index = cloudSelector.getSelectionIndex();
- if (currCloud != null)
- currCloud.removeInstanceListListener(parentView);
- currCloud = clouds[index];
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- try {
- prefs.put(IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW, currCloud.getName());
- } catch(Exception exc) {
- // do nothing
- }
- viewer.setInput(new DeltaCloudInstance[0]);
- viewer.refresh();
- Display.getCurrent().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- viewer.setInput(currCloud);
- currCloud.addInstanceListListener(parentView);
- viewer.refresh();
- }
-
- });
- }
-
- };
-
- 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) {
- InstanceComparator comparator = (InstanceComparator)viewer.getComparator();
- Table t = viewer.getTable();
- if (comparator.getColumn() == column) {
- comparator.reverseDirection();
- }
- comparator.setColumn(column);
- TableColumn tc = (TableColumn)e.getSource();
- t.setSortColumn(tc);
- t.setSortDirection(SWT.NONE);
- viewer.refresh();
- }
-
- };
-
- @Override
- public void dispose() {
- for (DeltaCloud cloud : clouds) {
- cloud.removeInstanceListListener(this);
- }
- DeltaCloudManager.getDefault().removeCloudManagerListener(this);
- super.dispose();
- }
-
- @Override
- public void createPartControl(Composite parent) {
- container = new Composite(parent, SWT.NULL);
- FormLayout layout = new FormLayout();
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- container.setLayout(layout);
-
- Label cloudSelectorLabel = new Label(container, SWT.NULL);
- cloudSelectorLabel.setText(CVMessages.getString(CLOUD_SELECTOR_LABEL));
-
- cloudSelector = new Combo(container, SWT.BORDER | SWT.READ_ONLY);
- initializeCloudSelector();
- cloudSelector.addModifyListener(cloudModifyListener);
- // Following is a kludge so that on Linux the Combo is read-only but
- // has a white background.
- cloudSelector.addVerifyListener(new VerifyListener() {
- @Override
- public void verifyText(VerifyEvent e) {
- e.doit = false;
- }
- });
-
- filterLabel = new Label(container, SWT.NULL);
- filterLabel.setText(CVMessages.getString(FILTERED_LABEL));
- filterLabel.setToolTipText(CVMessages.getString(FILTERED_TOOLTIP));
-
- Composite tableArea = new Composite(container, SWT.NULL);
- TableColumnLayout tableLayout = new TableColumnLayout();
- tableArea.setLayout(tableLayout);
-
- viewer = new TableViewer(tableArea, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- Table table = viewer.getTable();
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
- contentProvider = new InstanceViewLabelAndContentProvider();
- viewer.setContentProvider(contentProvider);
- viewer.setLabelProvider(contentProvider);
- InstanceComparator comparator = new InstanceComparator(0);
- viewer.setComparator(comparator);
-
- for (int i = 0; i < InstanceViewLabelAndContentProvider.Column.getSize(); ++i) {
- InstanceViewLabelAndContentProvider.Column c =
- InstanceViewLabelAndContentProvider.Column.getColumn(i);
- TableColumn tc = new TableColumn(table, SWT.NONE);
- if (i == 0)
- table.setSortColumn(tc);
- tc.setText(CVMessages.getString(c.name()));
- tableLayout.setColumnData(tc, new ColumnWeightData(c.getWeight(), true));
- tc.addSelectionListener(new ColumnListener(i, viewer));
- }
- table.setSortDirection(SWT.NONE);
-
- if (currCloud != null) {
- currCloud.removeInstanceListListener(parentView);
- viewer.setInput(currCloud);
- currCloud.addInstanceListListener(parentView);
- IInstanceFilter filter = currCloud.getInstanceFilter();
- filterLabel.setVisible(!filter.toString().equals(IInstanceFilter.ALL_STRING));
- }
-
- Point p1 = cloudSelectorLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p2 = cloudSelector.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int centering = (p2.y - p1.y + 1) / 2;
-
- FormData f = new FormData();
- f.top = new FormAttachment(0, 5 + centering);
- f.left = new FormAttachment(0, 30);
- cloudSelectorLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(0, 5);
- f.left = new FormAttachment(cloudSelectorLabel, 5);
- cloudSelector.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(0, 5 + centering);
- f.right = new FormAttachment(100, -10);
- filterLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(cloudSelector, 8);
- f.left = new FormAttachment(0, 0);
- f.right = new FormAttachment(100, 0);
- f.bottom = new FormAttachment(100, 0);
- tableArea.setLayoutData(f);
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "org.jboss.tools.deltacloud.ui.viewer");
- makeActions();
- hookContextMenu();
- hookSelection();
- contributeToActionBars();
-
- DeltaCloudManager.getDefault().addCloudManagerListener(this);
- }
-
- private void hookSelection() {
- viewer.addSelectionChangedListener(new ISelectionChangedListener() {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- handleSelection();
- }
- });
- }
-
- private void hookContextMenu() {
- MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- OriginalInstanceView.this.fillContextMenu(manager);
- }
- });
- Menu menu = menuMgr.createContextMenu(viewer.getControl());
- viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, viewer);
- }
-
- private void contributeToActionBars() {
- IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void handleSelection() {
- IStructuredSelection selection = (IStructuredSelection) viewer.getSelection();
- selectedElement = (DeltaCloudInstance)selection.getFirstElement();
- instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
- instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
- instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
- instanceActions.get(DeltaCloudInstance.DESTROY).setEnabled(false);
- if (selectedElement != null) {
- List<String> actions = selectedElement.getActions();
- for (String action : actions) {
- instanceActions.get(action).setEnabled(true);
- }
- }
- }
-
- private void fillLocalPullDown(IMenuManager manager) {
- manager.add(refreshAction);
- manager.add(filterAction);
- }
-
- private void fillContextMenu(IMenuManager manager) {
- List<String> actions = selectedElement.getActions();
- manager.add(instanceActions.get(DeltaCloudInstance.START));
- instanceActions.get(DeltaCloudInstance.START).setEnabled(false);
- manager.add(instanceActions.get(DeltaCloudInstance.STOP));
- instanceActions.get(DeltaCloudInstance.STOP).setEnabled(false);
- manager.add(instanceActions.get(DeltaCloudInstance.REBOOT));
- instanceActions.get(DeltaCloudInstance.REBOOT).setEnabled(false);
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- manager.add(instanceActions.get(DeltaCloudInstance.DESTROY));
- instanceActions.get(DeltaCloudInstance.DESTROY).setEnabled(false);
- for (String action : actions) {
- instanceActions.get(action).setEnabled(true);
- }
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- manager.add(rseAction);
- if (selectedElement.getState().equals(DeltaCloudInstance.RUNNING) ||
- selectedElement.getState().equals(DeltaCloudInstance.STOPPED))
- rseAction.setEnabled(true);
- else
- rseAction.setEnabled(false);
- // Other plug-ins can contribute there actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(IToolBarManager manager) {
- manager.add(instanceActions.get(DeltaCloudInstance.START));
- manager.add(instanceActions.get(DeltaCloudInstance.STOP));
- manager.add(instanceActions.get(DeltaCloudInstance.REBOOT));
- manager.add(instanceActions.get(DeltaCloudInstance.DESTROY));
- }
-
- private void makeActions() {
- refreshAction = new Action() {
- public void run() {
- Thread t = new Thread(new Runnable() {
-
- @Override
- public void run() {
- if (currCloud != null) {
-// currCloud.getInstances();
- }
- }
-
- });
- t.start();
- }
- };
- refreshAction.setText(CVMessages.getString(REFRESH));
- refreshAction.setToolTipText(CVMessages.getString(REFRESH));
- refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
-
- filterAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- // TODO Auto-generated method stub
- Shell shell = viewer.getControl().getShell();
- IWizard wizard = new InstanceFilter(currCloud);
- WizardDialog dialog = new WizardDialog(shell, wizard);
- dialog.create();
- dialog.open();
- if (!currCloud.getInstanceFilter().toString().equals(IInstanceFilter.ALL_STRING))
- filterLabel.setVisible(true);
- else
- filterLabel.setVisible(false);
- }
-
- });
- }
- };
- filterAction.setText(CVMessages.getString(FILTER));
- filterAction.setToolTipText(CVMessages.getString(FILTER));
-
- startAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.START,
- CVMessages.getString(STARTING_INSTANCE_TITLE),
- CVMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[]{instance.getName()}),
- DeltaCloudInstance.RUNNING);
- t.setUser(true);
- t.schedule();
- }
- };
- startAction.setText(CVMessages.getString(START_LABEL));
- startAction.setToolTipText(CVMessages.getString(START_LABEL));
- startAction.setImageDescriptor(SWTImagesFactory.DESC_START);
- startAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STARTD);
- startAction.setEnabled(false);
-
- stopAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.STOP,
- CVMessages.getString(STOPPING_INSTANCE_TITLE),
- CVMessages.getFormattedString(STOPPING_INSTANCE_MSG, new String[]{instance.getName()}),
- DeltaCloudInstance.STOPPED);
- t.setUser(true);
- t.schedule();
- }
- };
- stopAction.setText(CVMessages.getString(STOP_LABEL));
- stopAction.setToolTipText(CVMessages.getString(STOP_LABEL));
- stopAction.setImageDescriptor(SWTImagesFactory.DESC_STOP);
- stopAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_STOPD);
- stopAction.setEnabled(false);
-
- rebootAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
- PerformInstanceActionThread t = new PerformInstanceActionThread(currCloud, instance, DeltaCloudInstance.REBOOT,
- CVMessages.getString(REBOOTING_INSTANCE_TITLE),
- CVMessages.getFormattedString(REBOOTING_INSTANCE_MSG, new String[]{instance.getName()}),
- DeltaCloudInstance.RUNNING);
- t.setUser(true);
- t.schedule();
- }
- };
- rebootAction.setText(CVMessages.getString(REBOOT_LABEL));
- rebootAction.setToolTipText(CVMessages.getString(REBOOT_LABEL));
- rebootAction.setImageDescriptor(SWTImagesFactory.DESC_REBOOT);
- rebootAction.setDisabledImageDescriptor(SWTImagesFactory.DESC_REBOOTD);
- rebootAction.setEnabled(false);
-
- destroyAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
- PerformDestroyInstanceActionThread t = new PerformDestroyInstanceActionThread(currCloud, instance,
- CVMessages.getString(DESTROYING_INSTANCE_TITLE),
- CVMessages.getFormattedString(DESTROYING_INSTANCE_MSG, new String[]{instance.getName()}));
- t.setUser(true);
- t.schedule();
- }
- };
- destroyAction.setText(CVMessages.getString(DESTROY_LABEL));
- destroyAction.setToolTipText(CVMessages.getString(DESTROY_LABEL));
- ISharedImages sharedImages = PlatformUI.getWorkbench().getSharedImages();
- ImageDescriptor delete = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE));
- ImageDescriptor delete_disabled = ImageDescriptor.createFromImage(sharedImages.getImage(ISharedImages.IMG_ETOOL_DELETE_DISABLED));
- destroyAction.setImageDescriptor(delete);
- destroyAction.setDisabledImageDescriptor(delete_disabled);
- destroyAction.setEnabled(false);
-
- rseAction = new Action() {
- public void run() {
- ISelection selection = viewer.getSelection();
- DeltaCloudInstance instance = (DeltaCloudInstance)((IStructuredSelection)selection).getFirstElement();
- String hostname = instance.getHostName();
- ISystemRegistry registry = SystemStartHere.getSystemRegistry();
- RSECorePlugin rsep = RSECorePlugin.getDefault();
- IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
- IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
- IRSESystemType sshType = null;
- for (IRSESystemType sysType : sysTypes) {
- if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
- sshType = sysType;
- }
- String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- try {
- IHost host = registry.createHost(sshType, connectionName, hostname, null);
- if (host != null) {
- host.setDefaultUserId("root"); //$NON-NLS-1$
- IConnectorService[] services = host.getConnectorServices();
- if (services.length > 0) {
- final IConnectorService service = services[0];
- Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- service.connect(monitor);
- Display.getDefault().asyncExec(new Runnable() {
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
- } catch (PartInitException e) {
- // TODO Auto-generated catch block
- Activator.log(e);
- }
- }
- });
- return Status.OK_STATUS;
- } catch(Exception e) {
- return Status.CANCEL_STATUS;
- }
- }
- };
- connect.setUser(true);
- connect.schedule();
- }
- } else {
- // Assume failure is due to name already in use
- Display.getDefault().asyncExec(new Runnable() {
-
- @Override
- public void run() {
- try {
- PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.rse.ui.view.systemView");
- } catch (PartInitException e) {
- Activator.log(e);
- }
- }
-
- });
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- Activator.log(e);
- }
- }
- };
- rseAction.setText(CVMessages.getString(RSE_LABEL));
- rseAction.setToolTipText(CVMessages.getString(RSE_LABEL));
-
- instanceActions = new HashMap<String, Action>();
- instanceActions.put(DeltaCloudInstance.START, startAction);
- instanceActions.put(DeltaCloudInstance.STOP, stopAction);
- instanceActions.put(DeltaCloudInstance.REBOOT, rebootAction);
- instanceActions.put(DeltaCloudInstance.DESTROY, destroyAction);
- }
-
- @Override
- public void setFocus() {
- // TODO Auto-generated method stub
-
- }
-
- private void initializeCloudSelector() {
- int defaultIndex = 0;
- clouds = DeltaCloudManager.getDefault().getClouds();
- String[] cloudNames = new String[clouds.length];
- // If we have saved the last cloud used from a previous session,
- // default to using that cloud to start unless it no longer exists
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- String lastCloudUsed = prefs.get(IDeltaCloudPreferenceConstants.LAST_CLOUD_INSTANCE_VIEW, "");
- for (int i = 0; i < clouds.length; ++i) {
- cloudNames[i] = clouds[i].getName();
- if (cloudNames[i].equals(lastCloudUsed))
- defaultIndex = i;
- }
- cloudSelector.setItems(cloudNames);
- if (clouds.length > 0) {
- cloudSelector.setText(cloudNames[defaultIndex]);
- currCloud = clouds[defaultIndex];
- }
- }
-
- public void changeEvent(int type) {
- String currName = null;
- int currIndex = 0;
- if (currCloud != null) {
- currName = currCloud.getName();
- currIndex = cloudSelector.getSelectionIndex();
- }
- clouds = DeltaCloudManager.getDefault().getClouds();
- String[] cloudNames = new String[clouds.length];
- int index = 0;
- for (int i = 0; i < clouds.length; ++i) {
- cloudNames[i] = clouds[i].getName();
- if (cloudNames[i].equals(currName))
- index = i;
- }
- if (type == ICloudManagerListener.RENAME_EVENT) {
- index = currIndex; // no change in cloud displayed
- }
- cloudSelector.removeModifyListener(cloudModifyListener);
- cloudSelector.setItems(cloudNames);
- if (cloudNames.length > 0) {
- cloudSelector.setText(cloudNames[index]);
- currCloud = clouds[index];
- viewer.setInput(currCloud);
- } else {
- currCloud = null;
- cloudSelector.setText("");
- viewer.setInput(new DeltaCloudInstance[0]);
- }
- cloudSelector.addModifyListener(cloudModifyListener);
- }
-
- public void listChanged(DeltaCloud cloud, DeltaCloudInstance[] list) {
- // Run following under Display thread since this can be
- // triggered by a non-display thread notifying listeners.
- final DeltaCloudInstance[] finalList = list;
- if (cloud.getName().equals(currCloud.getName())) {
- Display.getDefault().syncExec(new Runnable() {
- @Override
- public void run() {
- // TODO Auto-generated method stub
- currCloud.removeInstanceListListener(parentView);
- viewer.setInput(finalList);
- currCloud.addInstanceListListener(parentView);
- viewer.refresh();
- }
- });
- }
- }
-
-}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/CloudViewElementUtils.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/CloudViewElementUtils.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/utils/CloudViewElementUtils.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -18,23 +18,28 @@
/**
* Returns a DeltaCloud instance for a given cloud view element
- *
- * @param element the cloud view element to get the DeltaCloud for
+ *
+ * @param element
+ * the cloud view element to get the DeltaCloud for
* @return the cloud for the given CloudViewElement
*
* @see DeltaCloud
* @see CloudViewElement
*/
public static DeltaCloud getCloud(CloudViewElement element) {
- CVCloudElement cvcloud = getCVCloudElement(element);
- DeltaCloud cloud = (DeltaCloud) cvcloud.getElement();
+ CVCloudElement cvCloud = getCVCloudElement(element);
+ if (cvCloud == null) {
+ return null;
+ }
+ DeltaCloud cloud = (DeltaCloud) cvCloud.getElement();
return cloud;
}
/**
* Returns a CVCloudElement for a given cloud view element
- *
- * @param element the cloud view element to get the CVCloudElement for
+ *
+ * @param element
+ * the cloud view element to get the CVCloudElement for
* @return the CVCloudElement for the given CloudViewElement
*
* @see CloudViewElement
@@ -46,5 +51,5 @@
}
return (CVCloudElement) element;
}
-
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/EditCloudConnection.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -109,8 +109,7 @@
cloud.editCloud(name, url, username, password, type);
if (!name.equals(oldName))
DeltaCloudManager.getDefault().notifyCloudRename();
- } catch (MalformedURLException e) {
- Activator.log(e);
+ } catch (Exception e) {
}
return true;
}
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/FindImagePage.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -1,5 +1,7 @@
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;
@@ -22,11 +24,13 @@
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.IImageFilter;
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.ImageComparator;
@@ -37,12 +41,10 @@
private final static String NAME = "FindImage.name"; //$NON-NLS-1$
private final static String TITLE = "FindImage.title"; //$NON-NLS-1$
private final static String DESC = "FindImage.desc"; //$NON-NLS-1$
- private final static String FILTER_LABEL = "Filter.label"; //$NON-NLS-1$
private final static String NAME_LABEL = "Name.label"; //$NON-NLS-1$
private final static String ID_LABEL = "Id.label"; //$NON-NLS-1$
private final static String ARCH_LABEL = "Arch.label"; //$NON-NLS-1$
private final static String DESC_LABEL = "Desc.label"; //$NON-NLS-1$
- private final static String EMPTY_RULE = "ErrorFilterEmptyRule.msg"; //$NON-NLS-1$
private final static String INVALID_SEMICOLON = "ErrorFilterSemicolon.msg"; //$NON-NLS-1$
private DeltaCloud cloud;
@@ -146,9 +148,21 @@
@Override
public void run() {
+ try {
contentProvider.setFilter(filter);
viewer.setInput(cloud.getCurrImages());
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);
+ }
}
});
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilter.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -1,7 +1,11 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.wizard.Wizard;
+import org.jboss.tools.common.log.StatusFactory;
import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.ui.Activator;
public class ImageFilter extends Wizard {
@@ -31,10 +35,22 @@
String archRule = mainPage.getArchRule();
String descRule = mainPage.getDescRule();
- cloud.updateImageFilter(nameRule + ";" + //$NON-NLS-1$
- idRule + ";" + //$NON-NLS-1$
- archRule + ";" + //$NON-NLS-1$
- descRule); //$NON-NLS-1$
+ try {
+ cloud.updateImageFilter(nameRule + ";" + //$NON-NLS-1$
+ idRule + ";" + //$NON-NLS-1$
+ archRule + ";" + //$NON-NLS-1$
+ descRule);
+ } catch (Exception e) {
+ IStatus status = StatusFactory.getInstance(
+ IStatus.ERROR,
+ Activator.PLUGIN_ID,
+ e.getMessage(),
+ e);
+ // TODO: internationalize strings
+ ErrorDialog.openError(getShell(),
+ "Error",
+ "Cloud not get update filters on cloud " + cloud.getName(), status);
+ }
return true;
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilter.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -1,7 +1,12 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.wizard.Wizard;
+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.ui.Activator;
public class InstanceFilter extends Wizard {
@@ -34,13 +39,21 @@
String realmRule = mainPage.getRealmRule();
String profileRule = mainPage.getProfileRule();
- cloud.updateInstanceFilter(nameRule + ";" + //$NON-NLS-1$
- idRule + ";" + //$NON-NLS-1$
- imageIdRule + ";" + //$NON-NLS-1$
- ownerIdRule + ";" + //$NON-NLS-1$
- keyNameRule + ";" + //$NON-NLS-1$
- realmRule + ";" + //$NON-NLS-1$
- profileRule); //$NON-NLS-1$
+ try {
+ cloud.updateInstanceFilter(nameRule + ";" + //$NON-NLS-1$
+ idRule + ";" + //$NON-NLS-1$
+ imageIdRule + ";" + //$NON-NLS-1$
+ ownerIdRule + ";" + //$NON-NLS-1$
+ keyNameRule + ";" + //$NON-NLS-1$
+ realmRule + ";" + //$NON-NLS-1$
+ profileRule);
+ } catch (Exception e) {
+ IStatus status = StatusFactory.getInstance(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e);
+ // TODO: internationalize strings
+ ErrorDialog.openError(Display.getDefault().getActiveShell(),
+ "Error",
+ "Could not update filters", status);
+ }
return true;
}
Deleted: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java 2010-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstance.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Red Hat Inc..
- * All rights reserved. This program and the accompanying materials
- * are 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 Incorporated - initial API and implementation
- *******************************************************************************/
-package org.jboss.tools.internal.deltacloud.ui.wizards;
-
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-
-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.core.runtime.preferences.InstanceScope;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.ErrorDialog;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.rse.core.IRSECoreRegistry;
-import org.eclipse.rse.core.IRSESystemType;
-import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.model.ISystemRegistry;
-import org.eclipse.rse.core.model.SystemStartHere;
-import org.eclipse.rse.core.subsystems.IConnectorService;
-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.DeltaCloudInstance;
-import org.jboss.tools.deltacloud.ui.Activator;
-import org.jboss.tools.deltacloud.ui.IDeltaCloudPreferenceConstants;
-import org.jboss.tools.deltacloud.ui.views.CVMessages;
-import org.osgi.service.prefs.Preferences;
-
-public class NewInstance extends Wizard {
-
- private final static String CREATE_INSTANCE_FAILURE_TITLE = "CreateInstanceError.title"; //$NON-NLS-1$
- private final static String CREATE_INSTANCE_FAILURE_MSG = "CreateInstanceError.msg"; //$NON-NLS-1$
- private final static String DEFAULT_REASON = "CreateInstanceErrorReason.msg"; //$NON-NLS-1$
- private final static String CONFIRM_CREATE_TITLE = "ConfirmCreate.title"; //$NON-NLS-1$
- private final static String CONFIRM_CREATE_MSG = "ConfirmCreate.msg"; //$NON-NLS-1$
- private final static String DONT_SHOW_THIS_AGAIN_MSG = "DontShowThisAgain.msg"; //$NON-NLS-1$
- private final static String STARTING_INSTANCE_MSG = "StartingInstance.msg"; //$NON-NLS-1$
- private final static String STARTING_INSTANCE_TITLE = "StartingInstance.title"; //$NON-NLS-1$
- private final static String RSE_CONNECTING_MSG = "ConnectingRSE.msg"; //$NON-NLS-1$
-
-
- private NewInstancePage mainPage;
-
- private DeltaCloud cloud;
- private DeltaCloudImage image;
- private DeltaCloudInstance instance;
-
- public NewInstance(DeltaCloud cloud, DeltaCloudImage image) {
- this.cloud = cloud;
- this.image = image;
- }
-
- @Override
- public void addPages() {
- // TODO Auto-generated method stub
- mainPage = new NewInstancePage(cloud, image);
- addPage(mainPage);
- }
-
- @Override
- public boolean canFinish() {
- return mainPage.isPageComplete();
- }
-
-
- private class WatchCreateJob extends Job {
-
- private DeltaCloud cloud;
- private String instanceId;
- private String instanceName;
-
- public WatchCreateJob(String title, DeltaCloud cloud,
- String instanceId, String instanceName) {
- super(title);
- this.cloud = cloud;
- this.instanceId = instanceId;
- this.instanceName = instanceName;
- }
-
- public IStatus run(IProgressMonitor pm) {
- if (!pm.isCanceled()){
- DeltaCloudInstance instance = null;
- try {
- pm.beginTask(WizardMessages.getFormattedString(STARTING_INSTANCE_MSG, new String[] {instanceName}), IProgressMonitor.UNKNOWN);
- pm.worked(1);
- cloud.registerActionJob(instanceId, this);
- boolean finished = false;
- while (!finished && !pm.isCanceled()) {
- instance = cloud.refreshInstance(instanceId);
- if (instance != null && !instance.getState().equals(DeltaCloudInstance.PENDING))
- break;
- Thread.sleep(400);
- }
-
- } catch (Exception e) {
- // do nothing
- } finally {
- cloud.addReplaceInstance(instance);
- cloud.removeActionJob(instanceId, this);
- String hostname = instance.getHostName();
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- boolean autoConnect = prefs.getBoolean(IDeltaCloudPreferenceConstants.AUTO_CONNECT_INSTANCE, true);
- if (hostname != null && hostname.length() > 0 && autoConnect) {
- ISystemRegistry registry = SystemStartHere.getSystemRegistry();
- RSECorePlugin rsep = RSECorePlugin.getDefault();
- IRSECoreRegistry coreRegistry = rsep.getCoreRegistry();
- IRSESystemType[] sysTypes = coreRegistry.getSystemTypes();
- IRSESystemType sshType = null;
- for (IRSESystemType sysType : sysTypes) {
- if (sysType.getId().equals(IRSESystemType.SYSTEMTYPE_SSH_ONLY_ID))
- sshType = sysType;
- }
- String connectionName = instance.getName() + " [" + instance.getId() + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- try {
- IHost host = registry.createHost(sshType, connectionName, hostname, null);
- if (host != null) {
- host.setDefaultUserId("root"); //$NON-NLS-1$
- IConnectorService[] services = host.getConnectorServices();
- if (services.length > 0) {
- final IConnectorService service = services[0];
- Job connect = new Job(CVMessages.getFormattedString(RSE_CONNECTING_MSG, connectionName)) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- service.connect(monitor);
- return Status.OK_STATUS;
- } catch(Exception e) {
- return Status.CANCEL_STATUS;
- }
- }
- };
- connect.setUser(true);
- connect.schedule();
- }
- }
- } catch (Exception e) {
- // TODO Auto-generated catch block
- Activator.log(e);
- }
- }
- pm.done();
- }
- return Status.OK_STATUS;
- }
- else {
- pm.done();
- return Status.CANCEL_STATUS;
- }
- };
- };
-
- @Override
- public boolean performFinish() {
- String imageId = image.getId();
- String profileId = mainPage.getHardwareProfile();
- String realmId = mainPage.getRealmId();
- String memory = mainPage.getMemoryProperty();
- String storage = mainPage.getStorageProperty();
- String keyname = mainPage.getKeyName();
- String name = null;
- try {
- name = URLEncoder.encode(mainPage.getInstanceName(), "UTF-8");
- } catch (UnsupportedEncodingException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- } //$NON-NLS-1$
-
- boolean result = false;
- String errorMessage = WizardMessages.getString(DEFAULT_REASON);
- try {
- Preferences prefs = new InstanceScope().getNode(Activator.PLUGIN_ID);
- boolean dontShowDialog = prefs.getBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, false);
- if (!dontShowDialog) {
- MessageDialogWithToggle dialog =
- MessageDialogWithToggle.openOkCancelConfirm(getShell(), WizardMessages.getString(CONFIRM_CREATE_TITLE),
- WizardMessages.getString(CONFIRM_CREATE_MSG),
- WizardMessages.getString(DONT_SHOW_THIS_AGAIN_MSG),
- false, null, null);
- int retCode = dialog.getReturnCode();
- boolean toggleState = dialog.getToggleState();
- if (retCode == Dialog.CANCEL)
- return true;
- // If warning turned off by user, set the preference for future usage
- if (toggleState) {
- prefs.putBoolean(IDeltaCloudPreferenceConstants.DONT_CONFIRM_CREATE_INSTANCE, true);
- }
- }
- instance = cloud.createInstance(name, imageId, realmId, profileId, keyname, memory, storage);
- if (instance != null)
- result = true;
- if (instance != null && instance.getState().equals(DeltaCloudInstance.PENDING)) {
- final String instanceId = instance.getId();
- final String instanceName = name;
- Job job = new WatchCreateJob(WizardMessages.getString(STARTING_INSTANCE_TITLE),
- cloud, instanceId, instanceName);
- job.setUser(true);
- job.schedule();
- }
- } catch (DeltaCloudException e) {
- errorMessage = e.getLocalizedMessage();
- }
- if (!result) {
- ErrorDialog.openError(this.getShell(),
- WizardMessages.getString(CREATE_INSTANCE_FAILURE_TITLE),
- WizardMessages.getFormattedString(CREATE_INSTANCE_FAILURE_MSG, new String[] {name, imageId, realmId, profileId}),
- new Status(IStatus.ERROR, Activator.PLUGIN_ID, errorMessage));
- }
- return result;
- }
-
-}
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-11-15 15:33:39 UTC (rev 26560)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewInstanceModel.java 2010-11-15 15:37:10 UTC (rev 26561)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.IStatus;
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.internal.deltacloud.ui.common.databinding.ObservablePojo;
@@ -31,7 +32,7 @@
public static final String PROPERTY_REALM = "realm"; //$NON-NLS-1$
public static final String PROPERTY_KEYNAME = "keyname"; //$NON-NLS-1$
public static final String PROPERTY_PROFILE = "profile"; //$NON-NLS-1$
-
+
private static final String IMAGE_ID_NOT_FOUND = "ErrorImageIdNotFound.text"; //$NON-NLS-1$
private String name;
@@ -43,21 +44,21 @@
public static class ImageContainer {
private DeltaCloudImage image;
-
+
public DeltaCloudImage getImage() {
return image;
}
-
+
public void setImage(DeltaCloudImage image) {
this.image = image;
}
}
-
+
public static class ArchConverter extends Converter {
private DeltaCloud cloud;
private ImageContainer imageContainer;
-
+
public ArchConverter(DeltaCloud cloud, ImageContainer imageContainer,
Object fromType, Object toType) {
super(fromType, toType);
@@ -67,13 +68,17 @@
@Override
public Object convert(final Object fromObject) {
- return getArch((String) fromObject);
+ try {
+ return getArch((String) fromObject);
+ } catch (DeltaCloudException e) {
+ return ValidationStatus.error("Could find image on the server", e);
+ }
}
- private String getArch(String id) {
+ private String getArch(String imageId) throws DeltaCloudException {
String arch = "";
- if (id != null && id.length() > 0) {
- DeltaCloudImage image = getImage(id, arch, cloud.getCurrImages());
+ if (imageId != null && imageId.length() > 0) {
+ DeltaCloudImage image = getImage(imageId, arch);
if (image != null) {
imageContainer.setImage(image);
arch = image.getArchitecture();
@@ -82,7 +87,15 @@
return arch;
}
- private DeltaCloudImage getImage(String id, String arch, DeltaCloudImage[] images) {
+ private DeltaCloudImage getImage(String imageId, String arch) throws DeltaCloudException {
+ DeltaCloudImage image = getFromcachedImage(imageId, cloud.getCurrImages());
+ 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)) {
@@ -99,7 +112,7 @@
@Override
public IStatus validate(Object value) {
Assert.isTrue(value instanceof String);
- if (value != null && ((String)value).length() > 0) {
+ if (value != null && ((String) value).length() > 0) {
return ValidationStatus.ok();
} else {
return ValidationStatus.error(WizardMessages.getString(IMAGE_ID_NOT_FOUND));
@@ -107,8 +120,7 @@
}
}
-
- public NewInstanceModel(String name, String imageId, String arch, String realm,
+ public NewInstanceModel(String name, String imageId, String arch, String realm,
String keyname, String profile) {
this.name = name;
this.imageId = imageId;
15 years, 5 months
JBoss Tools SVN: r26560 - trunk/vpe/plugins/org.jboss.tools.vpe.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-11-15 10:33:39 -0500 (Mon, 15 Nov 2010)
New Revision: 26560
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/build.properties
Log:
https://jira.jboss.org/browse/JBIDE-7587
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/build.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/build.properties 2010-11-15 15:30:06 UTC (rev 26559)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/build.properties 2010-11-15 15:33:39 UTC (rev 26560)
@@ -2,8 +2,6 @@
schema/,\
plugin.xml,\
plugin.properties,\
- images/,\
- html/,\
about.html,\
META-INF/,\
ve/,\
@@ -11,21 +9,16 @@
about.mappings,\
about.properties,\
jboss_about.png,\
- vpe.jar
+ vpe.jar,\
+ icons/
jars.compile.order = vpe.jar
source.vpe.jar = resources/,\
src/
-src.includes = resources/,\
- src/,\
- ve/,\
+src.includes = ve/,\
templates/,\
schema/,\
- META-INF/,\
about.html,\
about.ini,\
about.mappings,\
about.properties,\
- build.properties,\
- jboss_about.png,\
- plugin.properties,\
- plugin.xml
+ jboss_about.png
15 years, 5 months
JBoss Tools SVN: r26559 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-15 10:30:06 -0500 (Mon, 15 Nov 2010)
New Revision: 26559
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
Log:
[JBIDE-7598] corrected ok-enablement
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-15 15:29:02 UTC (rev 26558)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-11-15 15:30:06 UTC (rev 26559)
@@ -1,5 +1,9 @@
2010-11-15 André Dietisheim <adietish(a)redhat.com>
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java (.modifyText):
+ (validateDirectory):
+ (createControl):
+ [JBIDE-7598] corrected ok-enablement
* src/org/jboss/tools/internal/deltacloud/ui/wizards/CloudConnectionPage.java (createControl):
[JBIDE-7317] removed erroneous, duplicate type binding.
(DeltaCloudTypeLabelAdapter.handleValueChange):
15 years, 5 months
JBoss Tools SVN: r26558 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-15 10:29:02 -0500 (Mon, 15 Nov 2010)
New Revision: 26558
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
Log:
[JBIDE-7598] corrected ok-enablement
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2010-11-15 14:49:15 UTC (rev 26557)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ManageKeysPage.java 2010-11-15 15:29:02 UTC (rev 26558)
@@ -63,7 +63,7 @@
@Override
public void modifyText(ModifyEvent e) {
// TODO Auto-generated method stub
- validate();
+ validateDirectory();
}
};
@@ -114,8 +114,8 @@
@Override
public void widgetSelected(SelectionEvent e) {
currFile = fileList.getSelection()[0];
+ setPageComplete(isKeySelected());
}
-
};
private FilenameFilter extensionFilter = new FilenameFilter() {
@@ -143,13 +143,10 @@
return currFile;
}
- private void validate() {
+ private void validateDirectory() {
boolean hasError = false;
- boolean isComplete = true;
- if (directory.getText().length() == 0)
- isComplete = false;
- else {
+ if (directory.getText().length() > 0) {
File f = new File(directory.getText());
if (!f.exists() || !f.isDirectory()) {
hasError = true;
@@ -164,11 +161,16 @@
loadFileList();
}
}
- if (!hasError)
+ if (!hasError) {
setErrorMessage(null);
- setPageComplete(isComplete && !hasError);
+ }
+ setPageComplete(!hasError && isKeySelected());
}
+ private boolean isKeySelected() {
+ return fileList.getSelectionCount() == 1;
+ }
+
private void loadFileList() {
File dir = new File(directory.getText());
if (dir.exists() && dir.isDirectory()) {
@@ -190,7 +192,7 @@
@Override
public void createControl(Composite parent) {
- // TODO Auto-generated method stub
+ setPageComplete(false);
final Composite container = new Composite(parent, SWT.NULL);
FormLayout layout = new FormLayout();
layout.marginHeight = 5;
@@ -293,7 +295,7 @@
setControl(container);
loadFileList();
- validate();
+ validateDirectory();
}
}
15 years, 5 months