Author: DartPeng
Date: 2009-01-20 03:44:14 -0500 (Tue, 20 Jan 2009)
New Revision: 13139
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/LineConnectionSectionFilter.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/commandprocessor/JavaBeanModelCommandProcessor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/AbstractJavaBeanBuilder.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/BeanPopulatorMappingAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSectonFilter.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java
Log:
JBIDE-3593
Done it
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-01-20 07:35:17 UTC (rev
13138)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/plugin.xml 2009-01-20 08:44:14 UTC (rev
13139)
@@ -33,11 +33,9 @@
contributorId="org.jboss.tools.smooks.ui.editors.SmooksFormEditor">
<propertySection
class="org.jboss.tools.smooks.ui.ConnectionPropertySection"
+ filter="org.jboss.tools.smooks.ui.LineConnectionSectionFilter"
id="org.jboss.tools.smooks.ui.connection.propertyTab.Section"
tab="org.jboss.tools.smooks.ui.connection.propertyTab">
- <input
-
type="org.jboss.tools.smooks.ui.gef.model.LineConnectionModel">
- </input>
</propertySection>
<propertySection
class="org.jboss.tools.smooks.javabean.ui.JavaBeanPropertiesSection"
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/commandprocessor/JavaBeanModelCommandProcessor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/commandprocessor/JavaBeanModelCommandProcessor.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/commandprocessor/JavaBeanModelCommandProcessor.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -24,6 +24,7 @@
import org.jboss.tools.smooks.javabean.model.JavaBeanList;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.javabean.ui.BeanPopulatorMappingAnalyzer;
+import org.jboss.tools.smooks.ui.IXMLStructuredObject;
import org.jboss.tools.smooks.ui.gef.commandprocessor.ICommandProcessor;
import org.jboss.tools.smooks.ui.gef.commands.CreateConnectionCommand;
import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
@@ -116,6 +117,15 @@
return false;
}
}
+
+ if(source instanceof IXMLStructuredObject && t instanceof JavaBeanModel){
+ boolean isattribute = ((IXMLStructuredObject)source).isAttribute();
+ JavaBeanModel targetModel = (JavaBeanModel) t;
+ boolean isprimitive = targetModel.isPrimitive();
+ if(isattribute && !isprimitive) return false;
+ if(!isattribute && isprimitive) return false;
+ }
+
if (source instanceof JavaBeanModel && t instanceof JavaBeanModel
&& sourceGraphModel instanceof SourceModel) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -23,6 +23,7 @@
import java.util.List;
import java.util.Properties;
+import org.eclipse.ui.internal.part.NullEditorInput;
import org.jboss.tools.smooks.analyzer.IValidatable;
import org.jboss.tools.smooks.javabean.uitils.JavaPropertyUtils;
import org.jboss.tools.smooks.ui.IXMLStructuredObject;
@@ -337,11 +338,11 @@
return Collections.EMPTY_LIST;
PropertyDescriptor[] pds = JavaPropertyUtils
.getPropertyDescriptor(beanType);
-
for (int i = 0; i < pds.length; i++) {
PropertyDescriptor pd = pds[i];
if ("class".equals(pd.getName())) //$NON-NLS-1$
continue;
+ if(pd.getPropertyType() == null) continue;
if (Collection.class.isAssignableFrom(pd.getPropertyType())) {
Method rmethod = pd.getReadMethod();
if (rmethod != null) {
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/AbstractJavaBeanBuilder.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/AbstractJavaBeanBuilder.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/AbstractJavaBeanBuilder.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -56,6 +56,8 @@
GraphInformations graphInfo, int dataMode) {
String array = getDataSourceClassArray(graphInfo, dataMode);
List list = new ArrayList();
+ if (array == null)
+ return list;
String[] classes = array.split(";");
for (int i = 0; i < classes.length; i++) {
String className = classes[i];
@@ -85,13 +87,17 @@
if (dataMode == TARGET_DATA) {
key = "targetDataPath"; //$NON-NLS-1$
}
-
- Params params = info.getParams();
- List paramList = params.getParam();
- for (Iterator iterator = paramList.iterator(); iterator.hasNext();) {
- Param param = (Param) iterator.next();
- if (key.equals(param.getName())) {
- return param.getValue();
+ if (info != null) {
+ Params params = info.getParams();
+ if (params != null) {
+ List paramList = params.getParam();
+ for (Iterator iterator = paramList.iterator(); iterator
+ .hasNext();) {
+ Param param = (Param) iterator.next();
+ if (key.equals(param.getName())) {
+ return param.getValue();
+ }
+ }
}
}
return null;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/BeanPopulatorMappingAnalyzer.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/BeanPopulatorMappingAnalyzer.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/BeanPopulatorMappingAnalyzer.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -44,8 +44,7 @@
public static final String REFERENCE_BINDING = "referenceBinding";
- public static final String[] SELECTOR_SPERATORS = new String[] { " ",
"/",
- "\\" };
+ public static final String[] SELECTOR_SPERATORS = new String[] { " ",
"/"};
public static final String ONLY_NAME = "only_name";
public static final String FULL_PATH = "full_path";
@@ -291,7 +290,11 @@
List rl = listType.getAbstractResourceConfig();
ResourceConfigType resourceConfig = null;
for (Iterator iterator = rl.iterator(); iterator.hasNext();) {
- ResourceConfigType rct = (ResourceConfigType) iterator.next();
+ AbstractResourceConfig abstractResourceConfig = (AbstractResourceConfig)
iterator.next();
+
+ if(!(abstractResourceConfig instanceof ResourceConfigType)) continue;
+
+ ResourceConfigType rct = (ResourceConfigType) abstractResourceConfig;
// if (this.isSelectorIsUsed(rct.getSelector()))
// continue;
String beanId = getBeanIDFromParam(rct);
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -106,7 +106,9 @@
}
public void exceptionOccur(Exception e) {
- this.setErrorMessage(e.toString());
+ String error = null;
+ if(e != null) error = e.toString();
+ this.setErrorMessage(error);
}
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.smooks.javabean.ui;
-import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -23,15 +22,12 @@
import org.eclipse.jdt.ui.IJavaElementSearchConstants;
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.jface.window.Window;
@@ -313,12 +309,15 @@
} catch (Throwable e) {
exception = e;
}
- if (exception != null) {
- for (Iterator<IJavaBeanSelectionListener> iterator = this.selectionListenerList
- .iterator(); iterator.hasNext();) {
- IJavaBeanSelectionListener l = (IJavaBeanSelectionListener) iterator
- .next();
+
+ for (Iterator<IJavaBeanSelectionListener> iterator = this.selectionListenerList
+ .iterator(); iterator.hasNext();) {
+ IJavaBeanSelectionListener l = (IJavaBeanSelectionListener) iterator
+ .next();
+ if (exception != null) {
l.exceptionOccur(new Exception(exception));
+ }else{
+ l.exceptionOccur(null);
}
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSectonFilter.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSectonFilter.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/javabean/ui/JavaBeanPropertiesSectonFilter.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -5,26 +5,31 @@
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
import org.jboss.tools.smooks.ui.AbstractConnectionModelSectionFilter;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
/**
* @author Dart
- *
+ *
*/
public class JavaBeanPropertiesSectonFilter extends
AbstractConnectionModelSectionFilter {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object)
*/
public boolean select(Object toTest) {
- Object source = this.getReferenceSourceObject(toTest);
- Object target = this.getReferenceTargetObject(toTest);
- if (source != null && source instanceof JavaBeanModel) {
- return true;
+ Object target = this.getReferenceTargetObject(toTest);
+ if (target != null && target instanceof JavaBeanModel) {
+ LineConnectionModel connection = getConnectionModel(toTest);
+ if (BeanPopulatorMappingAnalyzer.REFERENCE_BINDING
+ .equals(connection
+ .getProperty(BeanPopulatorMappingAnalyzer.PRO_BINDING_TYPE))) {
+ return false;
}
- if (target != null && target instanceof JavaBeanModel) {
- return true;
- }
+ return true;
+ }
return false;
}
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/LineConnectionSectionFilter.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/LineConnectionSectionFilter.java
(rev 0)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/LineConnectionSectionFilter.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -0,0 +1,21 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.ui;
+
+import org.eclipse.jface.viewers.IFilter;
+
+/**
+ * @author Dart
+ *
+ */
+public class LineConnectionSectionFilter implements IFilter {
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.viewers.IFilter#select(java.lang.Object)
+ */
+ public boolean select(Object toTest) {
+ return false;
+ }
+
+}
Property changes on:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/LineConnectionSectionFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java 2009-01-20
07:35:17 UTC (rev 13138)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/DecoraterSelectionDialog.java 2009-01-20
08:44:14 UTC (rev 13139)
@@ -99,8 +99,9 @@
.getAbstractResourceConfig();
for (Iterator<AbstractResourceConfig> iterator = list.iterator(); iterator
.hasNext();) {
- ResourceConfigType config = (ResourceConfigType) iterator
- .next();
+ AbstractResourceConfig abstractResourceConfig = iterator.next();
+ if(!(abstractResourceConfig instanceof ResourceConfigType)) continue;
+ ResourceConfigType config = (ResourceConfigType)abstractResourceConfig;
String selector = config.getSelector();
if (selector != null && selector.indexOf(":") != -1) {
Show replies by date