JBoss Tools SVN: r26366 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:40:04 -0500 (Tue, 09 Nov 2010)
New Revision: 26366
Added:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
Log:
[JBIDE-7518] removed duplicate code in filters (expressions, etc.)
Added: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java (rev 0)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java 2010-11-09 13:40:04 UTC (rev 26366)
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.deltacloud.core;
+
+public interface ICloudElementFilter {
+
+ public static final String RULE_DELIMITER = ";"; // $NON-NLS-1$
+
+ public static final String ALL_MATCHER = "*"; //$NON-NLS-1$
+
+ public static final String ALL_STRING =
+ ALL_MATCHER + RULE_DELIMITER // name
+ + ALL_MATCHER + RULE_DELIMITER // id
+ + ALL_MATCHER + RULE_DELIMITER // arch
+ + ALL_MATCHER; // desc
+
+
+
+}
Property changes on: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ICloudElementFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-11-09 13:32:09 UTC (rev 26365)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-11-09 13:40:04 UTC (rev 26366)
@@ -10,9 +10,7 @@
******************************************************************************/
package org.jboss.tools.deltacloud.core;
-public interface IImageFilter {
-
- public final static String ALL_STRING = "*;*;*;*"; //$NON-NLS-1$
+public interface IImageFilter extends ICloudElementFilter {
public boolean isVisible(DeltaCloudImage image);
public void setRules(String ruleString);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2010-11-09 13:32:09 UTC (rev 26365)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IInstanceFilter.java 2010-11-09 13:40:04 UTC (rev 26366)
@@ -1,8 +1,16 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.deltacloud.core;
-public interface IInstanceFilter {
-
- public final static String ALL_STRING = "*;*;*;*;*;*;*"; //$NON-NLS-1$
+public interface IInstanceFilter extends ICloudElementFilter {
public boolean isVisible(DeltaCloudInstance instance);
public void setRules(String ruleString);
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:32:09 UTC (rev 26365)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:40:04 UTC (rev 26366)
@@ -14,7 +14,6 @@
public class ImageFilter implements IImageFilter {
- private static final String ALL_MATCHER = "*";
private IFieldMatcher nameRule;
private IFieldMatcher idRule;
private IFieldMatcher archRule;
15 years, 5 months
JBoss Tools SVN: r26365 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:32:09 -0500 (Tue, 09 Nov 2010)
New Revision: 26365
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
Log:
[JBIDE-7518] extracted constant for ALL_MATCHER
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:26:57 UTC (rev 26364)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:32:09 UTC (rev 26365)
@@ -14,6 +14,7 @@
public class ImageFilter implements IImageFilter {
+ private static final String ALL_MATCHER = "*";
private IFieldMatcher nameRule;
private IFieldMatcher idRule;
private IFieldMatcher archRule;
@@ -38,7 +39,7 @@
}
private IFieldMatcher createRule(String token) {
- if (token.equals("*")) { //$NON-NLS-1$
+ if (token.equals(ALL_MATCHER)) { //$NON-NLS-1$
return new AllFieldMatcher();
} else {
return new FieldMatcher(token);
15 years, 5 months
JBoss Tools SVN: r26364 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:26:57 -0500 (Tue, 09 Nov 2010)
New Revision: 26364
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
Log:
[JBIDE-7518] removed duplicate code (4x the same filter rule creation code)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:21:47 UTC (rev 26363)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/ImageFilter.java 2010-11-09 13:26:57 UTC (rev 26364)
@@ -29,27 +29,20 @@
@Override
public void setRules(String ruleString) throws PatternSyntaxException {
+ // TODO: replace filter passing (;-delimited string) by list
String[] tokens = ruleString.split(";");
- if (tokens[0].equals("*")) { //$NON-NLS-1$
- nameRule = new AllFieldMatcher();
+ this.nameRule = createRule(tokens[0]);
+ this.idRule = createRule(tokens[1]);
+ this.archRule = createRule(tokens[2]);
+ this.descRule = createRule(tokens[3]);
+ }
+
+ private IFieldMatcher createRule(String token) {
+ if (token.equals("*")) { //$NON-NLS-1$
+ return new AllFieldMatcher();
} else {
- nameRule = new FieldMatcher(tokens[0]);
+ return new FieldMatcher(token);
}
- if (tokens[1].equals("*")) { //$NON-NLS-1$
- idRule = new AllFieldMatcher();
- } else {
- idRule = new FieldMatcher(tokens[1]);
- }
- if (tokens[2].equals("*")) { //$NON-NLS-1$
- archRule = new AllFieldMatcher();
- } else {
- archRule = new FieldMatcher(tokens[2]);
- }
- if (tokens[3].equals("*")) { //$NON-NLS-1$
- descRule = new AllFieldMatcher();
- } else {
- descRule = new FieldMatcher(tokens[3]);
- }
}
@Override
15 years, 5 months
JBoss Tools SVN: r26363 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:21:47 -0500 (Tue, 09 Nov 2010)
New Revision: 26363
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
Log:
[JBIDE-7518] added copyright header
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-11-09 13:10:13 UTC (rev 26362)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/IImageFilter.java 2010-11-09 13:21:47 UTC (rev 26363)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.deltacloud.core;
public interface IImageFilter {
15 years, 5 months
JBoss Tools SVN: r26362 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:10:13 -0500 (Tue, 09 Nov 2010)
New Revision: 26362
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
Log:
[JBIDE-7518] cleanup code duplication (imageFilter and instanceFilter creation)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-09 13:08:40 UTC (rev 26361)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-09 13:10:13 UTC (rev 26362)
@@ -3,6 +3,12 @@
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (editCloud): [JBIDE-7521] storing cloud after it has been edited
(editCloud):
[JBIDE-7518] added notification after cloud was edited
+ (DeltaCloud):
+ (createImageFilter):
+ (updateImageFilter):
+ (createInstanceFilter):
+ (updateInstanceFilter):
+ [JBIDE-7518] cleanup code duplication (imageFilter and instanceFilter creation)
2010-11-05 André Dietisheim <adietish(a)redhat.com>
15 years, 5 months
JBoss Tools SVN: r26361 - trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2010-11-09 08:08:40 -0500 (Tue, 09 Nov 2010)
New Revision: 26361
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7518] cleanup code duplication (imageFilter and instanceFilter creation)
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-09 13:06:17 UTC (rev 26360)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-09 13:08:40 UTC (rev 26361)
@@ -74,18 +74,8 @@
this.name = name;
this.username = username;
this.type = type;
- imageFilter = new ImageFilter();
- try {
- imageFilter.setRules(imageFilterRules);
- } catch (PatternSyntaxException e) {
- imageFilter.setRules(IImageFilter.ALL_STRING);
- }
- instanceFilter = new InstanceFilter();
- try {
- instanceFilter.setRules(instanceFilterRules);
- } catch (PatternSyntaxException e) {
- instanceFilter.setRules(IInstanceFilter.ALL_STRING);
- }
+ imageFilter = createImageFilter(imageFilterRules);
+ instanceFilter = createInstanceFilter(instanceFilterRules);
if (persistent) {
storePassword(url, username, passwd);
}
@@ -100,7 +90,8 @@
this.type = type;
storePassword(url, username, passwd);
save();
- // TODO: remove notification with all instances, replace by notifying the changed instance
+ // TODO: remove notification with all instances, replace by notifying
+ // the changed instance
notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
@@ -158,39 +149,60 @@
return instanceFilter;
}
- public void createInstanceFilter(String ruleString) {
+ public void updateInstanceFilter(String ruleString) {
String rules = getInstanceFilter().toString();
- if (IInstanceFilter.ALL_STRING.equals(ruleString))
- instanceFilter = new AllInstanceFilter();
- else {
- instanceFilter = new InstanceFilter();
- instanceFilter.setRules(ruleString);
- }
+ instanceFilter = createInstanceFilter(ruleString);
if (!rules.equals(ruleString)) {
save();
- // TODO: remove notification with all instances, replace by notifying the changed instance
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
}
+ private IInstanceFilter createInstanceFilter(String ruleString) {
+ IInstanceFilter instanceFilter = null;
+ if (IInstanceFilter.ALL_STRING.equals(ruleString))
+ instanceFilter = new AllInstanceFilter();
+ else {
+ try {
+ instanceFilter = new InstanceFilter();
+ instanceFilter.setRules(ruleString);
+ } catch (PatternSyntaxException e) {
+ instanceFilter.setRules(IInstanceFilter.ALL_STRING);
+ }
+ }
+ return instanceFilter;
+ }
+
public IImageFilter getImageFilter() {
return imageFilter;
}
- public void createImageFilter(String ruleString) {
+ public void updateImageFilter(String ruleString) {
String rules = getImageFilter().toString();
- if (IImageFilter.ALL_STRING.equals(ruleString))
- imageFilter = new AllImageFilter();
- else {
- imageFilter = new ImageFilter();
- imageFilter.setRules(ruleString);
- }
+ this.imageFilter = createImageFilter(ruleString);
if (!rules.equals(ruleString)) {
save();
notifyImageListListeners(getCurrImages());
}
}
+ private IImageFilter createImageFilter(String ruleString) {
+ IImageFilter imageFilter = null;
+ if (IImageFilter.ALL_STRING.equals(ruleString))
+ imageFilter = new AllImageFilter();
+ else {
+ try {
+ imageFilter = new ImageFilter();
+ imageFilter.setRules(ruleString);
+ } catch (PatternSyntaxException e) {
+ imageFilter.setRules(IImageFilter.ALL_STRING);
+ }
+ }
+ return imageFilter;
+ }
+
public void loadChildren() {
Thread t = new Thread(new Runnable() {
@@ -275,7 +287,8 @@
} catch (DeltaCloudClientException e) {
Activator.log(e);
}
- // TODO: remove notification with all instances, replace by notifying the changed instance
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
DeltaCloudInstance[] instancesArray = instances.toArray(new DeltaCloudInstance[instances.size()]);
notifyInstanceListListeners(instancesArray);
return instancesArray;
@@ -301,8 +314,10 @@
} catch (DeltaCloudException e) {
return null;
}
- // TODO: remove notification with all instances, replace by notifying the changed instance
- DeltaCloudInstance[] instancesArray = instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()]));
+ // TODO: remove notification with all instances, replace by notifying
+ // the changed instance
+ DeltaCloudInstance[] instancesArray = instances.toArray(instances.toArray(new DeltaCloudInstance[instances
+ .size()]));
notifyInstanceListListeners(instancesArray);
return instancesArray;
}
@@ -337,9 +352,9 @@
if (!found) {
instances.add(instance);
}
- // TODO: remove notification with all instances, replace by notifying the changed instance
- notifyInstanceListListeners(
- instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
+ notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
}
@@ -379,8 +394,10 @@
boolean result = instance.performInstanceAction(actionId, client);
if (result) {
- // TODO: remove notification with all instances, replace by notifying the changed instance
- notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
+ // TODO: remove notification with all instances, replace by
+ // notifying the changed instance
+ notifyInstanceListListeners(instances
+ .toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
return result;
} catch (DeltaCloudClientException e) {
15 years, 5 months
JBoss Tools SVN: r26360 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-11-09 08:06:17 -0500 (Tue, 09 Nov 2010)
New Revision: 26360
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
Log:
https://jira.jboss.org/browse/JBIDE-7449: Vpe templates for rich iteration.
- created rich:list template
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.ajax4jsf/src/org/jboss/tools/jsf/vpe/ajax4jsf/template/Ajax4JSFMediaOutput.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -58,7 +58,7 @@
mainTag.setAttribute(uriAttribute, "file:///" + getAbsoluteResourcePath(IMG_PATH).replace('\\', '/')); //$NON-NLS-1$
- VisualDomUtil.copyAttributes(sourceElement, SAME_ATTRIBUTES_LIST, mainTag);
+ VisualDomUtil.copyAttributes(sourceElement, mainTag, SAME_ATTRIBUTES_LIST);
if (sourceElement.hasAttribute(Ajax4JSF.ATTR_STYLE_CLASS)) {
String styleClass = sourceElement.getAttribute(Ajax4JSF.ATTR_STYLE_CLASS);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -974,7 +974,7 @@
*/
public static Node getFacetBody(VpePageContext pageContext,
Element sourceElement, String facetName) {
- Element facet = SourceDomUtil.getFacetByName(sourceElement, facetName);
+ Element facet = SourceDomUtil.getFacetByName(pageContext, sourceElement, facetName);
Map<String, List<Node>> facetChildren = VisualDomUtil
.findFacetElements(facet, pageContext);
return getFacetBody(facetChildren);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -52,10 +52,10 @@
td.setAttribute(HTML.ATTR_CLASS, columnClass);
final VpeCreationData creationData = new VpeCreationData(td);
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_HEADER);
- Element footerFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_FOOTER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element footerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> headerFacetChildren = VisualDomUtil
.findFacetElements(headerFacet, pageContext);
Map<String, List<Node>> footerFacetChildren = VisualDomUtil
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataDefinitionListTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -75,8 +75,8 @@
ComponentUtil.correctAttribute((Element)sourceNode, listElement,
RichFaces.ATTR_STYLE_CLASS, HTML.ATTR_CLASS, null, "listClass"); //$NON-NLS-1$
- Element termFacet = SourceDomUtil.getFacetByName(sourceElement,
- RichFaces.NAME_FACET_TERM);
+ Element termFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_TERM);
Map<String, List<Node>> termFacetChildren = VisualDomUtil
.findFacetElements(termFacet, pageContext);
Node termNode= ComponentUtil.getFacetBody(termFacetChildren);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -73,7 +73,8 @@
/*
* Encode Caption
*/
- Element caption = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_CAPTION);
+ Element caption = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_CAPTION);
Map<String, List<Node>> captionFacetChildren = VisualDomUtil.findFacetElements(caption, pageContext);
Node captionBody = ComponentUtil.getFacetBody(captionFacetChildren);
encodeCaption(pageContext, creationData, sourceElement, visualDocument, table, captionBody);
@@ -81,7 +82,8 @@
/*
* Encode Header
*/
- Element header = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element header = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
Map<String, List<Node>> headerFacetChildren = VisualDomUtil.findFacetElements(header, pageContext);
Node headerBody = ComponentUtil.getFacetBody(headerFacetChildren);
if (headerBody != null) {
@@ -98,7 +100,8 @@
/*
* Encode Footer
*/
- Element footer = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_FOOTER);
+ Element footer = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> footerFacetChildren = VisualDomUtil.findFacetElements(footer, pageContext);
Node footerBody = ComponentUtil.getFacetBody(footerFacetChildren);
if (footerBody != null) {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataTableTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -71,7 +71,8 @@
/*
* Encode Caption
*/
- Element caption = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_CAPTION);
+ Element caption = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_CAPTION);
Map<String, List<Node>> captionFacetChildren = VisualDomUtil.findFacetElements(caption, pageContext);
Node captionNode= null;
if (captionFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0) {
@@ -82,7 +83,8 @@
/*
* Encode Header
*/
- Element header = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element header = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
Map<String, List<Node>> headerFacetChildren = VisualDomUtil.findFacetElements(header, pageContext);
boolean headerJsfElementPresents = headerFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0;
boolean hasColumnWithHeader = hasColumnWithFacet(columns, RichFaces.NAME_FACET_HEADER);
@@ -116,7 +118,8 @@
/*
* Encode Footer
*/
- Element footer = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_FOOTER);
+ Element footer = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_FOOTER);
Map<String, List<Node>> footerFacetChildren = VisualDomUtil.findFacetElements(footer, pageContext);
boolean footerJsfElementPresents = footerFacetChildren.get(VisualDomUtil.FACET_JSF_TAG).size() > 0;
boolean hasColumnWithFooter = hasColumnWithFacet(columns, RichFaces.NAME_FACET_FOOTER);
@@ -192,7 +195,8 @@
String element) {
for (Element column : headersOrFooters) {
- Element facet = SourceDomUtil.getFacetByName(column, facetName);
+ Element facet = SourceDomUtil.getFacetByName(pageContext,
+ column, facetName);
/*
* If facet is null unwanted cells might be added.
* Thus do not add TD for such facets.
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesListTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -0,0 +1,114 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.SourceDomUtil;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Template for rich:list.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ */
+public class RichFacesListTemplate extends VpeAbstractTemplate {
+
+ private static final String TYPE_DEFINITIONS = "definitions"; //$NON-NLS-1$
+ private static final String TYPE_ORDERED = "ordered"; //$NON-NLS-1$
+
+ @Override
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ Element sourceElement = (Element) sourceNode;
+
+ String firstRowClass = getFirstRowClass(sourceElement);
+
+ nsIDOMElement outerContainer;
+ nsIDOMElement innerContainer;
+ VpeChildrenInfo termInfo = null;
+ String type = sourceElement.getAttribute(RichFaces.ATTR_TYPE);
+ if (TYPE_ORDERED.equals(type)) {
+ outerContainer = visualDocument.createElement(HTML.TAG_OL);
+ innerContainer = visualDocument.createElement(HTML.TAG_LI);
+ } else if (TYPE_DEFINITIONS.equals(type)) {
+ outerContainer = visualDocument.createElement(HTML.TAG_DL);
+
+ nsIDOMElement termContainer = visualDocument.createElement(HTML.TAG_DT);
+ termContainer.setAttribute(HTML.ATTR_CLASS, firstRowClass);
+ outerContainer.appendChild(termContainer);
+ Element termElement = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_TERM);
+ termInfo = new VpeChildrenInfo(termContainer);
+ termInfo.addSourceChild(termElement);
+
+ innerContainer = visualDocument.createElement(HTML.TAG_DD);
+ } else { // "unordered" by default
+ outerContainer = visualDocument.createElement(HTML.TAG_UL);
+ innerContainer = visualDocument.createElement(HTML.TAG_LI);
+ }
+
+ VisualDomUtil.copyAttribute(sourceElement, RichFaces.ATTR_STYLE,
+ outerContainer, HTML.ATTR_STYLE);
+ VisualDomUtil.copyAttribute(sourceElement, RichFaces.ATTR_STYLE_CLASS,
+ outerContainer, HTML.ATTR_CLASS);
+ innerContainer.setAttribute(HTML.ATTR_CLASS, firstRowClass);
+
+ outerContainer.appendChild(innerContainer);
+
+ VpeCreationData creationData = new VpeCreationData(outerContainer);
+ if (termInfo != null) {
+ creationData.addChildrenInfo(termInfo);
+ }
+
+ NodeList childNodes = sourceElement.getChildNodes();
+ VpeChildrenInfo nonFacetChildrenInfo = new VpeChildrenInfo(innerContainer);
+ for (int i = 0; i < childNodes.getLength(); i++) {
+ Node childNode = childNodes.item(i);
+ if (!SourceDomUtil.isFacetElement(pageContext, childNode)) {
+ nonFacetChildrenInfo.addSourceChild(childNode);
+ }
+ }
+ creationData.addChildrenInfo(nonFacetChildrenInfo);
+
+ return creationData;
+ }
+
+ private String getFirstRowClass(Element sourceElement) {
+ StringBuilder firstRowClass = new StringBuilder();
+
+ if (sourceElement.hasAttribute(RichFaces.ATTR_ROW_CLASSES)) {
+ String rowClasses = sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASSES);
+ int commaIndex = rowClasses.indexOf(Constants.COMMA);
+ if (commaIndex >= 0) {
+ firstRowClass.append(rowClasses.substring(0, commaIndex));
+ } else {
+ firstRowClass.append(rowClasses);
+ }
+ firstRowClass.append(Constants.WHITE_SPACE);
+ }
+ if (sourceElement.hasAttribute(RichFaces.ATTR_ROW_CLASS)) {
+ firstRowClass.append(sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASS));
+ }
+
+ return firstRowClass.toString();
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelItemTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -172,7 +172,8 @@
td.setAttribute(HTML.ATTR_CLASS, tdClass);
td.setAttribute(HTML.ATTR_STYLE, tdStyle);
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
Map<String, List<Node>> labelFacetChildren = VisualDomUtil.findFacetElements(labelFacet, pageContext);
boolean labelFacetHtmlChildrenPresent = labelFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesPanelTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -58,7 +58,8 @@
* Find elements from the f:facet
*/
Map<String, List<Node>> headerFacetChildren = null;
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
if (headerFacet != null) {
headerFacetChildren = VisualDomUtil.findFacetElements(headerFacet, pageContext);
nsIDOMElement headerDiv = visualDocument.createElement(HTML.TAG_DIV);
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesProgressBarTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -93,12 +93,14 @@
* or supplementary HTML tags from facets
* then progress bar has more divs than usual.
*/
- Element initialFacet = SourceDomUtil.getFacetByName(sourceElement, "initial"); //$NON-NLS-1$
+ Element initialFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, "initial"); //$NON-NLS-1$
Map<String, List<Node>> initialFacetChildren = VisualDomUtil.findFacetElements(initialFacet, pageContext);
boolean initialFacetHtmlChildrenPresent = initialFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
- Element completeFacet = SourceDomUtil.getFacetByName(sourceElement, "complete"); //$NON-NLS-1$
+ Element completeFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, "complete"); //$NON-NLS-1$
Map<String, List<Node>> completeFacetChildren = VisualDomUtil.findFacetElements(completeFacet, pageContext);
boolean completeFacetHtmlChildrenPresent = completeFacetChildren
.get(VisualDomUtil.FACET_HTML_TAGS).size() > 0;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSimpleTogglePanelTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -97,7 +97,8 @@
* Find elements from the f:facet
*/
Map<String, List<Node>> headerFacetChildren = null;
- Element headerFacet = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_HEADER);
+ Element headerFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_HEADER);
if (headerFacet != null) {
headerFacetChildren = VisualDomUtil.findFacetElements(headerFacet, pageContext);
/*
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTabTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -121,7 +121,8 @@
+ STYLE_SEMICOLUMN + contentStyle);
Map<String, List<Node>> labelFacetChildren = null;
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
if (null != labelFacet) {
labelFacetChildren = VisualDomUtil.findFacetElements(labelFacet, pageContext);
}
@@ -290,7 +291,8 @@
* Encode the Label Facet
* Find elements from the f:facet
*/
- Element labelFacet = SourceDomUtil.getFacetByName(sourceElement, RichFaces.NAME_FACET_LABEL);
+ Element labelFacet = SourceDomUtil.getFacetByName(pageContext,
+ sourceElement, RichFaces.NAME_FACET_LABEL);
if (null != labelFacet) {
/*
* By adding attribute VPE-FACET to this visual node
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -60,6 +60,7 @@
public static final String ATTR_NAME = "name"; //$NON-NLS-1$
public static final String ATTR_POPUP = "popup";//$NON-NLS-1$
public static final String ATTR_ROWS = "rows"; //$NON-NLS-1$
+ public static final String ATTR_ROW_CLASS = "rowClass"; //$NON-NLS-1$
public static final String ATTR_ROW_CLASSES = "rowClasses"; //$NON-NLS-1$
public static final String ATTR_SELECT_ITEM_LABEL = "itemLabel"; //$NON-NLS-1$
public static final String ATTR_SELECT_ITEM_VALUE = "itemValue"; //$NON-NLS-1$showButton
@@ -70,6 +71,7 @@
public static final String ATTR_SORTABLE = "sortable"; //$NON-NLS-1$
public static final String ATTR_STYLE = "style"; //$NON-NLS-1$
public static final String ATTR_STYLE_CLASS = "styleClass"; //$NON-NLS-1$
+ public static final String ATTR_TYPE = "type"; //$NON-NLS-1$
public static final String ATTR_VALUE = "value"; //$NON-NLS-1$
public static final String ATTR_VISIBLE = "visible"; //$NON-NLS-1$
public static final String ATTR_WIDTH = "width"; //$NON-NLS-1$
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2010-11-09 13:06:17 UTC (rev 26360)
@@ -883,7 +883,16 @@
<vpe:drop container="no"/>
</vpe:dnd>
</vpe:template>
- </vpe:tag>
+ </vpe:tag>
+ <vpe:tag name="rich:list" case-sensitive="yes">
+ <vpe:template children="yes" modify="yes"
+ class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesListTemplate">
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes"/>
+ </vpe:dnd>
+ </vpe:template>
+ </vpe:tag>
<vpe:tag name="rich:clientId" case-sensitive="yes">
<vpe:template children="no" modify="no">
</vpe:template>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml 2010-11-09 13:06:17 UTC (rev 26360)
@@ -0,0 +1,68 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:rich="http://richfaces.org/rich">
+ <style>
+ .gray-background {
+ background-color: gray;
+ }
+ .red-background {
+ background-color: red;
+ border: 5px solid red;
+ }
+ .bold-weight {
+ font-weight: bold;
+ }
+ .italic-style {
+ font-style: italic;
+ }
+ </style>
+
+ <p><b>rich:list, default type:</b></p>
+ <rich:list id="default" value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style, bold-weight">
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="ordered"</b></p>
+ <rich:list id="ordered" value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="ordered" styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style, bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="unordered"</b></p>
+ <rich:list id="unordered" value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="unordered" styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style, bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+
+ <p><b>rich:list type="definitions"</b></p>
+ <rich:list id="definitions" value="#{carsBean.inventoryVendorLists}" id="list"
+ var="vendorList" type="definitions" styleClass="red-background" style="background-color:white"
+ rowClass="gray-background" rowClasses="italic-style, bold-weight">
+ <f:facet name="term">
+ <h:panelGroup layout="block">
+ <h:outputText value="In stock: #{vendorList.count}"
+ style="font-weight:bold" />
+ </h:panelGroup>
+ </f:facet>
+ <h:outputText value="#{vendorList.vendor}" />
+ </rich:list>
+</ui:composition>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/list.xhtml.xml 2010-11-09 13:06:17 UTC (rev 26360)
@@ -0,0 +1,47 @@
+<tests>
+ <test id="default">
+ <UL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </UL>
+ </test>
+ <test id="ordered">
+ <OL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </OL>
+ </test>
+ <test id="unordered">
+ <UL STYLE="background-color: white;" CLASS="red-background">
+ <LI CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </LI>
+ </UL>
+ </test>
+ <test id="definitions">
+ <DL STYLE="background-color: white;" CLASS="red-background">
+ <DT CLASS="italic-style gray-background">
+ <SPAN>
+ <DIV STYLE="-moz-user-modify: read-write;">
+ <SPAN STYLE="font-weight: bold;">
+ In stock: #{vendorList.count}
+ </SPAN>
+ </DIV>
+ </SPAN>
+ </DT>
+ <DD CLASS="italic-style gray-background">
+ <SPAN CLASS="vpe-text">
+ #{vendorList.vendor}
+ </SPAN>
+ </DD>
+ </DL>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -213,6 +213,10 @@
performInvisibleTagTest("components/jQuery.xhtml", "jQuery"); //$NON-NLS-1$ //$NON-NLS-2$
}
+ public void testList() throws Throwable {
+ performContentTest("components/list.xhtml");//$NON-NLS-1$
+ }
+
public void testListShuttle() throws Throwable {
performContentTest("components/listShuttle.xhtml");//$NON-NLS-1$
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/SourceDomUtil.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -95,21 +95,33 @@
return result;
}
- public static Element getFacetByName(Element sourceElement, String facetName) {
+ public static Element getFacetByName(VpePageContext pageContext,
+ Element sourceElement, String facetName) {
+ if (facetName == null) {
+ return null;
+ }
+
Element facetElement = null;
NodeList children = sourceElement.getChildNodes();
- for (int i = 0; i < children.getLength(); i++) {
- Node node = children.item(i);
- if ((facetName != null)
- && (node instanceof Element)
- && (node.getNodeName() != null)
- && (node.getNodeName().indexOf(":facet") > 0) //$NON-NLS-1$
- && (facetName.equalsIgnoreCase((((Element) node)).getAttribute("name")))) { //$NON-NLS-1$
+ for (int i = 0; i < children.getLength(); i++) {
+ Node node = children.item(i);
+ if (isFacetElement(pageContext, node)
+ && facetName.equalsIgnoreCase( ((Element) node).getAttribute("name") )) { //$NON-NLS-1$
facetElement = (Element) node;
- }
- }
- return facetElement;
+ }
+ }
+ return facetElement;
}
+
+ public static boolean isFacetElement(VpePageContext pageContext, Node node) {
+ if (node instanceof Element) {
+ String templateName = VpeTemplateManager.getInstance()
+ .getTemplateName(pageContext, node);
+ return "f:facet".equals(templateName);
+ } else {
+ return false;
+ }
+ }
/**
* Returns a XPath expression given a DOM Node.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/VisualDomUtil.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -1,12 +1,12 @@
/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Copyright (c) 2007-2010 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
*
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
******************************************************************************/
package org.jboss.tools.vpe.editor.util;
@@ -17,6 +17,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import java.util.Set;
import org.eclipse.swt.graphics.Point;
@@ -215,27 +216,51 @@
}
}
}
+
+ /**
+ * Copies all attributes from source node to visual node.
+ *
+ * @param sourceElement the source element
+ * @param sourceAttrName the name of source attribute
+ * @param visualElement the visual element
+ * @param visualAttrName the resulting name of visual attribute
+ */
+ public static void copyAttribute(Element sourceElement, String sourceAttrName,
+ nsIDOMElement visualElement, String visualAttrName) {
+ if (sourceElement.hasAttribute(sourceAttrName)) {
+ String attrValue = sourceElement.getAttribute(sourceAttrName);
+ visualElement.setAttribute(visualAttrName, attrValue);
+ }
+ }
/**
* Copies all attributes from source node to visual node.
*
* @param sourceElement the source element
+ * @param visualElement the visual element
* @param attributes list names of attributes which will copy
- * @param visualElement the visual element
*/
- public static void copyAttributes(Element sourceElement, List<String> attributes, nsIDOMElement visualElement) {
-
- if (attributes == null)
- return;
-
+ public static void copyAttributes(Element sourceElement, nsIDOMElement visualElement, List<String> attributes) {
for (String attributeName : attributes) {
- if (sourceElement.hasAttribute(attributeName)) {
- String attributeValue = sourceElement.getAttribute(attributeName);
- visualElement.setAttribute(attributeName, attributeValue);
- }
+ copyAttribute(sourceElement, attributeName, visualElement, attributeName);
}
-
}
+
+ /**
+ * Copies all attributes from source node to visual node.
+ *
+ * @param sourceElement the source element
+ * @param visualElement the visual element
+ * @param sourceToVisualMap mapping for attributes' names.
+ */
+ public static void copyAttributes(Element sourceElement,
+ nsIDOMElement visualElement, Map<String, String> sourceToVisualMap) {
+ for (Entry<String, String> sourceToVisual : sourceToVisualMap.entrySet()) {
+ String sourceAttrName = sourceToVisual.getKey();
+ String visualAttrName = sourceToVisual.getValue();
+ copyAttribute(sourceElement, sourceAttrName, visualElement, visualAttrName);
+ }
+ }
/**
* Returns instance of {@link nsIAccessibilityService}.
@@ -555,5 +580,4 @@
}
return false;
}
-
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/SpringFormSelectTemplate.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -10,12 +10,15 @@
******************************************************************************/
package org.jboss.tools.vpe.spring.template;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.spring.template.util.Spring;
-import org.jboss.tools.vpe.spring.template.util.VpeSpringUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
@@ -28,6 +31,13 @@
* @see <a href="http://static.springsource.org/spring/docs/3.0.x/spring-framework-referen...">The select tag</>
*/
public class SpringFormSelectTemplate extends VpeAbstractTemplate {
+ public static final Map<String, String> COMMON_SPRING_FORM_ATTRIBUTES_MAP
+ = new HashMap<String, String>() {{
+ put(Spring.ATTR_ID, HTML.ATTR_ID);
+ put(Spring.ATTR_CSS_STYLE, HTML.ATTR_STYLE);
+ put(Spring.ATTR_CSS_CLASS, HTML.ATTR_CLASS);
+ put(HTML.ATTR_SIZE, HTML.ATTR_SIZE);
+ }};
/* (non-Javadoc)
* @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
@@ -37,10 +47,9 @@
Element sourceElement = (Element) sourceNode;
nsIDOMElement select = visualDocument.createElement(HTML.TAG_SELECT);
- VpeSpringUtil.copyCommonAttributes(sourceElement, select);
- VpeSpringUtil.copyAttribute(sourceElement, HTML.ATTR_SIZE,
- select, HTML.ATTR_SIZE);
+ VisualDomUtil.copyAttributes(sourceElement, select, COMMON_SPRING_FORM_ATTRIBUTES_MAP);
+
if (Spring.VALUE_TRUE.equals(sourceElement.getAttribute(Spring.ATTR_DISABLED))) {
select.setAttribute(HTML.ATTR_DISABLED, HTML.ATTR_DISABLED);
}
Deleted: trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java 2010-11-09 12:56:31 UTC (rev 26359)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.spring/src/org/jboss/tools/vpe/spring/template/util/VpeSpringUtil.java 2010-11-09 13:06:17 UTC (rev 26360)
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.spring.template.util;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jboss.tools.vpe.editor.util.HTML;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.w3c.dom.Element;
-
-/**
- * @author Yahor Radtsevich (yradtsevich)
- *
- */
-public class VpeSpringUtil {
-
- public static final Map<String, String> COMMON_SPRING_FORM_ATTRIBUTES_MAP
- = new HashMap<String, String>() {{
- put(Spring.ATTR_ID, HTML.ATTR_ID);
- put(Spring.ATTR_CSS_STYLE, HTML.ATTR_STYLE);
- put(Spring.ATTR_CSS_CLASS, HTML.ATTR_CLASS);
- }};
-
- public static void copyAttribute(Element sourceElement, String sourceAttrName,
- nsIDOMElement visualElement, String visualAttrName) {
- if (sourceElement.hasAttribute(sourceAttrName)) {
- String attrValue = sourceElement.getAttribute(sourceAttrName);
- visualElement.setAttribute(visualAttrName, attrValue);
- }
- }
-
- public static void copyAttributes(Element sourceElement,
- nsIDOMElement visualElement, Map<String, String> sourceToVisualMap) {
- for (Entry<String, String> sourceToVisual : sourceToVisualMap.entrySet()) {
- String sourceAttrName = sourceToVisual.getKey();
- String visualAttrName = sourceToVisual.getValue();
- copyAttribute(sourceElement, sourceAttrName, visualElement, visualAttrName);
- }
- }
-
- public static void copyCommonAttributes(Element sourceElement,
- nsIDOMElement visualElement) {
- copyAttributes(sourceElement, visualElement,
- COMMON_SPRING_FORM_ATTRIBUTES_MAP);
- }
-}
15 years, 5 months
JBoss Tools SVN: r26359 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-11-09 07:56:31 -0500 (Tue, 09 Nov 2010)
New Revision: 26359
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
Log:
JBIDE-7494
https://jira.jboss.org/browse/JBIDE-7494
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2010-11-09 12:39:59 UTC (rev 26358)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2010-11-09 12:56:31 UTC (rev 26359)
@@ -131,12 +131,15 @@
try {
boolean auto = ResourcesUtils.setBuildAutomatically(false);
sp.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ JobUtils.waitForIdle();
int components_1 = sp.getComponents().length;
assertFalse(components_1 == 0);
sp.getProject().build(IncrementalProjectBuilder.CLEAN_BUILD, null);
+ JobUtils.waitForIdle();
int components_2 = sp.getComponents().length;
assertEquals(components_2, 0);
sp.getProject().build(IncrementalProjectBuilder.FULL_BUILD, null);
+ JobUtils.waitForIdle();
int components_3 = sp.getComponents().length;
assertEquals(components_1, components_3);
15 years, 5 months
JBoss Tools SVN: r26358 - trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2010-11-09 07:39:59 -0500 (Tue, 09 Nov 2010)
New Revision: 26358
Added:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerHolderAdapter.java
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ActivityAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ContainerAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/CorrelationSetAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ExpressionAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/LinkAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerDelegateAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MessageExchangeAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PartnerLinkAdapter.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/VariableAdapter.java
Log:
OPEN - issue JBIDE-7526: "Unknown Marker ID" exception being thrown by editor on mousehover over error decorator
https://jira.jboss.org/browse/JBIDE-7526
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ActivityAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ActivityAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ActivityAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -29,6 +29,7 @@
import org.eclipse.bpel.ui.uiextensionmodel.UiextensionmodelFactory;
import org.eclipse.bpel.ui.util.BPELUtil;
import org.eclipse.bpel.ui.util.FlowLinkUtil;
+import org.eclipse.core.internal.resources.Marker;
import org.eclipse.core.resources.IMarker;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
@@ -47,65 +48,14 @@
*
*/
-public abstract class ActivityAdapter extends AbstractStatefulAdapter implements INamedElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public abstract class ActivityAdapter extends MarkerHolderAdapter implements INamedElement,
ILabeledElement, EditPartFactory, IOutlineEditPartFactory, IMarkerHolder,
IEditPartActionContributor, IExtensionFactory, AdapterNotification
{
-
- public static class UniqueMarkers extends ArrayList<IMarker> {
-
- // https://jira.jboss.org/browse/JBIDE-7497
- // prevent duplicate marker IDs from being added to the list - this
- // causes those mysterious "Marker not found" errors during validation
- @Override
- public boolean add(IMarker e) {
- for (int i=0; i<size(); ++i) {
- IMarker m = get(i);
- if (m.getId() == e.getId())
- return false;
- }
- return super.add(e);
- }
-
- }
/**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- UniqueMarkers fMarkers = new UniqueMarkers();
-
- static IMarker [] EMPTY_MARKERS = {};
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
- /**
* Helper method for getting an AbstractUIObjectFactory from a model object.
*/
protected AbstractUIObjectFactory getUIObjectFactory(Object modelObject) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ContainerAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ContainerAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ContainerAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -10,20 +10,17 @@
*******************************************************************************/
package org.eclipse.bpel.ui.adapters;
-import java.util.ArrayList;
import java.util.List;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.emf.common.notify.Notification;
-
/**
* Adapter for an object which may (or may not) support IContainer.
* This class forwards the IContainer methods to a delegate which subclasses
* should construct in createContainerDelegate().
*/
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
public abstract class ContainerAdapter
- extends AbstractStatefulAdapter
+ extends MarkerHolderAdapter
implements IContainer, IMarkerHolder, AdapterNotification {
IContainer containerDelegate = null;
@@ -34,45 +31,7 @@
}
return containerDelegate;
}
-
-
-
- /**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
- static IMarker [] EMPTY_MARKERS = {};
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
/**
* Subclasses must override this to create the actual IContainer
* implementation. This method should not return null.
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/CorrelationSetAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/CorrelationSetAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/CorrelationSetAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -14,7 +14,6 @@
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.CorrelationSet;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
@@ -33,51 +32,14 @@
* @date Jun 5, 2007
*
*/
-public class CorrelationSetAdapter extends AbstractStatefulAdapter implements INamedElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class CorrelationSetAdapter extends MarkerHolderAdapter implements INamedElement,
ILabeledElement, EditPartFactory, IOutlineEditPartFactory, IMarkerHolder,
ITrayEditPartFactory,AdapterNotification
{
-
/**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
-
- static IMarker [] EMPTY_MARKERS = {};
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
-
-
- /**
* @see org.eclipse.bpel.ui.adapters.INamedElement#getName(java.lang.Object)
*/
public String getName(Object namedElement) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ExpressionAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ExpressionAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/ExpressionAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -23,41 +23,8 @@
*
*/
-public class ExpressionAdapter extends AbstractStatefulAdapter implements IMarkerHolder, AdapterNotification {
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class ExpressionAdapter extends MarkerHolderAdapter implements IMarkerHolder, AdapterNotification {
- /**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
-
- static IMarker [] EMPTY_MARKERS = {};
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/LinkAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/LinkAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/LinkAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -10,17 +10,13 @@
*******************************************************************************/
package org.eclipse.bpel.ui.adapters;
-import java.util.ArrayList;
-
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.Link;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.editparts.LinkEditPart;
import org.eclipse.bpel.ui.uiextensionmodel.UiextensionmodelFactory;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPart;
@@ -34,51 +30,13 @@
* @date Jun 5, 2007
*
*/
-public class LinkAdapter extends AbstractStatefulAdapter implements INamedElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class LinkAdapter extends MarkerHolderAdapter implements INamedElement,
EditPartFactory, ILabeledElement, IMarkerHolder, IExtensionFactory,
AdapterNotification
{
-
-
- /**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
-
- super.notifyChanged(notification);
-
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
- static IMarker [] EMPTY_MARKERS = {};
-
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
-
/**
* @see org.eclipse.bpel.ui.adapters.INamedElement#getName(java.lang.Object)
*/
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerDelegateAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerDelegateAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerDelegateAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -46,20 +46,18 @@
*/
public class MarkerDelegateAdapter extends AbstractStatefulAdapter implements IMarkerHolder, AdapterNotification {
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
-
static IMarker [] EMPTY_MARKERS = {};
/** (non-Javadoc)
* @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
+ *
+ * https://jira.jboss.org/browse/JBIDE-7526
+ * We don't own any markers since we delegate to MarkerHolderAdapter
+ * TODO: do we need to get markers from parent adapter?
*/
-
public IMarker[] getMarkers (Object object) {
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
+ return EMPTY_MARKERS;
}
protected boolean isMarkerEvent(Notification notification) {
Added: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerHolderAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerHolderAdapter.java (rev 0)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MarkerHolderAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.eclipse.bpel.ui.adapters;
+
+import java.util.ArrayList;
+
+import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.emf.common.notify.Notification;
+
+/**
+ * This class was created out of the duplicated code in a bunch of activity adapters.
+ * It manages the markers list and ensures that duplicate markers are not added to
+ * the list, and that only valid markers are returned.
+ *
+ * @see https://jira.jboss.org/browse/JBIDE-7526
+ * @author Bob Brodt
+ * @date Nov 9, 2010
+ */
+public class MarkerHolderAdapter extends AbstractStatefulAdapter implements IMarkerHolder, AdapterNotification {
+
+ private class UniqueMarkers extends ArrayList<IMarker> {
+
+ // prevent duplicate marker IDs from being added to the list
+ @Override
+ public boolean add(IMarker e) {
+ for (int i=0; i<size(); ++i) {
+ IMarker m = get(i);
+ if (m.getId() == e.getId())
+ return false;
+ }
+ return super.add(e);
+ }
+
+ }
+
+ /**
+ * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ @Override
+ public void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ switch (notification.getEventType()) {
+ case NOTIFICATION_MARKERS_STALE :
+ fMarkers.clear();
+ break;
+ case NOTIFICATION_MARKER_ADDED :
+ fMarkers.add ( (IMarker) notification.getNewValue() );
+ break;
+ case NOTIFICATION_MARKER_DELETED :
+ fMarkers.remove ( notification.getOldValue() );
+ break;
+ }
+ }
+
+ UniqueMarkers fMarkers = new UniqueMarkers();
+
+ static IMarker [] EMPTY_MARKERS = {};
+
+ /** (non-Javadoc)
+ * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
+ */
+ public IMarker[] getMarkers (Object object) {
+
+ if (fMarkers.size() == 0) {
+ return EMPTY_MARKERS;
+ }
+
+ UniqueMarkers removed = new UniqueMarkers();
+ for (IMarker m : fMarkers) {
+ if (!m.exists())
+ removed.add(m);
+ }
+
+ fMarkers.removeAll(removed);
+
+ return fMarkers.toArray( EMPTY_MARKERS );
+ }
+}
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MessageExchangeAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MessageExchangeAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/MessageExchangeAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -13,18 +13,14 @@
package org.eclipse.bpel.ui.adapters;
-import java.util.ArrayList;
-
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.MessageExchange;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
import org.eclipse.bpel.ui.editparts.MessageExchangeEditPart;
import org.eclipse.bpel.ui.editparts.OutlineTreeEditPart;
import org.eclipse.bpel.ui.properties.PropertiesLabelProvider;
-import org.eclipse.core.resources.IMarker;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
@@ -36,53 +32,15 @@
/**
* @author Miriam Grundig (MGrundig(a)de.ibm.com)
*/
-public class MessageExchangeAdapter extends AbstractStatefulAdapter implements INamedElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class MessageExchangeAdapter extends MarkerHolderAdapter implements INamedElement,
ILabeledElement, EditPartFactory, IOutlineEditPartFactory, IMarkerHolder,
ITrayEditPartFactory, IContentProposal,
AdapterNotification
{
-
/**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
-
- super.notifyChanged(notification);
-
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
- static IMarker [] EMPTY_MARKERS = {};
-
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
-
- /**
* @see org.eclipse.bpel.ui.adapters.INamedElement#getName(java.lang.Object)
*/
public String getName (Object namedElement) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PartnerLinkAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PartnerLinkAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/PartnerLinkAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -14,7 +14,6 @@
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.PartnerLink;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
@@ -36,53 +35,15 @@
* @date Jun 5, 2007
*
*/
-public class PartnerLinkAdapter extends AbstractStatefulAdapter implements INamedElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class PartnerLinkAdapter extends MarkerHolderAdapter implements INamedElement,
ILabeledElement, EditPartFactory, IOutlineEditPartFactory, IMarkerHolder,
ITrayEditPartFactory, IContentProposal,
AdapterNotification
{
-
/**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
-
- super.notifyChanged(notification);
-
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
- static IMarker [] EMPTY_MARKERS = {};
-
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
-
- /**
* @see org.eclipse.bpel.ui.adapters.INamedElement#getName(java.lang.Object)
*/
public String getName (Object namedElement) {
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/VariableAdapter.java
===================================================================
--- trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/VariableAdapter.java 2010-11-09 12:15:35 UTC (rev 26357)
+++ trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/adapters/VariableAdapter.java 2010-11-09 12:39:59 UTC (rev 26358)
@@ -14,7 +14,6 @@
import org.eclipse.bpel.model.BPELPackage;
import org.eclipse.bpel.model.Variable;
-import org.eclipse.bpel.model.adapters.AbstractStatefulAdapter;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Messages;
@@ -40,49 +39,14 @@
* @date May 23, 2007
*
*/
-public class VariableAdapter extends AbstractStatefulAdapter implements INamedElement, ILabeledElement,
+// https://jira.jboss.org/browse/JBIDE-7526
+// push all of the Marker stuff up to MarkerHolderAdapter to avoid duplication
+public class VariableAdapter extends MarkerHolderAdapter implements INamedElement, ILabeledElement,
EditPartFactory, IOutlineEditPartFactory, IMarkerHolder,
ITrayEditPartFactory, IExtensionFactory, IContentProposal, AdapterNotification
{
-
/**
- * @see org.eclipse.bpel.model.adapters.AbstractAdapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
- */
- @Override
- public void notifyChanged(Notification notification) {
- super.notifyChanged(notification);
- switch (notification.getEventType()) {
- case NOTIFICATION_MARKERS_STALE :
- fMarkers.clear();
- break;
- case NOTIFICATION_MARKER_ADDED :
- fMarkers.add ( (IMarker) notification.getNewValue() );
- break;
- case NOTIFICATION_MARKER_DELETED :
- fMarkers.remove ( notification.getOldValue() );
- break;
- }
- }
-
- ArrayList<IMarker> fMarkers = new ArrayList<IMarker>();
-
- static IMarker [] EMPTY_MARKERS = {};
-
- /** (non-Javadoc)
- * @see org.eclipse.bpel.ui.adapters.IMarkerHolder#getMarkers(java.lang.Object)
- */
-
- public IMarker[] getMarkers (Object object) {
-
- if (fMarkers.size() == 0) {
- return EMPTY_MARKERS;
- }
- return fMarkers.toArray( EMPTY_MARKERS );
- }
-
-
- /**
* @see org.eclipse.bpel.ui.adapters.INamedElement#getName(java.lang.Object)
*/
public String getName(Object modelObject) {
15 years, 5 months
JBoss Tools SVN: r26357 - 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: adietish
Date: 2010-11-09 07:15:35 -0500 (Tue, 09 Nov 2010)
New Revision: 26357
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
Log:
[JBIDE-7518] added notification after editing cloud
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-09 11:59:04 UTC (rev 26356)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/ChangeLog 2010-11-09 12:15:35 UTC (rev 26357)
@@ -1,6 +1,8 @@
2010-11-09 André Dietisheim <adietish(a)redhat.com>
* src/org/jboss/tools/deltacloud/core/DeltaCloud.java (editCloud): [JBIDE-7521] storing cloud after it has been edited
+ (editCloud):
+ [JBIDE-7518] added notification after cloud was edited
2010-11-05 André Dietisheim <adietish(a)redhat.com>
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-09 11:59:04 UTC (rev 26356)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.core/src/org/jboss/tools/deltacloud/core/DeltaCloud.java 2010-11-09 12:15:35 UTC (rev 26357)
@@ -100,6 +100,8 @@
this.type = type;
storePassword(url, username, passwd);
save();
+ // TODO: remove notification with all instances, replace by notifying the changed instance
+ notifyInstanceListListeners(instances.toArray(instances.toArray(new DeltaCloudInstance[instances.size()])));
}
private void storePassword(String url, String username, String passwd) {
@@ -109,6 +111,7 @@
try {
node.put("password", passwd, true /* encrypt */);
} catch (StorageException e) {
+ // TODO: implement proper rethrowing/loggin
e.printStackTrace();
}
}
15 years, 5 months