Index: TODO =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/TODO,v retrieving revision 1.4 diff -u -3 -p -u -r1.4 TODO --- TODO 5 May 2005 23:47:58 -0000 1.4 +++ TODO 16 May 2005 13:47:38 -0000 @@ -1,9 +1,3 @@ -Top priority: -* CASheW-s model -* Instantiate, serialize and send model -* Parse WSDL -* Interface - Nearly completed: * RDF * Parse RDF in XML form @@ -14,3 +8,8 @@ Postponed: * Eclipse diagram editor * Extend with all elements for OWL-S +Completed: +* CASheW-s model +* Instantiate, serialize and send model +* Parse WSDL +* Interface Index: src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 CreateNodeCommand.java --- src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java 5 May 2005 23:47:58 -0000 1.2 +++ src/nongnu/cashews/eclipse/composer/commands/CreateNodeCommand.java 16 May 2005 13:47:38 -0000 @@ -37,20 +37,14 @@ to any source code in the Content. package nongnu.cashews.eclipse.composer.commands; -import java.util.Iterator; import java.util.Vector; import nongnu.cashews.eclipse.composer.model.Diagram; import nongnu.cashews.eclipse.composer.model.Node; -import nongnu.cashews.eclipse.composer.wizards.ProcessData; import nongnu.cashews.eclipse.composer.wizards.ProcessDefine; import org.eclipse.draw2d.geometry.Point; import org.eclipse.gef.commands.Command; -import org.eclipse.jface.window.ApplicationWindow; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.ui.dialogs.FileSelectionDialog; -import org.eclipse.ui.dialogs.FileSystemElement; public class CreateNodeCommand extends Command Index: src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 RenameNodeCommand.java --- src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java 5 May 2005 23:47:58 -0000 1.2 +++ src/nongnu/cashews/eclipse/composer/commands/RenameNodeCommand.java 16 May 2005 13:47:38 -0000 @@ -39,9 +39,6 @@ package nongnu.cashews.eclipse.composer. import nongnu.cashews.eclipse.composer.model.Diagram; import nongnu.cashews.eclipse.composer.model.Node; -import nongnu.cashews.eclipse.composer.model.NodeRegistrar; -import nongnu.cashews.eclipse.composer.util.Dialogs; - import org.eclipse.gef.commands.Command; public class RenameNodeCommand Index: src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java diff -N src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java --- src/nongnu/cashews/eclipse/composer/figures/EllipseNodeFigure.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,89 +0,0 @@ -/* EllipseNodeFigure.java -- Figure for the elliptical node. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.figures; - -import org.eclipse.draw2d.Figure; -import org.eclipse.draw2d.Label; -import org.eclipse.draw2d.Ellipse; -import org.eclipse.draw2d.geometry.Rectangle; - -public class EllipseNodeFigure - extends Figure -{ - - private String name; - - private Ellipse ellipseFigure; - - private Label label; - - public EllipseNodeFigure() - { - this.ellipseFigure = new Ellipse(); - this.label = new Label(); - this.add(ellipseFigure); - this.add(label); - } - - public String getText() - { - return this.label.getText(); - } - - public Rectangle getTextBounds() - { - return this.label.getTextBounds(); - } - - public void setName(String name) - { - this.name = name; - this.label.setText(name); - this.repaint(); - } - - // ------------------------------------------------------------------------ - // Overridden methods from Figure - - public void setBounds(Rectangle rect) - { - super.setBounds(rect); - this.ellipseFigure.setBounds(rect); - this.label.setBounds(rect); - } -} Index: src/nongnu/cashews/eclipse/composer/model/Connection.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/model/Connection.java diff -N src/nongnu/cashews/eclipse/composer/model/Connection.java --- src/nongnu/cashews/eclipse/composer/model/Connection.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,71 +0,0 @@ -/* Connection.java -- A connection between two nodes. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.model; - -public class Connection - extends Element -{ - - /** - * Comment for serialVersionUID - */ - private static final long serialVersionUID = 1L; - - private Node target; - - private Node source; - - public Connection(Node source, Node target) - { - this.source = source; - this.target = target; - - source.addOutput(this); - target.addInput(this); - } - - public Node getTarget() - { - return this.target; - } - - public Node getSource() - { - return this.source; - } -} Index: src/nongnu/cashews/eclipse/composer/model/EllipseNode.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/model/EllipseNode.java diff -N src/nongnu/cashews/eclipse/composer/model/EllipseNode.java --- src/nongnu/cashews/eclipse/composer/model/EllipseNode.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,205 +0,0 @@ -/* EllipseNode.java -- Representation of an ellipsical node. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.model; - -import java.util.Iterator; -import java.util.List; - -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.ui.views.properties.IPropertyDescriptor; -import org.eclipse.ui.views.properties.IPropertySource; -import org.eclipse.ui.views.properties.TextPropertyDescriptor; - -public class EllipseNode - extends Node - implements IPropertySource, XMLizable -{ - - // serialization version - static final long serialVersionUID = 4; - - // properties - - // descriptors for property sheet - static final IPropertyDescriptor[] descriptors; - static - { - descriptors = new IPropertyDescriptor[] { new TextPropertyDescriptor( - NAME, - "Name") }; - } - - // actual fields - - public EllipseNode(String name) - { - setName(name); - } - - public void setLocation(Point p) - { - if (location.equals(p)) - { - return; - } - location = p; - firePropertyChange(LOCATION, null, p); - } - - public Point getLocation() - { - return location; - } - - public String getName() - { - return name; - } - - public void addInput(Connection connection) - { - inputs.add(connection); - fireStructureChange(INPUTS, connection); - } - - public void addOutput(Connection connection) - { - outputs.add(connection); - fireStructureChange(OUTPUTS, connection); - } - - public List getIncomingConnections() - { - return inputs; - } - - public List getOutgoingConnections() - { - return outputs; - } - - public void removeInput(Connection connection) - { - inputs.remove(connection); - fireStructureChange(INPUTS, connection); - } - - public void removeOutput(Connection connection) - { - outputs.remove(connection); - fireStructureChange(OUTPUTS, connection); - } - - // ------------------------------------------------------------------------ - // Abstract methods from IPropertySource - - public Object getEditableValue() - { - return this; - } - - public Object getPropertyValue(Object id) - { - if (NAME.equals(id)) - { - return getName(); - } - else - { - return null; - } - } - - public boolean isPropertySet(Object id) - { - return true; - } - - public void resetPropertyValue(Object id) - { - // do nothing - } - - public void setPropertyValue(Object id, Object value) - { - if (id == NAME) - { - setName((String) value); - } - } - - /* - * (non-Javadoc) - * - * @see nongnu.cashews.eclipse.composer.model.XMLizable#toXML() - */ - public String toXML() - { - StringBuffer str = new StringBuffer(); - str.append(""); - Iterator i = outputs.iterator(); - Node tempNode = null; - Connection tempConnection = null; - while (i.hasNext()) - { - tempConnection = (Connection) i.next(); - tempNode = (Node) tempConnection.getTarget(); - str.append(""); - } - str.append(""); - return str.toString(); - } -} Index: src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java diff -N src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java --- src/nongnu/cashews/eclipse/composer/model/EllipseNodeFactory.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,53 +0,0 @@ -/* EllipseNodeFactory.java -- Factory for creating ellipse nodes. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.model; - -public class EllipseNodeFactory extends NodeFactory -{ - - public EllipseNodeFactory(Class aClass) - { - super(aClass); - } - - public Node createNode(String name) - { - return new EllipseNode(name); - } - -} Index: src/nongnu/cashews/eclipse/composer/model/NodeFactory.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/model/NodeFactory.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 NodeFactory.java --- src/nongnu/cashews/eclipse/composer/model/NodeFactory.java 5 May 2005 23:47:58 -0000 1.2 +++ src/nongnu/cashews/eclipse/composer/model/NodeFactory.java 16 May 2005 13:47:38 -0000 @@ -42,9 +42,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import nongnu.cashews.eclipse.composer.commands.DiagramSingleton; -import nongnu.cashews.eclipse.composer.wizards.ProcessData; -import nongnu.cashews.eclipse.composer.wizards.ProcessDefine; - import org.eclipse.gef.requests.SimpleFactory; public abstract class NodeFactory extends SimpleFactory Index: src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 PerformanceElement.java --- src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java 5 May 2005 23:47:58 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/model/PerformanceElement.java 16 May 2005 13:47:38 -0000 @@ -216,7 +216,7 @@ public class PerformanceElement str.append("/>"); } } - str.append(""); + str.append(""); return str.toString(); } Index: src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java,v retrieving revision 1.2 diff -u -3 -p -u -r1.2 ConnectionPart.java --- src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java 5 May 2005 23:47:58 -0000 1.2 +++ src/nongnu/cashews/eclipse/composer/parts/ConnectionPart.java 16 May 2005 13:47:38 -0000 @@ -96,17 +96,21 @@ public class ConnectionPart if (figure.getChildren().size() > 1) { figure.remove(ellipseFigure); + figure.remove(label); } ellipseFigure = new Ellipse(); + ellipseFigure.setSize(60,40); + Dimension d = new Dimension(40, 40); label = new Label(); - + label.setText("a\nb\nc"); ellipseFigure.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation())); + label.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation())); figure.add(ellipseFigure); - + figure.add(label); figure.addFigureListener ( new FigureListener() @@ -116,6 +120,7 @@ public class ConnectionPart { ConnectionElement connx = (ConnectionElement) getModel(); ellipseFigure.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation())); + label.setLocation(midPoint(connx.getSource().getLocation(), connx.getTarget().getLocation())); } } Index: src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java diff -N src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java --- src/nongnu/cashews/eclipse/composer/parts/EllipseNodePart.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,149 +0,0 @@ -/* EllipseNodePart.java -- Displayable part of the elliptical node. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.parts; - -import java.beans.PropertyChangeListener; -import java.util.List; - -import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure; -import nongnu.cashews.eclipse.composer.model.EllipseNode; -import nongnu.cashews.eclipse.composer.model.Node; -import nongnu.cashews.eclipse.composer.tools.EllipseNodeCellEditorLocator; -import nongnu.cashews.eclipse.composer.tools.EllipseNodeDirectEditManager; - -import org.eclipse.draw2d.IFigure; - -import org.eclipse.draw2d.geometry.Dimension; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.NodeEditPart; -import org.eclipse.gef.Request; -import org.eclipse.gef.RequestConstants; - -import org.eclipse.jface.viewers.TextCellEditor; - -public class EllipseNodePart - extends NodePart - implements PropertyChangeListener, NodeEditPart -{ - - // ------------------------------------------------------------------------ - // Overridden from AbstractGraphicalEditPart - - // override activate to register with the model for property changes - public void activate() - { - if (isActive()) - { - return; - } - super.activate(); - ((EllipseNode) getModel()).addPropertyChangeListener(this); - } - - // override deactivate to deregister with the model - public void deactivate() - { - if (!isActive()) - { - return; - } - super.deactivate(); - ((EllipseNode) getModel()).removePropertyChangeListener(this); - } - - protected List getModelSourceConnections() - { - return ((EllipseNode) this.getModel()).getOutgoingConnections(); - } - - protected List getModelTargetConnections() - { - return ((EllipseNode) this.getModel()).getIncomingConnections(); - } - - // ------------------------------------------------------------------------ - // Overridden from AbstractEditPart - - protected void refreshVisuals() - { - EllipseNode node = (EllipseNode) this.getModel(); - Point loc = node.getLocation(); - Dimension size = new Dimension(60, 60); - Rectangle rectangle = new Rectangle(loc, size); - - ((EllipseNodeFigure) this.getFigure()).setName(((Node) this.getModel()).getName()); - - // tells the parent part (in this case DiagramPart) that this part - // and its figure are to be constrained to the given rectangle - ((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(), - rectangle); - // //////============================================================ - - } - - public void performRequest(Request request) - { - if (request.getType() == RequestConstants.REQ_DIRECT_EDIT) - { - if (manager == null) - { - EllipseNodeFigure nodeFigure = (EllipseNodeFigure) getFigure(); - manager = new EllipseNodeDirectEditManager( - this, - TextCellEditor.class, - new EllipseNodeCellEditorLocator( - nodeFigure), - nodeFigure); - } - manager.show(); - } - } - - // ------------------------------------------------------------------------ - // Abstract methods from AbstractGraphicalEditPart - - protected IFigure createFigure() - { - // return new NodeFigure(); - return new EllipseNodeFigure(); - } - - -} Index: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java diff -N src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java --- src/nongnu/cashews/eclipse/composer/tools/EllipseNodeCellEditorLocator.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,70 +0,0 @@ -/* EllipseNodeCellEditorLocator.java -- Locator for elliptical nodes. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.tools; - -import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure; - -import org.eclipse.draw2d.geometry.Rectangle; -import org.eclipse.gef.tools.CellEditorLocator; -import org.eclipse.jface.viewers.CellEditor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Text; - -public class EllipseNodeCellEditorLocator - implements CellEditorLocator -{ - - private EllipseNodeFigure nodeFigure; - - public EllipseNodeCellEditorLocator(EllipseNodeFigure nodeFigure) - { - this.nodeFigure = nodeFigure; - } - - // ------------------------------------------------------------------------ - // Abstract methods from CellEditorLocator - - public void relocate(CellEditor celleditor) - { - Text text = (Text) celleditor.getControl(); - Point pref = text.computeSize(SWT.DEFAULT, SWT.DEFAULT); - Rectangle rect = this.nodeFigure.getTextBounds(); - text.setBounds(rect.x - 1, rect.y - 1, pref.x + 1, pref.y + 1); - } -} Index: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java diff -N src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java --- src/nongnu/cashews/eclipse/composer/tools/EllipseNodeDirectEditManager.java 31 Mar 2005 17:35:21 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,138 +0,0 @@ -/* EllipseNodeDirectEditManager.java -- Manager for direct edits. - Copyright (C) 2005 The University of Sheffield. - -This file is part of the CASheW-s editor Eclipse plug-in. - -The CASheW-s editor Eclipse plug-in is free software; you may copy, modify, -and redistribute it under the terms of the GNU General Public License -version 2 (or, at your option, any later version), and/or the Eclipse -Public License version 1.0. - -The CASheW-s editor 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 -General Public License for more details. - -You should have received a copy of the GNU General Public License -along with The CASheW-s editor; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -The University of Sheffield makes available all content in this plug-in -("Content"). Unless otherwise indicated below, the Content is provided to -you under the terms and conditions of the Eclipse Public License Version -1.0 ("EPL"). A copy of the EPL is available at -http://www.eclipse.org/legal/epl-v10.html. For purposes of the EPL, -"Program" will mean the Content. - -If you did not receive this Content directly from the University of Sheffield, -the Content is being redistributed by another party ("Redistributor") and -different terms and conditions may apply to your use of any object code in -the Content. Check the Redistributor's license that was provided with the -Content. If no such license exists, contact the Redistributor. Unless -otherwise indicated below, the terms and conditions of the EPL still apply -to any source code in the Content. - -*/ - -package nongnu.cashews.eclipse.composer.tools; - -import nongnu.cashews.eclipse.composer.figures.EllipseNodeFigure; - -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.VerifyEvent; -import org.eclipse.swt.events.VerifyListener; -import org.eclipse.swt.graphics.Font; -import org.eclipse.swt.graphics.FontData; -import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Text; - -import org.eclipse.draw2d.IFigure; -import org.eclipse.draw2d.geometry.Dimension; - -import org.eclipse.gef.GraphicalEditPart; -import org.eclipse.gef.tools.CellEditorLocator; -import org.eclipse.gef.tools.DirectEditManager; - -public class EllipseNodeDirectEditManager - extends DirectEditManager -{ - - Font scaledFont; - - protected VerifyListener verifyListener; - - protected EllipseNodeFigure ellipseNodeFigure; - - public EllipseNodeDirectEditManager(GraphicalEditPart source, - Class editorType, - CellEditorLocator locator, - EllipseNodeFigure ellipseNodeFigure) - { - super(source, editorType, locator); - this.ellipseNodeFigure = ellipseNodeFigure; - } - - // ------------------------------------------------------------------------ - // Overridden methods from DirectEditManager - - protected void bringDown() - { - Font disposeFont = this.scaledFont; - this.scaledFont = null; - super.bringDown(); - if (disposeFont != null) - { - disposeFont.dispose(); - } - } - - protected void unhookListeners() - { - super.unhookListeners(); - Text text = (Text) getCellEditor().getControl(); - text.removeVerifyListener(verifyListener); - verifyListener = null; - } - - // ------------------------------------------------------------------------ - // Abstract methods from DirectEditManager - - protected void initCellEditor() - { - - verifyListener = new VerifyListener() - { - public void verifyText(VerifyEvent event) - { - Text text = (Text) getCellEditor().getControl(); - String oldText = text.getText(); - String leftText = oldText.substring(0, event.start); - String rightText = oldText.substring(event.end, oldText.length()); - GC gc = new GC(text); - Point size = gc.textExtent(leftText + event.text + rightText); - gc.dispose(); - if (size.x != 0) - { - size = text.computeSize(size.x, SWT.DEFAULT); - } - getCellEditor().getControl().setSize(size.x, size.y); - } - }; - - Text text = (Text) getCellEditor().getControl(); - text.addVerifyListener(verifyListener); - - getCellEditor().setValue(this.ellipseNodeFigure.getText()); - IFigure figure = ((GraphicalEditPart) getEditPart()).getFigure(); - scaledFont = figure.getFont(); - FontData data = scaledFont.getFontData()[0]; - Dimension fontSize = new Dimension(0, data.getHeight()); - data.setHeight(fontSize.height); - scaledFont = new Font(null, data); - - text.setFont(scaledFont); - text.selectAll(); - } -} Index: src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 EndPointNodeDirectEditManager.java --- src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/tools/EndPointNodeDirectEditManager.java 16 May 2005 13:47:38 -0000 @@ -36,13 +36,7 @@ to any source code in the Content. */ package nongnu.cashews.eclipse.composer.tools; -/** - * @author Xianfeng Liu - */ -import nongnu.cashews.eclipse.composer.figures.PerformanceNodeFigure; import nongnu.cashews.eclipse.composer.figures.EndPointFigure; -import nongnu.cashews.eclipse.composer.figures.StartPointFigure; - import org.eclipse.swt.SWT; import org.eclipse.swt.events.VerifyEvent; import org.eclipse.swt.events.VerifyListener; Index: src/nongnu/cashews/eclipse/composer/ui/ConnectionPage1.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/ui/ConnectionPage1.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ConnectionPage1.java --- src/nongnu/cashews/eclipse/composer/ui/ConnectionPage1.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/ui/ConnectionPage1.java 16 May 2005 13:47:38 -0000 @@ -1,11 +1,6 @@ package nongnu.cashews.eclipse.composer.ui; -import java.util.Iterator; - import nongnu.cashews.eclipse.composer.model.ConnectionElement; -import nongnu.cashews.eclipse.composer.model.PerformanceElement; -import nongnu.cashews.language.process.ValueData; - import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridLayout; Index: src/nongnu/cashews/eclipse/composer/ui/ConnectionWizard.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/ui/ConnectionWizard.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ConnectionWizard.java --- src/nongnu/cashews/eclipse/composer/ui/ConnectionWizard.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/ui/ConnectionWizard.java 16 May 2005 13:47:38 -0000 @@ -39,11 +39,8 @@ package nongnu.cashews.eclipse.composer. import nongnu.cashews.eclipse.composer.model.ConnectionElement; -import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.wizard.Wizard; -import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; -import org.eclipse.ui.IWorkbench; /** * @author Ravish Index: src/nongnu/cashews/eclipse/composer/wizards/DataEvaluatePage.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/wizards/DataEvaluatePage.java diff -N src/nongnu/cashews/eclipse/composer/wizards/DataEvaluatePage.java --- src/nongnu/cashews/eclipse/composer/wizards/DataEvaluatePage.java 5 May 2005 23:47:59 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,73 +0,0 @@ -package nongnu.cashews.eclipse.composer.wizards; - -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.window.ApplicationWindow; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyEvent; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.FileDialog; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Text; - -public class DataEvaluatePage { - Display display = new Display(); - Shell shell = new Shell(display); - - - Label dataValue; - Label dataCollector; - Button evaluate; - - Text dataValueText; - Text dataCollectorText; - - public DataEvaluatePage() { - shell.setText("SWT Temperature Converter"); - shell.setLayout(new GridLayout(4, false)); - dataValue = new Label(shell, SWT.NULL); - dataValue.setText("Data Value: "); - - dataValueText = new Text(shell, SWT.SINGLE | SWT.BORDER); - - dataCollector = new Label(shell, SWT.NULL); - dataCollector.setText("Data Collector: "); - - dataCollectorText = new Text(shell, SWT.SINGLE | SWT.BORDER); - evaluate = new Button(shell, SWT.BORDER); - GridData gridData = new GridData(GridData.FILL_BOTH); - gridData.horizontalSpan = 4; - evaluate.setLayoutData(gridData); - - evaluate.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { - shell.close(); - } - }); - - shell.pack(); - shell.open(); - - // Set up the event loop. - while (!shell.isDisposed()) { - if (!display.readAndDispatch()) { - // If no more entries in event queue - display.sleep(); - } - } - - display.dispose(); - } - } Index: src/nongnu/cashews/eclipse/composer/wizards/NamePerformancePage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/NamePerformancePage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 NamePerformancePage.java --- src/nongnu/cashews/eclipse/composer/wizards/NamePerformancePage.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/NamePerformancePage.java 16 May 2005 13:47:38 -0000 @@ -2,14 +2,10 @@ package nongnu.cashews.eclipse.composer.wizards; -import nongnu.cashews.eclipse.composer.model.Node; - import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; Index: src/nongnu/cashews/eclipse/composer/wizards/OperationSelectPage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/OperationSelectPage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 OperationSelectPage.java --- src/nongnu/cashews/eclipse/composer/wizards/OperationSelectPage.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/OperationSelectPage.java 16 May 2005 13:47:38 -0000 @@ -9,7 +9,6 @@ import org.eclipse.swt.widgets.Composite import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; public class OperationSelectPage extends WizardPage { Combo OperationTypes; Index: src/nongnu/cashews/eclipse/composer/wizards/ProcessData.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/ProcessData.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ProcessData.java --- src/nongnu/cashews/eclipse/composer/wizards/ProcessData.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/ProcessData.java 16 May 2005 13:47:38 -0000 @@ -1,9 +1,17 @@ package nongnu.cashews.eclipse.composer.wizards; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + public class ProcessData { public String performanceName; public String operationName; + public Set item = new HashSet(); + public Object[] getElements(Object inputElement) { + return ((List) inputElement).toArray(); + } public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Performance Name:\t" + performanceName.toString() + "\n"); Index: src/nongnu/cashews/eclipse/composer/wizards/ProcessDefine.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/ProcessDefine.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ProcessDefine.java --- src/nongnu/cashews/eclipse/composer/wizards/ProcessDefine.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/ProcessDefine.java 16 May 2005 13:47:38 -0000 @@ -5,12 +5,8 @@ import nongnu.cashews.eclipse.composer.c import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; public class ProcessDefine extends ApplicationWindow { Index: src/nongnu/cashews/eclipse/composer/wizards/ProcessWizard.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/ProcessWizard.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ProcessWizard.java --- src/nongnu/cashews/eclipse/composer/wizards/ProcessWizard.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/ProcessWizard.java 16 May 2005 13:47:38 -0000 @@ -2,34 +2,12 @@ package nongnu.cashews.eclipse.composer. import nongnu.cashews.eclipse.composer.commands.CreateNodeCommand; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.window.ApplicationWindow; -import org.eclipse.jface.wizard.WizardDialog; - -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; -import org.eclipse.swt.widgets.*; - -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; - -import org.eclipse.jface.wizard.WizardPage; - -import java.io.IOException; import java.lang.reflect.InvocationTargetException; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.jface.dialogs.DialogSettings; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.operation.IRunnableWithProgress; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.Wizard; // The data model. @@ -56,6 +34,7 @@ static final String KEY_PERFORMANCE_NAME addPage(new NamePerformancePage()); addPage(new OperationSelectPage()); addPage(new ValueDataSelectedPage()); + addPage(new ValueDataSelectedPage2()); } @@ -98,8 +77,6 @@ static final String KEY_PERFORMANCE_NAME if(ans) return true; else{ - ProcessDefine pd = new ProcessDefine(null); - pd.close(); return false;} } } Index: src/nongnu/cashews/eclipse/composer/wizards/ValueDataLabelProvider.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/ValueDataLabelProvider.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ValueDataLabelProvider.java --- src/nongnu/cashews/eclipse/composer/wizards/ValueDataLabelProvider.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/ValueDataLabelProvider.java 16 May 2005 13:47:38 -0000 @@ -1,11 +1,7 @@ package nongnu.cashews.eclipse.composer.wizards; -import java.util.List; - import org.eclipse.jface.viewers.ILabelProviderListener; -import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.ITableLabelProvider; -import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.graphics.Image; class ValueDataLabelProvider implements ITableLabelProvider { Index: src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 ValueDataSelectedPage.java --- src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage.java 16 May 2005 13:47:38 -0000 @@ -6,7 +6,6 @@ import java.util.LinkedList; import org.eclipse.draw2d.Panel; import org.eclipse.jface.viewers.TableViewer; -import org.eclipse.jface.window.ApplicationWindow; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; @@ -14,16 +13,14 @@ import org.eclipse.swt.events.SelectionA import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Text; class ValueDataSelectedPage extends WizardPage @@ -36,15 +33,19 @@ class ValueDataSelectedPage extends Wiza * private Button dr; */ - private Table input, valueData; + public Table input, valueData; + + private TableViewer tableViewer; private Button add, add2; private Panel panel; - + private Label dv, dc; private Text dvT, dcT; + + ProcessData pd = new ProcessData(); /** * ComplaintsPage constructor @@ -54,53 +55,106 @@ class ValueDataSelectedPage extends Wiza super("ValuedataSelectPage"); setTitle("Value data Select"); setDescription("Please input the data values "); - setPageComplete(true); + setPageComplete(false); } /** * Creates the page controls */ - public void createControl(Composite parent) +public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(3,false)); LinkedList entries = new LinkedList(); - input = new Table(composite, SWT.NONE); + input = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); input.setLayoutData(new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL)); new TableColumn(input, SWT.NULL).setText(" Input "); input.setHeaderVisible(true); input.setLinesVisible(true); - for (int i = 0, n = input.getColumnCount(); i < n; i++) - input.getColumn(i).pack(); + for (int i=0; i<12; i++) { + TableItem item = new TableItem (input, SWT.NONE); + item.setText ("Item " + i); + + } + input.addListener (SWT.Selection, new Listener () { + public void handleEvent (Event event) { + String string = event.detail == SWT.CHECK ? "Checked" : "Selected"; + System.out.println (event.item + " " + string); + + if (event.detail == SWT.CHECK){ + event.item.setData("checked"); + } + } + }); + for (int i = 0, n = input.getColumnCount(); i < n; i++) + input.getColumn(i).pack(); Composite composite1 = new Composite(composite, SWT.NONE); composite1.setLayout(new GridLayout(1,false)); add = new Button(composite1, SWT.RIGHT); add.setText("Add->"); - + add.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + int i = input.getItemCount(); + System.out.println("ItemCount" + i); + while(i!=0){ + if((input.getItem(i-1).getData()!=null)&&(input.getItem(i-1).getData().equals("checked"))){ + + TableItem item = new TableItem (valueData, SWT.NULL); + item.setText (0, input.getItem(i-1).getText()); + input.remove(i-1); + } + i--; + } + + + if (input.getItemCount() != i){ + setPageComplete(true); + } + else{setPageComplete(false);} + } + }); add2 = new Button(composite1,SWT.RIGHT); add2.setText("<-Add"); - valueData = new Table(composite, SWT.RIGHT); + + valueData = new Table(composite, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); // Set up the table valueData.setLayoutData(new GridData(GridData.FILL_VERTICAL | GridData.FILL_HORIZONTAL)); TableColumn vd = new TableColumn(valueData, SWT.CENTER); - vd.setText(" ValueData "); + vd.setText(" ValueData "); valueData.showColumn(vd); valueData.setHeaderVisible(true); valueData.setLinesVisible(true); - for (int i = 0, n = valueData.getColumnCount(); i < n; i++) valueData.getColumn(i).pack(); - - /** - * - * End - * - */ + valueData.addListener (SWT.Selection, new Listener () { + public void handleEvent (Event event) { + String string = event.detail == SWT.CHECK ? "Checked" : "Selected"; + System.out.println (event.item + " " + string); + if (event.detail == SWT.CHECK){ + event.item.setData("checked"); + } + } +}); + add2.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + int i = valueData.getItemCount(); + System.out.println("ItemCount" + i); + while(i!=0){ + if((valueData.getItem(i-1).getData()!=null)&&(valueData.getItem(i-1).getData().equals("checked"))){ + + TableItem item = new TableItem (input, SWT.NULL); + item.setText (0, valueData.getItem(i-1).getText()); + valueData.remove(i-1); + } + i--; + } + } + }); + setControl(composite); } - } Index: src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage2.java =================================================================== RCS file: src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage2.java diff -N src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage2.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/nongnu/cashews/eclipse/composer/wizards/ValueDataSelectedPage2.java 16 May 2005 13:47:38 -0000 @@ -0,0 +1,175 @@ + + +package nongnu.cashews.eclipse.composer.wizards; + +import java.util.LinkedList; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.draw2d.Panel; +import org.eclipse.jface.dialogs.InputDialog; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.TableItem; +import org.eclipse.swt.widgets.Text; + +class ValueDataSelectedPage2 extends WizardPage +{ + /* + * private Button d; + * + * private Button c; + * + * private Button dr; + */ + + private Table input, valueData; + + private TableViewer tableViewer; + + private Button add, add2; + + private Panel panel; + + private Label dv, dc; + + private Text dvT, dcT; + + ProcessData pd = new ProcessData(); + //ValueDataSelectedPage vdp = new ValueDataSelectedPage(); + + /** + * ComplaintsPage constructor + */ + public ValueDataSelectedPage2() + { + super("ValuedataSelectPage2"); + setTitle("Value data Select"); + setDescription("Please input the data values "); + setPageComplete(false); + } + + /** + * Creates the page controls + */ +public void createControl(Composite parent) + { + Composite composite = new Composite(parent, SWT.NONE); + composite.setLayout(new GridLayout(3,false)); + LinkedList entries = new LinkedList(); + input = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + input.setLayoutData(new GridData(GridData.FILL_VERTICAL + | GridData.FILL_HORIZONTAL)); + new TableColumn(input, SWT.NULL).setText(" Input "); + input.setHeaderVisible(true); + input.setLinesVisible(true); + // System.out.println(vdp.input.getItemCount()); + for (int i=0; i<12; i++) { + TableItem item = new TableItem (input, SWT.NONE); + item.setText ("Item " + i); + } + input.addListener (SWT.Selection, new Listener () { + public void handleEvent (Event event) { + for (int a = 0; a"); + add.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + InputDialog dlg = new InputDialog(null,"Input Dialog","Please input the number of the value data!","",null); + dlg.open(); + Pattern untitled = Pattern.compile("[0-9]*"); + Matcher matcher = untitled.matcher(dlg.getValue()); + if ((dlg.getValue()==null)||(!matcher.matches())){ + MessageDialog.openError(null, "CASheW-s Composer Error", "Please install an integer"); + return; + } + else{ + TableItem item = new TableItem (valueData, SWT.NULL); + item.setText (1, dlg.getValue()); + int i = input.getItemCount(); + System.out.println("ItemCount" + i); + while(i!=0){ + if((input.getItem(i-1).getData()!=null)&&(input.getItem(i-1).getData().equals("checked"))){ + + //TableItem item = new TableItem (valueData, SWT.NULL); + item.setText (0, input.getItem(i-1).getText()); + input.remove(i-1); + } + i--; + } + System.out.println("match"); + + if (input.getItemCount() != i){ + setPageComplete(true); + } + else{setPageComplete(false);} + } + } + }); + add2 = new Button(composite1,SWT.RIGHT); + add2.setText("<-Add"); + + valueData = new Table(composite, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL); + + // Set up the table + valueData.setLayoutData(new GridData(GridData.FILL_VERTICAL + | GridData.FILL_HORIZONTAL)); + TableColumn vd = new TableColumn(valueData, SWT.CENTER); + TableColumn num = new TableColumn(valueData, SWT.CENTER); + vd.setText(" ValueData "); + num.setText("Number of value data"); + valueData.showColumn(vd); + valueData.setHeaderVisible(true); + valueData.setLinesVisible(true); + for (int i = 0, n = valueData.getColumnCount(); i < n; i++) + valueData.getColumn(i).pack(); + valueData.addListener (SWT.Selection, new Listener () { + public void handleEvent (Event event) { + String string = event.detail == SWT.CHECK ? "Checked" : "Selected"; + System.out.println (event.item + " " + string); + event.item.setData("checked"); + } +}); + add2.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + int i = valueData.getItemCount(); + System.out.println("ItemCount" + i); + while(i!=0){ + if((valueData.getItem(i-1).getData()!=null)&&(valueData.getItem(i-1).getData().equals("checked"))){ + + TableItem item = new TableItem (input, SWT.NULL); + item.setText (0, valueData.getItem(i-1).getText()); + valueData.remove(i-1); + } + i--; + } + } + }); + setControl(composite); + } +} Index: src/nongnu/cashews/eclipse/composer/wizards/WSDLFileLoadPage.java =================================================================== RCS file: /cvsroot/cashew-s-editor/cashews/src/nongnu/cashews/eclipse/composer/wizards/WSDLFileLoadPage.java,v retrieving revision 1.1 diff -u -3 -p -u -r1.1 WSDLFileLoadPage.java --- src/nongnu/cashews/eclipse/composer/wizards/WSDLFileLoadPage.java 5 May 2005 23:47:59 -0000 1.1 +++ src/nongnu/cashews/eclipse/composer/wizards/WSDLFileLoadPage.java 16 May 2005 13:47:38 -0000 @@ -2,11 +2,6 @@ package nongnu.cashews.eclipse.composer.wizards; -import java.io.File; -import java.io.IOException; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.wizard.WizardPage; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; @@ -16,14 +11,12 @@ import org.eclipse.swt.layout.GridLayout import org.eclipse.swt.layout.RowLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.FileDialog; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Text; -import org.eclipse.ui.dialogs.FileSelectionDialog; class WSDLFileLoadPage extends WizardPage { @@ -33,6 +26,7 @@ class WSDLFileLoadPage extends WizardPag Text filePath; //Display display = new Display(); Shell shell = new Shell(); + ProcessData pd = new ProcessData(); public WSDLFileLoadPage() { super("WSDL Load");