Author: DartPeng
Date: 2010-10-10 23:04:21 -0400 (Sun, 10 Oct 2010)
New Revision: 25700
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/command/GEFAdapterCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
Log:
JBIDE-6902
Done
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2010-10-11
02:58:36 UTC (rev 25699)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/editor/AbstractSmooksFormEditor.java 2010-10-11
03:04:21 UTC (rev 25700)
@@ -394,7 +394,14 @@
adapterFactory.addAdapterFactory(new Javabean12ItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new Csv12ItemProviderAdapterFactory());
- BasicCommandStack commandStack = new BasicCommandStack();
+ BasicCommandStack commandStack = new BasicCommandStack(){
+
+ @Override
+ protected void handleError(Exception exception) {
+ super.handleError(exception);
+ }
+
+ };
handleCommandStack(commandStack);
editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new
HashMap<Resource, Boolean>());
}
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/command/GEFAdapterCommand.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/command/GEFAdapterCommand.java 2010-10-11
02:58:36 UTC (rev 25699)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/gef/tree/command/GEFAdapterCommand.java 2010-10-11
03:04:21 UTC (rev 25700)
@@ -22,28 +22,26 @@
protected org.eclipse.emf.common.command.Command emfCommand;
protected EditingDomain domain;
-
+
protected Object owner;
-
+
protected Object collections;
-
+
protected Object feature;
-
+
protected int x;
-
+
protected int y;
-
+
protected int width;
-
+
protected int height;
- public GEFAdapterCommand(EditingDomain domain, org.eclipse.emf.common.command.Command
emfCommand) {
+ public GEFAdapterCommand(EditingDomain domain,
+ org.eclipse.emf.common.command.Command emfCommand) {
this.emfCommand = emfCommand;
this.domain = domain;
}
-
-
-
/**
* @return the x
@@ -52,19 +50,14 @@
return x;
}
-
-
-
/**
- * @param x the x to set
+ * @param x
+ * the x to set
*/
public void setX(int x) {
this.x = x;
}
-
-
-
/**
* @return the y
*/
@@ -72,19 +65,14 @@
return y;
}
-
-
-
/**
- * @param y the y to set
+ * @param y
+ * the y to set
*/
public void setY(int y) {
this.y = y;
}
-
-
-
/**
* @return the width
*/
@@ -92,19 +80,14 @@
return width;
}
-
-
-
/**
- * @param width the width to set
+ * @param width
+ * the width to set
*/
public void setWidth(int width) {
this.width = width;
}
-
-
-
/**
* @return the height
*/
@@ -112,55 +95,38 @@
return height;
}
-
-
-
/**
- * @param height the height to set
+ * @param height
+ * the height to set
*/
public void setHeight(int height) {
this.height = height;
}
-
-
-
public Object getOwner() {
return owner;
}
-
-
public void setOwner(Object owner) {
this.owner = owner;
}
-
-
public Object getCollections() {
return collections;
}
-
-
public void setCollections(Object collections) {
this.collections = collections;
}
-
-
public Object getFeature() {
return feature;
}
-
-
public void setFeature(Object feature) {
this.feature = feature;
}
-
-
/*
* (non-Javadoc)
*
@@ -209,7 +175,7 @@
* @see org.eclipse.gef.commands.Command#execute()
*/
@Override
- public void execute(){
+ public void execute() {
if (emfCommand != null && domain != null) {
domain.getCommandStack().execute(emfCommand);
return;
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java
===================================================================
---
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2010-10-11
02:58:36 UTC (rev 25699)
+++
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/editors/ConnectionModelFactoryImpl.java 2010-10-11
03:04:21 UTC (rev 25700)
@@ -105,6 +105,9 @@
if (beanid.equals(idRefData)) {
AbstractSmooksGraphicalModel sourceGraphModel =
SmooksGraphUtil.findSmooksGraphModel(root,
eObject);
+ if(sourceGraphModel == null){
+ continue;
+ }
List<TreeNodeConnection> scs = sourceGraphModel.getSourceConnections();
boolean createNewConnection = true;
for (Iterator<?> iterator2 = scs.iterator(); iterator2.hasNext();) {