JBoss Tools SVN: r23793 - in trunk/bpel/plugins: org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-07-29 09:56:39 -0400 (Thu, 29 Jul 2010)
New Revision: 23793
Modified:
trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/editmodel/EditModel.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/PortTypeTreeContentProvider.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/PartnerLinkTypeSelectorDialog.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkTypeWizardRolePage.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java
trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/xpath/XPathValidator.java
Log:
https://jira.jboss.org/browse/JBIDE-6697
Merged bug fixes from eclipse.org/bpel
Modified: trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/editmodel/EditModel.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/editmodel/EditModel.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.common.ui/src/org/eclipse/bpel/common/ui/editmodel/EditModel.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -285,7 +285,9 @@
}
- protected static IFile getIFileForURI(URI uri) {
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.5 on 5/5/2010 5:13AM by smoser: fix for bidirectional PLT - > Tammo/JAX Session Feedback
+ public static IFile getIFileForURI(URI uri) {
String filePath = null;
String scheme = uri.scheme();
IFile file = null;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/contentassist/ExpressionContentAssistProcessor.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -337,6 +337,10 @@
theStatus = -1;
return false;
}
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // These lines were removed at rev 23527 because of bad merge
+ theStatus = -1;
+ return false;
}
else if (currChar == ',') {
// could be a function argument
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/PortTypeTreeContentProvider.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/PortTypeTreeContentProvider.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/details/providers/PortTypeTreeContentProvider.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -42,7 +42,21 @@
PortType element = (PortType) it.next();
list.add ( new PortTypeTreeNode(element,isCondensed));
}
- }
+ }
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.5 on 5/5/2010 5:13AM by smoser: fix for bidirectional PLT - > Tammo/JAX Session Feedback
+ else if (inputElement instanceof List){
+ List inputList = (List) inputElement;
+ for (Iterator iterator = inputList.iterator(); iterator.hasNext();) {
+ Definition def = (Definition) iterator.next();
+ Iterator it = def.getPortTypes().values().iterator();
+ while (it.hasNext()) {
+ PortType element = (PortType) it.next();
+ list.add ( new PortTypeTreeNode(element,isCondensed));
+ }
+ }
+
+ }
return list.isEmpty() ? EMPTY_ARRAY : list.toArray();
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/PartnerLinkTypeSelectorDialog.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/PartnerLinkTypeSelectorDialog.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/dialogs/PartnerLinkTypeSelectorDialog.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -184,7 +184,9 @@
PortType pt = (PortType) obj;
CreatePartnerLinkWizard wizard = new CreatePartnerLinkWizard();
- wizard.setPortType( pt );
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.5 on 5/5/2010 5:13AM by smoser: fix for bidirectional PLT - > Tammo/JAX Session Feedback
+ wizard.setMandatoryPortType( pt );
wizard.setBPELEditor( ModelHelper.getBPELEditor( pt ) );
WizardDialog dialog = new WizardDialog(getShell(), wizard);
@@ -194,13 +196,14 @@
}
fPartnerLinkType = wizard.getPartnerLinkType();
+ if (fPartnerLinkType == null) {
+ return ;
+ }
+
if (!checkNamespace(fPartnerLinkType)){
return;
}
- if (fPartnerLinkType == null) {
- return ;
- }
super.okPressed();
return ;
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/properties/VariablePartAssignCategory.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -545,10 +545,14 @@
// Variable is defined using "messageType"
Message msg = var.getMessageType();
if (msg != null) {
- XSDElementDeclaration declaration = side.getPart().getElementDeclaration();
- if (declaration != null) {
- uriWSDL = declaration.getSchema().getSchemaLocation();
- rootElement = declaration.getName();
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.17 on 7/23/2010 3:13AM bugzilla 302943 by gqian: apply the patch from bugzilla
+ if (side.getPart() != null) {
+ XSDElementDeclaration declaration = side.getPart().getElementDeclaration();
+ if (declaration != null) {
+ uriWSDL = declaration.getSchema().getSchemaLocation();
+ rootElement = declaration.getName();
+ }
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkTypeWizardRolePage.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkTypeWizardRolePage.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkTypeWizardRolePage.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.bpel.ui.wizards;
+import java.util.List;
+
import org.eclipse.bpel.ui.details.providers.ModelTreeLabelProvider;
import org.eclipse.bpel.ui.details.providers.PortTypeTreeContentProvider;
import org.eclipse.bpel.ui.details.tree.PortTypeTreeNode;
@@ -38,6 +40,8 @@
* @date Aug 14, 2006
*
*/
+//https://jira.jboss.org/browse/JBIDE-6697
+//from eclipse.org/bpel rev 1.5 on 5/5/2010 5:13AM by smoser: fix for bidirectional PLT - > Tammo/JAX Session Feedback
public class CreatePartnerLinkTypeWizardRolePage extends WizardPage {
static final int SIZING_TEXT_FIELD_WIDTH = 250;
@@ -45,10 +49,12 @@
Text roleName;
Tree portTypeTree;
TreeViewer portTypeViewer;
- PortType portType;
+ PortType mandatoryPortType;
+ PortType optionalPortType;
- Definition wsdlDefinition;
-
+ Definition mandatoryWsdlDefinition;
+ List<Definition> optionalWsdlDefinitions;
+
private CreatePartnerLinkTypeWizardRolePage fOtherRolePage;
boolean fOptional = false;
@@ -125,8 +131,13 @@
portTypeTree = new Tree(fields, SWT.BORDER);
portTypeViewer = new TreeViewer( portTypeTree );
portTypeViewer.setContentProvider( new PortTypeTreeContentProvider (true));
- portTypeViewer.setLabelProvider( new ModelTreeLabelProvider() );
- portTypeViewer.setInput( wsdlDefinition );
+ portTypeViewer.setLabelProvider( new ModelTreeLabelProvider() );
+ if (!fOptional) {
+ portTypeViewer.setInput( mandatoryWsdlDefinition );
+ }
+ else {
+ portTypeViewer.setInput( optionalWsdlDefinitions );
+ }
data = new GridData(GridData.FILL_BOTH);
portTypeTree.setLayoutData(data);
@@ -138,11 +149,16 @@
IStructuredSelection ssel = (IStructuredSelection) event.getSelection();
Object obj = ssel.getFirstElement();
if (obj != null && obj instanceof PortTypeTreeNode) {
- PortTypeTreeNode pttn = (PortTypeTreeNode) obj;
- setPortType( (PortType) pttn.getModelObject() );
+ PortTypeTreeNode pttn = (PortTypeTreeNode) obj;
+ if (!fOptional) {
+ setMandatoryPortType( (PortType) pttn.getModelObject() );
+ }
+ else {
+ setOptionalPortType((PortType) pttn.getModelObject());
+ }
setPageComplete(validatePage());
} else {
- setPortType(null);
+ setMandatoryPortType(null);
setPageComplete(validatePage());
}
}
@@ -157,15 +173,16 @@
String roleNCName = roleName.getText();
if (fOptional) {
- if (portType == null && roleNCName.length() == 0) {
+ if (optionalPortType == null && roleNCName.length() == 0) {
setMessage(Messages.CreatePartnerLinkTypeWizardRolePage_2,INFORMATION);
return true;
}
}
-
- if (portType == null) {
- setMessage(Messages.CreatePartnerLinkTypeWizardRolePage_3,ERROR);
- return false;
+ else {
+ if (mandatoryPortType == null) {
+ setMessage(Messages.CreatePartnerLinkTypeWizardRolePage_3,ERROR);
+ return false;
+ }
}
IInputValidator validator = BPELUtil.getNCNameValidator();
@@ -186,24 +203,35 @@
return true;
}
- public void setDefinition ( Definition defn ) {
- wsdlDefinition = defn;
+ public void setMandatoryDefinition ( Definition defn ) {
+ mandatoryWsdlDefinition = defn;
}
-
/**
* @param portType2
*/
- public void setPortType(PortType pt) {
- portType = pt;
+ public void setMandatoryPortType(PortType pt) {
+ mandatoryPortType = pt;
}
- public PortType getPortType () {
- return portType;
+ public PortType getMandatoryPortType () {
+ return mandatoryPortType;
}
+ public void setOptionalDefinitions ( List <Definition> defs ) {
+ optionalWsdlDefinitions = defs;
+ }
+
+ public void setOptionalPortType(PortType pt) {
+ optionalPortType = pt;
+ }
+
+ public PortType getOptionalPortType () {
+ return optionalPortType;
+ }
+
public String getRoleName () {
return roleName.getText();
}
@@ -229,7 +257,7 @@
*/
public boolean isSpecified() {
if (fOptional) {
- if (portType == null) {
+ if (optionalPortType == null) {
return false;
}
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/CreatePartnerLinkWizard.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -10,6 +10,12 @@
*******************************************************************************/
package org.eclipse.bpel.ui.wizards;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.bpel.common.ui.editmodel.EditModel;
import org.eclipse.bpel.model.partnerlinktype.PartnerLinkType;
import org.eclipse.bpel.model.partnerlinktype.PartnerlinktypeFactory;
import org.eclipse.bpel.model.partnerlinktype.Role;
@@ -19,6 +25,17 @@
import org.eclipse.bpel.ui.commands.AddWSDLImportCommand;
import org.eclipse.bpel.ui.commands.CompoundCommand;
import org.eclipse.bpel.ui.commands.CreatePartnerLinkTypeCommand;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceVisitor;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EcorePackage;
+import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.wst.wsdl.Definition;
import org.eclipse.wst.wsdl.PortType;
@@ -28,12 +45,14 @@
* @date Aug 14, 2006
*
*/
+// https://jira.jboss.org/browse/JBIDE-6697
+// from eclipse.org/bpel rev 1.5 on 5/5/2010 5:13AM by smoser: fix for bidirectional PLT - > Tammo/JAX Session Feedback
public class CreatePartnerLinkWizard extends Wizard {
CreatePartnerLinkTypeWizardNamePage fFirstPage;
CreatePartnerLinkTypeWizardRolePage fRolePage1;
CreatePartnerLinkTypeWizardRolePage fRolePage2;
- PortType fPortType;
+ PortType fMandatoryPortType;
PartnerLinkType fPartnerLinkType;
BPELEditor fEditor;
@@ -50,8 +69,8 @@
return fPartnerLinkType;
}
- public void setPortType (PortType pt) {
- fPortType = pt;
+ public void setMandatoryPortType (PortType pt) {
+ fMandatoryPortType = pt;
}
public void setBPELEditor ( BPELEditor editor ) {
@@ -72,7 +91,7 @@
fRolePage1.setDescription(Messages.CreatePartnerLinkWizard_6);
fRolePage1.setImageDescriptor(BPELUIPlugin.INSTANCE.getImageDescriptor(
IBPELUIConstants.ICON_WIZARD_BANNER));
- fRolePage1.setDefinition( fPortType.getEnclosingDefinition() );
+ fRolePage1.setMandatoryDefinition( fMandatoryPortType.getEnclosingDefinition() );
fRolePage2 = new CreatePartnerLinkTypeWizardRolePage ("role.2"); //$NON-NLS-1$
@@ -80,7 +99,9 @@
fRolePage2.setDescription(Messages.CreatePartnerLinkWizard_9);
fRolePage2.setImageDescriptor(BPELUIPlugin.INSTANCE.getImageDescriptor(
IBPELUIConstants.ICON_WIZARD_BANNER));
- fRolePage2.setDefinition( fPortType.getEnclosingDefinition() );
+
+ IFile file = EditModel.getIFileForURI(fMandatoryPortType.eResource().getURI());
+ fRolePage2.setOptionalDefinitions( getOptionalDefinitions(file.getProject()) );
fRolePage2.setOptional(true);
@@ -97,6 +118,54 @@
+ private List<Definition> getOptionalDefinitions(IProject project) {
+ final List<Definition> wsdlDefinitions = new ArrayList<Definition>();
+ final List<IFile> wsdlFiles = new ArrayList<IFile>();
+ IResourceVisitor visitor = new IResourceVisitor() {
+ public boolean visit(org.eclipse.core.resources.IResource resource) throws org.eclipse.core.runtime.CoreException {
+ if (resource.getType() == IResource.FILE && "wsdl".equalsIgnoreCase(resource.getFileExtension())) {
+
+ IFile artifactFile = EditModel.getIFileForURI(fEditor.getArtifactsDefinition().eResource().getURI());
+ if (!(artifactFile.getFullPath().equals(((IFile)resource).getFullPath()))) {
+ //filter artifacts WSDL
+ wsdlFiles.add((IFile)resource);
+ }
+ }
+ return true;
+ }
+ };
+ try {
+ project.accept(visitor);
+ }
+ catch (CoreException e) {
+ e.printStackTrace();
+ }
+
+ for (Iterator<IFile> iterator = wsdlFiles.iterator(); iterator.hasNext();) {
+ IFile iFile = iterator.next();
+ IPath fullPath = iFile.getFullPath();
+ URI uri = URI.createPlatformResourceURI(fullPath.toString(), false);
+ Resource wsdlResource = fEditor.getResource().getResourceSet().getResource(uri, true);
+
+ EcorePackage instance = EcorePackage.eINSTANCE;
+ instance.eAdapters();
+
+ try {
+ wsdlResource.load(Collections.EMPTY_MAP);
+ EList<EObject> contents = wsdlResource.getContents();
+ if (!contents.isEmpty()) {
+ Definition def = (Definition) contents.get(0);
+ wsdlDefinitions.add(def);
+ }
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ }
+
+ return wsdlDefinitions;
+ }
+
/**
* Create and return the partner link type that this wizard gathered information
* about.
@@ -113,13 +182,13 @@
Role role1 = PartnerlinktypeFactory.eINSTANCE.createRole();
role1.setName ( fRolePage1.getRoleName() );
- role1.setPortType( fRolePage1.getPortType() );
+ role1.setPortType( fRolePage1.getMandatoryPortType() );
plt.getRole().add(role1);
if (fRolePage2.isSpecified()) {
Role role2 = PartnerlinktypeFactory.eINSTANCE.createRole();
role2.setName ( fRolePage2.getRoleName() );
- role2.setPortType( fRolePage2.getPortType() );
+ role2.setPortType( fRolePage2.getOptionalPortType() );
plt.getRole().add(role2);
}
return plt;
@@ -141,7 +210,7 @@
// WSDL imports to find portTypes etc.
// 1. Add WSDL import to the artifacts file (again, this is a noop if already exists).
- cmd.add( new AddWSDLImportCommand ( artifactsDefinition, fPortType ));
+ cmd.add( new AddWSDLImportCommand ( artifactsDefinition, fMandatoryPortType ));
// 2. Create the new Partner Link Type in the artifacts file.
cmd.add( new CreatePartnerLinkTypeCommand(artifactsDefinition, fPartnerLinkType) );
Modified: trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/xpath/XPathValidator.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/xpath/XPathValidator.java 2010-07-29 13:49:41 UTC (rev 23792)
+++ trunk/bpel/plugins/org.eclipse.bpel.validator/src/org/eclipse/bpel/validator/xpath/XPathValidator.java 2010-07-29 13:56:39 UTC (rev 23793)
@@ -334,6 +334,12 @@
IProblem problem;
Expr expr = xpathExpr;
+ // https://jira.jboss.org/browse/JBIDE-6697
+ // from eclipse.org/bpel rev 1.13 on 7/23/2010 12:21AM by gqian: apply the patch from bugzilla 320539
+ if (expr instanceof UnaryExpr) {
+ expr = ((UnaryExpr) expr).getExpr();
+ }
+
if (expr instanceof LiteralExpr) {
LiteralExpr lexpr = (LiteralExpr) expr;
try {
14 years, 5 months
JBoss Tools SVN: r23792 - in trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main: java/org/jboss/tools/vpe/spring/test/springtest/data and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dvinnichek
Date: 2010-07-29 09:49:41 -0400 (Thu, 29 Jul 2010)
New Revision: 23792
Added:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/CategoryType.java
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml
trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp
Log:
add template for <form:checkboxes> according to https://jira.jboss.org/browse/JBIDE-6711
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java 2010-07-29 13:29:04 UTC (rev 23791)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/FormBean.java 2010-07-29 13:49:41 UTC (rev 23792)
@@ -1,30 +1,65 @@
package org.jboss.tools.vpe.spring.test.springtest;
-/**
- *
- * @author Yahor Radtsevich (yradtsevich)
- */
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.jboss.tools.vpe.spring.test.springtest.data.CategoryType;
+
public class FormBean {
+
private boolean chechbox1Selected = false;
private boolean chechbox2Selected = true;
private boolean chechbox3Selected = false;
-
+
+ private Map<Integer, String> availableCategories = new HashMap<Integer, String>();
+ private Set<Integer> selectedCategories = new HashSet<Integer>();
+
+ public FormBean() {
+ for (CategoryType categoryType : CategoryType.values()) {
+ availableCategories.put(categoryType.getId(), categoryType.getName());
+ }
+ selectedCategories.add(CategoryType.Books.getId());
+ }
+
public boolean isChechbox1Selected() {
return chechbox1Selected;
}
+
public void setChechbox1Selected(boolean chechbox1Selected) {
this.chechbox1Selected = chechbox1Selected;
}
+
public boolean isChechbox2Selected() {
return chechbox2Selected;
}
+
public void setChechbox2Selected(boolean chechbox2Selected) {
this.chechbox2Selected = chechbox2Selected;
}
+
public boolean isChechbox3Selected() {
return chechbox3Selected;
}
+
public void setChechbox3Selected(boolean chechbox3Selected) {
this.chechbox3Selected = chechbox3Selected;
}
+
+ public Map<Integer, String> getAvailableCategories() {
+ return availableCategories;
+ }
+
+ public void setAvailableCategories(Map<Integer, String> availableCategories) {
+ this.availableCategories = availableCategories;
+ }
+
+ public Set<Integer> getSelectedCategories() {
+ return selectedCategories;
+ }
+
+ public void setSelectedCategories(Set<Integer> selectedCategories) {
+ this.selectedCategories = selectedCategories;
+ }
}
Added: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/CategoryType.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/CategoryType.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/CategoryType.java 2010-07-29 13:49:41 UTC (rev 23792)
@@ -0,0 +1,26 @@
+package org.jboss.tools.vpe.spring.test.springtest.data;
+
+public enum CategoryType {
+
+ Sport(1, "sport"),
+ Books(2, "books"),
+ Films(3, "films"),
+ Fishing(4, "fishing");
+
+ private Integer id;
+
+ private String name;
+
+ private CategoryType(Integer id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/java/org/jboss/tools/vpe/spring/test/springtest/data/CategoryType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp 2010-07-29 13:49:41 UTC (rev 23792)
@@ -0,0 +1,33 @@
+<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<html>
+<head>
+ <style>
+ .tall-checkbox {
+ -moz-appearance: none;
+ height: 30px;
+ }
+ </style>
+</head>
+<body>
+ <h1>Test of form:checkboxes</h1>
+
+ <form:form modelAttribute="formBean">
+ <form:checkboxes id="checkboxes1" items="${formBean.availableCategories}"
+ path="selectedCategories" />
+ <br/>form:checkboxes with id, items and path attributes.
+ <br/><br/>
+ <form:checkboxes id="checkboxes2"
+ cssClass="tall-checkbox" cssStyle="width: 30px;"
+ items="${formBean.availableCategories}"
+ path="selectedCategories" />
+ <br/>form:checkboxes with id, cssStyle, cssClass, items and path attributes. (Must look as a big square.)
+ <br/><br/>
+ <form:checkboxes id="checkboxes3" disabled="true"
+ items="${formBean.availableCategories}"
+ path="selectedCategories" />
+ <br/>disabled form:checkboxes
+ <br/><br/>
+ </form:form>
+</body>
+</html>
Property changes on: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/jsp/checkboxes.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml 2010-07-29 13:29:04 UTC (rev 23791)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/WEB-INF/springapp-servlet.xml 2010-07-29 13:49:41 UTC (rev 23792)
@@ -9,6 +9,7 @@
<bean name="/form.htm" class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
<bean name="/checkbox.htm" class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
+ <bean name="/checkboxes.htm" class="org.jboss.tools.vpe.spring.test.springtest.FormController"/>
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"></property>
Modified: trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp 2010-07-29 13:29:04 UTC (rev 23791)
+++ trunk/vpe/tests/org.jboss.tools.vpe.spring.test/resources/SpringTest/src/main/webapp/index.jsp 2010-07-29 13:49:41 UTC (rev 23792)
@@ -1,3 +1,5 @@
+<a href="checkboxes.htm">checkboxes.htm</a>
+<br/>
<a href="checkbox.htm">checkbox.htm</a>
<br/>
<a href="form.htm">form.htm</a>
14 years, 5 months
JBoss Tools SVN: r23791 - trunk/common/plugins/org.jboss.tools.common.model.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-29 09:29:04 -0400 (Thu, 29 Jul 2010)
New Revision: 23791
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-6730
deprecated extension point is replaced with actual one
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2010-07-29 12:55:41 UTC (rev 23790)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2010-07-29 13:29:04 UTC (rev 23791)
@@ -301,7 +301,7 @@
</editor>
</extension>
- <extension point="org.eclipse.core.runtime.contentTypes">
+ <extension point="org.eclipse.core.contenttype.contentTypes">
<content-type id="xml"
name="%ContentType_JBossToolsXML"
base-type="org.eclipse.core.runtime.xml"
14 years, 5 months
JBoss Tools SVN: r23790 - in trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test: widgets and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jlukas(a)redhat.com
Date: 2010-07-29 08:55:41 -0400 (Thu, 29 Jul 2010)
New Revision: 23790
Modified:
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WsTesterTest.java
trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/SelectWSDLDialog.java
Log:
adopt latest changes in test
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WsTesterTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WsTesterTest.java 2010-07-29 12:51:40 UTC (rev 23789)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/WsTesterTest.java 2010-07-29 12:55:41 UTC (rev 23790)
@@ -144,7 +144,7 @@
wstv.show();
wstv.setRequestType(Request_Type.JAX_WS);
Assert.assertEquals(Request_Type.JAX_WS, wstv.getRequestType());
- wstv.setServiceURL(SERVICE_URL);
+ wstv.setServiceURL(SERVICE_URL + "?WSDL");
InputStream is = WsTesterTest.class.getResourceAsStream("/resources/jbossws/message_soap_out.xml");
wstv.setRequestBody(readResource(is));
wstv.invoke();
@@ -178,7 +178,7 @@
dlg.close();
}
}
- Assert.assertEquals(SERVICE_URL, wstv.getServiceURL());
+ Assert.assertEquals(SERVICE_URL + "?WSDL", wstv.getServiceURL());
InputStream is = WsTesterTest.class.getResourceAsStream("/resources/jbossws/message_soap12_out.xml");
wstv.setRequestBody(readResource(is));
wstv.invoke();
@@ -372,7 +372,7 @@
Assert.assertTrue(items.contains("GetBibleWordsByChapterAndVerse"));
dlg.selectOperation("GetBibleWordsbyKeyWord");
dlg.ok();
- Assert.assertEquals("http://www.webservicex.net/BibleWebservice.asmx", wstv.getServiceURL());
+ Assert.assertEquals("http://www.webservicex.net/BibleWebservice.asmx?WSDL", wstv.getServiceURL());
} finally {
if (dlg.isOpen()) {
dlg.close();
Modified: trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/SelectWSDLDialog.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/SelectWSDLDialog.java 2010-07-29 12:51:40 UTC (rev 23789)
+++ trunk/ws/tests/org.jboss.tools.ws.ui.bot.test/src/org/jboss/tools/ws/ui/bot/test/widgets/SelectWSDLDialog.java 2010-07-29 12:55:41 UTC (rev 23790)
@@ -73,6 +73,10 @@
public void ok() {
bot().button(IDialogConstants.OK_LABEL).click();
+ bot().sleep(500);
+ if (JBossWSUIMessages.JAXRSWSTestView2_Title_Msg_May_Be_Out_of_Date.equals(bot().activeShell().getText())) {
+ bot().activeShell().bot().button("Yes").click();
+ }
}
private List<String> getItems(String label) {
14 years, 5 months
JBoss Tools SVN: r23789 - trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2010-07-29 08:51:40 -0400 (Thu, 29 Jul 2010)
New Revision: 23789
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/PortletCoreActivator.java
Log:
https://jira.jboss.org/browse/JBIDE-6719 Make portal facets show up by default, disregarding runtime
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/PortletCoreActivator.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/PortletCoreActivator.java 2010-07-29 12:33:07 UTC (rev 23788)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.core/src/org/jboss/tools/portlet/core/PortletCoreActivator.java 2010-07-29 12:51:40 UTC (rev 23789)
@@ -36,7 +36,7 @@
public static final String RESOURCES_FOLDER = "resources"; //$NON-NLS-1$
public static final String JSFPORTLET_FOLDER = "jsfportlet"; //$NON-NLS-1$
public static final String CHECK_RUNTIMES = "checkRuntimes"; //$NON-NLS-1$
- public static final boolean DEFAULT_CHECK_RUNTIMES = true;
+ public static final boolean DEFAULT_CHECK_RUNTIMES = false;
public static final String JSFPORTLET_LIBRARY_PROVIDER = "jsfportlet-library-provider"; //$NON-NLS-1$
public static final String JSFPORTLETBRIDGE_LIBRARY_PROVIDER = "jsfportletbridge-library-provider"; //$NON-NLS-1$
14 years, 5 months
JBoss Tools SVN: r23788 - trunk/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-29 08:33:07 -0400 (Thu, 29 Jul 2010)
New Revision: 23788
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
https://jira.jboss.org/browse/JBIDE-6730
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2010-07-29 12:20:11 UTC (rev 23787)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2010-07-29 12:33:07 UTC (rev 23788)
@@ -351,7 +351,7 @@
versions="5.0"/>
<moduleType
types="jst.web"
- versions="2.2, 2.3, 2.4, 2.5"/>
+ versions="2.2, 2.3, 2.4, 2.5, 3.0"/>
<moduleType
types="jst.ejb"
versions="1.0, 1.1, 2.0, 2.1, 3.0"/>
@@ -795,7 +795,7 @@
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
version="6.0"/>
- <facet id="jst.web" version="2.2,2.3,2.4,2.5"/>
+ <facet id="jst.web" version="2.2,2.3,2.4,2.5,3.0"/>
<facet id="jst.java" version="5.0,6.0"/>
<facet id="jst.utility" version="1.0"/>
<facet id="jst.connector" version="1.0,1.5"/>
14 years, 5 months
JBoss Tools SVN: r23787 - trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-07-29 08:20:11 -0400 (Thu, 29 Jul 2010)
New Revision: 23787
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
Log:
https://jira.jboss.org/browse/JBIDE-6730
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2010-07-29 00:05:11 UTC (rev 23786)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/operation/WebNatureOperation.java 2010-07-29 12:20:11 UTC (rev 23787)
@@ -394,6 +394,7 @@
FacetDataModelMap map = (FacetDataModelMap) dataModel.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
IDataModel configDM = (IDataModel) map.get("jst.web"); //$NON-NLS-1$
+ IDataModel configJavaDM = (IDataModel) map.get("java"); //$NON-NLS-1$
boolean hasJSTWebFacet = false;
if(exists) {
@@ -410,9 +411,12 @@
}
}
- if(sv != null && (sv.indexOf("2.3") >= 0 || sv.indexOf("2.5") >= 0)) { //$NON-NLS-1$ //$NON-NLS-2$
+ if(sv != null && (sv.indexOf("2.3") >= 0 || sv.indexOf("2.5") >= 0 || sv.indexOf("3.0") >= 0)) { //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
configDM.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, sv);
}
+ if(configJavaDM != null && sv != null && sv.indexOf("3.0") >= 0) { //$NON-NLS-1$
+ configJavaDM.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, "1.6"); //$NON-NLS-1$
+ }
if(webroot != null) {
int i = webroot.lastIndexOf("/"); //$NON-NLS-1$
14 years, 5 months
JBoss Tools SVN: r23786 - trunk/hibernatetools/docs.
by jbosstools-commits@lists.jboss.org
Author: benlc
Date: 2010-07-28 20:05:11 -0400 (Wed, 28 Jul 2010)
New Revision: 23786
Removed:
trunk/hibernatetools/docs/task-reference/
Log:
'removing the task-reference document to avoid possible build issues JBIDE 6720. Changing filenaming scheme. Document is in very early stages of development so svn history is minimal. '
14 years, 5 months
JBoss Tools SVN: r23785 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core: src/org/jboss/tools/deltacloud/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-07-28 17:58:36 -0400 (Wed, 28 Jul 2010)
New Revision: 23785
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java
Log:
2010-07-28 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (findCloud): New
method to find a cloud by name.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-07-28 21:57:41 UTC (rev 23784)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-07-28 21:58:36 UTC (rev 23785)
@@ -1,3 +1,8 @@
+2010-07-28 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java (findCloud): New
+ method to find a cloud by name.
+
2010-07-27 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/client/Property.java: New file.
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-07-28 21:57:41 UTC (rev 23784)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloudManager.java 2010-07-28 21:58:36 UTC (rev 23785)
@@ -35,6 +35,14 @@
return clouds.toArray(new DeltaCloud[clouds.size()]);
}
+ public DeltaCloud findCloud(String name) {
+ for (DeltaCloud cloud : clouds) {
+ if (cloud.getName().equals(name))
+ return cloud;
+ }
+ return null;
+ }
+
public void addCloud(DeltaCloud d) {
clouds.add(d);
notifyListeners(ICloudManagerListener.ADD_EVENT);
14 years, 5 months
JBoss Tools SVN: r23784 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: jjohnstn
Date: 2010-07-28 17:57:41 -0400 (Wed, 28 Jul 2010)
New Revision: 23784
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java
Log:
2010-07-28 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java: New file.
* src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: New file.
* plugin.properties: Add messages for connection wizard.
* plugin.xml: Add new connection wizard.
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages.
* src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (changeEvent): New method
to make this an ICloudManagerListener.
(makeActions): Add new refresh action.
(fillLocalPullDown): Ditto.
(createPartControl): Register this as DeltaCloudManager listener.
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-07-28 19:14:28 UTC (rev 23783)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2010-07-28 21:57:41 UTC (rev 23784)
@@ -1,3 +1,18 @@
+2010-07-28 Jeff Johnston <jjohnstn(a)redhat.com>
+
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java: New file.
+ * src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties: New file.
+ * plugin.properties: Add messages for connection wizard.
+ * plugin.xml: Add new connection wizard.
+ * src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new messages.
+ * src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java (changeEvent): New method
+ to make this an ICloudManagerListener.
+ (makeActions): Add new refresh action.
+ (fillLocalPullDown): Ditto.
+ (createPartControl): Register this as DeltaCloudManager listener.
+
2010-07-27 Jeff Johnston <jjohnstn(a)redhat.com>
* src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties: Add new message
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties 2010-07-28 19:14:28 UTC (rev 23783)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.properties 2010-07-28 21:57:41 UTC (rev 23784)
@@ -1,4 +1,5 @@
DeltaCloudCategory=Delta Cloud
CloudViewerName=Cloud Viewer
-Advanced.label=Advanced
\ No newline at end of file
+Advanced.label=Advanced
+NewWizard.name=Cloud Connection
\ No newline at end of file
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-07-28 19:14:28 UTC (rev 23783)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2010-07-28 21:57:41 UTC (rev 23784)
@@ -56,5 +56,19 @@
</propertySection>
</propertySections>
</extension>
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <category
+ id="org.jboss.tools.deltacloud.ui.wizard.category"
+ name="%DeltaCloudCategory">
+ </category>
+ <wizard
+ category="org.jboss.tools.deltacloud.ui.wizard.category"
+ class="org.jboss.tools.internal.deltacloud.ui.wizards.NewCloudConnection"
+ icon="icons/delta.gif"
+ id="org.jboss.tools.deltacloud.ui.connection.wizard"
+ name="%NewWizard.name">
+ </wizard>
+ </extension>
</plugin>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-07-28 19:14:28 UTC (rev 23783)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/CVMessages.properties 2010-07-28 21:57:41 UTC (rev 23784)
@@ -16,4 +16,5 @@
CollapseAll.label=Collapse All
-RemoveCloud.label=Disconnect Cloud
\ No newline at end of file
+RemoveCloud.label=Disconnect Cloud
+Refresh.label=Refresh View
\ No newline at end of file
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-07-28 19:14:28 UTC (rev 23783)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/DeltaCloudView.java 2010-07-28 21:57:41 UTC (rev 23784)
@@ -26,10 +26,11 @@
import org.eclipse.ui.part.ViewPart;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.core.ICloudManagerListener;
import org.jboss.tools.deltacloud.ui.SWTImagesFactory;
-public class DeltaCloudView extends ViewPart {
+public class DeltaCloudView extends ViewPart implements ICloudManagerListener {
/**
* The ID of the view as specified by the extension.
@@ -37,6 +38,7 @@
public static final String ID = "org.jboss.tools.deltacloud.ui.views.DeltaCloudView";
private static final String REMOVE_CLOUD = "RemoveCloud.label"; //$NON-NLS-1$
+ private static final String REFRESH = "Refresh.label"; //$NON-NLS-1$
public static final String COLLAPSE_ALL = "CollapseAll.label"; //$NON-NLS-1$
@@ -44,10 +46,10 @@
private Action action1;
private Action action2;
private Action removeCloud;
+ private Action refreshAction;
private Action collapseall;
private Action doubleClickAction;
-
/**
* The constructor.
*/
@@ -73,6 +75,7 @@
hookDoubleClickAction();
hookSelection();
contributeToActionBars();
+ DeltaCloudManager.getDefault().addCloudManagerListener(this);
}
private void hookSelection() {
@@ -113,6 +116,7 @@
manager.add(action1);
manager.add(new Separator());
manager.add(removeCloud);
+ manager.add(refreshAction);
}
private void fillContextMenu(IMenuManager manager) {
@@ -152,7 +156,17 @@
removeCloud.setText(CVMessages.getString(REMOVE_CLOUD));
removeCloud.setToolTipText(CVMessages.getString(REMOVE_CLOUD));
removeCloud.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
+ getImageDescriptor(ISharedImages.IMG_ELCL_REMOVE));
+
+ refreshAction = new Action() {
+ public void run() {
+ viewer.setInput(getViewSite());
+ }
+ };
+ refreshAction.setText(CVMessages.getString(REFRESH));
+ refreshAction.setToolTipText(CVMessages.getString(REFRESH));
+ refreshAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
+ getImageDescriptor(ISharedImages.IMG_TOOL_REDO));
action1 = new Action() {
public void run() {
@@ -210,4 +224,9 @@
public void setFocus() {
viewer.getControl().setFocus();
}
+
+ @Override
+ public void changeEvent(int type) {
+ viewer.setInput(getViewSite());
+ }
}
\ No newline at end of file
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnection.java 2010-07-28 21:57:41 UTC (rev 23784)
@@ -0,0 +1,56 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.deltacloud.core.DeltaCloud;
+import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.ui.Activator;
+
+public class NewCloudConnection extends Wizard implements INewWizard {
+
+ private static final String MAINPAGE_NAME = "NewCloudConnection.name"; //$NON-NLS-1$
+ private NewCloudConnectionPage mainPage;
+
+ public NewCloudConnection() {
+ super();
+ }
+
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // TODO Auto-generated method stub
+ }
+
+ @Override
+ public void addPages() {
+ // TODO Auto-generated method stub
+ mainPage = new NewCloudConnectionPage(WizardMessages.getString(MAINPAGE_NAME));
+ addPage(mainPage);
+ }
+
+ @Override
+ public boolean canFinish() {
+ return mainPage.isPageComplete();
+ }
+
+ @Override
+ public boolean performFinish() {
+ String name = mainPage.getName();
+ String url = mainPage.getURL();
+ String username = mainPage.getUsername();
+ String password = mainPage.getPassword();
+ try {
+ DeltaCloud newCloud = new DeltaCloud(name, new URL(url), username, password);
+ DeltaCloudManager.getDefault().addCloud(newCloud);
+ } catch (MalformedURLException e) {
+ Activator.log(e);
+ return false;
+ }
+ return true;
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/NewCloudConnectionPage.java 2010-07-28 21:57:41 UTC (rev 23784)
@@ -0,0 +1,314 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.StringReader;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.jboss.tools.deltacloud.core.DeltaCloudManager;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+public class NewCloudConnectionPage extends WizardPage {
+
+ private static final String DESCRIPTION = "NewCloudConnection.desc"; //$NON-NLS-1$
+ private static final String TITLE = "NewCloudConnection.title"; //$NON-NLS-1$
+ private static final String URL_LABEL = "Url.label"; //$NON-NLS-1$
+ private static final String NAME_LABEL = "Name.label"; //$NON-NLS-1$
+ private static final String USERNAME_LABEL = "UserName.label"; //$NON-NLS-1$
+ private static final String TYPE_LABEL = "Type.label"; //$NON-NLS-1$
+ private static final String PASSWORD_LABEL = "Password.label"; //$NON-NLS-1$
+ private static final String UNKNOWN_TYPE_LABEL = "UnknownType.label"; //$NON-NLS-1$
+ private static final String EC2_USER_INFO = "EC2UserNameLink.text"; //$NON-NLS-1$
+ private static final String EC2_PASSWORD_INFO = "EC2PasswordLink.text"; //$NON-NLS-1$
+ private static final String NAME_ALREADY_IN_USE = "ErrorNameInUse.text"; //$NON-NLS-1$
+ private static final String INVALID_URL = "ErrorInvalidURL.text"; //$NON-NLS-1$
+ private static final String NONCLOUD_URL = "ErrorNonCloudURL.text"; //$NON-NLS-1$
+
+ private Label errorLabel;
+
+ private Text nameText;
+ private Text urlText;
+ private Label typeText;
+ private Text usernameText;
+ private Text passwordText;
+
+ private String name;
+ private String url;
+ private String username;
+ private String password;
+
+ private Listener linkListener = new Listener() {
+
+ public void handleEvent(Event event) {
+ try {
+ URL url = new URL(event.text);
+ PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(url);
+ } catch (Exception e) {
+ Activator.log(e);
+ }
+ }
+
+ };
+
+ public NewCloudConnectionPage(String pageName) {
+ super(pageName);
+ setDescription(WizardMessages.getString(DESCRIPTION));
+ setTitle(WizardMessages.getString(TITLE));
+ setPageComplete(false);
+ }
+
+ private ModifyListener textListener = new ModifyListener() {
+
+ @Override
+ public void modifyText(ModifyEvent e) {
+ validate();
+ }
+ };
+
+ public String getName() {
+ return name;
+ }
+
+ public String getURL() {
+ return url;
+ }
+
+ public String getUsername() {
+ return username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ private void validate() {
+ boolean complete = true;
+ boolean errorFree = true;
+ name = nameText.getText();
+ if (name.length() > 0) {
+ if (DeltaCloudManager.getDefault().findCloud(name) != null) {
+ errorFree = false;
+ setErrorMessage(WizardMessages.getString(NAME_ALREADY_IN_USE));
+ }
+ } else {
+ complete = false;
+ }
+ String oldurl = url;
+ url = urlText.getText();
+ if (url.length() > 0) {
+ if (!url.equals(oldurl)) {
+ try {
+ URL u = new URL(url + ".xml");
+ Object o = u.getContent();
+ if (o instanceof InputStream) {
+ String xml = "";
+ InputStream is = (InputStream)o;
+ try
+ {
+ if (is != null)
+ {
+ StringBuilder sb = new StringBuilder();
+ String line;
+
+ BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ while ((line = reader.readLine()) != null)
+ {
+ sb.append(line).append("\n");
+ }
+ xml = sb.toString();
+ }
+ }
+ finally
+ {
+ is.close();
+ }
+
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document document = db.parse(new InputSource(new StringReader(xml)));
+
+ NodeList elements = document.getElementsByTagName("api"); //$NON-NLS-1$
+ if (elements.getLength() > 0) {
+ Node n = elements.item(0);
+ Node driver = n.getAttributes().getNamedItem("driver"); //$NON-NLS-1$
+ if (driver != null) {
+ String driverValue = driver.getNodeValue();
+ typeText.setText(driverValue.toUpperCase());
+ }
+ }
+ }
+ } catch (MalformedURLException e) {
+ errorFree = false;
+ setErrorMessage(WizardMessages.getString(INVALID_URL));
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ errorFree = false;
+ setErrorMessage(WizardMessages.getString(NONCLOUD_URL));
+ } catch (ParserConfigurationException e) {
+ errorFree = false;
+ setErrorMessage(WizardMessages.getString(NONCLOUD_URL));
+ } catch (SAXException e) {
+ errorFree = false;
+ setErrorMessage(WizardMessages.getString(NONCLOUD_URL));
+ }
+ }
+ } else {
+ complete = false;
+ }
+ username = usernameText.getText();
+ if (username.length() <= 0) {
+ complete = false;
+ }
+ password = passwordText.getText();
+ if (password.length() <= 0) {
+ complete = false;
+ }
+ if (errorFree)
+ setErrorMessage(null);
+ setPageComplete(complete & errorFree);
+ }
+
+ @Override
+ public void createControl(Composite parent) {
+ // TODO Auto-generated method stub
+ final Composite container = new Composite(parent, SWT.NULL);
+ FormLayout layout = new FormLayout();
+ layout.marginHeight = 5;
+ layout.marginWidth = 5;
+ container.setLayout(layout);
+
+ errorLabel = new Label(container, SWT.NULL);
+ // errorLabel.setForeground(JFaceResources.getColorRegistry().get(JFacePreferences.ERROR_COLOR));
+
+ Label nameLabel = new Label(container, SWT.NULL);
+ nameLabel.setText(WizardMessages.getString(NAME_LABEL));
+ nameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ nameText.addModifyListener(textListener);
+
+ Label urlLabel = new Label(container, SWT.NULL);
+ urlLabel.setText(WizardMessages.getString(URL_LABEL));
+
+ urlText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ urlText.addModifyListener(textListener);
+
+ Label typeLabel = new Label(container, SWT.NULL);
+ typeLabel.setText(WizardMessages.getString(TYPE_LABEL));
+
+ typeText = new Label(container, SWT.NULL);
+ typeText.setText(WizardMessages.getString(UNKNOWN_TYPE_LABEL));
+
+ Label usernameLabel = new Label(container, SWT.NULL);
+ usernameLabel.setText(WizardMessages.getString(USERNAME_LABEL));
+
+ usernameText = new Text(container, SWT.BORDER | SWT.SINGLE);
+ usernameText.addModifyListener(textListener);
+
+ Label passwordLabel = new Label(container, SWT.NULL);
+ passwordLabel.setText(WizardMessages.getString(PASSWORD_LABEL));
+
+ passwordText = new Text(container, SWT.BORDER | SWT.PASSWORD | SWT.SINGLE);
+ passwordText.addModifyListener(textListener);
+
+ Link ec2userLink = new Link(container, SWT.NULL);
+ ec2userLink.setText(WizardMessages.getString(EC2_USER_INFO));
+ ec2userLink.addListener(SWT.Selection, linkListener);
+
+ Link ec2pwLink = new Link(container, SWT.NULL);
+ ec2pwLink.setText(WizardMessages.getString(EC2_PASSWORD_INFO));
+ ec2pwLink.addListener(SWT.Selection, linkListener);
+
+ FormData f = new FormData();
+ f.left = new FormAttachment(0, 0);
+ f.right = new FormAttachment(100, 0);
+ errorLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(errorLabel, 8);
+ nameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(errorLabel, 8);
+ f.left = new FormAttachment(usernameLabel, 5);
+ f.right = new FormAttachment(100, 0);
+ nameText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(nameText, 8);
+ urlLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(nameText, 0, SWT.LEFT);
+ f.top = new FormAttachment(nameText, 5);
+ f.right = new FormAttachment(100, 0);
+ urlText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(urlText, 8);
+ typeLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(urlText, 0, SWT.LEFT);
+ f.top = new FormAttachment(urlText, 5);
+ f.right = new FormAttachment(100, 0);
+ typeText.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(typeText, 8);
+ usernameLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(typeText, 0, SWT.LEFT);
+ f.top = new FormAttachment(typeText, 5);
+ f.right = new FormAttachment(100, 0);
+ usernameText.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(usernameText, 0, SWT.LEFT);
+ f.top = new FormAttachment(usernameText, 5);
+ ec2userLink.setLayoutData(f);
+
+ f = new FormData();
+ f.top = new FormAttachment(ec2userLink, 8);
+ passwordLabel.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(usernameText, 0, SWT.LEFT);
+ f.top = new FormAttachment(ec2userLink, 5);
+ f.right = new FormAttachment(100, 0);
+ passwordText.setLayoutData(f);
+
+ f = new FormData();
+ f.left = new FormAttachment(passwordText, 0, SWT.LEFT);
+ f.top = new FormAttachment(passwordText, 5);
+ ec2pwLink.setLayoutData(f);
+
+ setControl(container);
+}
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.java 2010-07-28 21:57:41 UTC (rev 23784)
@@ -0,0 +1,20 @@
+package org.jboss.tools.internal.deltacloud.ui.wizards;
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+public class WizardMessages {
+
+ private static final String BUNDLE_NAME = WizardMessages.class.getName();
+
+ public static String getString(String key) {
+ try {
+ return ResourceBundle.getBundle(BUNDLE_NAME).getString(key);
+ } catch (MissingResourceException e) {
+ return '!' + key + '!';
+ } catch (NullPointerException e) {
+ return '#' + key + '#';
+ }
+ }
+
+}
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2010-07-28 21:57:41 UTC (rev 23784)
@@ -0,0 +1,18 @@
+NewCloudConnection.desc=Specify connection details for a cloud you wish to access
+NewCloudConnection.title=Cloud Connection
+NewCloudConnection.name=Cloud Connection
+
+Url.label=URL:
+Name.label=Name:
+Type.label=Type:
+UserName.label=Username:
+Password.label=Password:
+TestButton.label=Test
+UnknownType.label=Unknown
+
+EC2UserNameLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access ID</a>
+EC2PasswordLink.text=For EC2 use the <a href="https://console.aws.amazon.com/ec2/home">Access Secret Key</a>
+
+ErrorNameInUse.text=Error: the name chosen is already in use
+ErrorInvalidURL.text=Error: the URL specified is invalid
+ErrorNonCloudURL.text=Error: the URL specified is not a valid cloud address
\ No newline at end of file
14 years, 5 months