JBoss Tools SVN: r18999 - trunk/jst/plugins/org.jboss.tools.jst.web.ui.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 10:40:22 -0500 (Wed, 02 Dec 2009)
New Revision: 18999
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-5353
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-12-02 15:20:54 UTC (rev 18998)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/plugin.xml 2009-12-02 15:40:22 UTC (rev 18999)
@@ -239,7 +239,7 @@
<extension point="org.eclipse.ui.popupMenus">
<objectContribution id="RedHatEclipse4Web_IProject" objectClass="org.eclipse.core.resources.IProject">
- <menu id="RedHat4Web" label="JBoss Tools Developer Studio" path="additions">
+ <menu id="RedHat4Web" label="JBoss Tools" path="additions">
<separator name="a">
</separator>
<separator name="b">
@@ -257,7 +257,7 @@
</action>
</objectContribution>
<objectContribution id="RedHatEclipse4Web_IJavaProject" objectClass="org.eclipse.jdt.core.IJavaProject">
- <menu id="RedHat4Web" label="JBoss Tools Developer Studio" path="additions">
+ <menu id="RedHat4Web" label="JBoss Tools" path="additions">
<separator name="a">
</separator>
<separator name="b">
15 years, 1 month
JBoss Tools SVN: r18998 - in branches/jbosstools-3.1.0.RC1/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-12-02 10:20:54 -0500 (Wed, 02 Dec 2009)
New Revision: 18998
Modified:
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
Log:
JBIDE-5354
done
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 15:11:42 UTC (rev 18997)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-12-02 15:20:54 UTC (rev 18998)
@@ -109,204 +109,217 @@
public static EStructuralFeature ELEMENT_BINDING = ExtendedMetaData.INSTANCE.demandFeature(
"http://www.milyn.org/xsd/smooks-1.0.xsd", "binding", true);
-// public static AnyType addBindingTypeToParamType(ParamType param, String property, String selector, String type,
-// String uri) {
-// AnyType binding = createBindingType(property, selector, type, uri);
-// param.getMixed().add(ELEMENT_BINDING, binding);
-// return binding;
-// }
-//
-// public static List<Object> getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
-// List<ParamType> paramList = resourceConfig.getParam();
-// for (Iterator<ParamType> iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = iterator.next();
-// if ("bindings".equals(param.getName())) {
-// if (param.eContents().isEmpty())
-// continue;
-// List<Object> bindingList = (List<Object>) param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
-// return bindingList;
-// }
-// }
-// return Collections.emptyList();
-// }
-//
-// public static boolean isBeanPopulatorResource(ResourceConfigType type) {
-// ResourceType resource = type.getResource();
-// if (resource == null)
-// return false;
-// String value = resource.getStringValue();
-// if (value != null)
-// value = value.trim();
-// if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
-// return true;
-// }
-// return false;
-// }
+ // public static AnyType addBindingTypeToParamType(ParamType param, String
+ // property, String selector, String type,
+ // String uri) {
+ // AnyType binding = createBindingType(property, selector, type, uri);
+ // param.getMixed().add(ELEMENT_BINDING, binding);
+ // return binding;
+ // }
+ //
+ // public static List<Object>
+ // getBindingListFromResourceConfigType(ResourceConfigType resourceConfig) {
+ // List<ParamType> paramList = resourceConfig.getParam();
+ // for (Iterator<ParamType> iterator = paramList.iterator();
+ // iterator.hasNext();) {
+ // ParamType param = iterator.next();
+ // if ("bindings".equals(param.getName())) {
+ // if (param.eContents().isEmpty())
+ // continue;
+ // List<Object> bindingList = (List<Object>)
+ // param.getMixed().list(SmooksModelUtils.ELEMENT_BINDING);
+ // return bindingList;
+ // }
+ // }
+ // return Collections.emptyList();
+ // }
+ //
+ // public static boolean isBeanPopulatorResource(ResourceConfigType type) {
+ // ResourceType resource = type.getResource();
+ // if (resource == null)
+ // return false;
+ // String value = resource.getStringValue();
+ // if (value != null)
+ // value = value.trim();
+ // if (SmooksModelConstants.BEAN_POPULATOR.equals(value)) {
+ // return true;
+ // }
+ // return false;
+ // }
public static void setPropertyValueToAnyType(Object value, EStructuralFeature attribute, AnyType anyType) {
anyType.getAnyAttribute().set(attribute, value);
}
-// public static AnyType getBindingViaProperty(ResourceConfigType resourceConfig, String property) {
-// List bindingList = getBindingListFromResourceConfigType(resourceConfig);
-// for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
-// AnyType binding = (AnyType) iterator.next();
-// String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
-// if (pro != null)
-// pro = pro.trim();
-// if (property.equals(pro)) {
-// return binding;
-// }
-// }
-// return null;
-// }
-//
-// public static boolean isInnerFileContents(ResourceConfigType resourceConfig) {
-// ResourceType resource = resourceConfig.getResource();
-// if (resource == null)
-// return false;
-// String type = resource.getType();
-// if (type != null)
-// type = type.trim();
-// for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
-// String type1 = TEMPLATE_TYPES[i];
-// if (type1.equalsIgnoreCase(type))
-// return true;
-// }
-// return false;
-// }
-//
-// public static boolean isDateTypeSelector(ResourceConfigType type) {
-// ResourceType resource = type.getResource();
-// if (resource == null)
-// return false;
-// String value = resource.getStringValue();
-// if (value != null)
-// value = value.trim();
-// for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
-// String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
-// if (decoderClass.equals(value)) {
-// return true;
-// }
-// }
-// return false;
-// }
-//
-// public static String getTransformType(ResourceConfigType resourceConfig) {
-// ParamType typeParam = null;
-// if (resourceConfig == null)
-// return "";
-// if (isTransformTypeResourceConfig(resourceConfig)) {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = (ParamType) iterator.next();
-// String name = param.getName();
-// if (name != null)
-// name = name.trim();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
-// typeParam = param;
-// break;
-// }
-// }
-// if (typeParam != null) {
-// return SmooksModelUtils.getAnyTypeText(typeParam);
-// }
-// }
-// return "";
-// }
-//
-// public static void setTransformType(ResourceConfigType resourceConfig, String type) {
-// if (type == null)
-// type = "";
-// if (isTransformTypeResourceConfig(resourceConfig)) {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType param = (ParamType) iterator.next();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
-// cleanTextToSmooksType(param);
-// setTextToAnyType(param, type);
-// }
-// }
-// }
-// }
-//
-// public static boolean isFilePathResourceConfig(ResourceConfigType resourceConfig) {
-// ResourceType resource = resourceConfig.getResource();
-// if (resource != null) {
-// String value = resource.getStringValue();
-// if (value != null) {
-// if (value.startsWith("\\")) {
-// return true;
-// }
-// if (value.startsWith("/")) {
-// return true;
-// }
-// }
-// }
-// return false;
-// }
-//
-// public static boolean isTransformTypeResourceConfig(ResourceConfigType resourceConfig) {
-// String selector = resourceConfig.getSelector();
-// if (selector != null)
-// selector = selector.trim();
-// if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
-// return false;
-// }
-//
-// if (resourceConfig.getParam().isEmpty()) {
-// return false;
-// } else {
-// List paramList = resourceConfig.getParam();
-// for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
-// ParamType p = (ParamType) iterator.next();
-// String paramName = p.getName();
-// if (paramName != null)
-// paramName = paramName.trim();
-// if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
-// return true;
-// }
-// }
-// return false;
-// }
-// }
-//
-// public static void setParamText(String paramName, String value, ResourceConfigType resourceConfigType) {
-// List<ParamType> list = resourceConfigType.getParam();
-// ParamType param = null;
-// for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();) {
-// ParamType paramType = (ParamType) iterator.next();
-// String n = paramType.getName();
-// if (n == null)
-// continue;
-// n = n.trim();
-// if (n.equalsIgnoreCase(paramName)) {
-// param = paramType;
-// break;
-// }
-// }
-// if (param == null) {
-// param = SmooksFactory.eINSTANCE.createParamType();
-// param.setName(paramName);
-// resourceConfigType.getParam().add(param);
-// }
-// setTextToAnyType(param, value);
-// }
-//
-// public static String getParmaText(String paramName, ResourceConfigType resourceConfigType) {
-// List plist = resourceConfigType.getParam();
-// for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
-// ParamType p = (ParamType) iterator.next();
-// String n = p.getName();
-// if (n == null)
-// continue;
-// n = n.trim();
-// if (paramName.equalsIgnoreCase(n)) {
-// return getAnyTypeText(p);
-// }
-// }
-// return null;
-// }
+ // public static AnyType getBindingViaProperty(ResourceConfigType
+ // resourceConfig, String property) {
+ // List bindingList = getBindingListFromResourceConfigType(resourceConfig);
+ // for (Iterator iterator = bindingList.iterator(); iterator.hasNext();) {
+ // AnyType binding = (AnyType) iterator.next();
+ // String pro = getAttributeValueFromAnyType(binding, ATTRIBUTE_PROPERTY);
+ // if (pro != null)
+ // pro = pro.trim();
+ // if (property.equals(pro)) {
+ // return binding;
+ // }
+ // }
+ // return null;
+ // }
+ //
+ // public static boolean isInnerFileContents(ResourceConfigType
+ // resourceConfig) {
+ // ResourceType resource = resourceConfig.getResource();
+ // if (resource == null)
+ // return false;
+ // String type = resource.getType();
+ // if (type != null)
+ // type = type.trim();
+ // for (int i = 0; i < TEMPLATE_TYPES.length; i++) {
+ // String type1 = TEMPLATE_TYPES[i];
+ // if (type1.equalsIgnoreCase(type))
+ // return true;
+ // }
+ // return false;
+ // }
+ //
+ // public static boolean isDateTypeSelector(ResourceConfigType type) {
+ // ResourceType resource = type.getResource();
+ // if (resource == null)
+ // return false;
+ // String value = resource.getStringValue();
+ // if (value != null)
+ // value = value.trim();
+ // for (int i = 0; i < SmooksModelConstants.DECODER_CLASSES.length; i++) {
+ // String decoderClass = SmooksModelConstants.DECODER_CLASSES[i];
+ // if (decoderClass.equals(value)) {
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ //
+ // public static String getTransformType(ResourceConfigType resourceConfig)
+ // {
+ // ParamType typeParam = null;
+ // if (resourceConfig == null)
+ // return "";
+ // if (isTransformTypeResourceConfig(resourceConfig)) {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType param = (ParamType) iterator.next();
+ // String name = param.getName();
+ // if (name != null)
+ // name = name.trim();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(name)) {
+ // typeParam = param;
+ // break;
+ // }
+ // }
+ // if (typeParam != null) {
+ // return SmooksModelUtils.getAnyTypeText(typeParam);
+ // }
+ // }
+ // return "";
+ // }
+ //
+ // public static void setTransformType(ResourceConfigType resourceConfig,
+ // String type) {
+ // if (type == null)
+ // type = "";
+ // if (isTransformTypeResourceConfig(resourceConfig)) {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType param = (ParamType) iterator.next();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(param.getName())) {
+ // cleanTextToSmooksType(param);
+ // setTextToAnyType(param, type);
+ // }
+ // }
+ // }
+ // }
+ //
+ // public static boolean isFilePathResourceConfig(ResourceConfigType
+ // resourceConfig) {
+ // ResourceType resource = resourceConfig.getResource();
+ // if (resource != null) {
+ // String value = resource.getStringValue();
+ // if (value != null) {
+ // if (value.startsWith("\\")) {
+ // return true;
+ // }
+ // if (value.startsWith("/")) {
+ // return true;
+ // }
+ // }
+ // }
+ // return false;
+ // }
+ //
+ // public static boolean isTransformTypeResourceConfig(ResourceConfigType
+ // resourceConfig) {
+ // String selector = resourceConfig.getSelector();
+ // if (selector != null)
+ // selector = selector.trim();
+ // if (!SmooksModelConstants.GLOBAL_PARAMETERS.equals(selector)) {
+ // return false;
+ // }
+ //
+ // if (resourceConfig.getParam().isEmpty()) {
+ // return false;
+ // } else {
+ // List paramList = resourceConfig.getParam();
+ // for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
+ // ParamType p = (ParamType) iterator.next();
+ // String paramName = p.getName();
+ // if (paramName != null)
+ // paramName = paramName.trim();
+ // if (SmooksModelConstants.STREAM_FILTER_TYPE.equals(paramName)) {
+ // return true;
+ // }
+ // }
+ // return false;
+ // }
+ // }
+ //
+ // public static void setParamText(String paramName, String value,
+ // ResourceConfigType resourceConfigType) {
+ // List<ParamType> list = resourceConfigType.getParam();
+ // ParamType param = null;
+ // for (Iterator<ParamType> iterator = list.iterator(); iterator.hasNext();)
+ // {
+ // ParamType paramType = (ParamType) iterator.next();
+ // String n = paramType.getName();
+ // if (n == null)
+ // continue;
+ // n = n.trim();
+ // if (n.equalsIgnoreCase(paramName)) {
+ // param = paramType;
+ // break;
+ // }
+ // }
+ // if (param == null) {
+ // param = SmooksFactory.eINSTANCE.createParamType();
+ // param.setName(paramName);
+ // resourceConfigType.getParam().add(param);
+ // }
+ // setTextToAnyType(param, value);
+ // }
+ //
+ // public static String getParmaText(String paramName, ResourceConfigType
+ // resourceConfigType) {
+ // List plist = resourceConfigType.getParam();
+ // for (Iterator iterator = plist.iterator(); iterator.hasNext();) {
+ // ParamType p = (ParamType) iterator.next();
+ // String n = p.getName();
+ // if (n == null)
+ // continue;
+ // n = n.trim();
+ // if (paramName.equalsIgnoreCase(n)) {
+ // return getAnyTypeText(p);
+ // }
+ // }
+ // return null;
+ // }
public static String getAttributeValueFromAnyType(AnyType anyType, EStructuralFeature attribute) {
String value = (String) anyType.getAnyAttribute().get(attribute, false);
@@ -353,24 +366,26 @@
return null;
}
-// public static AnyType createBindingType(String property, String selector, String type, String uri) {
-// if (uri == null) {
-// uri = SmooksPackage.eNS_URI;
-// }
-//
-// AnyType binding = (AnyType) EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
-// if (property != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
-// }
-//
-// if (selector != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
-// }
-// if (type != null) {
-// binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
-// }
-// return binding;
-// }
+ // public static AnyType createBindingType(String property, String selector,
+ // String type, String uri) {
+ // if (uri == null) {
+ // uri = SmooksPackage.eNS_URI;
+ // }
+ //
+ // AnyType binding = (AnyType)
+ // EcoreUtil.create(XMLTypePackage.Literals.ANY_TYPE);
+ // if (property != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_PROPERTY, property);
+ // }
+ //
+ // if (selector != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_SELECTOR, selector);
+ // }
+ // if (type != null) {
+ // binding.getAnyAttribute().add(ATTRIBUTE_TYPE, false);
+ // }
+ // return binding;
+ // }
public static void appendTextToSmooksType(AnyType smooksModel, String text) {
smooksModel.getMixed().add(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT, text);
@@ -600,7 +615,9 @@
String value = typeParam.getStringValue();
if (value != null) {
value = value.trim();
- return value.split(",");
+ if (!"".equals(value)) {
+ return value.split(",");
+ }
}
}
return null;
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-02 15:11:42 UTC (rev 18997)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/SmooksFreemarkerTemplateGraphicalEditor.java 2009-12-02 15:20:54 UTC (rev 18998)
@@ -16,6 +16,7 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -31,7 +32,6 @@
import org.jboss.template.TemplateBuilder;
import org.jboss.template.csv.CSVFreeMarkerTemplateBuilder;
import org.jboss.template.csv.CSVModelBuilder;
-import org.jboss.tools.smooks.configuration.SmooksConstants;
import org.jboss.tools.smooks.configuration.editors.actions.AbstractSmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.actions.ISmooksActionGrouper;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
@@ -91,6 +91,77 @@
return factory;
}
+ @Override
+ public void validateEnd(List<Diagnostic> diagnosticResult) {
+ cleanValidationMarker();
+ // validate freemarker model.Because the freemarker csv node
+ // model isn't EMF model so they need to validate separately
+ if(root == null) return;
+ List<AbstractSmooksGraphicalModel> children = root.getChildren();
+ for (Iterator<?> iterator = children.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel abstractSmooksGraphicalModel = (AbstractSmooksGraphicalModel) iterator.next();
+ if (abstractSmooksGraphicalModel instanceof FreemarkerTemplateGraphicalModel) {
+ Object data = abstractSmooksGraphicalModel.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+ if (data instanceof Freemarker) {
+ String type = SmooksModelUtils.getTemplateType((Freemarker) data);
+ if (SmooksModelUtils.FREEMARKER_TEMPLATE_TYPE_CSV.equals(type)) {
+ validateCSVTemplate(abstractSmooksGraphicalModel);
+ }
+ }
+ }
+ }
+ }
+
+ protected void validateCSVTemplate(AbstractSmooksGraphicalModel templateGraphModel) {
+ int s = AbstractSmooksGraphicalModel.NONE;
+ Object data = templateGraphModel.getData();
+ data = AdapterFactoryEditingDomain.unwrap(data);
+
+ char seperator = SmooksModelUtils.getFreemarkerCSVSeperator((Freemarker) data);
+
+ if (seperator == 0) {
+ templateGraphModel.getMessage().add("Seperator character can't be empty");
+ s = AbstractSmooksGraphicalModel.WARNING;
+ }
+
+ char quote = SmooksModelUtils.getFreemarkerCSVQuote((Freemarker) data);
+ if (quote == 0) {
+ templateGraphModel.getMessage().add("Quote character can't be empty");
+ s = AbstractSmooksGraphicalModel.WARNING;
+ }
+
+ String[] fields = SmooksModelUtils.getFreemarkerCSVFileds((Freemarker) data);
+ boolean missFields = false;
+ if (fields == null) {
+ missFields = true;
+ }
+
+ if (s != AbstractSmooksGraphicalModel.NONE) {
+ templateGraphModel.setSeverity(s);
+ }
+
+ List<AbstractSmooksGraphicalModel> csvRecordNode = templateGraphModel.getChildren();
+ for (Iterator<?> iterator = csvRecordNode.iterator(); iterator.hasNext();) {
+ AbstractSmooksGraphicalModel csvRecordGraphModel = (AbstractSmooksGraphicalModel) iterator.next();
+ if (missFields) {
+ csvRecordGraphModel.getMessage().add("CSV fields can't be empty");
+ csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
+ }
+ List<TreeNodeConnection> collectionConnections = csvRecordGraphModel.getTargetConnections();
+ if (collectionConnections.isEmpty()) {
+ csvRecordGraphModel.addMessage("Must be linked with source node");
+ csvRecordGraphModel.setSeverity(AbstractSmooksGraphicalModel.WARNING);
+ List<AbstractSmooksGraphicalModel> csvFields = csvRecordGraphModel.getChildren();
+ for (Iterator<?> iterator2 = csvFields.iterator(); iterator2.hasNext();) {
+ AbstractSmooksGraphicalModel csvFieldsGModel = (AbstractSmooksGraphicalModel) iterator2.next();
+ csvFieldsGModel.addMessage("Case CSV-Record isn't linked with source node , this node can't be linked.");
+ csvFieldsGModel.setSeverity(AbstractSmooksGraphicalModel.ERROR);
+ }
+ }
+ }
+ }
+
/*
* (non-Javadoc)
*
@@ -377,7 +448,7 @@
char quote = SmooksModelUtils.getFreemarkerCSVQuote(freemarker);
String[] fields = SmooksModelUtils.getFreemarkerCSVFileds(freemarker);
try {
- if(contents != null) {
+ if (contents != null) {
CSVModelBuilder modelBuilder = new CSVModelBuilder(fields);
Document model = modelBuilder.buildModel();
TemplateBuilder builder = new CSVFreeMarkerTemplateBuilder(model, seprator, quote, contents);
@@ -386,7 +457,7 @@
}
} catch (Exception e) {
// ignore exception
-// e.printStackTrace();
+ // e.printStackTrace();
}
}
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 15:11:42 UTC (rev 18997)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/freemarker/FreemarkerCSVNodeGraphicalModel.java 2009-12-02 15:20:54 UTC (rev 18998)
@@ -99,7 +99,7 @@
Freemarker freemarker = (Freemarker) parent.getData();
if (freemarker != null) {
ParamType param = SmooksModelUtils.getParam(freemarker.getParam(), SmooksModelUtils.KEY_CSV_FIELDS);
- if (param == null){
+ if (param == null) {
param = SmooksFactory.eINSTANCE.createParamType();
param.setName(SmooksModelUtils.KEY_CSV_FIELDS);
freemarker.getParam().add(param);
Modified: branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 15:11:42 UTC (rev 18997)
+++ branches/jbosstools-3.1.0.RC1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/model/javamapping/JavaBeanChildGraphModel.java 2009-12-02 15:20:54 UTC (rev 18998)
@@ -11,6 +11,7 @@
package org.jboss.tools.smooks.graphical.editors.model.javamapping;
import java.util.Collections;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.emf.ecore.EObject;
@@ -29,6 +30,7 @@
import org.jboss.tools.smooks.graphical.editors.model.AbstractResourceConfigChildNodeGraphModel;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVLinkConnection;
import org.jboss.tools.smooks.graphical.editors.model.freemarker.CSVNodeModel;
+import org.jboss.tools.smooks.graphical.editors.model.freemarker.FreemarkerCSVNodeGraphicalModel;
import org.jboss.tools.smooks.model.javabean.ValueType;
/**
@@ -115,7 +117,24 @@
obj = AdapterFactoryEditingDomain.unwrap(obj);
if (obj instanceof ValueType || obj instanceof org.jboss.tools.smooks.model.javabean12.ValueType) {
if (m instanceof CSVNodeModel) {
- return !((CSVNodeModel) m).isRecord();
+ if (!((CSVNodeModel) m).isRecord()) {
+ List<TreeNodeConnection> exsitingConnection = gm.getTargetConnections();
+ if (!exsitingConnection.isEmpty())
+ return false;
+ for (Iterator<?> iterator = exsitingConnection.iterator(); iterator.hasNext();) {
+ TreeNodeConnection treeNodeConnection = (TreeNodeConnection) iterator.next();
+ if (treeNodeConnection.getSourceNode() == this) {
+ return false;
+ }
+ }
+ AbstractSmooksGraphicalModel parent = gm.getParent();
+ if (parent instanceof FreemarkerCSVNodeGraphicalModel) {
+ List<TreeNodeConnection> connections = parent.getTargetConnections();
+ if (!connections.isEmpty()) {
+ return true;
+ }
+ }
+ }
}
}
if (!inJavaMapping())
15 years, 1 month
JBoss Tools SVN: r18997 - in trunk: jsf/docs/userguide/en/images/visual_page and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-12-02 10:11:42 -0500 (Wed, 02 Dec 2009)
New Revision: 18997
Modified:
trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam25.png
trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam47.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
trunk/jsf/docs/userguide/en/images/visual_page/visual_page_7a.png
Log:
https://jira.jboss.org/jira/browse/JBDS-960 Scaling possibility is added to VPE - screens are updated
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam25.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/first_seam/first_seam47.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_23b.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/visual_page/visual_page_7a.png
===================================================================
(Binary files differ)
15 years, 1 month
JBoss Tools SVN: r18996 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 10:09:30 -0500 (Wed, 02 Dec 2009)
New Revision: 18996
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2009-12-02 15:08:33 UTC (rev 18995)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreBuilder.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -11,10 +11,14 @@
package org.jboss.tools.cdi.core;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.HashSet;
+import java.util.List;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceDelta;
@@ -22,7 +26,17 @@
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.internal.core.scanner.CDIBuilderDelegate;
+import org.jboss.tools.common.EclipseUtil;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.project.ProjectHome;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
public class CDICoreBuilder extends IncrementalProjectBuilder {
public static String BUILDER_ID = "org.jboss.tools.cdi.core.cdibuilder";
@@ -32,7 +46,8 @@
static Set<ICDIBuilderDelegate> getDelegates() {
if(delegates == null) {
delegates = new HashSet<ICDIBuilderDelegate>();
- //TODO populate
+ //TODO populate; extension point will be used
+ delegates.add(new CDIBuilderDelegate()); //default
}
return delegates;
}
@@ -74,6 +89,7 @@
protected IProject[] build(int kind, Map args, IProgressMonitor monitor)
throws CoreException {
+ resourceVisitor = null;
findDelegate();
if(getDelegate() == null) {
return null;
@@ -183,10 +199,91 @@
}
class CDIResourceVisitor implements IResourceVisitor {
+ IPath[] outs = new IPath[0];
+ IPath[] srcs = new IPath[0];
+ IPath webinf = null;
+
+ CDIResourceVisitor() {
+ webinf = ProjectHome.getWebInfPath(getProject());
+ getJavaSourceRoots(getProject());
+ }
+ void getJavaSourceRoots(IProject project) {
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+ if(javaProject == null) return;
+ List<IPath> ps = new ArrayList<IPath>();
+ List<IPath> os = new ArrayList<IPath>();
+ try {
+ IPath output = javaProject.getOutputLocation();
+ if(output != null) os.add(output);
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IResource findMember = ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
+ if(findMember != null && findMember.exists()) {
+ ps.add(findMember.getFullPath());
+ }
+ IPath out = es[i].getOutputLocation();
+ if(out != null && !os.contains(out)) {
+ os.add(out);
+ }
+ }
+ }
+ srcs = ps.toArray(new IPath[0]);
+ outs = os.toArray(new IPath[0]);
+ } catch(CoreException ce) {
+ CDICorePlugin.getDefault().logError("Error while locating java source roots for " + project, ce);
+ }
+ }
+
public boolean visit(IResource resource) throws CoreException {
- // TODO
- return false;
+ IPath path = resource.getFullPath();
+ if(resource instanceof IFile) {
+ IFile f = (IFile)resource;
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path)) {
+ if(f.getName().endsWith(".java")) {
+ ICompilationUnit unit = EclipseUtil.getCompilationUnit(f);
+ builderDelegate.build(f, unit, getCDICoreNature());
+ }
+ return false;
+ }
+ }
+ if(webinf != null && webinf.isPrefixOf(path)) {
+ if(f.getName().equals("beans.xml")) {
+ //TODO
+ }
+ }
+ }
+
+ if(resource instanceof IFolder) {
+ for (int i = 0; i < outs.length; i++) {
+ if(outs[i].isPrefixOf(path)) {
+ return false;
+ }
+ }
+ for (int i = 0; i < srcs.length; i++) {
+ if(srcs[i].isPrefixOf(path) || path.isPrefixOf(srcs[i])) {
+ return true;
+ }
+ }
+ if(webinf != null) {
+ if(webinf.isPrefixOf(path) || path.isPrefixOf(webinf)) {
+ return true;
+ }
+ }
+ if(resource == resource.getProject()) {
+ return true;
+ }
+ return false;
+ }
+ //return true to continue visiting children.
+ return true;
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-02 15:08:33 UTC (rev 18995)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreNature.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -53,6 +53,7 @@
public void setProject(IProject project) {
this.project = project;
+ classPath.init();
}
public void setCDIProject(ICDIProject cdiProject) {
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java 2009-12-02 15:08:33 UTC (rev 18995)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/ICDIBuilderDelegate.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -12,6 +12,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.ICompilationUnit;
/**
* Builder delegate performs build for specific kind of cdi project.
@@ -29,6 +30,7 @@
public Class<? extends ICDIProject> getProjectImplementationClass();
+ public void build(IFile file, ICompilationUnit unit, CDICoreNature projectNature);
public void build(IFile file, CDICoreNature projectNature);
}
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -0,0 +1,127 @@
+package org.jboss.tools.cdi.internal.core.impl;
+
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IType;
+import org.jboss.tools.cdi.core.IAnnotationDeclaration;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.core.IClassBean;
+import org.jboss.tools.cdi.core.IInjectionPoint;
+import org.jboss.tools.cdi.core.IObserverMethod;
+import org.jboss.tools.common.text.INodeReference;
+
+public class CDIProject implements ICDIProject {
+
+ public List<INodeReference> getAlternativeClasses() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getAlternativeStereotypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getAlternatives(String fullQualifiedTypeName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public IClassBean getBeanClass(IType type) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IBean> getBeans(String name,
+ boolean attemptToResolveAmbiguousNames) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IBean> getBeans(boolean attemptToResolveAmbiguousDependency,
+ IType beanType, IAnnotationDeclaration... qualifiers) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IBean> getBeans(IInjectionPoint injectionPoints) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IBean> getBeans(IPath path) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getDecoratorClasses() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getDecoratorClasses(String fullQualifiedTypeName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getInterceptorClasses() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public List<INodeReference> getInterceptorClasses(
+ String fullQualifiedTypeName) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IType> getQualifierTypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IType> getStereotypes() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean isNormalScope(IType annotationType) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isPassivatingScope(IType annotationType) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isQualifier(IType annotationType) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isScope(IType annotationType) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public boolean isStereotype(IType annotationType) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public Set<IBean> resolve(Set<IBean> beans) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Set<IObserverMethod> resolveObserverMethods(
+ IInjectionPoint injectionPoint) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -0,0 +1,59 @@
+package org.jboss.tools.cdi.internal.core.scanner;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.ICDIBuilderDelegate;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.internal.core.impl.CDIProject;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+
+public class CDIBuilderDelegate implements ICDIBuilderDelegate {
+
+ public int computeRelevance(IProject project) {
+ //nothing to compute, builder works only if cdi nature is present
+ return 1;
+ }
+
+ public String getID() {
+ return getClass().getName();
+ }
+
+ public Class<? extends ICDIProject> getProjectImplementationClass() {
+ return CDIProject.class;
+ }
+
+ public void build(IFile file, CDICoreNature projectNature) {
+ IProject project = projectNature.getProject();
+
+
+ }
+
+ public void build(IFile file, ICompilationUnit unit, CDICoreNature projectNature) {
+ if(unit != null) {
+ try {
+ IType[] types = unit.getTypes();
+ if(types != null) {
+ for (IType type: types) {
+ if(type.isAnnotation()) {
+ IAnnotation[] as = type.getAnnotations();
+ for (IAnnotation a: as) {
+ String name = a.getElementName();
+ String qName = EclipseJavaUtil.resolveType(type, name);
+ System.out.println(qName);
+ }
+ }
+ }
+ }
+ } catch (JavaModelException e) {
+ e.printStackTrace();
+ }
+ } else {
+
+ }
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/CDIBuilderDelegate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2009-12-02 15:08:33 UTC (rev 18995)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/scanner/lib/ClassPathMonitor.java 2009-12-02 15:09:30 UTC (rev 18996)
@@ -10,18 +10,19 @@
******************************************************************************/
package org.jboss.tools.cdi.internal.core.scanner.lib;
+import org.eclipse.core.resources.IProject;
import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.common.model.project.ext.AbstractClassPathMonitor;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
-//TODO implement
-public class ClassPathMonitor {
+public class ClassPathMonitor extends AbstractClassPathMonitor<CDICoreNature>{
public ClassPathMonitor(CDICoreNature project) {
-
+ this.project = project;
}
- public boolean update() {
- //TODO
- return true;
+ public void init() {
+ model = EclipseResourceUtil.createObjectForResource(getProjectResource()).getModel();
}
public void validateProjectDependencies() {
@@ -37,8 +38,8 @@
return false;
}
- public void clean() {
- //TODO
+ public IProject getProjectResource() {
+ return project.getProject();
}
}
15 years, 1 month
JBoss Tools SVN: r18995 - in trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model: util and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 10:08:33 -0500 (Wed, 02 Dec 2009)
New Revision: 18995
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-12-02 15:07:59 UTC (rev 18994)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ProjectHome.java 2009-12-02 15:08:33 UTC (rev 18995)
@@ -96,7 +96,8 @@
//Taken from J2EEUtils and modified
public static IPath getWebInfPath(IProject project) {
- IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ if(component == null || component.getRootFolder() == null) return null;
IVirtualFolder webInfDir = component.getRootFolder().getFolder(new Path("/WEB-INF")); //$NON-NLS-1$
IPath modulePath = webInfDir.getWorkspaceRelativePath();
return (!webInfDir.exists()) ? null : modulePath;
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-12-02 15:07:59 UTC (rev 18994)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/util/EclipseResourceUtil.java 2009-12-02 15:08:33 UTC (rev 18995)
@@ -848,26 +848,6 @@
return false;
}
- public static IResource[] getJavaSourceRoots(IProject project) {
- IJavaProject javaProject = getJavaProject(project);
- if(javaProject == null) return null;
- List<IResource> resources = new ArrayList<IResource>();
- try {
- IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
- for (int i = 0; i < es.length; i++) {
- if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
- IResource findMember = ModelPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
- if(findMember != null && findMember.exists()) {
- resources.add(findMember);
- }
- }
- }
- } catch(CoreException ce) {
- ModelPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce); //$NON-NLS-1$
- }
- return resources.toArray(new IResource[resources.size()]);
- }
-
public static IResource getJavaSourceRoot(IProject project) {
IJavaProject javaProject = getJavaProject(project);
if(javaProject == null) return null;
15 years, 1 month
JBoss Tools SVN: r18994 - trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 10:07:59 -0500 (Wed, 02 Dec 2009)
New Revision: 18994
Modified:
trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/EclipseUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Modified: trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/EclipseUtil.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/EclipseUtil.java 2009-12-02 14:23:23 UTC (rev 18993)
+++ trunk/common/plugins/org.jboss.tools.common/src/org/jboss/tools/common/EclipseUtil.java 2009-12-02 15:07:59 UTC (rev 18994)
@@ -10,16 +10,25 @@
******************************************************************************/
package org.jboss.tools.common;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.JavaCore;
/**
- * @author Alexey Kazakov
+ * @author Alexey Kazakov, Viacheslav Kabanovich
*/
public class EclipseUtil {
@@ -47,6 +56,49 @@
}
}
+ public static IResource[] getJavaSourceRoots(IProject project) {
+ IJavaProject javaProject = getJavaProject(project);
+ if(javaProject == null) return null;
+ List<IResource> resources = new ArrayList<IResource>();
+ try {
+ IClasspathEntry[] es = javaProject.getResolvedClasspath(true);
+ for (int i = 0; i < es.length; i++) {
+ if(es[i].getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ IResource findMember = ResourcesPlugin.getWorkspace().getRoot().findMember(es[i].getPath());
+ if(findMember != null && findMember.exists()) {
+ resources.add(findMember);
+ }
+ }
+ }
+ } catch(CoreException ce) {
+ CommonPlugin.getPluginLog().logError("Error while locating java source roots for " + project, ce); //$NON-NLS-1$
+ }
+ return resources.toArray(new IResource[resources.size()]);
+ }
+
+ public static ICompilationUnit getCompilationUnit(IFile f) throws CoreException {
+ IProject project = f.getProject();
+ IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
+ IResource[] rs = getJavaSourceRoots(project);
+ for (int i = 0; i < rs.length; i++) {
+ if(rs[i].getFullPath().isPrefixOf(f.getFullPath())) {
+ IPath path = f.getFullPath().removeFirstSegments(rs[i].getFullPath().segmentCount());
+ IJavaElement e = javaProject.findElement(path);
+ if(e == null && path.lastSegment().equals("package-info.java")) {
+ //strange but sometimes only this works
+ IJavaElement ep = javaProject.findElement(path.removeLastSegments(1));
+ if(ep instanceof IPackageFragment) {
+ e = ((IPackageFragment)ep).getCompilationUnit("package-info.java");
+ }
+ }
+ if(e instanceof ICompilationUnit) {
+ return (ICompilationUnit)e;
+ }
+ }
+ }
+ return null;
+ }
+
public static void addNatureToProject(IProject project, String natureId) throws CoreException {
IProject proj = project.getProject();
IProjectDescription description = proj.getDescription();
15 years, 1 month
JBoss Tools SVN: r18992 - documentation/trunk/movies/index/en.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-12-02 09:09:57 -0500 (Wed, 02 Dec 2009)
New Revision: 18992
Modified:
documentation/trunk/movies/index/en/master.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-957 - updating the movies index page according to the new demos about Seam refactoring added;
Modified: documentation/trunk/movies/index/en/master.xml
===================================================================
--- documentation/trunk/movies/index/en/master.xml 2009-12-02 13:51:03 UTC (rev 18991)
+++ documentation/trunk/movies/index/en/master.xml 2009-12-02 14:09:57 UTC (rev 18992)
@@ -14,15 +14,15 @@
<index>
<title/>
<!--title>The following viewlets illustrate various aspects of JBoss Tools and JBDS.</title-->
- <itemizedlist>
+ <!--itemizedlist>
<title>JBDS Demos</title>
<listitem>
<para>
<ulink url="demos/welcome_to_JBDS_demo/welcome_jbds.htm">Welcome to JBDS</ulink>
</para>
- <para>This demo introduces JBoss Developer Studio and gives an overview of some its features that help you to get started</para>
+ <para>This demo introduces JBoss Developer Studio and gives an overview of some its features that help you get started</para>
</listitem>
- </itemizedlist>
+ </itemizedlist-->
<itemizedlist>
<title>Hibernate Demos</title>
@@ -121,20 +121,57 @@
<para>In this part of the video cast about Seam it will be shown how to create a web page that displays database entries and adds a new entry to the database reusing generated code. You will practically learn how to use JSF, RichFaces and Facelets.</para>
</listitem>
- <listitem>
+ <listitem>
<para>
<ulink url="demos/connecting_to_db_and_reverse_engineering_db_table/seamDemo.sql">The database used in these movies</ulink>
</para>
- </listitem>
-
-
+ </listitem>
</itemizedlist>
</listitem>
+<listitem>
+ <para>The next set of movies demonstrates the Seam refactoring tools in action:</para>
+
+ <itemizedlist>
+ <listitem>
+ <para><ulink url="demos/rename_seam_components_java/rename_seam_components_java.htm">Reanaming a Seam component in the Java Editor</ulink></para>
+ <para>The video shows how you can rename a Seam component and how it effects <literal>.java</literal>, <literal>pages.xml</literal>
+ and <literal>.xhtml</literal> files in the project. It also includes an example of what happens for read only files.</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="demos/rename_seam_components_comp_view/rename_seam_components_comp_view.htm">Reanaming a Seam component in the Seam Components view</ulink>
+ </para>
+ <para>The movie shows how you can rename a Seam component in the Seam Components view and how it takes effect in <literal>.java</literal> and
+ <literal>components.xml</literal> files.</para>
+ </listitem>
+
+ <listitem>
+ <para>
+ <ulink url="demos/rename_seam_components_comp_xml/rename_seam_components_comp_xml.htm">Reanaming a Seam component in the components.xml file</ulink>
+ </para>
+ <para>The movie shows how to rename a Seam component in the <literal>components.xml</literal> file where the component has declaration from the JAR file.</para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="demos/rename_context_variables_java/rename_context_variables_java.htm">Reanaming a Seam context variable in EL in the Java editor</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="demos/rename_context_variables_properties/rename_context_variables_properties.htm">Reanaming a Seam context variable in EL in .properties file editor</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="demos/rename_context_variables_xml/rename_context_variables_xml.htm">Reanaming a Seam context variable in EL in the XML editor</ulink></para>
+ </listitem>
+
+ <listitem>
+ <para><ulink url="rename_context_variables_vpe/rename_context_variables_vpe.htm">Reanaming a Seam context variable in EL in the Visual Page Editor</ulink></para>
+ <para>These movies demonstrate how you can rename a Seam context variable in EL in different editors.</para>
+ </listitem>
+ </itemizedlist>
+</listitem>
-
-
-
-
</itemizedlist>
<itemizedlist>
<title>Project Archives Demos</title>
15 years, 1 month
JBoss Tools SVN: r18991 - in documentation/trunk/movies: rename_seam_components_comp_xml and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-12-02 08:51:03 -0500 (Wed, 02 Dec 2009)
New Revision: 18991
Added:
documentation/trunk/movies/rename_seam_components_comp_xml/
documentation/trunk/movies/rename_seam_components_comp_xml/readme.txt
documentation/trunk/movies/rename_seam_components_comp_xml/rename_seam_components_comp_xml.wnk
Log:
https://jira.jboss.org/jira/browse/JBDS-957 - creating and adding the "Renaming a Seam Component in the components.xml File" demo;
Added: documentation/trunk/movies/rename_seam_components_comp_xml/readme.txt
===================================================================
--- documentation/trunk/movies/rename_seam_components_comp_xml/readme.txt (rev 0)
+++ documentation/trunk/movies/rename_seam_components_comp_xml/readme.txt 2009-12-02 13:51:03 UTC (rev 18991)
@@ -0,0 +1,25 @@
+To apply Jboss org styles to the generated HTML file, you should do next:
+
+
+- first, add the HEAD of the HTML document to attach a style sheet, a tab icon and a title of the page:
+
+ <head>
+ <title>Renaming a Seam Component in the components.xml File</title>
+ <link rel="stylesheet" href="../resources/tools.css"
+ type="text/css"/>
+ <link xmlns="" rel="shortcut icon" type="image/vnd.microsoft.icon" href="../resources/images/favicon.ico"/>
+ </head>
+
+
+- place the generated by Wink OBJECT inside this block element:
+
+ <div class="book">
+ <p id="title"><a href="http://www.jboss.org" class="site_href">
+ <strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href">
+ <strong>Community Demos</strong></a></p>
+
+ <--! Place the OBJECT generated by Wink here. -->
+
+ </div>
+
+
\ No newline at end of file
Added: documentation/trunk/movies/rename_seam_components_comp_xml/rename_seam_components_comp_xml.wnk
===================================================================
(Binary files differ)
Property changes on: documentation/trunk/movies/rename_seam_components_comp_xml/rename_seam_components_comp_xml.wnk
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
15 years, 1 month
JBoss Tools SVN: r18990 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-02 08:29:19 -0500 (Wed, 02 Dec 2009)
New Revision: 18990
Added:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4943
Added: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java 2009-12-02 13:29:19 UTC (rev 18990)
@@ -0,0 +1,142 @@
+package org.jboss.tools.common.model.project.ext;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.filesystems.impl.FileSystemsLoader;
+import org.jboss.tools.common.model.plugin.ModelPlugin;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.XModelObjectUtil;
+
+/**
+ * Monitors class path of project and loads seam components of it.
+ *
+ * @author Viacheslav Kabanovich
+ */
+public abstract class AbstractClassPathMonitor<P> {
+ protected XModel model = null;
+ protected P project;
+
+ protected List<String> paths = null;
+ protected Map<IPath, String> paths2 = new HashMap<IPath, String>();
+
+ protected Set<String> processedPaths = new HashSet<String>();
+
+ public AbstractClassPathMonitor() {
+ }
+
+ public P getProject() {
+ return project;
+ }
+
+ /**
+ * Initialization of inner model.
+ */
+ public void init() {
+ }
+
+ public abstract IProject getProjectResource();
+
+ /**
+ * Returns true if class path was up-to-date.
+ * Otherwise, updates inner model and disables class loader.
+ * @return
+ */
+ public boolean update() {
+ List<String> newPaths = null;
+ try {
+ newPaths = EclipseResourceUtil.getClassPath(getProjectResource());
+ List<String> jre = EclipseResourceUtil.getJREClassPath(getProjectResource());
+ if(jre != null) newPaths.removeAll(jre);
+ } catch (CoreException e) {
+ //TODO
+ ModelPlugin.getDefault().logError(e);
+ } catch(IOException e) {
+ ModelPlugin.getDefault().logError(e);
+ }
+ if(paths == null && newPaths == null) return false;
+ if((newPaths == null || paths == null) || (paths.size() != newPaths.size())) {
+ paths = newPaths;
+ } else {
+ boolean b = false;
+ for (int i = 0; i < paths.size() && !b; i++) {
+ if(!paths.get(i).equals(newPaths.get(i))) b = true;
+ }
+ if(!b) return false;
+ paths = newPaths;
+ }
+ createMap();
+ XModelObject object = model.getByPath("FileSystems"); //$NON-NLS-1$
+ XModelObject[] fs = object.getChildren("FileSystemJar"); //$NON-NLS-1$
+ Set<XModelObject> fss = new HashSet<XModelObject>();
+ for (int i = 0; i < fs.length; i++) fss.add(fs[i]);
+
+ for (int i = 0; i < paths.size(); i++) {
+ String path = paths.get(i);
+ if(!EclipseResourceUtil.isJar(path)) continue;
+ String fileName = new File(path).getName();
+ if(EclipseResourceUtil.SYSTEM_JAR_SET.contains(fileName)) continue;
+ String jsname = "lib-" + fileName; //$NON-NLS-1$
+ XModelObject o = model.getByPath("FileSystems").getChildByPath(jsname); //$NON-NLS-1$
+ if(o != null) {
+ fss.remove(o);
+ } else {
+ o = object.getModel().createModelObject("FileSystemJar", null); //$NON-NLS-1$
+ o.setAttributeValue("name", jsname); //$NON-NLS-1$
+ o.setAttributeValue("location", path); //$NON-NLS-1$
+ o.set(FileSystemsLoader.IS_ADDED_TO_CLASSPATH, "true"); //$NON-NLS-1$
+ object.addChild(o);
+// object.setModified(true);
+ }
+ }
+
+ for (XModelObject o: fss) {
+ String path = XModelObjectUtil.expand(o.getAttributeValue("location"), o.getModel(), null); //$NON-NLS-1$
+ if("true".equals(o.get(FileSystemsLoader.IS_ADDED_TO_CLASSPATH))) { //$NON-NLS-1$
+ o.removeFromParent();
+ } else if(!new File(path).exists()) {
+ o.removeFromParent();
+ }
+ }
+
+ return true;
+ }
+
+ private void createMap() {
+ paths2.clear();
+ if(paths != null) {
+ for (String p : paths) {
+ paths2.put(new Path(p), p);
+ }
+ }
+ }
+
+ public void pathLoaded(IPath path) {
+ String p = paths2.get(path);
+ if(p != null) {
+ processedPaths.add(p);
+ }
+ }
+
+ public boolean hasPath(IPath path) {
+ return paths2.get(path) != null;
+ }
+
+ public void clean() {
+ paths = null;
+ if(paths2 != null) paths2.clear();
+ processedPaths.clear();
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/project/ext/AbstractClassPathMonitor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month