JBoss Tools SVN: r29920 - in branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating: src/org/jboss/tools/smooks/templating/model/xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-03-21 11:08:39 -0400 (Mon, 21 Mar 2011)
New Revision: 29920
Modified:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/META-INF/MANIFEST.MF
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java
Log:
[JBIDE-8522] added LSResourceResolver to XSDSchemaFactory, switched to URIConverter (was: #toFile) when getting dependent schemes
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/META-INF/MANIFEST.MF 2011-03-21 15:02:04 UTC (rev 29919)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/META-INF/MANIFEST.MF 2011-03-21 15:08:39 UTC (rev 29920)
@@ -12,7 +12,8 @@
Require-Bundle: org.jboss.tools.smooks.runtime,
org.eclipse.xsd,
org.eclipse.emf,
- org.eclipse.core.runtime
+ org.eclipse.core.runtime,
+ org.apache.xerces;bundle-version="2.9.0"
Export-Package: com.thoughtworks.xstream,
com.thoughtworks.xstream.alias,
com.thoughtworks.xstream.annotations,
Modified: branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java
===================================================================
--- branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java 2011-03-21 15:02:04 UTC (rev 29919)
+++ branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.templating/src/org/jboss/tools/smooks/templating/model/xml/XSDModelBuilder.java 2011-03-21 15:08:39 UTC (rev 29920)
@@ -19,34 +19,56 @@
*/
package org.jboss.tools.smooks.templating.model.xml;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Set;
+import java.util.Stack;
+
+import javax.xml.XMLConstants;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+import javax.xml.validation.Validator;
+
+import org.apache.xerces.dom.DOMInputImpl;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.xsd.XSDAttributeDeclaration;
+import org.eclipse.xsd.XSDAttributeGroupContent;
+import org.eclipse.xsd.XSDAttributeUse;
+import org.eclipse.xsd.XSDAttributeUseCategory;
+import org.eclipse.xsd.XSDComplexTypeDefinition;
+import org.eclipse.xsd.XSDCompositor;
+import org.eclipse.xsd.XSDElementDeclaration;
+import org.eclipse.xsd.XSDModelGroup;
+import org.eclipse.xsd.XSDParticle;
+import org.eclipse.xsd.XSDParticleContent;
+import org.eclipse.xsd.XSDSchema;
+import org.eclipse.xsd.XSDSimpleTypeDefinition;
+import org.eclipse.xsd.XSDTypeDefinition;
import org.eclipse.xsd.util.XSDResourceFactoryImpl;
import org.eclipse.xsd.util.XSDResourceImpl;
-import org.eclipse.xsd.*;
+import org.jboss.tools.smooks.templating.model.ModelBuilder;
+import org.jboss.tools.smooks.templating.model.ModelBuilderException;
+import org.jboss.tools.smooks.templating.template.xml.XMLFreeMarkerTemplateBuilder;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.Element;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSResourceResolver;
import org.xml.sax.SAXException;
-import org.jboss.tools.smooks.templating.model.ModelBuilder;
-import org.jboss.tools.smooks.templating.model.ModelBuilderException;
-import org.jboss.tools.smooks.templating.template.xml.XMLFreeMarkerTemplateBuilder;
-import java.util.*;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.File;
-
-import javax.xml.XMLConstants;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-import javax.xml.validation.Validator;
-
/**
* XML Model Builder from an XML Schema (XSD).
* <p/>
@@ -60,15 +82,25 @@
private Map<String, XSDElementDeclaration> elements = new LinkedHashMap<String, XSDElementDeclaration>();
private Map<String, XSDTypeDefinition> types = new LinkedHashMap<String, XSDTypeDefinition>();
- private Set<String> loadedSchemas = new HashSet<String>();
+ private ResourceSet resourceSet;
+ private Set<URI> loadedSchemas = new HashSet<URI>();
private Stack<XSDTypeDefinition> elementExpandStack = new Stack<XSDTypeDefinition>();
private String rootElementName;
private Properties nsPrefixes = new Properties();
public XSDModelBuilder(URI schemaURI) throws IOException, ModelBuilderException {
- loadSchema(schemaURI);
- }
+ this.resourceSet = createResourceSet();
+ loadSchema(schemaURI);
+ }
+ private ResourceSet createResourceSet() {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl()); //$NON-NLS-1$
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put(XSDResourceImpl.XSD_TRACK_LOCATION, true);
+ return resourceSet;
+ }
+
public Set<String> getRootElementNames() {
return Collections.unmodifiableSet(elements.keySet());
}
@@ -102,74 +134,109 @@
* @throws SAXException Validation error.
* @throws IOException Error reading the XSD Sources.
*/
- public void validate(Document message) throws SAXException, IOException {
- StreamSource[] xsdSources = new StreamSource[loadedSchemas.size()];
- int i = 0;
+ public void validate(Document message) throws SAXException, IOException {
+ StreamSource[] xsdSources = new StreamSource[loadedSchemas.size()];
+ int i = 0;
- try {
- for(String schemaPath : loadedSchemas) {
- File schemaFile = new File(schemaPath);
-
- if(!schemaFile.exists()) {
- throw new IOException("XSD '" + schemaFile.getAbsolutePath() + "' not found."); //$NON-NLS-1$ //$NON-NLS-2$
- }
- xsdSources[i] = new StreamSource(new FileInputStream(schemaFile));
- i++;
- }
+ try {
+ for (URI schemaURI : loadedSchemas) {
+ InputStream in = resourceSet.getURIConverter().createInputStream(schemaURI);
+ if (in == null) {
+ throw new IOException("XSD '" + schemaURI + "' not found."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ xsdSources[i] = new StreamSource(in);
+ i++;
+ }
+
+ SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+ schemaFactory.setResourceResolver(new SchemeListLSResourceResolver());
+ Schema schema = schemaFactory.newSchema(xsdSources);
+ Validator validator = schema.newValidator();
+
+ validator.validate(new DOMSource(message));
+ } finally {
+ for (StreamSource schemaStream : xsdSources) {
+ try {
+ schemaStream.getInputStream().close();
+ } catch (Exception e) {
+ // Nothing we can do...
+ }
+ }
+ }
+ }
- SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
- Schema schema = schemaFactory.newSchema(xsdSources);
- Validator validator = schema.newValidator();
+ /**
+ * resolves a schema for a given system id on behalf of a list of schemes that were
+ * extracted in a former step in #validate.
+ *
+ * @see #validate
+ *
+ */
+ public class SchemeListLSResourceResolver implements LSResourceResolver {
- validator.validate(new DOMSource(message));
- } finally {
- for(StreamSource schemaStream : xsdSources) {
- try {
- schemaStream.getInputStream().close();
- } catch(Exception e) {
- // Nothing we can do...
- }
- }
- }
- }
+ public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId,
+ String baseURI) {
- private void loadSchema(URI schemaURI) throws IOException, ModelBuilderException {
- ResourceSet resourceSet = new ResourceSetImpl();
- Resource resource;
-
+ LSInput input = new DOMInputImpl();
+ try {
+ InputStream in = getLoadedSchema(systemId);
+ input.setByteStream(in);
+ return input;
+ } catch (Exception ex) {
+ ex.printStackTrace();
+ return null;
+ }
+ }
+
+ private InputStream getLoadedSchema(String systemId) throws IOException {
+ for (URI schemaUri : loadedSchemas) {
+ String lastSegment = schemaUri.lastSegment();
+ if (systemId.equals(lastSegment)) {
+ return resourceSet.getURIConverter().createInputStream(schemaUri);
+ }
+ }
+ return null;
+ }
+
+ }
+
+ private void loadSchema(URI schemaURI) throws IOException, ModelBuilderException {
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("xsd", new XSDResourceFactoryImpl()); //$NON-NLS-1$
- resource = resourceSet.getResource(schemaURI, true);
+ Resource resource = resourceSet.getResource(schemaURI, true);
- Map<String, Object> options = new HashMap<String, Object>();
- options.put(XSDResourceImpl.XSD_TRACK_LOCATION, true);
+ Map<String, Object> options = new HashMap<String, Object>();
+ options.put(XSDResourceImpl.XSD_TRACK_LOCATION, true);
- resource.load(options);
+ resource.load(options);
- if(resource.getContents().isEmpty()) {
- throw new ModelBuilderException("Failed to load schema '" + schemaURI + "'."); //$NON-NLS-1$ //$NON-NLS-2$
- }
+ if (resource.getContents().isEmpty()) {
+ throw new ModelBuilderException("Failed to load schema '" + schemaURI + "'."); //$NON-NLS-1$ //$NON-NLS-2$
+ }
- XSDSchema schema = (XSDSchema) resource.getContents().get(0);
+ XSDSchema schema = (XSDSchema) resource.getContents().get(0);
- List<XSDElementDeclaration> elementDeclarations = schema.getElementDeclarations();
- for(XSDElementDeclaration elementDeclaration : elementDeclarations) {
- if(!elementDeclaration.isAbstract()) {
- elements.put(elementDeclaration.getName(), elementDeclaration);
- }
- }
+ List<XSDElementDeclaration> elementDeclarations = schema.getElementDeclarations();
+ for (XSDElementDeclaration elementDeclaration : elementDeclarations) {
+ if (!elementDeclaration.isAbstract()) {
+ elements.put(elementDeclaration.getName(), elementDeclaration);
+ }
+ }
- EList typeDefs = schema.getTypeDefinitions();
- for(int i = 0; i < typeDefs.size(); i++) {
- XSDTypeDefinition type = (XSDTypeDefinition) typeDefs.get(i);
- types.put(type.getName(), type);
- }
-
- EList<Resource> schemaResources = resourceSet.getResources();
- for(Resource schemaRes : schemaResources) {
- loadedSchemas.add(schemaRes.getURI().toFileString());
- }
- }
+ EList<XSDTypeDefinition> typeDefs = schema.getTypeDefinitions();
+ for (int i = 0; i < typeDefs.size(); i++) {
+ XSDTypeDefinition type = (XSDTypeDefinition) typeDefs.get(i);
+ types.put(type.getName(), type);
+ }
+ EList<Resource> schemaResources = resourceSet.getResources();
+ for (Resource schemaRes : schemaResources) {
+ loadedSchemas.add(schemaRes.getURI());
+ }
+
+ resourceSet.getResources().remove(resource);
+ }
+
+
private void expand(XSDElementDeclaration elementDeclaration, int minOccurs, int maxOccurs, Node parent, Document document) {
XSDTypeDefinition typeDef;
@@ -241,7 +308,7 @@
private void processComplexType(Document document, Element element, XSDComplexTypeDefinition complexTypeDef) {
XSDParticle particle = complexTypeDef.getComplexType();
- EList attributes = complexTypeDef.getAttributeContents();
+ EList<XSDAttributeGroupContent> attributes = complexTypeDef.getAttributeContents();
addAttributes(element, attributes);
@@ -290,13 +357,13 @@
}
}
- private void addAttributes(Element element, EList attributes) {
+ private void addAttributes(Element element, EList<XSDAttributeGroupContent> attributes) {
// Add the attributes...
if(attributes != null) {
for(int i = 0; i < attributes.size(); i++) {
XSDAttributeUse attributeUse = (XSDAttributeUse) attributes.get(i);
XSDAttributeDeclaration attributeDecl = attributeUse.getAttributeDeclaration();
- XSDSimpleTypeDefinition typeDef = attributeDecl.getTypeDefinition();
+// XSDSimpleTypeDefinition typeDef = attributeDecl.getTypeDefinition();
String name = attributeDecl.getName();
String attributeNS = attributeDecl.getTargetNamespace();
String value = ""; //$NON-NLS-1$
13 years, 9 months
JBoss Tools SVN: r29921 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-03-21 11:08:41 -0400 (Mon, 21 Mar 2011)
New Revision: 29921
Modified:
trunk/build/pom.xml
Log:
bump version to 0.0.2, fix instructions for running w/ Mead
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-03-21 15:08:39 UTC (rev 29920)
+++ trunk/build/pom.xml 2011-03-21 15:08:41 UTC (rev 29921)
@@ -5,16 +5,17 @@
<groupId>org.jboss.tools</groupId>
<artifactId>org.jboss.tools.build</artifactId>
<name>org.jboss.tools.build</name>
- <version>0.0.1-SNAPSHOT</version>
+ <version>0.0.2</version>
<packaging>pom</packaging>
<profiles>
- <!-- for bootstrapping the parent and target-platform poms via Mead, we need to be able to fetch from
- this folder and run these two profiles (excluding all others)
+ <!-- for bootstrapping the parent and target-platform poms via Mead, we need to be able to fetch from this folder and run
+ this profile (excluding all others); currently parent pom includes target-platform build too, so only need to build the parent
- -P parent,target-platform,!libs,!tests,!jmx,!archives,!as,!common,!jst,!xulrunner,!vpe,!jsf
- -P !freemarker,!hibernatetools,!portlet,!struts,!smooks,!cdi,!birt,!bpel,!esb,!seam,!examples
- -P !maven,!tptp,!ws,!modeshape,!flow,!jbpm,!gwt,!deltacloud,!runtime,!usage,!aggregate-coverage
+ mvn clean install -P parent,\!libs,\!tests,\!jmx,\!archives,\!as,\!common,\!jst,\!xulrunner,\!vpe \
+ -P \!jsf,\!freemarker,\!hibernatetools,\!portlet,\!struts,\!smooks,\!cdi,\!birt,\!bpel,\!esb,\!seam,\!examples \
+ -P \!maven,\!tptp,\!ws,\!modeshape,\!flow,\!jbpm,\!gwt,\!deltacloud,\!runtime,\!usage,\!aggregate-coverage
+
-->
<profile>
<id>parent</id>
@@ -25,17 +26,8 @@
<module>parent</module>
</modules>
</profile>
+
<profile>
- <id>target-platform</id>
- <activation>
- <activeByDefault>false</activeByDefault>
- </activation>
- <modules>
- <module>target-platform</module>
- </modules>
- </profile>
-
- <profile>
<id>libs</id>
<activation>
<activeByDefault>true</activeByDefault>
13 years, 9 months
JBoss Tools SVN: r29919 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2011-03-21 11:02:04 -0400 (Mon, 21 Mar 2011)
New Revision: 29919
Modified:
trunk/build/pom.xml
Log:
add profiles for building parent and target-platform; disable workingset, profiler, and site (not used in aggregate)
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-03-21 13:47:02 UTC (rev 29918)
+++ trunk/build/pom.xml 2011-03-21 15:02:04 UTC (rev 29919)
@@ -9,6 +9,31 @@
<packaging>pom</packaging>
<profiles>
+ <!-- for bootstrapping the parent and target-platform poms via Mead, we need to be able to fetch from
+ this folder and run these two profiles (excluding all others)
+
+ -P parent,target-platform,!libs,!tests,!jmx,!archives,!as,!common,!jst,!xulrunner,!vpe,!jsf
+ -P !freemarker,!hibernatetools,!portlet,!struts,!smooks,!cdi,!birt,!bpel,!esb,!seam,!examples
+ -P !maven,!tptp,!ws,!modeshape,!flow,!jbpm,!gwt,!deltacloud,!runtime,!usage,!aggregate-coverage
+ -->
+ <profile>
+ <id>parent</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <modules>
+ <module>parent</module>
+ </modules>
+ </profile>
+ <profile>
+ <id>target-platform</id>
+ <activation>
+ <activeByDefault>false</activeByDefault>
+ </activation>
+ <modules>
+ <module>target-platform</module>
+ </modules>
+ </profile>
<profile>
<id>libs</id>
@@ -251,7 +276,7 @@
<profile>
<id>workingset</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>../portlet</module>
@@ -291,7 +316,7 @@
<profile>
<id>profiler</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>../profiler</module>
@@ -615,7 +640,7 @@
<profile>
<id>site</id>
<activation>
- <activeByDefault>true</activeByDefault>
+ <activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>../site</module>
13 years, 9 months
JBoss Tools SVN: r29918 - 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: 2011-03-21 09:47:02 -0400 (Mon, 21 Mar 2011)
New Revision: 29918
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/AbstractFilterPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
Log:
[JBIDE-8326] added button that resets all filters
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/AbstractFilterPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/AbstractFilterPage.java 2011-03-21 12:39:36 UTC (rev 29917)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/AbstractFilterPage.java 2011-03-21 13:47:02 UTC (rev 29918)
@@ -37,6 +37,7 @@
protected final static String INVALID_SEMICOLON = "ErrorFilterSemicolon.msg"; //$NON-NLS-1$
protected final static String DEFAULT_LABEL = "DefaultButton.label"; //$NON-NLS-1$
+ protected final static String DEFAULT_ALL_LABEL = "DefaultAllButton.label"; //$NON-NLS-1$
private DeltaCloud cloud;
@@ -63,11 +64,14 @@
Button b = (Button) e.widget;
Text text = getTextWidget(b);
if (text != null) {
- text.setText(ICloudElementFilter.ALL_MATCHER_EXPRESSION);
+ resetFilter(text);
}
}
};
+ protected void resetFilter(Text text) {
+ text.setText(ICloudElementFilter.ALL_MATCHER_EXPRESSION);
+ }
protected abstract Text getTextWidget(Button button);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java 2011-03-21 12:39:36 UTC (rev 29917)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/ImageFilterPage.java 2011-03-21 13:47:02 UTC (rev 29918)
@@ -11,11 +11,12 @@
package org.jboss.tools.internal.deltacloud.ui.wizards;
import org.eclipse.jface.fieldassist.ControlDecoration;
+import org.eclipse.jface.layout.GridDataFactory;
+import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
-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.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -105,111 +106,69 @@
@Override
public void createControl(Composite parent) {
final Composite container = new Composite(parent, SWT.NULL);
- FormLayout layout = new FormLayout();
- layout.marginHeight = 5;
- layout.marginWidth = 5;
- container.setLayout(layout);
+ GridLayoutFactory.fillDefaults().numColumns(3).spacing(8, 4).applyTo(container);
IImageFilter filter = getDeltaCloud().getImageFilter();
Label label = new Label(container, SWT.NULL);
label.setText(WizardMessages.getString(FILTER_LABEL));
+ GridDataFactory.fillDefaults().span(3, 1).align(SWT.LEFT, SWT.CENTER).indent(0, 14).hint(SWT.DEFAULT, 30)
+ .applyTo(label);
Label nameLabel = createRuleLabel(WizardMessages.getString(NAME_LABEL), container);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(nameLabel);
this.nameText = createRuleText(filter.getNameRule(), container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(nameText);
this.nameDecoration = UIUtils.createErrorDecoration("", nameText);
this.defaultName = createDefaultRuleButton(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultName);
Label idLabel = createRuleLabel(WizardMessages.getString(ID_LABEL), container);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(idLabel);
this.idText = createRuleText(filter.getIdRule(), container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(idText);
this.idDecoration = UIUtils.createErrorDecoration("", idText);
this.defaultId = createDefaultRuleButton(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultId);
Label archLabel = createRuleLabel(WizardMessages.getString(ARCH_LABEL), container);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(archLabel);
this.archText = createRuleText(filter.getArchRule(), container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(archText);
this.archDecoration = UIUtils.createErrorDecoration(WizardMessages.getString(""), archText);
this.defaultArch = createDefaultRuleButton(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultArch);
Label descLabel = createRuleLabel(WizardMessages.getString(DESC_LABEL), container);
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(descLabel);
this.descText = createRuleText(filter.getDescRule(), container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(descText);
this.descDecoration = UIUtils.createErrorDecoration("", descText);
this.defaultDesc = createDefaultRuleButton(container);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultDesc);
- Point p1 = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p2 = nameText.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Point p3 = defaultName.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int centering = (p2.y - p1.y + 1) / 2;
- int centering2 = (p3.y - p2.y + 1) / 2;
+ Label dummyLabel = new Label(container, SWT.NONE);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.RIGHT, SWT.CENTER).applyTo(dummyLabel);
+ Button defaultAllButton = new Button(container, SWT.BORDER);
+ defaultAllButton.setText("Default All");
+ GridDataFactory.fillDefaults().indent(0, 10).align(SWT.RIGHT, SWT.BOTTOM).applyTo(defaultAllButton);
+ defaultAllButton.addSelectionListener(onDefaultAllPressed());
- FormData f = new FormData();
- f.top = new FormAttachment(0);
- label.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(label, 11 + centering + centering2);
- f.left = new FormAttachment(0, 0);
- nameLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(label, 11);
- f.right = new FormAttachment(100);
- defaultName.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(label, 11 + centering2);
- f.left = new FormAttachment(archLabel, 5);
- f.right = new FormAttachment(defaultName, -10);
- nameText.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(nameLabel, 11 + centering + centering2);
- f.left = new FormAttachment(0, 0);
- idLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(nameLabel, 11);
- f.right = new FormAttachment(100);
- defaultId.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(nameLabel, 11 + centering2);
- f.left = new FormAttachment(archLabel, 5);
- f.right = new FormAttachment(defaultId, -10);
- idText.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(idLabel, 11 + centering + centering2);
- f.left = new FormAttachment(0, 0);
- archLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(idLabel, 11);
- f.right = new FormAttachment(100);
- defaultArch.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(idLabel, 11 + centering2);
- f.left = new FormAttachment(archLabel, 5);
- f.right = new FormAttachment(defaultArch, -10);
- archText.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(archLabel, 11 + centering + centering2);
- f.left = new FormAttachment(0, 0);
- descLabel.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(archLabel, 11);
- f.right = new FormAttachment(100);
- defaultDesc.setLayoutData(f);
-
- f = new FormData();
- f.top = new FormAttachment(archLabel, 11 + centering2);
- f.left = new FormAttachment(archLabel, 5);
- f.right = new FormAttachment(defaultDesc, -10);
- descText.setLayoutData(f);
-
setControl(container);
setPageComplete(true);
}
+
+ private SelectionListener onDefaultAllPressed() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ resetFilter(nameText);
+ resetFilter(idText);
+ resetFilter(archText);
+ resetFilter(descText);
+ }
+ };
+ }
+
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java 2011-03-21 12:39:36 UTC (rev 29917)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/InstanceFilterPage.java 2011-03-21 13:47:02 UTC (rev 29918)
@@ -14,6 +14,9 @@
import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
@@ -134,7 +137,7 @@
keyIdDecoration.hide();
realmDecoration.hide();
profileDecoration.hide();
-
+
String error = null;
error = validate(nameText, nameDecoration, error);
error = validate(idText, idDecoration, error);
@@ -166,7 +169,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(nameText);
this.nameDecoration = UIUtils.createErrorDecoration("", nameText);
this.defaultName = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultName);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultName);
Label aliasLabel = createRuleLabel(WizardMessages.getString(ALIAS_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(aliasLabel);
@@ -174,7 +177,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(aliasText);
this.aliasDecoration = UIUtils.createErrorDecoration("", aliasText);
this.defaultAlias = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultAlias);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultAlias);
Label idLabel = createRuleLabel(WizardMessages.getString(ID_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(idLabel);
@@ -182,7 +185,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(idText);
this.idDecoration = UIUtils.createErrorDecoration("", idText);
this.defaultId = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultId);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultId);
Label imageIdLabel = createRuleLabel(WizardMessages.getString(IMAGE_ID_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(imageIdLabel);
@@ -190,7 +193,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(imageIdText);
this.imageDecoration = UIUtils.createErrorDecoration("", imageIdText);
this.defaultImageId = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultImageId);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultImageId);
Label ownerIdLabel = createRuleLabel(WizardMessages.getString(OWNER_ID_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(ownerIdLabel);
@@ -198,7 +201,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(ownerIdText);
this.ownerDecoration = UIUtils.createErrorDecoration("", ownerIdText);
this.defaultOwnerId = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultOwnerId);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultOwnerId);
Label keyNameLabel = createRuleLabel(WizardMessages.getString(KEYNAME_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(keyNameLabel);
@@ -206,7 +209,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(keyIdText);
this.keyIdDecoration = UIUtils.createErrorDecoration("", keyIdText);
this.defaultKeyId = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultKeyId);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultKeyId);
Label realmLabel = createRuleLabel(WizardMessages.getString(REALM_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(realmLabel);
@@ -214,7 +217,7 @@
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(realmText);
this.realmDecoration = UIUtils.createErrorDecoration("", realmText);
this.defaultRealm = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultRealm);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultRealm);
Label profileLabel = createRuleLabel(WizardMessages.getString(PROFILE_LABEL), container);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(profileLabel);
@@ -222,9 +225,33 @@
this.profileDecoration = UIUtils.createErrorDecoration("", profileText);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(profileText);
this.defaultProfile = createDefaultRuleButton(container);
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(defaultProfile);
+ GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).applyTo(defaultProfile);
+ Label dummyLabel = new Label(container, SWT.NONE);
+ GridDataFactory.fillDefaults().span(2, 1).align(SWT.RIGHT, SWT.CENTER).applyTo(dummyLabel);
+ Button defaultAllButton = new Button(container, SWT.BORDER);
+ defaultAllButton.setText("Default All");
+ GridDataFactory.fillDefaults().indent(0, 10).align(SWT.RIGHT, SWT.BOTTOM).applyTo(defaultAllButton);
+ defaultAllButton.addSelectionListener(onDefaultAllPressed());
+
setControl(container);
setPageComplete(true);
}
+
+ private SelectionListener onDefaultAllPressed() {
+ return new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ resetFilter(nameText);
+ resetFilter(idText);
+ resetFilter(aliasText);
+ resetFilter(imageIdText);
+ resetFilter(ownerIdText);
+ resetFilter(keyIdText);
+ resetFilter(realmText);
+ resetFilter(profileText);
+ }
+ };
+ }
}
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-21 12:39:36 UTC (rev 29917)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/internal/deltacloud/ui/wizards/WizardMessages.properties 2011-03-21 13:47:02 UTC (rev 29918)
@@ -55,6 +55,7 @@
NewButton.label=New...
DeleteButton.label=Delete
DefaultButton.label=Default
+DefaultAllButton.label=Default All
Pem.name=PEM file (*.pem)
13 years, 9 months
JBoss Tools SVN: r29917 - trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-03-21 08:39:36 -0400 (Mon, 21 Mar 2011)
New Revision: 29917
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://issues.jboss.org/browse/JBIDE-8603
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-21 12:17:39 UTC (rev 29916)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-21 12:39:36 UTC (rev 29917)
@@ -539,7 +539,7 @@
}
/**
- *
+ * @deprecated should be used getSelectedNodes() instead.
* @return selected element if only one element selected in visual part
*/
public nsIDOMElement getSelectedElement(){
13 years, 10 months
JBoss Tools SVN: r29916 - in trunk: vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2011-03-21 08:17:39 -0400 (Mon, 21 Mar 2011)
New Revision: 29916
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java
trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
Log:
https://issues.jboss.org/browse/JBIDE-8603
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -41,22 +41,22 @@
XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 6);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Show be selected Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Show be selected Text Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 7);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Element Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Element Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 15);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 20);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 25);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Text Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Text Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 26);
part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
- assertTrue("Selected should be Element Node",xulRunnerEditor.getSelectedElement().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+ assertTrue("Selected should be Element Node",getSelectedNode(xulRunnerEditor).getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3650Test.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -67,7 +67,7 @@
int focusOffcetInSourceDocument = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), srcLine, srcLinePos);
part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(focusOffcetInSourceDocument);
vpeController.getPageContext().getSourceBuilder().getStructuredTextViewer().setSelectedRange(focusOffcetInSourceDocument, 0);
- nsIDOMNode lastSelectedNode = vpeController.getXulRunnerEditor().getSelectedElement();
+ nsIDOMNode lastSelectedNode = getSelectedNode(vpeController.getXulRunnerEditor());
NodeImpl sourceSelectedNode=null;
//was selected source el
if(attributeName!=null) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -134,7 +134,7 @@
}
private nsIDOMElement getSelectedElement() {
- if(vpeController.getXulRunnerEditor().getLastSelectedNodes().size()!=1) return null;
+ if(vpeController.getXulRunnerEditor().getSelectedNodes().size()!=1) return null;
return vpeController.getXulRunnerEditor().getSelectedElement();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SelectionUtil.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -346,7 +346,7 @@
public static nsIDOMNode getSelectedNode(VpePageContext pageContext) {
nsIDOMNode domNode=null;
List<nsIDOMNode> selectedNodes = pageContext.getVisualBuilder().getXulRunnerEditor()
- .getLastSelectedNodes();
+ .getSelectedNodes();
if(selectedNodes!=null&&selectedNodes.size()>0){
domNode=selectedNodes.get(0);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.base.test/src/org/jboss/tools/vpe/base/test/VpeTest.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -379,7 +379,7 @@
TestUtil.delay(50);
- assertNotNull(xulRunnerEditor.getSelectedElement());
+ assertNotNull(getSelectedNode(xulRunnerEditor));
nsIDOMNode sample;
if (nodeMapping.getSourceNode().getNodeType() == Node.TEXT_NODE
@@ -391,7 +391,7 @@
sample = nodeMapping.getVisualNode();
}
- assertEquals(sample, xulRunnerEditor.getSelectedElement());
+ assertEquals(sample, getSelectedNode(xulRunnerEditor));
}
}
}
@@ -464,4 +464,12 @@
protected String getEditorID(){
return EDITOR_ID;
}
+ /**
+ * @author mareshkau
+ * @param xulRunnerEditor
+ * @return first node in nodes selection, if it selected
+ */
+ protected static nsIDOMNode getSelectedNode(XulRunnerEditor xulRunnerEditor){
+ return (xulRunnerEditor.getSelectedNodes().size()>0)?xulRunnerEditor.getSelectedNodes().get(0):null;
+ }
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -252,7 +252,7 @@
// return getElementForNode(lastSelectedNode);
// }
- public List<nsIDOMNode> getLastSelectedNodes() {
+ public List<nsIDOMNode> getSelectedNodes() {
if(selectedNodes==null){
selectedNodes=Collections.<nsIDOMNode>emptyList();
}
@@ -434,7 +434,7 @@
// }
// }
List<FlasherData> flasherDatas = new ArrayList<FlasherData>();
- for (nsIDOMNode domNode : getLastSelectedNodes()) {
+ for (nsIDOMNode domNode : getSelectedNodes()) {
flasherDatas.add(prepareFlasherData(domNode));
}
drawElementOutline(flasherDatas);
@@ -544,8 +544,8 @@
*/
public nsIDOMElement getSelectedElement(){
nsIDOMElement resizeElement = null;
- if(getLastSelectedNodes()!=null&&getLastSelectedNodes().size()>0){
- resizeElement =getElementForNode(getLastSelectedNodes().get(0));
+ if(getSelectedNodes()!=null&&getSelectedNodes().size()>0){
+ resizeElement =getElementForNode(getSelectedNodes().get(0));
}
return resizeElement;
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java 2011-03-21 10:04:22 UTC (rev 29915)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/editor/MultipleSelectionTest.java 2011-03-21 12:17:39 UTC (rev 29916)
@@ -51,7 +51,7 @@
viewer.setSelectedRange(startSelectionOffcet, length);
VpeController vpeController = TestUtil.getVpeController(part);
vpeController.sourceSelectionChanged();
- List<nsIDOMNode> selectedNodes = vpeController.getXulRunnerEditor().getLastSelectedNodes();
+ List<nsIDOMNode> selectedNodes = vpeController.getXulRunnerEditor().getSelectedNodes();
assertEquals("Shuld be selected ",3,selectedNodes.size()); //$NON-NLS-1$
}
13 years, 10 months
JBoss Tools SVN: r29915 - trunk/deltacloud/tests/org.jboss.tools.deltacloud.client.test.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-03-21 06:04:22 -0400 (Mon, 21 Mar 2011)
New Revision: 29915
Modified:
trunk/deltacloud/tests/org.jboss.tools.deltacloud.client.test/
Log:
Property changes on: trunk/deltacloud/tests/org.jboss.tools.deltacloud.client.test
___________________________________________________________________
Modified: svn:ignore
- deltacloud-dependencies
+ deltacloud-dependencies
jruby
13 years, 10 months
JBoss Tools SVN: r29914 - in trunk/gwt: plugins/org.jboss.tools.gwt.core and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-03-21 06:04:10 -0400 (Mon, 21 Mar 2011)
New Revision: 29914
Modified:
trunk/gwt/features/org.jboss.tools.gwt.feature/pom.xml
trunk/gwt/plugins/org.jboss.tools.gwt.core/pom.xml
trunk/gwt/plugins/org.jboss.tools.gwt.ui/pom.xml
Log:
increase gwt component version
Modified: trunk/gwt/features/org.jboss.tools.gwt.feature/pom.xml
===================================================================
--- trunk/gwt/features/org.jboss.tools.gwt.feature/pom.xml 2011-03-21 10:01:25 UTC (rev 29913)
+++ trunk/gwt/features/org.jboss.tools.gwt.feature/pom.xml 2011-03-21 10:04:10 UTC (rev 29914)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools.gwt.features</groupId>
<artifactId>org.jboss.tools.gwt.feature</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.core/pom.xml
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.core/pom.xml 2011-03-21 10:01:25 UTC (rev 29913)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.core/pom.xml 2011-03-21 10:04:10 UTC (rev 29914)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools.gwt.plugins</groupId>
<artifactId>org.jboss.tools.gwt.core</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
-</project>
\ No newline at end of file
+</project>
Modified: trunk/gwt/plugins/org.jboss.tools.gwt.ui/pom.xml
===================================================================
--- trunk/gwt/plugins/org.jboss.tools.gwt.ui/pom.xml 2011-03-21 10:01:25 UTC (rev 29913)
+++ trunk/gwt/plugins/org.jboss.tools.gwt.ui/pom.xml 2011-03-21 10:04:10 UTC (rev 29914)
@@ -9,6 +9,6 @@
</parent>
<groupId>org.jboss.tools.gwt.plugins</groupId>
<artifactId>org.jboss.tools.gwt.ui</artifactId>
- <version>1.0.0-SNAPSHOT</version>
+ <version>1.0.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
-</project>
\ No newline at end of file
+</project>
13 years, 10 months
JBoss Tools SVN: r29913 - in trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui: src/org/jboss/tools/deltacloud/ui/commands and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-03-21 06:01:25 -0400 (Mon, 21 Mar 2011)
New Revision: 29913
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
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/cloud/property/CVPropertySection.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
Log:
[JBIDE-8416] implemented custom property sheet page so that elements copied (to the clipboard) from it do not contain the label
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-20 17:32:34 UTC (rev 29912)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-03-21 10:01:25 UTC (rev 29913)
@@ -1,3 +1,13 @@
+2011-03-21 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+2011-03-21 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+
+ * src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java:
+ * src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
+ * plugin.xml:
+ [JBIDE-8416] implemented custom property sheet page so that elements copied (to the clipboard)
+ from it do not contain the label
+
2011-03-16 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
* plugin.xml:
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-03-20 17:32:34 UTC (rev 29912)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/plugin.xml 2011-03-21 10:01:25 UTC (rev 29913)
@@ -358,6 +358,23 @@
</enabledWhen>
</handler>
</extension>
+ <extension
+ point="org.eclipse.ui.handlers">
+ <!-- copy property sheet entry handler -->
+ <handler
+ class="org.jboss.tools.deltacloud.ui.commands.CopyCVPropertySheetPageEntryHandler"
+ commandId="org.eclipse.ui.edit.copy">
+ <activeWhen>
+ <with
+ variable="selection">
+ <iterate>
+ <instanceof
+ value="org.jboss.tools.deltacloud.ui.views.cloud.property.CVPropertySheetPage$PropertySourceContentProvider$CVPropertySheetPageEntry" />
+ </iterate>
+ </with>
+ </activeWhen>
+ </handler>
+ </extension>
<!-- InstanceView context menu ================================== -->
<extension point="org.eclipse.ui.menus">
<menuContribution
@@ -723,9 +740,27 @@
tooltip="%command.filterimages.tooltip">
</command>
</menuContribution>
-
</extension>
+ <!-- CVPropertySheetPage context menu ================================== -->
+ <extension point="org.eclipse.ui.menus">
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.jboss.tools.deltacloud.ui.views.CVPropertySheetPage">
+ <separator
+ name="edit"
+ visible="true" />
+ </menuContribution>
+ <!-- filter images -->
+ <menuContribution
+ allPopups="true"
+ locationURI="popup:org.jboss.tools.deltacloud.ui.views.CVPropertySheetPage?after=edit">
+ <!-- image commands -->
+ <command
+ commandId="org.eclipse.ui.edit.copy"/>
+ </menuContribution>
+ </extension>
+
<!-- Commands ========================================= -->
<extension
point="org.eclipse.ui.commands">
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java 2011-03-21 10:01:25 UTC (rev 29913)
@@ -0,0 +1,60 @@
+package org.jboss.tools.deltacloud.ui.commands;
+
+import org.eclipse.core.commands.AbstractHandler;
+import org.eclipse.core.commands.ExecutionEvent;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.handlers.HandlerUtil;
+import org.jboss.tools.deltacloud.ui.Activator;
+import org.jboss.tools.deltacloud.ui.views.cloud.property.CVPropertySheetPage.PropertySourceContentProvider.CVPropertySheetPageEntry;
+
+/**
+ * A handler for the copy command (org.eclipse.ui.edit.copy) that copies entries
+ * in the CVPropertySheetPage to the clipboard.
+ *
+ * @author André Dietisheim
+ *
+ * @see CVPropertySheetPage
+ * @see CVPropertySheetPageEntry
+ */
+public class CopyCVPropertySheetPageEntryHandler extends AbstractHandler {
+
+ private Clipboard clipboard;
+
+ @Override
+ public Object execute(ExecutionEvent event) throws ExecutionException {
+ ISelection selection = HandlerUtil.getCurrentSelection(event);
+ if (selection instanceof IStructuredSelection) {
+ Object selectedObject = ((IStructuredSelection) selection).getFirstElement();
+ if (selectedObject instanceof CVPropertySheetPageEntry) {
+ CVPropertySheetPageEntry entry = (CVPropertySheetPageEntry) selectedObject;
+ Shell shell = HandlerUtil.getActiveShell(event);
+ if (shell == null) {
+ return null;
+ }
+ Clipboard clipboard = getClipboard(shell.getDisplay());
+ clipboard.setContents(
+ new Object[] { entry.getStringValue() },
+ new Transfer[] { TextTransfer.getInstance() });
+ return Status.OK_STATUS;
+ }
+ }
+ return new Status(IStatus.ERROR, Activator.PLUGIN_ID,
+ "The element to copy is not of an entry of the deltacloud property view");
+ }
+
+ private Clipboard getClipboard(Display display) {
+ if (clipboard == null) {
+ this.clipboard = new Clipboard(display);
+ }
+ return clipboard;
+ }
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/commands/CopyCVPropertySheetPageEntryHandler.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySection.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySection.java 2011-03-20 17:32:34 UTC (rev 29912)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySection.java 2011-03-21 10:01:25 UTC (rev 29913)
@@ -17,7 +17,6 @@
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.PropertySheetPage;
import org.eclipse.ui.views.properties.tabbed.AbstractPropertySection;
import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetPage;
@@ -26,7 +25,7 @@
/**
* The Property Sheet Page.
*/
- protected PropertySheetPage page;
+ protected CVPropertySheetPage page;
/**
* @see org.eclipse.ui.views.properties.tabbed.ISection#createControls(org.eclipse.swt.widgets.Composite,
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java 2011-03-20 17:32:34 UTC (rev 29912)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/property/CVPropertySheetPage.java 2011-03-21 10:01:25 UTC (rev 29913)
@@ -12,21 +12,51 @@
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITableLabelProvider;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.views.properties.PropertySheetPage;
+import org.eclipse.ui.part.Page;
+import org.eclipse.ui.views.properties.IPropertyDescriptor;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.ui.views.properties.IPropertySource;
import org.jboss.tools.deltacloud.core.DeltaCloud;
import org.jboss.tools.deltacloud.ui.views.cloud.CloudItem;
import org.jboss.tools.internal.deltacloud.ui.utils.WorkbenchUtils;
/**
+ * A custom property sheet page for deltacloud element properties.
+ *
* @Jeff Johnston
* @author André Dietisheim
*/
-public class CVPropertySheetPage extends PropertySheetPage {
+public class CVPropertySheetPage extends Page implements IPropertySheetPage {
+ public static final String ID = "org.jboss.tools.deltacloud.ui.views.CVPropertySheetPage";
+
+ protected TreeViewer viewer;
+ protected Composite control;
+
private DeltaCloud deltaCloud;
private PropertyChangeListener cloudPropertyListener = new PropertyChangeListener() {
@@ -36,15 +66,13 @@
@Override
public void run() {
- refresh();
+ viewer.refresh();
}
});
}
};
public CVPropertySheetPage() {
- super();
- setSorter(new CVPropertySheetNonSorter());
}
@Override
@@ -59,9 +87,18 @@
}
}
- super.selectionChanged(part, selection);
+ setInput(selection);
}
+ private void setInput(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ Object o = ((IStructuredSelection) selection).getFirstElement();
+ if (o != null) {
+ viewer.setInput(o);
+ }
+ }
+ }
+
private void addPropertyChangeListener(DeltaCloud deltaCloud) {
if (deltaCloud != null) {
deltaCloud.addPropertyChangeListener(cloudPropertyListener);
@@ -78,4 +115,146 @@
public void dispose() {
removePropertyChangeListener(deltaCloud);
}
+
+ @Override
+ public void createControl(Composite parent) {
+ control = new Composite(parent, SWT.BORDER);
+ control.setLayout(new FillLayout());
+ this.viewer = createTreeViewer(control);
+ getSite().setSelectionProvider(viewer);
+ createContextMenu(viewer.getControl());
+ }
+
+ private TreeViewer createTreeViewer(Composite parent) {
+ final Tree tree = new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
+ tree.setHeaderVisible(true);
+ tree.setLinesVisible(true);
+ tree.setFont(parent.getFont());
+
+ TreeColumn column = new TreeColumn(tree, SWT.SINGLE);
+ column.setText("Property");
+ TreeColumn column2 = new TreeColumn(tree, SWT.SINGLE);
+ column2.setText("Value");
+
+ tree.addControlListener(setTreeColumInitialSize(tree));
+
+ TreeViewer viewer = new TreeViewer(tree);
+ PropertySourceContentProvider provider = new PropertySourceContentProvider();
+ viewer.setContentProvider(provider);
+ viewer.setLabelProvider(provider);
+ return viewer;
+ }
+
+ private ControlAdapter setTreeColumInitialSize(final Tree tree) {
+ return new ControlAdapter() {
+ public void controlResized(ControlEvent e) {
+ Rectangle area = tree.getClientArea();
+ TreeColumn[] columns = tree.getColumns();
+ if (area.width > 0) {
+ columns[0].setWidth(area.width * 40 / 100);
+ columns[1].setWidth(area.width - columns[0].getWidth() - 4);
+ tree.removeControlListener(this);
+ }
+ }
+ };
+ }
+
+ private void createContextMenu(Control control) {
+ IMenuManager menuManager = WorkbenchUtils.createContextMenu(control);
+ WorkbenchUtils.registerContributionManager(WorkbenchUtils.getContextMenuId(ID), menuManager, control);
+ }
+
+ @Override
+ public Control getControl() {
+ return control;
+ }
+
+ @Override
+ public void setActionBars(IActionBars actionBars) {
+ }
+
+ @Override
+ public void setFocus() {
+ viewer.getControl().setFocus();
+ }
+
+ public static class PropertySourceContentProvider extends LabelProvider
+ implements ITableLabelProvider, ITreeContentProvider {
+
+ protected IPropertySource input;
+
+ public static class CVPropertySheetPageEntry {
+ private IPropertyDescriptor descriptor;
+ private IPropertySource source;
+
+ private CVPropertySheetPageEntry(IPropertyDescriptor descriptor, IPropertySource source) {
+ this.descriptor = descriptor;
+ this.source = source;
+ }
+
+ public String getLabel() {
+ return descriptor.getDisplayName();
+ }
+
+ public Object getValue() {
+ return source.getPropertyValue(descriptor.getId());
+ }
+
+ public String getStringValue() {
+ return String.valueOf(getValue());
+ }
+ }
+
+ public PropertySourceContentProvider() {
+ }
+
+ public Object[] getElements(Object inputElement) {
+ IPropertySource propertySource = WorkbenchUtils.adapt(inputElement, IPropertySource.class);
+ if (propertySource == null) {
+ return new Object[]{};
+ }
+ this.input = propertySource;
+ List<CVPropertySheetPageEntry> elements = new ArrayList<CVPropertySheetPageEntry>();
+ for (IPropertyDescriptor descriptor : input.getPropertyDescriptors()) {
+ elements.add(new CVPropertySheetPageEntry(descriptor, input));
+ }
+ return elements.toArray();
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ return new Object[] {};
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return false;
+ }
+
+ public Image getColumnImage(Object element, int columnIndex) {
+ return null;
+ }
+
+ public String getColumnText(Object element, int columnIndex) {
+ if (columnIndex == 0) {
+ return ((CVPropertySheetPageEntry) element).getLabel();
+ }
+ else if (columnIndex == 1 && element instanceof CVPropertySheetPageEntry) {
+ return String.valueOf(((CVPropertySheetPageEntry) element).getValue());
+ }
+ return null;
+ }
+ }
+
+ public void refresh() {
+ viewer.refresh();
+ }
}
13 years, 10 months
JBoss Tools SVN: r29912 - trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-03-20 13:32:34 -0400 (Sun, 20 Mar 2011)
New Revision: 29912
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
Log:
JBIDE-7514 jboss 7 support, test has bad overrides
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-03-18 23:55:10 UTC (rev 29911)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/v2/MockPublishMethod.java 2011-03-20 17:32:34 UTC (rev 29912)
@@ -19,18 +19,15 @@
public static final String PUBLISH_METHOD_ID = "mock";
public static final MockCopyCallbackHandler HANDLER = new MockCopyCallbackHandler();
- @Override
public IPublishCopyCallbackHandler getCallbackHandler(IPath path,
IServer server) {
return HANDLER;
}
- @Override
public String getPublishDefaultRootFolder(IServer server) {
return "/";
}
- @Override
public String getPublishMethodId() {
return PUBLISH_METHOD_ID;
}
@@ -52,7 +49,6 @@
return (IPath[]) changed.toArray(new IPath[changed.size()]);
}
- @Override
public IStatus[] deleteResource(IPath path, IProgressMonitor monitor)
throws CoreException {
if( !removed.contains(path.makeRelative()))
@@ -60,7 +56,6 @@
return new IStatus[]{};
}
- @Override
public IStatus[] makeDirectoryIfRequired(IPath dir,
IProgressMonitor monitor) throws CoreException {
if( !changed.contains(dir.makeRelative()))
@@ -81,7 +76,6 @@
return new IStatus[]{};
}
- @Override
public IStatus[] touchResource(IPath path) {
if( !changed.contains(path.makeRelative()))
changed.add(path.makeRelative());
13 years, 10 months