[jbosstools-commits] JBoss Tools SVN: r9423 - in trunk/drools/plugins/org.jboss.tools.flow.ruleflow: src/main/java/org/jboss/tools/process/ruleflow/editor and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Jul 30 06:08:43 EDT 2008


Author: koen.aers at jboss.com
Date: 2008-07-30 06:08:43 -0400 (Wed, 30 Jul 2008)
New Revision: 9423

Removed:
   trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ConnectionWrapperFactory.java
Modified:
   trunk/drools/plugins/org.jboss.tools.flow.ruleflow/plugin.xml
   trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/RuleFlowPaletteFactory.java
   trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/editpart/ConnectionWrapperEditPart.java
Log:
refactor PaletteFactory, ditch ConnectionFactory

Modified: trunk/drools/plugins/org.jboss.tools.flow.ruleflow/plugin.xml
===================================================================
--- trunk/drools/plugins/org.jboss.tools.flow.ruleflow/plugin.xml	2008-07-30 10:08:26 UTC (rev 9422)
+++ trunk/drools/plugins/org.jboss.tools.flow.ruleflow/plugin.xml	2008-07-30 10:08:43 UTC (rev 9423)
@@ -7,7 +7,7 @@
             name="RuleFlow Editor"
             extensions="rf"
             icon="icons/process.gif"
-            contributorClass="org.jboss.tools.process.editor.GenericActionBarContributor"
+            contributorClass="org.jboss.tools.flow.editor.GenericActionBarContributor"
             class="org.jboss.tools.process.ruleflow.editor.RuleFlowEditor"
             id="org.jboss.tools.process.ruleflow.editor.RuleFlowModelEditor">
       </editor>
@@ -24,7 +24,7 @@
 	        toolbarPath="Process"
             icon="icons/processV.gif"
             tooltip="Auto layout the process (vertical)"
-            class="org.jboss.tools.process.editor.action.VerticalAutoLayoutAction"
+            class="org.jboss.tools.flow.editor.action.VerticalAutoLayoutAction"
          />
       </editorContribution>
       <editorContribution
@@ -36,7 +36,7 @@
 	        toolbarPath="Process"
             icon="icons/process.gif"
             tooltip="Auto layout the process (horizontal)"
-            class="org.jboss.tools.process.editor.action.HorizontalAutoLayoutAction"
+            class="org.jboss.tools.flow.editor.action.HorizontalAutoLayoutAction"
          />
       </editorContribution>
    </extension>

Modified: trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/RuleFlowPaletteFactory.java
===================================================================
--- trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/RuleFlowPaletteFactory.java	2008-07-30 10:08:26 UTC (rev 9422)
+++ trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/RuleFlowPaletteFactory.java	2008-07-30 10:08:43 UTC (rev 9423)
@@ -24,14 +24,12 @@
 import org.eclipse.gef.palette.PaletteContainer;
 import org.eclipse.gef.palette.PaletteEntry;
 import org.eclipse.gef.palette.PaletteRoot;
-import org.eclipse.gef.requests.CreationFactory;
 import org.eclipse.gef.requests.SimpleFactory;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.jboss.tools.flow.JBossToolsProcessPlugin;
 import org.jboss.tools.flow.editor.PaletteFactory;
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
 import org.jboss.tools.process.ruleflow.Activator;
-import org.jboss.tools.process.ruleflow.editor.core.ConnectionWrapperFactory;
+import org.jboss.tools.process.ruleflow.editor.core.ConnectionWrapper;
 import org.jboss.tools.process.ruleflow.editor.core.StartNodeWrapper;
 import org.jboss.tools.process.ruleflow.editor.core.SubProcessWrapper;
 
@@ -42,10 +40,6 @@
  */
 public class RuleFlowPaletteFactory extends PaletteFactory {
 	
-    public RuleFlowPaletteFactory() {
-        super(new ConnectionWrapperFactory());
-    }
-    
     protected PaletteContainer createControlGroup(PaletteRoot root) {
         PaletteContainer controlGroup = super.createControlGroup(root);
         controlGroup.add(createConnectionEntry());
@@ -56,14 +50,7 @@
     	return new ConnectionCreationToolEntry(
                 "Connection Creation",
                 "Creating connections",
-                new CreationFactory() {
-                    public Object getNewObject() {
-                    	return connectionFactory.createElementConnection();
-                    }
-                    public Object getObjectType() {
-                    	return AbstractConnectionWrapper.class;
-                    }
-                },
+                new SimpleFactory(ConnectionWrapper.class),
                 ImageDescriptor.createFromURL(JBossToolsProcessPlugin.getDefault().getBundle().getEntry("icons/connection.gif")), 
                 ImageDescriptor.createFromURL(JBossToolsProcessPlugin.getDefault().getBundle().getEntry("icons/connection.gif"))
             );

Deleted: trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ConnectionWrapperFactory.java
===================================================================
--- trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ConnectionWrapperFactory.java	2008-07-30 10:08:26 UTC (rev 9422)
+++ trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/core/ConnectionWrapperFactory.java	2008-07-30 10:08:43 UTC (rev 9423)
@@ -1,33 +0,0 @@
-package org.jboss.tools.process.ruleflow.editor.core;
-
-/*
- * Copyright 2005 JBoss Inc
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.jboss.tools.flow.editor.core.AbstractConnectionWrapper;
-import org.jboss.tools.flow.editor.core.ConnectionFactory;
-
-/**
- * Factory for creating a connection wrapper.
- * 
- * @author <a href="mailto:kris_verlaenen at hotmail.com">Kris Verlaenen</a>
- */
-public class ConnectionWrapperFactory implements ConnectionFactory {
-	
-	public AbstractConnectionWrapper createElementConnection() {
-		return new ConnectionWrapper();
-	}
-
-}

Modified: trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/editpart/ConnectionWrapperEditPart.java
===================================================================
--- trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/editpart/ConnectionWrapperEditPart.java	2008-07-30 10:08:26 UTC (rev 9422)
+++ trunk/drools/plugins/org.jboss.tools.flow.ruleflow/src/main/java/org/jboss/tools/process/ruleflow/editor/editpart/ConnectionWrapperEditPart.java	2008-07-30 10:08:43 UTC (rev 9423)
@@ -16,14 +16,13 @@
  * limitations under the License.
  */
 
-import org.jboss.tools.flow.editor.core.ConnectionFactory;
 import org.jboss.tools.flow.editor.editpart.ConnectionEditPart;
-import org.jboss.tools.process.ruleflow.editor.core.ConnectionWrapperFactory;
+import org.jboss.tools.process.ruleflow.editor.core.ConnectionWrapper;
 
 public class ConnectionWrapperEditPart extends ConnectionEditPart {
 
-	protected ConnectionFactory getElementConnectionFactory() {
-    	return new ConnectionWrapperFactory();
-    }
+	protected Class<?> getElementConnectionType() {
+		return ConnectionWrapper.class;
+	}
 	
 }




More information about the jbosstools-commits mailing list