JBoss Tools SVN: r11026 - branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-21 03:15:20 -0400 (Tue, 21 Oct 2008)
New Revision: 11026
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java
Log:
JBIDE-2943
Fix it
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java 2008-10-21 03:42:46 UTC (rev 11025)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/TreeItemRelationModel.java 2008-10-21 07:15:20 UTC (rev 11026)
@@ -40,7 +40,11 @@
int y = Integer.MAX_VALUE;
if (item != null) {
y = item.getBounds().y;
+ // for windows
+ TreeItem parentItem = item.getParentItem();
+ if(parentItem == null) return false;
}
+
return (y == 0);
}
16 years, 2 months
JBoss Tools SVN: r11025 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui: src/org/jboss/tools/smooks/ui/gef/commands and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 23:42:46 -0400 (Mon, 20 Oct 2008)
New Revision: 11025
Removed:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
Log:
JBIDE-2942
remove all needless codes
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-21 03:42:46 UTC (rev 11025)
@@ -49,8 +49,6 @@
org.jboss.tools.smooks.ui.gef.policy,
org.jboss.tools.smooks.ui.gef.tools,
org.jboss.tools.smooks.ui.gef.util,
- org.jboss.tools.smooks.ui.gef.util.editparts,
- org.jboss.tools.smooks.ui.gef.util.figures,
org.jboss.tools.smooks.ui.modelparser,
org.jboss.tools.smooks.ui.wizards,
org.jboss.tools.smooks.utils,
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.commands;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.commands.Command;
-import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
-
-/**
- * @deprecated
- * @author Dart Peng
- *
- */
-public class ChangeConstraintCommand extends Command {
- Rectangle constraint = null;
-
- IGraphicalModel graphicalModel = null;
-
- /**
- * @return the graphicalModel
- */
- public IGraphicalModel getGraphicalModel() {
- return graphicalModel;
- }
-
- /**
- * @param graphicalModel the graphicalModel to set
- */
- public void setGraphicalModel(IGraphicalModel graphicalModel) {
- this.graphicalModel = graphicalModel;
- }
-
- Rectangle prevConstraint = null;
-
- /**
- * @return the constraint
- */
- public Rectangle getConstraint() {
- return constraint;
- }
-
- /**
- * @param constraint
- * the constraint to set
- */
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
- }
-
- @Override
- public void execute() {
- if (constraint != null && graphicalModel != null) {
- graphicalModel.setConstraint(constraint);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.commands.Command#redo()
- */
- @Override
- public void redo() {
- // TODO Auto-generated method stub
- super.redo();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.commands.Command#undo()
- */
- @Override
- public void undo() {
- // TODO Auto-generated method stub
- super.undo();
- }
-
-
-
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -22,6 +22,7 @@
* @author Dart Peng
*
* @CreateTime Jul 22, 2008
+ * @deprecated
*/
public class CreateStructuredDataModelCommand extends Command {
private AbstractStructuredDataModel parent;
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-/**
- * @author Dart Peng
- *
- */
-public class HiddenEditPart extends AbstractGraphicalEditPart {
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- @Override
- protected IFigure createFigure() {
- Figure figure = new Figure(){
-
- @Override
- public Dimension getPreferredSize(int hint, int hint2) {
- // TODO Auto-generated method stub
- return new Dimension(200,300);
- }
-
- @Override
- public Dimension getMaximumSize() {
- // TODO Auto-generated method stub
- return new Dimension(100,300);
- }
-
-
-
- };
- return figure;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- @Override
- protected void createEditPolicies() {
-
- }
-
-}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,68 +1,57 @@
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPartFactory;
-import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
-import org.jboss.tools.smooks.ui.gef.model.HiddenAreaModel;
-import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
-import org.jboss.tools.smooks.ui.gef.model.RootModel;
-import org.jboss.tools.smooks.ui.gef.model.SourceModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.TargetModel;
-
-/**
- *
- * @author Dart Peng
- * @Date Jul 30, 2008
- */
-public class SmooksEditPartFactory implements EditPartFactory {
-
- public SmooksEditPartFactory() {
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
- * java.lang.Object)
- */
- public EditPart createEditPart(EditPart context, Object model) {
- EditPart part = getPartForElement(model);
- if (part != null)
- part.setModel(model);
-
- return part;
- }
-
- /**
- *
- * @param modelElement
- * @return
- */
- private EditPart getPartForElement(Object modelElement) {
-
- if (modelElement instanceof RootModel) {
- return new RootModelEditPart();
- } else if (modelElement instanceof HiddenAreaModel) {
- return new HiddenEditPart();
- } else if (modelElement instanceof StructuredDataModel) {
- return new StructuredDataEditPart();
- } else if (modelElement instanceof StructuredDataContentModel) {
- return new StructuredDataContentEditPart();
- } else if (modelElement instanceof LineConnectionModel) {
- return new StructuredDataConnectionEditPart();
- } else if (modelElement instanceof GraphRootModel) {
- return new RootModelEditPart();
- } else if (modelElement instanceof TargetModel) {
- return new TargetConnectionPointEditPart();
- } else if (modelElement instanceof SourceModel) {
- return new SourceConnectionPointEditPart();
- }
-
- throw new RuntimeException("Can't create part from model element: "
- + ((modelElement != null) ? modelElement.getClass().getName()
- : "null"));
- }
+package org.jboss.tools.smooks.ui.gef.editparts;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPartFactory;
+import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
+import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
+import org.jboss.tools.smooks.ui.gef.model.SourceModel;
+import org.jboss.tools.smooks.ui.gef.model.TargetModel;
+
+/**
+ *
+ * @author Dart Peng
+ * @Date Jul 30, 2008
+ */
+public class SmooksEditPartFactory implements EditPartFactory {
+
+ public SmooksEditPartFactory() {
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
+ * java.lang.Object)
+ */
+ public EditPart createEditPart(EditPart context, Object model) {
+ EditPart part = getPartForElement(model);
+ if (part != null)
+ part.setModel(model);
+
+ return part;
+ }
+
+ /**
+ *
+ * @param modelElement
+ * @return
+ */
+ private EditPart getPartForElement(Object modelElement) {
+
+ if (modelElement instanceof LineConnectionModel) {
+ return new StructuredDataConnectionEditPart();
+ } else if (modelElement instanceof GraphRootModel) {
+ return new RootModelEditPart();
+ } else if (modelElement instanceof TargetModel) {
+ return new TargetConnectionPointEditPart();
+ } else if (modelElement instanceof SourceModel) {
+ return new SourceConnectionPointEditPart();
+ }
+
+ throw new RuntimeException("Can't create part from model element: "
+ + ((modelElement != null) ? modelElement.getClass().getName()
+ : "null"));
+ }
}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,267 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import java.beans.PropertyChangeEvent;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.swt.graphics.Color;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerLeftEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerRightEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.LabelAreaFigure;
-import org.jboss.tools.smooks.ui.gef.figures.TreeNodeContentFigure;
-import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.policy.ConnectFeedbackEditPolicy;
-import org.jboss.tools.smooks.ui.gef.policy.CustomGraphicalNodeEditPolicy;
-import org.jboss.tools.smooks.ui.gef.policy.NonResizableSelectionEditPolicy;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.LeftSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.RightSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.editparts.InteractorHelper;
-import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-import org.jboss.tools.smooks.ui.gef.util.figures.Placeholder;
-
-/**
- *
- * @author Dart Peng
- *
- */
-public class StructuredDataContentEditPart extends
- AbstractStructuredDataEditPart implements GraphicsConstants,
- IConnectableEditPart {
-
- protected static final Color label2ForegroundColor = new Color(null, 82,
- 82, 158);
-
- protected Label propertyName;
- protected Label javaTypeLabel;
- protected ContainerFigure labelHolder = new ContainerFigure();
- protected TreeNodeContentFigure contentFigure;
- protected InteractorHelper interactorHelper;
- protected boolean isExpanded = false;
-
- private EditPart expandPart;
-
- public void propertyChange(PropertyChangeEvent event) {
-
- if (event.getPropertyName().equals(
- StructuredDataContentModel.P_SOURCE_CONNECTION)) {
- refreshSourceConnections();
- } else if (event.getPropertyName().equals(
- StructuredDataContentModel.P_TARGET_CONNECTION)) {
- refreshTargetConnections();
- }
- }
-
- public IFigure getContentPane() {
- return contentFigure.getInnerContentArea();
- }
-
- protected IFigure createFigure() {
- createContentFigure();
- createFigureContent();
- return contentFigure;
- }
-
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
- new CustomGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- new NonResizableSelectionEditPolicy());
- installEditPolicy("CONNECTION_FEED_BACK", new ConnectFeedbackEditPolicy());
- }
-
- protected void createContentFigure() {
- contentFigure = new TreeNodeContentFigure();
- contentFigure.setFill(true);
- }
-
- protected void createFigureContent() {
-
- StructuredDataContentModel model = (StructuredDataContentModel) getModel();
-
- // add a bit of space between the interactor and icon
- //
-
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(5, 5));
-
- labelHolder = new LabelAreaFigure();
- labelHolder.setFill(true);
-
- IFigure interactor = null;
-
- if (model.getChildren() != null
- && !model.getChildren().equals(Collections.EMPTY_LIST)) {
-
- interactor = new Interactor();
- interactor.setBorder(new MarginBorder(0, 0, 0, 5));
- interactor.setForegroundColor(ColorConstants.black);
- interactor.setBackgroundColor(ColorConstants.white);
- } else {
- interactor = new Placeholder();
- interactor.setBorder(new MarginBorder(0, 0, 0, 5));
- interactor.setForegroundColor(ColorConstants.white);
- }
-
- // contentFigure.getIconArea().getContainerLayout().setAlign(
- // PositionConstants.RIGHT);
- //contentFigure.getIconArea().getContainerLayout().setHorizontal(false);
- if (!((AbstractStructuredDataModel) getModel()).isLeft()) {
- contentFigure.getIconArea().getContainerLayout().setAlign(
- PositionConstants.RIGHT);
- contentFigure.getIconArea().add(space);
- contentFigure.getIconArea().add(labelHolder);
- contentFigure.setInteractor(interactor);
- } else {
- contentFigure.getIconArea().getContainerLayout().setAlign(
- PositionConstants.LEFT);
- contentFigure.setInteractor(interactor);
- contentFigure.getIconArea().add(space);
- contentFigure.getIconArea().add(labelHolder);
- }
-
- propertyName = new Label(model.getLabelName());
- propertyName.setForegroundColor(ColorConstants.black);
-// propertyName.setTextAlignment(PositionConstants.RIGHT);
- // propertyName.setBackgroundColor(ColorConstants.red);
- // propertyName.setOpaque(true);
-
- // if ( model.isRootNode() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_ALL).createImage());
- // } else if ( model.isListType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_CHOICE).createImage());
- // } else if ( !model.isListType() && model.isComplexType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_COMPLEX_TYPE).createImage());
- // } else if ( !model.isListType() && !model.isComplexType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_SIMPLE_TYPE).createImage());
- // }
- // contentFigure.getIconArea().setFill(true);
- // contentFigure.getIconArea().setBackgroundColor(ColorConstants.black);
- labelHolder.add(propertyName);
-
- if (model.getChildren() != null
- && !model.getChildren().equals(Collections.EMPTY_LIST)) {
- interactorHelper = new InteractorHelper(this, contentFigure
- .getInteractor(), contentFigure.getInnerContentArea());
- }
-
- javaTypeLabel = new Label();
- javaTypeLabel.setBorder(new MarginBorder(0, 5, 0, 0));
- javaTypeLabel.setForegroundColor(label2ForegroundColor);
- // javaTypeLabel.setIcon(SDPlugin.getImageDescriptor(
- // "icons/XSDSimpleType.gif").createImage());
-
- if (model.getTypeString() != null) {
- javaTypeLabel.setText("- (" + model.getTypeString() + ")");
- }
- labelHolder.add(javaTypeLabel);
- }
-
- protected void refreshVisuals() {
- Rectangle constraint = ((StructuredDataContentModel) getModel())
- .getConstraint();
-
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
- getFigure(), constraint);
-
- super.refreshVisuals();
- }
-
- public void notifyExpand(EditPart part) {
- expandPart = part;
- List sourceConnections = this.getSourceConnections();
- for (Iterator iter = sourceConnections.iterator(); iter.hasNext();) {
- AbstractConnectionEditPart sourceC = (AbstractConnectionEditPart) iter
- .next();
- sourceC.refresh();
- }
- List targetConnections = this.getTargetConnections();
- for (Iterator iter = targetConnections.iterator(); iter.hasNext();) {
- AbstractConnectionEditPart sourceC = (AbstractConnectionEditPart) iter
- .next();
- sourceC.refresh();
- }
-
- }
-
- public IFigure getSelectionFigure() {
- return ((TreeNodeContentFigure) getFigure()).getIconArea();
- }
-
- public IFigure getAnchroFigure() {
- if (expandPart == null)
- return ((TreeNodeContentFigure) getFigure()).getIconArea();
-
- if (expandPart instanceof StructuredDataContentEditPart) {
- IFigure figure = ((StructuredDataContentEditPart) expandPart)
- .getFigure();
- if (figure instanceof TreeNodeContentFigure) {
- return ((TreeNodeContentFigure) figure).getIconArea();
- }
- }
- return ((GraphicalEditPart) expandPart).getFigure();
- }
-
- protected List getModelChildren() {
- return ((AbstractStructuredDataModel) getModel()).getChildren();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(
- ConnectionEditPart connection) {
- return new ContainerRightEdgeAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connection) {
- return new ContainerLeftEdgeAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- return new RightSourceAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- return new LeftSourceAnchor(getAnchroFigure());
- }
-
- public List getModelSourceConnections() {
- return ((StructuredDataContentModel) getModel())
- .getModelSourceConnections();
- }
-
- public List getModelTargetConnections() {
- return ((StructuredDataContentModel) getModel())
- .getModelTargetConnections();
- }
-
- public boolean isExpanded() {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded) {
- this.isExpanded = isExpanded;
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,274 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.ContainerEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerBoxFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerLeftEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerRightEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.RoundedLineBorder;
-import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.policy.CustomGraphicalNodeEditPolicy;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.LeftSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.RightSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-import org.jboss.tools.smooks.ui.gef.util.figures.FillLayout;
-
-/**
- *
- */
-public class StructuredDataEditPart extends AbstractStructuredDataEditPart
- implements GraphicsConstants, IConnectableEditPart {
-
- protected ScrollPane scrollpane;
- protected Label label;
- protected ContainerFigure outerPane;
-
- public IFigure getContentPane() {
- return scrollpane.getContents();
- }
-
- /*
- * (non-Javadoc)
- *
- * @seejava.beans.PropertyChangeListener#propertyChange(java.beans.
- * PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent evt) {
- String pname = evt.getPropertyName();
- if (AbstractStructuredDataModel.P_CHILDREN.equals(pname)) {
- refreshChildren();
- }
- if (AbstractStructuredDataModel.P_BOUNDS_CHANGE.equals(pname)) {
- refresh();
- }
-
- if (StructuredDataContentModel.P_SOURCE_CONNECTION.equals(pname)) {
- refreshSourceConnections();
- } else if (StructuredDataContentModel.P_TARGET_CONNECTION.equals(pname)) {
- refreshTargetConnections();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- protected IFigure createFigure() {
-
- AbstractStructuredDataModel model = (AbstractStructuredDataModel) getModel();
-
- outerPane = new ContainerBoxFigure();
- outerPane.setMinimumSize(new Dimension(100, 100));
- outerPane.setBorder(new RoundedLineBorder(1, 5));
- outerPane.setForegroundColor(groupBorderColor);
- outerPane.setFill(true);
- outerPane.setBackgroundColor(ColorConstants.white);
- ContainerFigure titleFigure = new ContainerFigure(){
- @Override
- protected void fillShape(Graphics graphics) {
- graphics.pushState();
- graphics.setForegroundColor(graphics.getBackgroundColor());
- graphics.setBackgroundColor(ColorConstants.white);
- graphics.fillGradient(getBounds(), true);
- graphics.popState();
- }
- };
- // r.setCornerDimensions(new Dimension(4, 4));
- titleFigure.setOutline(false);
- titleFigure.setMinimumSize(new Dimension(0, 0));
-
- titleFigure.setFill(true);
-
- titleFigure.setBackgroundColor(groupHeaderColor);
- outerPane.add(titleFigure);
-
- label = new Label();
- label.setForegroundColor(ColorConstants.black);
- label.setBorder(new MarginBorder(2, 4, 2, 4));
- titleFigure.add(label); // Holder);
-
- RectangleFigure line = new RectangleFigure();
- line.setPreferredSize(20, 1);
- outerPane.add(line);
-
- int minHeight = 400;
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(250, theMinHeight));
- return d;
- }
- };
-
- outerLayout.setHorizontal(false);
- // layout.setSpacing(5);
- outerPane.setLayoutManager(outerLayout);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC);
- scrollpane.setHorizontalScrollBarVisibility(ScrollPane.AUTOMATIC);
- scrollpane.scrollHorizontalTo(scrollpane.getBounds().width / 2);
- scrollpane.scrollVerticalTo(scrollpane.getBounds().height / 2);
- outerPane.add(scrollpane);
-
- ContainerFigure pane = new ContainerFigure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- AbstractStructuredDataModel currentModel = (AbstractStructuredDataModel) this
- .getModel();
- if (!currentModel.isLeft()) {
- layout.setAlign(PositionConstants.RIGHT);
- }
- pane.setLayoutManager(layout);
- // pane.setBackgroundColor(ColorConstants.black);
- // pane.setFill(true);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.height = Math.min(d.height, theMinHeight - 25);
- return d;
- }
- };
-
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
- if (model instanceof StructuredDataModel) {
- label.setText(((StructuredDataModel) model).getLabelName());
- }
- return outerPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- protected void createEditPolicies() {
- this.installEditPolicy(EditPolicy.CONTAINER_ROLE,
- new ContainerEditPolicy() {
-
- @Override
- protected Command getCreateCommand(CreateRequest arg0) {
- return null;
- }
-
- });
-
- this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
- new CustomGraphicalNodeEditPolicy());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelSourceConnections
- * ()
- */
- @Override
- protected List getModelSourceConnections() {
- return ((IConnectableModel) getModel()).getModelSourceConnections();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelTargetConnections
- * ()
- */
- @Override
- protected List getModelTargetConnections() {
- return ((IConnectableModel) getModel()).getModelTargetConnections();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
- */
- protected List getModelChildren() {
- return ((AbstractStructuredDataModel) getModel()).getChildren();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
- */
- protected void refreshVisuals() {
- Rectangle constraint = null;
- AbstractStructuredDataModel model = (AbstractStructuredDataModel) getModel();
-
- if (model instanceof StructuredDataModel) {
- constraint = ((StructuredDataModel) model).getConstraint();
- }
- if (constraint == null)
- constraint = new Rectangle(0, 0, -1, -1);
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
- getFigure(), constraint);
-
- super.refreshVisuals();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart arg0) {
- return new ContainerRightEdgeAnchor(label);
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request arg0) {
- return new RightSourceAnchor(label);
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart arg0) {
- return new ContainerLeftEdgeAnchor(label);
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request arg0) {
- return new LeftSourceAnchor(label);
- }
-
- public IFigure getAnchroFigure() {
- return label;
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- * @Date Jul 30, 2008
- */
-public class ConnectionPointFiguresLocationCaculator {
- int itemY = 0;
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerBoxFigure extends ContainerFigure implements
- ITreeContainer {
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,52 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-
-
-public class ContainerFigure extends RectangleFigure implements IExpandable {
-
- protected boolean isOutlined = false;
-
- protected boolean isExpanded = true;
-
- public ContainerFigure() {
- setLayoutManager(new ContainerLayout());
- setFill(false);
- }
-
- public void doLayout() {
- layout();
- setValid(true);
- }
-
- public ContainerLayout getContainerLayout() {
- return (ContainerLayout) getLayoutManager();
- }
-
- public void setOutlined(boolean isOutlined) {
- this.isOutlined = isOutlined;
- }
-
- protected void outlineShape(Graphics graphics) {
- if (isOutlined) {
- super.outlineShape(graphics);
- }
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.draw2d.RectangleFigure#fillShape(org.eclipse.draw2d.Graphics)
- */
-
- public boolean isExpanded() {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded) {
- this.isExpanded = isExpanded;
- }
-
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerLeftEdgeAnchor extends ChopboxAnchor {
-
- public ContainerLeftEdgeAnchor(IFigure owner) {
- super(owner);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.draw2d.ChopboxAnchor#getLocation(org.eclipse.draw2d.geometry
- * .Point)
- */
- @Override
- public Point getLocation(Point reference) {
- Point p;
- IFigure figure = getOwner();
- IFigure parent = findTheTreeContainerFigure(figure);
- // caculate the right edge of parent figure
- if (parent == null)
- return getOwner().getBounds().getLeft();
- p = getOwner().getBounds().getCenter();
- getOwner().translateToAbsolute(p);
- p = getOwner().getBounds().getLeft();
- getOwner().translateToAbsolute(p);
- return new Point(parent.getBounds().x , p.y);
- }
-
- protected IFigure findTheTreeContainerFigure(IFigure figure) {
- if (figure == null)
- return null;
- IFigure parent = figure.getParent();
- if (parent == null)
- return null;
- if (parent instanceof ITreeContainer) {
- return parent;
- } else {
- return findTheTreeContainerFigure(parent);
- }
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerRightEdgeAnchor extends ChopboxAnchor {
-
- public ContainerRightEdgeAnchor(IFigure owner) {
- super(owner);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.draw2d.ChopboxAnchor#getLocation(org.eclipse.draw2d.geometry
- * .Point)
- */
- @Override
- public Point getLocation(Point reference) {
- Point p;
- IFigure figure = getOwner();
- IFigure parent = findTheTreeContainerFigure(figure);
- // caculate the right edge of parent figure
- if (parent == null)
- return getOwner().getBounds().getRight();
- p = getOwner().getBounds().getCenter();
- getOwner().translateToAbsolute(p);
- p = getOwner().getBounds().getRight();
- getOwner().translateToAbsolute(p);
- return new Point(parent.getBounds().x + parent.getBounds().width, p.y);
- }
-
- protected IFigure findTheTreeContainerFigure(IFigure figure) {
- if (figure == null)
- return null;
- IFigure parent = figure.getParent();
- if (parent == null)
- return null;
- if (parent instanceof ITreeContainer) {
- return parent;
- } else {
- return findTheTreeContainerFigure(parent);
- }
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,73 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-
-
-//--------------------------------------------
-//| ExpandableGraphNodeContentFigure |
-//| |
-//| ---------------------------------- |
-//| | verticalGroup | |
-//| | | |
-//| | ----------------------------- | |
-//| | | horizontalGroup | | |
-//| | | | | |
-//| | | --------------------- | | |
-//| | | | outlinedArea | | | |
-//| | | | ----------------- | | | |
-//| | | | |[+]iconArea | | | | |
-//| | | | ----------------- | | | |
-//| | | | ----------------- | | | |
-//| | | | | innerContent | | | | |
-//| | | | ----------------- | | | |
-//| | | --------------------- | | |
-//| | ----------------------------- | |
-//| | | |
-//| ---------------------------------- |
-//--------------------------------------------
-
-public class ExpandableGraphNodeContentFigure extends GraphNodeContentFigure {
-
- protected IFigure interactor;
-
- public ExpandableGraphNodeContentFigure() {
- super();
- }
-
- public Interactor getInteractor() {
- return (Interactor)interactor;
- }
-
- protected void createFigure() {
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
-// createInteractor(iconArea);
- innerContentArea.setBorder(new MarginBorder(0, 10, 0, 0));
- }
-
- protected void createInteractor(IFigure parent) {
-// interactor = new Interactor();
-// interactor.setBorder(new MarginBorder(0, 0, 0, 5));
-// interactor.setForegroundColor(ColorConstants.black);
-// interactor.setBackgroundColor(ColorConstants.white);
-// parent.add(interactor);
- }
-
- protected void createPreceedingSpace(IFigure parent) {
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(10, 10));
- parent.add(space);
- }
-
- /**
- */
- public void setInteractor(IFigure interactor) {
- this.interactor = interactor;
- iconArea.add(interactor);
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,79 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.jboss.tools.smooks.ui.gef.util.figures.IConnectedFigure;
-
-
-//------------------------------
-//| GraphNodeContentFigure |
-//| |
-//| ------------------------- |
-//| | vertical group | |
-//| | --------------------- | |
-//| | | outlined area | | |
-//| | | ----------------- | | |
-//| | | | icon area | | | |
-//| | | ----------------- | | |
-//| | | ----------------- | | |
-//| | | | inner content | | | |
-//| | | ----------------- | | |
-//| | --------------------- | |
-//| ------------------------- |
-//------------------------------
-
-public class GraphNodeContentFigure extends ContainerFigure implements IConnectedFigure {
-
- protected ContainerFigure verticalGroup;
- protected ContainerFigure outlinedArea;
- protected ContainerFigure iconArea;
- protected ContainerFigure innerContentArea;
-
- public GraphNodeContentFigure() {
- createFigure();
- }
-
- public IFigure getConnectionFigure() {
- return outlinedArea;
- }
-
- public ContainerFigure getIconArea() {
- return iconArea;
- }
-
- public ContainerFigure getOutlinedArea() {
- return outlinedArea;
- }
-
- public ContainerFigure getInnerContentArea() {
- return innerContentArea;
- }
-
- protected void createFigure() {
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
- }
-
- protected void createVerticalGroup(IFigure parent) {
- verticalGroup = new ContainerFigure();
- verticalGroup.getContainerLayout().setHorizontal(false);
- parent.add(verticalGroup);
- }
-
- protected void createOutlinedArea(IFigure parent) {
- outlinedArea = new ContainerFigure();
- outlinedArea.getContainerLayout().setHorizontal(false);
-// outlinedArea.setBackgroundColor(ColorConstants.red);
-// outlinedArea.setFill(true);
- parent.add(outlinedArea);
-
- iconArea = new IconAreaFigure();
- iconArea.getContainerLayout().setHorizontal(true);
- outlinedArea.add(iconArea);
-
- innerContentArea = new ContainerFigure();
- innerContentArea.getContainerLayout().setHorizontal(false);
-// innerContentArea.setBackgroundColor(ColorConstants.red);
-// innerContentArea.setFill(true);
- outlinedArea.add(innerContentArea);
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,153 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.swt.SWT;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-import org.jboss.tools.smooks.ui.gef.util.figures.FillLayout;
-
-
-//----------------------------------
-//| GroupFigure Head Area |
-//| |
-//| ----------------------------- |
-//| | | |
-//| | GroupFigure Client Area | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| ----------------------------- |
-//----------------------------------
-public class GroupFigure extends RectangleFigure implements GraphicsConstants {
-
- private static final int DEFAULT_MIN_HEIGHT = 250;
-
- protected ScrollPane scrollpane;
- /**
- * Text Name
- */
- protected Label label;
- protected ContainerFigure outerPane;
-
- public GroupFigure() {
-
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(100, DEFAULT_MIN_HEIGHT));
- return d;
- }
- };
- setLayoutManager(outerLayout);
- setFill(false);
- createFigure();
- }
-
- public void doLayout() {
- layout();
- setValid(true);
- }
-
- public FillLayout getFillLayout() {
- return (FillLayout)getLayoutManager();
- }
-
- protected void createFigure() {
- outerPane = new ContainerFigure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
- outerPane.setForegroundColor(groupBorderColor);
-
- ContainerFigure r = new ContainerFigure();
- //r.setCornerDimensions(new Dimension(4, 4));
- r.setOutline(false);
- r.setMinimumSize(new Dimension(0, 0));
-
- r.setFill(true);
-
- r.setBackgroundColor(groupHeaderColor);
- outerPane.add(r);
-
- //ContainerFigure labelHolder = new ContainerFigure();
- //labelHolder.add(label);
- label = new Label();
- label.setForegroundColor(ColorConstants.black);
- label.setBorder(new MarginBorder(2, 4, 2, 4));
- r.add(label); //Holder);
-// label.setTextAlignment(PositionConstants.RIGHT);
- RectangleFigure line = new RectangleFigure();
- line.setPreferredSize(20, 1);
- outerPane.add(line);
-
- int minHeight = 250;
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(100, theMinHeight));
- return d;
- }
- };
-
- outerLayout.setHorizontal(false);
-// outerLayout.setSpacing(10);
- outerPane.setLayoutManager(outerLayout);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); //ScrollPane.ALWAYS);
- outerPane.add(scrollpane);
-
- ContainerFigure pane = new ContainerFigure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- pane.setLayoutManager(layout);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.height = Math.min(d.height, theMinHeight - 25); // getViewer().getControl().getBounds().height);
- return d;
- }
- };
-
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
-
- this.add(outerPane);
- }
-
- public void setTextName(String name) {
- label.setText(name);
- }
-
- /**
- * @return
- */
- public String getTextName() {
- return label == null ? null : label.getText();
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,9 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IExpandable extends IFigure {
- boolean isExpanded();
-
- void setExpanded(boolean isExpanded);
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- */
-public interface ITreeContainer {
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-
-/**
- * @author Dart Peng
- *
- */
-public class IconAreaFigure extends ContainerFigure {
-
- public IconAreaFigure() {
- setLayoutManager(new RightAlignContainerLayout());
- setFill(false);
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- * @CreateTime Jul 21, 2008
- */
-public class LabelAreaFigure extends ContainerFigure {
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-
-/**
- * @author Dart Peng
- *
- */
-public class RightAlignContainerLayout extends ContainerLayout {
-
- public RightAlignContainerLayout() {
- super();
- this.setAlign(PositionConstants.RIGHT);
- this.setHorizontal(false);
- }
-
- @Override
- public void layout(IFigure parent) {
- super.layout(parent);
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,51 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder {
- protected int arcLength;
-
- protected int lineStyle = Graphics.LINE_SOLID;
-
- public RoundedLineBorder(Color c, int width, int arcLength) {
- super(c, width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(int width, int arcLength) {
- super(width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle) {
- super(c, width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public RoundedLineBorder(int width, int arcLength, int lineStyle) {
- super(width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- tempRect.setBounds(getPaintRectangle(figure, insets));
- int width = getWidth();
- Color color = getColor();
- if (width % 2 == 1) {
- tempRect.width--;
- tempRect.height--;
- }
- tempRect.shrink(width / 2, width / 2);
- graphics.setLineWidth(width);
- graphics.setLineStyle(lineStyle);
- if (color != null)
- graphics.setForegroundColor(color);
- graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Figure;
-
-/**
- * @author Dart Peng
- *
- */
-public class SourceConnectionDecoration extends Figure {
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,11 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-public class SpacingFigure extends RectangleFigure {
- public SpacingFigure() {
- setFill(false);
- setPreferredSize(new Dimension(0, 0));
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,77 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-
-/**
- *
- * @author Dart Peng
- *
- * @CreateTime Jul 21, 2008
- */
-public class TreeNodeContentFigure extends ExpandableGraphNodeContentFigure
- implements ISelectableFigure {
-
- private boolean selected = false;
-
- /**
- * @return the selected
- */
- public boolean getSelected() {
- return selected;
- }
-
- /**
- * @param selected
- * the selected to set
- */
- public void setSelected(boolean selected) {
- this.selected = selected;
- this.repaint();
- }
-
- /**
- * @return the focus
- */
- public boolean getFocus() {
- return focus;
- }
-
- /**
- * @param focus
- * the focus to set
- */
- public void setFocus(boolean focus) {
- this.focus = focus;
- }
-
- private boolean focus = false;
-
- public IFigure getConnectionFigure() {
- return outlinedArea;
- }
-
- protected void createOutlinedArea(IFigure parent) {
- super.createOutlinedArea(parent);
- outlinedArea.setBorder(new MarginBorder(0, 2, 0, 2));
- }
-
- protected void fillShape(Graphics graphics) {
- super.fillShape(graphics);
- }
-
- public void paintFigure(Graphics graphics){
- super.paintFigure(graphics);
- ContainerFigure figure = this.getIconArea();
- if (this.selected) {
- figure.setFill(true);
- figure.setBackgroundColor(GraphicsConstants.groupHeaderColor);
- } else {
- figure.setFill(false);
- figure.setBackgroundColor(ColorConstants.white);
- }
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,41 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.model;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * @deprecated
- *
- */
-public class DataObjectContainerModel extends AbstractStructuredDataModel {
-
- public static final int SOURCE_DATA_OBJECT_CONTAINER = 1;
- public static final int TARGET_DATA_OBJECT_CIBTAUBER = 2;
-
- private String name;
- private Rectangle constraint;
- private int category = -1;
-
- public int getCategory() {
- return category;
- }
-
- public void setCategory(int category) {
- this.category = category;
- }
-
- public Rectangle getConstraint() {
- return constraint;
- }
-
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.model;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Dart Peng
- *
- */
-public class HiddenAreaModel extends AbstractStructuredDataModel {
-
- @Override
- public List getChildren() {
- return Collections.EMPTY_LIST;
- }
-
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,32 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.policy;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.jboss.tools.smooks.ui.gef.editparts.StructuredDataContentEditPart;
-
-public class NodeSelectionHandlesEditPolicyImpl extends SelectionHandlesEditPolicy {
-
- protected List createSelectionHandles() {
-
- List list = new ArrayList();
- EditPart editPart = getHost();
-
- if ( editPart instanceof GraphicalEditPart ) {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
- IFigure figure = (graphicalEditPart instanceof StructuredDataContentEditPart ) ?
- ((StructuredDataContentEditPart)graphicalEditPart).getSelectionFigure() : graphicalEditPart.getFigure();
-
- MoveHandleLocator loc = new MoveHandleLocator(figure);
- MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);
- list.add(moveHandle);
- }
- return list;
- }
-}
\ No newline at end of file
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,91 +1,89 @@
-package org.jboss.tools.smooks.ui.gef.policy;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
-import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.smooks.ui.gef.commands.ChangeConstraintCommand;
-import org.jboss.tools.smooks.ui.gef.commands.CommandMappingFactory;
-import org.jboss.tools.smooks.ui.gef.commands.ICommandMappingFactory;
-import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
-
-
-
-/**
- * @deprecated
- * @author Dart
- *
- */
-public class RootGraphicsXYLayoutEditPolicy extends XYLayoutEditPolicy {
-
- private ICommandMappingFactory mappingFactory = null;
-
- /**
- * @return the mappingFactory
- */
- public ICommandMappingFactory getMappingFactory() {
- if (mappingFactory == null)
- mappingFactory = createMappingFactory();
- return mappingFactory;
- }
-
- /**
- * @return the mappingFactory
- */
- public ICommandMappingFactory createMappingFactory() {
- return new CommandMappingFactory();
- }
-
- protected Command createAddCommand(EditPart child, Object constraint) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @seeorg.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy#
- * createChangeConstraintCommand(org.eclipse.gef.EditPart, java.lang.Object)
- */
- @Override
- protected Command createChangeConstraintCommand(EditPart child,
- Object constraint) {
- Rectangle con = (Rectangle) constraint;
- Object model = child.getModel();
- ChangeConstraintCommand command = null;
- if (model instanceof IGraphicalModel) {
- command = new ChangeConstraintCommand();
- command.setConstraint(con);
- command.setGraphicalModel((IGraphicalModel) model);
- }
- return command;
- }
-
- @Override
- protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
- return super.getResizeChildrenCommand(request);
- }
-
- protected Command getCreateCommand(CreateRequest request) {
- GraphicalEditPart rootEditPart = (GraphicalEditPart) this.getHost();
- ICommandMappingFactory factory = getMappingFactory();
- if (factory != null) {
- return factory.createCreationStructuredModelCommand(request,
- rootEditPart);
- }
- return null;
- }
-
- protected Command getDeleteDependantCommand(Request request) {
- return null;
- }
-
- protected EditPolicy createChildEditPolicy(EditPart child) {
- return new NonResizableEditPolicy();
- }
+package org.jboss.tools.smooks.ui.gef.policy;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gef.requests.CreateRequest;
+import org.jboss.tools.smooks.ui.gef.commands.CommandMappingFactory;
+import org.jboss.tools.smooks.ui.gef.commands.ICommandMappingFactory;
+
+
+
+/**
+ * @deprecated
+ * @author Dart
+ *
+ */
+public class RootGraphicsXYLayoutEditPolicy extends XYLayoutEditPolicy {
+
+ private ICommandMappingFactory mappingFactory = null;
+
+ /**
+ * @return the mappingFactory
+ */
+ public ICommandMappingFactory getMappingFactory() {
+ if (mappingFactory == null)
+ mappingFactory = createMappingFactory();
+ return mappingFactory;
+ }
+
+ /**
+ * @return the mappingFactory
+ */
+ public ICommandMappingFactory createMappingFactory() {
+ return new CommandMappingFactory();
+ }
+
+ protected Command createAddCommand(EditPart child, Object constraint) {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @seeorg.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy#
+ * createChangeConstraintCommand(org.eclipse.gef.EditPart, java.lang.Object)
+ */
+ @Override
+ protected Command createChangeConstraintCommand(EditPart child,
+ Object constraint) {
+// Rectangle con = (Rectangle) constraint;
+// Object model = child.getModel();
+// ChangeConstraintCommand command = null;
+// if (model instanceof IGraphicalModel) {
+// command = new ChangeConstraintCommand();
+// command.setConstraint(con);
+// command.setGraphicalModel((IGraphicalModel) model);
+// }
+// return command;
+ return null;
+ }
+
+ @Override
+ protected Command getResizeChildrenCommand(ChangeBoundsRequest request) {
+ return super.getResizeChildrenCommand(request);
+ }
+
+ protected Command getCreateCommand(CreateRequest request) {
+ GraphicalEditPart rootEditPart = (GraphicalEditPart) this.getHost();
+ ICommandMappingFactory factory = getMappingFactory();
+ if (factory != null) {
+ return factory.createCreationStructuredModelCommand(request,
+ rootEditPart);
+ }
+ return null;
+ }
+
+ protected Command getDeleteDependantCommand(Request request) {
+ return null;
+ }
+
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ return new NonResizableEditPolicy();
+ }
}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/InteractorHelper.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,119 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.editparts;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LayoutManager;
-import org.eclipse.draw2d.MouseEvent;
-import org.eclipse.draw2d.MouseListener;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-import org.jboss.tools.smooks.ui.gef.editparts.StructuredDataContentEditPart;
-import org.jboss.tools.smooks.ui.gef.figures.IExpandable;
-import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-
-/**
- * @deprecated
- *
- */
-public class InteractorHelper implements MouseListener {
-
- protected boolean needToPerformDefaultExpansion = true;
-
- protected EditPart editPart;
-
- protected Interactor interactor;
-
- protected IExpandable expandable;
-
- public InteractorHelper(EditPart editPart, Interactor interactor,
- IExpandable expandable) {
- this.editPart = editPart;
- this.interactor = interactor;
- this.expandable = expandable;
- interactor.addMouseListener(this);
- expandable.setExpanded(interactor.isExpanded());
- }
-
- public void setExpanded(boolean isExpanded) {
- interactor.setExpanded(isExpanded);
- interactorExpansionChanged(isExpanded);
- }
-
- protected void interactorExpansionChanged(boolean isInteractorExpanded) {
- expandable.setExpanded(isInteractorExpanded);
- expandable.setVisible(isInteractorExpanded);
-
- editPart.refresh();
- ((StructuredDataContentEditPart) editPart).setExpanded(!expandable
- .isExpanded());
- expandChildrenLinesToMe(editPart, expandable.isExpanded());
-
- EditPart root = editPart.getRoot();
-
- if (root instanceof AbstractGraphicalEditPart) {
- IFigure rootFigure = ((AbstractGraphicalEditPart) root).getFigure();
- invalidateAll(rootFigure);
- rootFigure.validate();
- rootFigure.repaint();
- }
- }
-
- private void expandChildrenLinesToMe(EditPart parentEditPart,
- boolean expanded) {
- List children = parentEditPart.getChildren();
- for (Iterator iter = children.iterator(); iter.hasNext();) {
- Object child = iter.next();
- if (child instanceof StructuredDataContentEditPart) {
- if (!expanded) {
- ((StructuredDataContentEditPart) child).notifyExpand(editPart);
- } else {
- EditPart part = null;
- if (((StructuredDataContentEditPart) parentEditPart).isExpanded()) {
- StructuredDataContentEditPart finalEditPart = (StructuredDataContentEditPart)parentEditPart;
- while(finalEditPart.isExpanded()){
- Object myParent = finalEditPart.getParent();
- part = finalEditPart;
- if(myParent instanceof StructuredDataContentEditPart){
- finalEditPart = (StructuredDataContentEditPart)myParent;
- }
- }
- }
- ((StructuredDataContentEditPart) child).notifyExpand(part);
-
- }
- if (!((StructuredDataContentEditPart) child).getChildren().isEmpty()) {
- expandChildrenLinesToMe((StructuredDataContentEditPart) child,
- expanded);
- }
- }
- }
- }
-
- protected void invalidateAll(IFigure figure) {
- figure.invalidate();
- LayoutManager manager = figure.getLayoutManager();
-
- if (manager != null) {
- manager.invalidate();
- }
-
- for (Iterator i = figure.getChildren().iterator(); i.hasNext();) {
- IFigure child = (IFigure) i.next();
- invalidateAll(child);
- }
- }
-
- public void mousePressed(MouseEvent me) {
- boolean newExpansionState = !interactor.isExpanded();
- interactor.setExpanded(newExpansionState);
- interactorExpansionChanged(newExpansionState);
- }
-
- public void mouseReleased(MouseEvent me) {
- }
-
- public void mouseDoubleClicked(MouseEvent me) {
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/ContainerLayout.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,247 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.jboss.tools.smooks.ui.gef.figures.IExpandable;
-import org.jboss.tools.smooks.ui.gef.figures.SpacingFigure;
-/**
- * @deprecated
- */
-public class ContainerLayout extends AbstractLayout {
- protected boolean isHorizontal;
-
- private int align = PositionConstants.LEFT;
-
- protected int spacing = 0;
-
- protected int border = 0;
-
- public ContainerLayout() {
- this(true, 0);
- }
-
- public int getAlign() {
- return align;
- }
-
- public void setAlign(int align) {
- this.align = align;
- }
-
- public ContainerLayout(boolean isHorizontal, int spacing) {
- this.isHorizontal = isHorizontal;
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal) {
- this.isHorizontal = isHorizontal;
- }
-
- public void setSpacing(int spacing) {
- this.spacing = spacing;
- }
-
- public void setBorder(int border) {
- this.border = border;
- }
-
- protected int alignFigure(IFigure parent, IFigure child) {
- return -1;
- }
-
- /**
- * Calculates and returns the preferred size of the container given as
- * input.
- *
- * @param figure
- * Figure whose preferred size is required.
- * @return The preferred size of the passed Figure.
- */
- protected Dimension calculatePreferredSizeHelper(IFigure parent) {
- Dimension preferred = new Dimension();
- List children = parent.getChildren();
-
- for (int i = 0; i < children.size(); i++) {
- IFigure child = (IFigure) children.get(i);
-
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal) {
- preferred.width += childSize.width;
- preferred.height = Math.max(preferred.height, childSize.height);
- } else {
- preferred.height += childSize.height;
- preferred.width = Math.max(preferred.width, childSize.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 1) {
- if (isHorizontal) {
- preferred.width += spacing * (childrenSize - 1);
- } else {
- preferred.height += spacing * (childrenSize - 1);
- }
- }
-
- preferred.width += border * 2;
- preferred.height += border * 2;
- preferred.width += parent.getInsets().getWidth();
- preferred.height += parent.getInsets().getHeight();
-
- return preferred;
- }
-
- protected Dimension calculatePreferredSize(IFigure parent, int width,
- int height) {
- Dimension preferred = null;
-
- // Here we ensure that an unexpanded container is given a size of (0,0)
- //
- if (parent instanceof IExpandable) {
- IExpandable expandableFigure = (IExpandable) parent;
- if (!expandableFigure.isExpanded()) {
- preferred = new Dimension();
- }
- }
-
- if (preferred == null) {
- preferred = calculatePreferredSizeHelper(parent);
- }
-
- return preferred;
- }
-
- protected void adjustLayoutLocation(IFigure parent, Dimension dimension) {
- }
-
- public void layout(IFigure parent) {
- List children = parent.getChildren();
-
- int rx = 0;
-
- Dimension dimension = new Dimension();
-
- for (int i = 0; i < children.size(); i++) {
- IFigure child = (IFigure) children.get(i);
- Dimension childSize = child.getPreferredSize();
- if (isHorizontal) {
- dimension.height = Math.max(dimension.height, childSize.height);
- rx += childSize.width;
- } else {
- dimension.width = Math.max(dimension.width, childSize.width);
- }
- }
-
- int tempwidth = rx;
-
- // dimension.width += parent.getInsets().left;
- // dimension.height += parent.getInsets().top;
-
- if (isHorizontal) {
- dimension.height += border * 2;
- dimension.width += border;
- } else {
- dimension.width += border * 2;
- dimension.height += border;
- }
-
-
- int maxChildWidth = 0;
- for (Iterator iterator = children.iterator(); iterator.hasNext();) {
- IFigure childf = (IFigure) iterator.next();
- maxChildWidth = Math.max(childf.getPreferredSize().width, maxChildWidth);
- }
- adjustLayoutLocation(parent, dimension);
- // Add by DartPeng Jul 16 2008
- int myh = 0;
-// if (isHorizontal && align == PositionConstants.RIGHT) {
-// for (int i = children.size() - 1; i >= 0; i--) {
-// IFigure child = (IFigure) children.get(i);
-// Dimension childSize = child.getPreferredSize();
-//
-// if (isHorizontal) {
-// int y = -1;
-//
-// y = alignFigure(parent, child);
-//
-// if (y == -1) {
-// y = (dimension.height - childSize.height) / 2;
-// }
-// myh += childSize.width;
-// myh += spacing;
-// Rectangle rectangle = new Rectangle(
-// parent.getClientArea().width - myh, y,
-// childSize.width, childSize.height);
-// rectangle.translate(parent.getClientArea().getLocation());
-//
-// child.setBounds(rectangle);
-// dimension.width += childSize.width;
-// dimension.width += spacing;
-// if (child instanceof SpacingFigure) {
-// int availableHorizontalSpace = parent.getClientArea().width
-// - rx;
-// dimension.width += availableHorizontalSpace;
-// myh += availableHorizontalSpace;
-// }
-// }
-// }
-// return;
-// }
-
- for (int i = 0; i < children.size(); i++) {
- IFigure child = (IFigure) children.get(i);
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal) {
- int y = -1;
-
- y = alignFigure(parent, child);
-
- if (y == -1) {
- y = (dimension.height - childSize.height) / 2;
- }
-
- int adjust = dimension.width;
-
- Rectangle rectangle = new Rectangle(adjust, y, childSize.width,
- childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
- child.setBounds(rectangle);
- dimension.width += childSize.width;
- dimension.width += spacing;
- tempwidth -= childSize.width;
- if (child instanceof SpacingFigure) {
- int availableHorizontalSpace = parent.getClientArea().width
- - rx;
- dimension.width += availableHorizontalSpace;
- tempwidth -= availableHorizontalSpace;
- }
- } else {
- int adjust = 0;
- // Modify by Dart 2008.7.17
-// switch (this.align) {
-// case PositionConstants.LEFT:
-// break;
-// case PositionConstants.RIGHT:
-// adjust = parent.getClientArea().width - dimension.width;
-// }
-
- Rectangle rectangle = new Rectangle(adjust, dimension.height,
- maxChildWidth, childSize.height);
- rectangle.translate(parent.getClientArea().getLocation());
-
- child.setBounds(rectangle);
- dimension.height += childSize.height;
- dimension.height += spacing;
- }
- }
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/FillLayout.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,138 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.figures;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.AbstractLayout;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * @deprecated
- * @author dart
- *
- */
-public class FillLayout extends AbstractLayout {
-
- protected boolean isHorizontal = false;
-
- protected int spacing = 0;
-
- public Dimension min;
-
- public FillLayout() {
- }
-
- public FillLayout(int spacing) {
- this.spacing = spacing;
- }
-
- public void setHorizontal(boolean isHorizontal) {
- this.isHorizontal = isHorizontal;
- }
-
- /**
- * Calculates and returns the preferred size of the input container. This is
- * the size of the largest child of the container, as all other children fit
- * into this size.
- *
- * @param figure
- * Container figure for which preferred size is required.
- * @return The preferred size of the input figure.
- */
-
- protected Dimension calculatePreferredSize(IFigure figure, int width,
- int height) {
- Dimension d = calculatePreferredClientAreaSize(figure);
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- d.union(getBorderPreferredSize(figure));
- return d;
- }
-
- protected Dimension calculatePreferredClientAreaSize(IFigure figure) {
- Dimension d = new Dimension();
- List children = figure.getChildren();
-
- for (Iterator i = children.iterator(); i.hasNext();) {
- IFigure child = (IFigure) i.next();
- Dimension childSize = child.getPreferredSize();
-
- if (isHorizontal) {
- d.width += childSize.width;
- d.height = Math.max(childSize.height, d.height);
- } else {
- d.height += childSize.height;
- d.width = Math.max(childSize.width, d.width);
- }
- }
-
- int childrenSize = children.size();
- if (childrenSize > 0) {
- if (isHorizontal) {
- d.width += spacing * (childrenSize - 1);
- } else {
- d.height += spacing * (childrenSize - 1);
- }
- }
-
- if (min != null) {
- d.width = Math.max(d.width, min.width);
- d.height = Math.max(d.height, min.height);
- }
- return d;
- }
-
- /*
- * Returns the minimum size required by the input container. This is the
- * size of the largest child of the container, as all other children fit
- * into this size.
- */
- public Dimension getMinimumSize(IFigure figure, int width, int height) {
- Dimension d = new Dimension();
- List children = figure.getChildren();
- IFigure child;
-
- for (int i = 0; i < children.size(); i++) {
- child = (IFigure) children.get(i);
- d.union(child.getMinimumSize());
- }
- d.expand(figure.getInsets().getWidth(), figure.getInsets().getHeight());
- return d;
- }
-
- public Dimension getPreferredSize(IFigure figure, int width, int height) {
- return calculatePreferredSize(figure, width, height);
- }
-
- /*
- * Lays out the children on top of each other with their sizes equal to that
- * of the available paintable area of the input container figure.
- */
- public void layout(IFigure figure) {
- Dimension preferredSize = calculatePreferredClientAreaSize(figure);
- Rectangle r = figure.getClientArea().getCopy();
- List children = figure.getChildren();
-
- int nChildren = children.size();
- int extraHorizontalSpace = r.width - preferredSize.width;
-
- for (Iterator i = children.iterator(); i.hasNext();) {
- IFigure child = (IFigure) i.next();
- Dimension preferredChildSize = child.getPreferredSize();
-
- if (isHorizontal) {
- int w = preferredChildSize.width
- + (extraHorizontalSpace / nChildren);
- child.setBounds(new Rectangle(r.x, r.y, w, Math.max(
- preferredSize.height, r.height)));
- r.x += w + spacing;
- } else {
- child.setBounds(new Rectangle(r.x, r.y, Math.max(
- preferredSize.width, r.width),
- preferredChildSize.height));
- r.y += preferredChildSize.height + spacing;
- }
- }
- }
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/IConnectedFigure.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,10 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.figures;
-
-import org.eclipse.draw2d.IFigure;
-/**
- * @deprecated
- *
- */
-public interface IConnectedFigure extends IFigure {
- public IFigure getConnectionFigure();
-}
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Interactor.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,41 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * @deprecated
- */
-public class Interactor extends RectangleFigure {
-
- protected boolean isExpanded = true;
-
- public Interactor() {
- super();
- setPreferredSize(new Dimension(9, 9));
- }
-
- public void setExpanded(boolean isExpanded) {
- this.isExpanded = isExpanded;
- repaint();
- }
-
- public boolean isExpanded() {
- return isExpanded;
- }
-
- protected void fillShape(Graphics g) {
- super.fillShape(g);
- Rectangle r = getBounds();
- int mx = r.x + r.width / 2;
- int my = r.y + r.height / 2;
- int s = 2;
- g.drawLine(r.x + s, my, r.x + r.width - s - 1, my);
-
- if (!isExpanded) {
- g.drawLine(mx, r.y + s, mx, r.y + r.height - s - 1);
- }
- }
-}
\ No newline at end of file
Deleted: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java 2008-10-21 03:41:10 UTC (rev 11024)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/Placeholder.java 2008-10-21 03:42:46 UTC (rev 11025)
@@ -1,17 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.util.figures;
-
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-/**
- * @deprecated
- *
- */
-public class Placeholder extends RectangleFigure {
-
- public Placeholder() {
- super();
- setPreferredSize(new Dimension(9, 9));
- this.setVisible(false);
- }
-}
16 years, 2 months
JBoss Tools SVN: r11024 - in branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui: src/org/jboss/tools/smooks/ui/gef/commands and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-20 23:41:10 -0400 (Mon, 20 Oct 2008)
New Revision: 11024
Removed:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/editparts/
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/util/figures/
Modified:
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
Log:
JBIDE-2942
Delete some needless codes
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/META-INF/MANIFEST.MF 2008-10-21 03:41:10 UTC (rev 11024)
@@ -49,8 +49,6 @@
org.jboss.tools.smooks.ui.gef.policy,
org.jboss.tools.smooks.ui.gef.tools,
org.jboss.tools.smooks.ui.gef.util,
- org.jboss.tools.smooks.ui.gef.util.editparts,
- org.jboss.tools.smooks.ui.gef.util.figures,
org.jboss.tools.smooks.ui.modelparser,
org.jboss.tools.smooks.ui.wizards,
org.jboss.tools.smooks.utils,
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/ChangeConstraintCommand.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.commands;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.commands.Command;
-import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
-
-/**
- * @deprecated
- * @author Dart Peng
- *
- */
-public class ChangeConstraintCommand extends Command {
- Rectangle constraint = null;
-
- IGraphicalModel graphicalModel = null;
-
- /**
- * @return the graphicalModel
- */
- public IGraphicalModel getGraphicalModel() {
- return graphicalModel;
- }
-
- /**
- * @param graphicalModel the graphicalModel to set
- */
- public void setGraphicalModel(IGraphicalModel graphicalModel) {
- this.graphicalModel = graphicalModel;
- }
-
- Rectangle prevConstraint = null;
-
- /**
- * @return the constraint
- */
- public Rectangle getConstraint() {
- return constraint;
- }
-
- /**
- * @param constraint
- * the constraint to set
- */
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
- }
-
- @Override
- public void execute() {
- if (constraint != null && graphicalModel != null) {
- graphicalModel.setConstraint(constraint);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.commands.Command#redo()
- */
- @Override
- public void redo() {
- // TODO Auto-generated method stub
- super.redo();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.commands.Command#undo()
- */
- @Override
- public void undo() {
- // TODO Auto-generated method stub
- super.undo();
- }
-
-
-
-}
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/commands/CreateStructuredDataModelCommand.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -22,6 +22,7 @@
* @author Dart Peng
*
* @CreateTime Jul 22, 2008
+ * @deprecated
*/
public class CreateStructuredDataModelCommand extends Command {
private AbstractStructuredDataModel parent;
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/HiddenEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.gef.editparts.AbstractGraphicalEditPart;
-
-/**
- * @author Dart Peng
- *
- */
-public class HiddenEditPart extends AbstractGraphicalEditPart {
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- @Override
- protected IFigure createFigure() {
- Figure figure = new Figure(){
-
- @Override
- public Dimension getPreferredSize(int hint, int hint2) {
- // TODO Auto-generated method stub
- return new Dimension(200,300);
- }
-
- @Override
- public Dimension getMaximumSize() {
- // TODO Auto-generated method stub
- return new Dimension(100,300);
- }
-
-
-
- };
- return figure;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- @Override
- protected void createEditPolicies() {
-
- }
-
-}
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/SmooksEditPartFactory.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -3,12 +3,8 @@
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.jboss.tools.smooks.ui.gef.model.GraphRootModel;
-import org.jboss.tools.smooks.ui.gef.model.HiddenAreaModel;
import org.jboss.tools.smooks.ui.gef.model.LineConnectionModel;
-import org.jboss.tools.smooks.ui.gef.model.RootModel;
import org.jboss.tools.smooks.ui.gef.model.SourceModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
import org.jboss.tools.smooks.ui.gef.model.TargetModel;
/**
@@ -25,8 +21,9 @@
/*
* (non-Javadoc)
*
- * @see org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
- * java.lang.Object)
+ * @see
+ * org.eclipse.gef.EditPartFactory#createEditPart(org.eclipse.gef.EditPart,
+ * java.lang.Object)
*/
public EditPart createEditPart(EditPart context, Object model) {
EditPart part = getPartForElement(model);
@@ -43,15 +40,7 @@
*/
private EditPart getPartForElement(Object modelElement) {
- if (modelElement instanceof RootModel) {
- return new RootModelEditPart();
- } else if (modelElement instanceof HiddenAreaModel) {
- return new HiddenEditPart();
- } else if (modelElement instanceof StructuredDataModel) {
- return new StructuredDataEditPart();
- } else if (modelElement instanceof StructuredDataContentModel) {
- return new StructuredDataContentEditPart();
- } else if (modelElement instanceof LineConnectionModel) {
+ if (modelElement instanceof LineConnectionModel) {
return new StructuredDataConnectionEditPart();
} else if (modelElement instanceof GraphRootModel) {
return new RootModelEditPart();
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataContentEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,267 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import java.beans.PropertyChangeEvent;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.editparts.AbstractConnectionEditPart;
-import org.eclipse.swt.graphics.Color;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerLeftEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerRightEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.LabelAreaFigure;
-import org.jboss.tools.smooks.ui.gef.figures.TreeNodeContentFigure;
-import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.policy.ConnectFeedbackEditPolicy;
-import org.jboss.tools.smooks.ui.gef.policy.CustomGraphicalNodeEditPolicy;
-import org.jboss.tools.smooks.ui.gef.policy.NonResizableSelectionEditPolicy;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.LeftSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.RightSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.editparts.InteractorHelper;
-import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-import org.jboss.tools.smooks.ui.gef.util.figures.Placeholder;
-
-/**
- *
- * @author Dart Peng
- *
- */
-public class StructuredDataContentEditPart extends
- AbstractStructuredDataEditPart implements GraphicsConstants,
- IConnectableEditPart {
-
- protected static final Color label2ForegroundColor = new Color(null, 82,
- 82, 158);
-
- protected Label propertyName;
- protected Label javaTypeLabel;
- protected ContainerFigure labelHolder = new ContainerFigure();
- protected TreeNodeContentFigure contentFigure;
- protected InteractorHelper interactorHelper;
- protected boolean isExpanded = false;
-
- private EditPart expandPart;
-
- public void propertyChange(PropertyChangeEvent event) {
-
- if (event.getPropertyName().equals(
- StructuredDataContentModel.P_SOURCE_CONNECTION)) {
- refreshSourceConnections();
- } else if (event.getPropertyName().equals(
- StructuredDataContentModel.P_TARGET_CONNECTION)) {
- refreshTargetConnections();
- }
- }
-
- public IFigure getContentPane() {
- return contentFigure.getInnerContentArea();
- }
-
- protected IFigure createFigure() {
- createContentFigure();
- createFigureContent();
- return contentFigure;
- }
-
- protected void createEditPolicies() {
- installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
- new CustomGraphicalNodeEditPolicy());
- installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE,
- new NonResizableSelectionEditPolicy());
- installEditPolicy("CONNECTION_FEED_BACK", new ConnectFeedbackEditPolicy());
- }
-
- protected void createContentFigure() {
- contentFigure = new TreeNodeContentFigure();
- contentFigure.setFill(true);
- }
-
- protected void createFigureContent() {
-
- StructuredDataContentModel model = (StructuredDataContentModel) getModel();
-
- // add a bit of space between the interactor and icon
- //
-
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(5, 5));
-
- labelHolder = new LabelAreaFigure();
- labelHolder.setFill(true);
-
- IFigure interactor = null;
-
- if (model.getChildren() != null
- && !model.getChildren().equals(Collections.EMPTY_LIST)) {
-
- interactor = new Interactor();
- interactor.setBorder(new MarginBorder(0, 0, 0, 5));
- interactor.setForegroundColor(ColorConstants.black);
- interactor.setBackgroundColor(ColorConstants.white);
- } else {
- interactor = new Placeholder();
- interactor.setBorder(new MarginBorder(0, 0, 0, 5));
- interactor.setForegroundColor(ColorConstants.white);
- }
-
- // contentFigure.getIconArea().getContainerLayout().setAlign(
- // PositionConstants.RIGHT);
- //contentFigure.getIconArea().getContainerLayout().setHorizontal(false);
- if (!((AbstractStructuredDataModel) getModel()).isLeft()) {
- contentFigure.getIconArea().getContainerLayout().setAlign(
- PositionConstants.RIGHT);
- contentFigure.getIconArea().add(space);
- contentFigure.getIconArea().add(labelHolder);
- contentFigure.setInteractor(interactor);
- } else {
- contentFigure.getIconArea().getContainerLayout().setAlign(
- PositionConstants.LEFT);
- contentFigure.setInteractor(interactor);
- contentFigure.getIconArea().add(space);
- contentFigure.getIconArea().add(labelHolder);
- }
-
- propertyName = new Label(model.getLabelName());
- propertyName.setForegroundColor(ColorConstants.black);
-// propertyName.setTextAlignment(PositionConstants.RIGHT);
- // propertyName.setBackgroundColor(ColorConstants.red);
- // propertyName.setOpaque(true);
-
- // if ( model.isRootNode() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_ALL).createImage());
- // } else if ( model.isListType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_CHOICE).createImage());
- // } else if ( !model.isListType() && model.isComplexType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_COMPLEX_TYPE).createImage());
- // } else if ( !model.isListType() && !model.isComplexType() ) {
- // propertyName.setIcon(SDPlugin.getImageDescriptor(IImagePaths.
- // IMAGE_XSD_SIMPLE_TYPE).createImage());
- // }
- // contentFigure.getIconArea().setFill(true);
- // contentFigure.getIconArea().setBackgroundColor(ColorConstants.black);
- labelHolder.add(propertyName);
-
- if (model.getChildren() != null
- && !model.getChildren().equals(Collections.EMPTY_LIST)) {
- interactorHelper = new InteractorHelper(this, contentFigure
- .getInteractor(), contentFigure.getInnerContentArea());
- }
-
- javaTypeLabel = new Label();
- javaTypeLabel.setBorder(new MarginBorder(0, 5, 0, 0));
- javaTypeLabel.setForegroundColor(label2ForegroundColor);
- // javaTypeLabel.setIcon(SDPlugin.getImageDescriptor(
- // "icons/XSDSimpleType.gif").createImage());
-
- if (model.getTypeString() != null) {
- javaTypeLabel.setText("- (" + model.getTypeString() + ")");
- }
- labelHolder.add(javaTypeLabel);
- }
-
- protected void refreshVisuals() {
- Rectangle constraint = ((StructuredDataContentModel) getModel())
- .getConstraint();
-
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
- getFigure(), constraint);
-
- super.refreshVisuals();
- }
-
- public void notifyExpand(EditPart part) {
- expandPart = part;
- List sourceConnections = this.getSourceConnections();
- for (Iterator iter = sourceConnections.iterator(); iter.hasNext();) {
- AbstractConnectionEditPart sourceC = (AbstractConnectionEditPart) iter
- .next();
- sourceC.refresh();
- }
- List targetConnections = this.getTargetConnections();
- for (Iterator iter = targetConnections.iterator(); iter.hasNext();) {
- AbstractConnectionEditPart sourceC = (AbstractConnectionEditPart) iter
- .next();
- sourceC.refresh();
- }
-
- }
-
- public IFigure getSelectionFigure() {
- return ((TreeNodeContentFigure) getFigure()).getIconArea();
- }
-
- public IFigure getAnchroFigure() {
- if (expandPart == null)
- return ((TreeNodeContentFigure) getFigure()).getIconArea();
-
- if (expandPart instanceof StructuredDataContentEditPart) {
- IFigure figure = ((StructuredDataContentEditPart) expandPart)
- .getFigure();
- if (figure instanceof TreeNodeContentFigure) {
- return ((TreeNodeContentFigure) figure).getIconArea();
- }
- }
- return ((GraphicalEditPart) expandPart).getFigure();
- }
-
- protected List getModelChildren() {
- return ((AbstractStructuredDataModel) getModel()).getChildren();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(
- ConnectionEditPart connection) {
- return new ContainerRightEdgeAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(
- ConnectionEditPart connection) {
- return new ContainerLeftEdgeAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request request) {
- return new RightSourceAnchor(getAnchroFigure());
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request request) {
- return new LeftSourceAnchor(getAnchroFigure());
- }
-
- public List getModelSourceConnections() {
- return ((StructuredDataContentModel) getModel())
- .getModelSourceConnections();
- }
-
- public List getModelTargetConnections() {
- return ((StructuredDataContentModel) getModel())
- .getModelTargetConnections();
- }
-
- public boolean isExpanded() {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded) {
- this.isExpanded = isExpanded;
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/editparts/StructuredDataEditPart.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,274 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.editparts;
-
-import java.beans.PropertyChangeEvent;
-import java.util.List;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionAnchor;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.gef.ConnectionEditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.ContainerEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerBoxFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerFigure;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerLeftEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.ContainerRightEdgeAnchor;
-import org.jboss.tools.smooks.ui.gef.figures.RoundedLineBorder;
-import org.jboss.tools.smooks.ui.gef.model.AbstractStructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.model.IConnectableModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataContentModel;
-import org.jboss.tools.smooks.ui.gef.model.StructuredDataModel;
-import org.jboss.tools.smooks.ui.gef.policy.CustomGraphicalNodeEditPolicy;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.LeftSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.RightSourceAnchor;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-import org.jboss.tools.smooks.ui.gef.util.figures.FillLayout;
-
-/**
- *
- */
-public class StructuredDataEditPart extends AbstractStructuredDataEditPart
- implements GraphicsConstants, IConnectableEditPart {
-
- protected ScrollPane scrollpane;
- protected Label label;
- protected ContainerFigure outerPane;
-
- public IFigure getContentPane() {
- return scrollpane.getContents();
- }
-
- /*
- * (non-Javadoc)
- *
- * @seejava.beans.PropertyChangeListener#propertyChange(java.beans.
- * PropertyChangeEvent)
- */
- public void propertyChange(PropertyChangeEvent evt) {
- String pname = evt.getPropertyName();
- if (AbstractStructuredDataModel.P_CHILDREN.equals(pname)) {
- refreshChildren();
- }
- if (AbstractStructuredDataModel.P_BOUNDS_CHANGE.equals(pname)) {
- refresh();
- }
-
- if (StructuredDataContentModel.P_SOURCE_CONNECTION.equals(pname)) {
- refreshSourceConnections();
- } else if (StructuredDataContentModel.P_TARGET_CONNECTION.equals(pname)) {
- refreshTargetConnections();
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
- */
- protected IFigure createFigure() {
-
- AbstractStructuredDataModel model = (AbstractStructuredDataModel) getModel();
-
- outerPane = new ContainerBoxFigure();
- outerPane.setMinimumSize(new Dimension(100, 100));
- outerPane.setBorder(new RoundedLineBorder(1, 5));
- outerPane.setForegroundColor(groupBorderColor);
- outerPane.setFill(true);
- outerPane.setBackgroundColor(ColorConstants.white);
- ContainerFigure titleFigure = new ContainerFigure(){
- @Override
- protected void fillShape(Graphics graphics) {
- graphics.pushState();
- graphics.setForegroundColor(graphics.getBackgroundColor());
- graphics.setBackgroundColor(ColorConstants.white);
- graphics.fillGradient(getBounds(), true);
- graphics.popState();
- }
- };
- // r.setCornerDimensions(new Dimension(4, 4));
- titleFigure.setOutline(false);
- titleFigure.setMinimumSize(new Dimension(0, 0));
-
- titleFigure.setFill(true);
-
- titleFigure.setBackgroundColor(groupHeaderColor);
- outerPane.add(titleFigure);
-
- label = new Label();
- label.setForegroundColor(ColorConstants.black);
- label.setBorder(new MarginBorder(2, 4, 2, 4));
- titleFigure.add(label); // Holder);
-
- RectangleFigure line = new RectangleFigure();
- line.setPreferredSize(20, 1);
- outerPane.add(line);
-
- int minHeight = 400;
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(250, theMinHeight));
- return d;
- }
- };
-
- outerLayout.setHorizontal(false);
- // layout.setSpacing(5);
- outerPane.setLayoutManager(outerLayout);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC);
- scrollpane.setHorizontalScrollBarVisibility(ScrollPane.AUTOMATIC);
- scrollpane.scrollHorizontalTo(scrollpane.getBounds().width / 2);
- scrollpane.scrollVerticalTo(scrollpane.getBounds().height / 2);
- outerPane.add(scrollpane);
-
- ContainerFigure pane = new ContainerFigure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- AbstractStructuredDataModel currentModel = (AbstractStructuredDataModel) this
- .getModel();
- if (!currentModel.isLeft()) {
- layout.setAlign(PositionConstants.RIGHT);
- }
- pane.setLayoutManager(layout);
- // pane.setBackgroundColor(ColorConstants.black);
- // pane.setFill(true);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.height = Math.min(d.height, theMinHeight - 25);
- return d;
- }
- };
-
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
- if (model instanceof StructuredDataModel) {
- label.setText(((StructuredDataModel) model).getLabelName());
- }
- return outerPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#createEditPolicies()
- */
- protected void createEditPolicies() {
- this.installEditPolicy(EditPolicy.CONTAINER_ROLE,
- new ContainerEditPolicy() {
-
- @Override
- protected Command getCreateCommand(CreateRequest arg0) {
- return null;
- }
-
- });
-
- this.installEditPolicy(EditPolicy.GRAPHICAL_NODE_ROLE,
- new CustomGraphicalNodeEditPolicy());
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelSourceConnections
- * ()
- */
- @Override
- protected List getModelSourceConnections() {
- return ((IConnectableModel) getModel()).getModelSourceConnections();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.gef.editparts.AbstractGraphicalEditPart#getModelTargetConnections
- * ()
- */
- @Override
- protected List getModelTargetConnections() {
- return ((IConnectableModel) getModel()).getModelTargetConnections();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#getModelChildren()
- */
- protected List getModelChildren() {
- return ((AbstractStructuredDataModel) getModel()).getChildren();
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.gef.editparts.AbstractEditPart#refreshVisuals()
- */
- protected void refreshVisuals() {
- Rectangle constraint = null;
- AbstractStructuredDataModel model = (AbstractStructuredDataModel) getModel();
-
- if (model instanceof StructuredDataModel) {
- constraint = ((StructuredDataModel) model).getConstraint();
- }
- if (constraint == null)
- constraint = new Rectangle(0, 0, -1, -1);
- ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
- getFigure(), constraint);
-
- super.refreshVisuals();
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart arg0) {
- return new ContainerRightEdgeAnchor(label);
- }
-
- public ConnectionAnchor getSourceConnectionAnchor(Request arg0) {
- return new RightSourceAnchor(label);
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart arg0) {
- return new ContainerLeftEdgeAnchor(label);
- }
-
- public ConnectionAnchor getTargetConnectionAnchor(Request arg0) {
- return new LeftSourceAnchor(label);
- }
-
- public IFigure getAnchroFigure() {
- return label;
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ConnectionPointFiguresLocationCaculator.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- * @Date Jul 30, 2008
- */
-public class ConnectionPointFiguresLocationCaculator {
- int itemY = 0;
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerBoxFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerBoxFigure extends ContainerFigure implements
- ITreeContainer {
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,52 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.RectangleFigure;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-
-
-public class ContainerFigure extends RectangleFigure implements IExpandable {
-
- protected boolean isOutlined = false;
-
- protected boolean isExpanded = true;
-
- public ContainerFigure() {
- setLayoutManager(new ContainerLayout());
- setFill(false);
- }
-
- public void doLayout() {
- layout();
- setValid(true);
- }
-
- public ContainerLayout getContainerLayout() {
- return (ContainerLayout) getLayoutManager();
- }
-
- public void setOutlined(boolean isOutlined) {
- this.isOutlined = isOutlined;
- }
-
- protected void outlineShape(Graphics graphics) {
- if (isOutlined) {
- super.outlineShape(graphics);
- }
- }
-
-
-
- /* (non-Javadoc)
- * @see org.eclipse.draw2d.RectangleFigure#fillShape(org.eclipse.draw2d.Graphics)
- */
-
- public boolean isExpanded() {
- return isExpanded;
- }
-
- public void setExpanded(boolean isExpanded) {
- this.isExpanded = isExpanded;
- }
-
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerLeftEdgeAnchor.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerLeftEdgeAnchor extends ChopboxAnchor {
-
- public ContainerLeftEdgeAnchor(IFigure owner) {
- super(owner);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.draw2d.ChopboxAnchor#getLocation(org.eclipse.draw2d.geometry
- * .Point)
- */
- @Override
- public Point getLocation(Point reference) {
- Point p;
- IFigure figure = getOwner();
- IFigure parent = findTheTreeContainerFigure(figure);
- // caculate the right edge of parent figure
- if (parent == null)
- return getOwner().getBounds().getLeft();
- p = getOwner().getBounds().getCenter();
- getOwner().translateToAbsolute(p);
- p = getOwner().getBounds().getLeft();
- getOwner().translateToAbsolute(p);
- return new Point(parent.getBounds().x , p.y);
- }
-
- protected IFigure findTheTreeContainerFigure(IFigure figure) {
- if (figure == null)
- return null;
- IFigure parent = figure.getParent();
- if (parent == null)
- return null;
- if (parent instanceof ITreeContainer) {
- return parent;
- } else {
- return findTheTreeContainerFigure(parent);
- }
- }
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ContainerRightEdgeAnchor.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.geometry.Point;
-
-/**
- * @author Dart Peng
- *
- */
-public class ContainerRightEdgeAnchor extends ChopboxAnchor {
-
- public ContainerRightEdgeAnchor(IFigure owner) {
- super(owner);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see
- * org.eclipse.draw2d.ChopboxAnchor#getLocation(org.eclipse.draw2d.geometry
- * .Point)
- */
- @Override
- public Point getLocation(Point reference) {
- Point p;
- IFigure figure = getOwner();
- IFigure parent = findTheTreeContainerFigure(figure);
- // caculate the right edge of parent figure
- if (parent == null)
- return getOwner().getBounds().getRight();
- p = getOwner().getBounds().getCenter();
- getOwner().translateToAbsolute(p);
- p = getOwner().getBounds().getRight();
- getOwner().translateToAbsolute(p);
- return new Point(parent.getBounds().x + parent.getBounds().width, p.y);
- }
-
- protected IFigure findTheTreeContainerFigure(IFigure figure) {
- if (figure == null)
- return null;
- IFigure parent = figure.getParent();
- if (parent == null)
- return null;
- if (parent instanceof ITreeContainer) {
- return parent;
- } else {
- return findTheTreeContainerFigure(parent);
- }
- }
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ExpandableGraphNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,73 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.jboss.tools.smooks.ui.gef.util.figures.Interactor;
-
-
-//--------------------------------------------
-//| ExpandableGraphNodeContentFigure |
-//| |
-//| ---------------------------------- |
-//| | verticalGroup | |
-//| | | |
-//| | ----------------------------- | |
-//| | | horizontalGroup | | |
-//| | | | | |
-//| | | --------------------- | | |
-//| | | | outlinedArea | | | |
-//| | | | ----------------- | | | |
-//| | | | |[+]iconArea | | | | |
-//| | | | ----------------- | | | |
-//| | | | ----------------- | | | |
-//| | | | | innerContent | | | | |
-//| | | | ----------------- | | | |
-//| | | --------------------- | | |
-//| | ----------------------------- | |
-//| | | |
-//| ---------------------------------- |
-//--------------------------------------------
-
-public class ExpandableGraphNodeContentFigure extends GraphNodeContentFigure {
-
- protected IFigure interactor;
-
- public ExpandableGraphNodeContentFigure() {
- super();
- }
-
- public Interactor getInteractor() {
- return (Interactor)interactor;
- }
-
- protected void createFigure() {
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
-// createInteractor(iconArea);
- innerContentArea.setBorder(new MarginBorder(0, 10, 0, 0));
- }
-
- protected void createInteractor(IFigure parent) {
-// interactor = new Interactor();
-// interactor.setBorder(new MarginBorder(0, 0, 0, 5));
-// interactor.setForegroundColor(ColorConstants.black);
-// interactor.setBackgroundColor(ColorConstants.white);
-// parent.add(interactor);
- }
-
- protected void createPreceedingSpace(IFigure parent) {
- RectangleFigure space = new RectangleFigure();
- space.setVisible(false);
- space.setPreferredSize(new Dimension(10, 10));
- parent.add(space);
- }
-
- /**
- */
- public void setInteractor(IFigure interactor) {
- this.interactor = interactor;
- iconArea.add(interactor);
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GraphNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,79 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.jboss.tools.smooks.ui.gef.util.figures.IConnectedFigure;
-
-
-//------------------------------
-//| GraphNodeContentFigure |
-//| |
-//| ------------------------- |
-//| | vertical group | |
-//| | --------------------- | |
-//| | | outlined area | | |
-//| | | ----------------- | | |
-//| | | | icon area | | | |
-//| | | ----------------- | | |
-//| | | ----------------- | | |
-//| | | | inner content | | | |
-//| | | ----------------- | | |
-//| | --------------------- | |
-//| ------------------------- |
-//------------------------------
-
-public class GraphNodeContentFigure extends ContainerFigure implements IConnectedFigure {
-
- protected ContainerFigure verticalGroup;
- protected ContainerFigure outlinedArea;
- protected ContainerFigure iconArea;
- protected ContainerFigure innerContentArea;
-
- public GraphNodeContentFigure() {
- createFigure();
- }
-
- public IFigure getConnectionFigure() {
- return outlinedArea;
- }
-
- public ContainerFigure getIconArea() {
- return iconArea;
- }
-
- public ContainerFigure getOutlinedArea() {
- return outlinedArea;
- }
-
- public ContainerFigure getInnerContentArea() {
- return innerContentArea;
- }
-
- protected void createFigure() {
- createVerticalGroup(this);
- createOutlinedArea(verticalGroup);
- }
-
- protected void createVerticalGroup(IFigure parent) {
- verticalGroup = new ContainerFigure();
- verticalGroup.getContainerLayout().setHorizontal(false);
- parent.add(verticalGroup);
- }
-
- protected void createOutlinedArea(IFigure parent) {
- outlinedArea = new ContainerFigure();
- outlinedArea.getContainerLayout().setHorizontal(false);
-// outlinedArea.setBackgroundColor(ColorConstants.red);
-// outlinedArea.setFill(true);
- parent.add(outlinedArea);
-
- iconArea = new IconAreaFigure();
- iconArea.getContainerLayout().setHorizontal(true);
- outlinedArea.add(iconArea);
-
- innerContentArea = new ContainerFigure();
- innerContentArea.getContainerLayout().setHorizontal(false);
-// innerContentArea.setBackgroundColor(ColorConstants.red);
-// innerContentArea.setFill(true);
- outlinedArea.add(innerContentArea);
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/GroupFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,153 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.MarginBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.ScrollPane;
-import org.eclipse.draw2d.Viewport;
-import org.eclipse.draw2d.ViewportLayout;
-import org.eclipse.draw2d.geometry.Dimension;
-import org.eclipse.swt.SWT;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-import org.jboss.tools.smooks.ui.gef.util.figures.FillLayout;
-
-
-//----------------------------------
-//| GroupFigure Head Area |
-//| |
-//| ----------------------------- |
-//| | | |
-//| | GroupFigure Client Area | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| | | |
-//| ----------------------------- |
-//----------------------------------
-public class GroupFigure extends RectangleFigure implements GraphicsConstants {
-
- private static final int DEFAULT_MIN_HEIGHT = 250;
-
- protected ScrollPane scrollpane;
- /**
- * Text Name
- */
- protected Label label;
- protected ContainerFigure outerPane;
-
- public GroupFigure() {
-
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(100, DEFAULT_MIN_HEIGHT));
- return d;
- }
- };
- setLayoutManager(outerLayout);
- setFill(false);
- createFigure();
- }
-
- public void doLayout() {
- layout();
- setValid(true);
- }
-
- public FillLayout getFillLayout() {
- return (FillLayout)getLayoutManager();
- }
-
- protected void createFigure() {
- outerPane = new ContainerFigure();
- outerPane.setBorder(new RoundedLineBorder(1, 6));
- outerPane.setForegroundColor(groupBorderColor);
-
- ContainerFigure r = new ContainerFigure();
- //r.setCornerDimensions(new Dimension(4, 4));
- r.setOutline(false);
- r.setMinimumSize(new Dimension(0, 0));
-
- r.setFill(true);
-
- r.setBackgroundColor(groupHeaderColor);
- outerPane.add(r);
-
- //ContainerFigure labelHolder = new ContainerFigure();
- //labelHolder.add(label);
- label = new Label();
- label.setForegroundColor(ColorConstants.black);
- label.setBorder(new MarginBorder(2, 4, 2, 4));
- r.add(label); //Holder);
-// label.setTextAlignment(PositionConstants.RIGHT);
- RectangleFigure line = new RectangleFigure();
- line.setPreferredSize(20, 1);
- outerPane.add(line);
-
- int minHeight = 250;
- final int theMinHeight = minHeight;
- FillLayout outerLayout = new FillLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.union(new Dimension(100, theMinHeight));
- return d;
- }
- };
-
- outerLayout.setHorizontal(false);
-// outerLayout.setSpacing(10);
- outerPane.setLayoutManager(outerLayout);
-
- scrollpane = new ScrollPane();
- scrollpane.setForegroundColor(ColorConstants.black);
- scrollpane.setVerticalScrollBarVisibility(ScrollPane.AUTOMATIC); //ScrollPane.ALWAYS);
- outerPane.add(scrollpane);
-
- ContainerFigure pane = new ContainerFigure();
- pane.setBorder(new MarginBorder(5, 8, 5, 8));
- ContainerLayout layout = new ContainerLayout();
- layout.setHorizontal(false);
- layout.setSpacing(0);
- pane.setLayoutManager(layout);
-
- Viewport viewport = new Viewport();
- viewport.setContentsTracksHeight(true);
- ViewportLayout viewportLayout = new ViewportLayout() {
- protected Dimension calculatePreferredSize(IFigure parent,
- int width, int height) {
- Dimension d = super.calculatePreferredSize(parent, width,
- height);
- d.height = Math.min(d.height, theMinHeight - 25); // getViewer().getControl().getBounds().height);
- return d;
- }
- };
-
- viewport.setLayoutManager(viewportLayout);
-
- scrollpane.setViewport(viewport);
- scrollpane.setContents(pane);
-
- this.add(outerPane);
- }
-
- public void setTextName(String name) {
- label.setText(name);
- }
-
- /**
- * @return
- */
- public String getTextName() {
- return label == null ? null : label.getText();
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IExpandable.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,9 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-
-public interface IExpandable extends IFigure {
- boolean isExpanded();
-
- void setExpanded(boolean isExpanded);
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/ITreeContainer.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- */
-public interface ITreeContainer {
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/IconAreaFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-
-/**
- * @author Dart Peng
- *
- */
-public class IconAreaFigure extends ContainerFigure {
-
- public IconAreaFigure() {
- setLayoutManager(new RightAlignContainerLayout());
- setFill(false);
- }
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/LabelAreaFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-/**
- * @author Dart Peng
- *
- * @CreateTime Jul 21, 2008
- */
-public class LabelAreaFigure extends ContainerFigure {
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RightAlignContainerLayout.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.PositionConstants;
-import org.jboss.tools.smooks.ui.gef.util.figures.ContainerLayout;
-
-/**
- * @author Dart Peng
- *
- */
-public class RightAlignContainerLayout extends ContainerLayout {
-
- public RightAlignContainerLayout() {
- super();
- this.setAlign(PositionConstants.RIGHT);
- this.setHorizontal(false);
- }
-
- @Override
- public void layout(IFigure parent) {
- super.layout(parent);
- }
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/RoundedLineBorder.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,51 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.swt.graphics.Color;
-
-public class RoundedLineBorder extends LineBorder {
- protected int arcLength;
-
- protected int lineStyle = Graphics.LINE_SOLID;
-
- public RoundedLineBorder(Color c, int width, int arcLength) {
- super(c, width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(int width, int arcLength) {
- super(width);
- this.arcLength = arcLength;
- }
-
- public RoundedLineBorder(Color c, int width, int arcLength, int lineStyle) {
- super(c, width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public RoundedLineBorder(int width, int arcLength, int lineStyle) {
- super(width);
- this.arcLength = arcLength;
- this.lineStyle = lineStyle;
- }
-
- public void paint(IFigure figure, Graphics graphics, Insets insets) {
- tempRect.setBounds(getPaintRectangle(figure, insets));
- int width = getWidth();
- Color color = getColor();
- if (width % 2 == 1) {
- tempRect.width--;
- tempRect.height--;
- }
- tempRect.shrink(width / 2, width / 2);
- graphics.setLineWidth(width);
- graphics.setLineStyle(lineStyle);
- if (color != null)
- graphics.setForegroundColor(color);
- graphics.drawRoundRectangle(tempRect, arcLength, arcLength);
- }
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SourceConnectionDecoration.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.Figure;
-
-/**
- * @author Dart Peng
- *
- */
-public class SourceConnectionDecoration extends Figure {
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/SpacingFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,11 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.RectangleFigure;
-import org.eclipse.draw2d.geometry.Dimension;
-
-public class SpacingFigure extends RectangleFigure {
- public SpacingFigure() {
- setFill(false);
- setPreferredSize(new Dimension(0, 0));
- }
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/figures/TreeNodeContentFigure.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,77 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.figures;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.draw2d.MarginBorder;
-import org.jboss.tools.smooks.ui.gef.util.GraphicsConstants;
-
-/**
- *
- * @author Dart Peng
- *
- * @CreateTime Jul 21, 2008
- */
-public class TreeNodeContentFigure extends ExpandableGraphNodeContentFigure
- implements ISelectableFigure {
-
- private boolean selected = false;
-
- /**
- * @return the selected
- */
- public boolean getSelected() {
- return selected;
- }
-
- /**
- * @param selected
- * the selected to set
- */
- public void setSelected(boolean selected) {
- this.selected = selected;
- this.repaint();
- }
-
- /**
- * @return the focus
- */
- public boolean getFocus() {
- return focus;
- }
-
- /**
- * @param focus
- * the focus to set
- */
- public void setFocus(boolean focus) {
- this.focus = focus;
- }
-
- private boolean focus = false;
-
- public IFigure getConnectionFigure() {
- return outlinedArea;
- }
-
- protected void createOutlinedArea(IFigure parent) {
- super.createOutlinedArea(parent);
- outlinedArea.setBorder(new MarginBorder(0, 2, 0, 2));
- }
-
- protected void fillShape(Graphics graphics) {
- super.fillShape(graphics);
- }
-
- public void paintFigure(Graphics graphics){
- super.paintFigure(graphics);
- ContainerFigure figure = this.getIconArea();
- if (this.selected) {
- figure.setFill(true);
- figure.setBackgroundColor(GraphicsConstants.groupHeaderColor);
- } else {
- figure.setFill(false);
- figure.setBackgroundColor(ColorConstants.white);
- }
- }
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/DataObjectContainerModel.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,41 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.model;
-
-import org.eclipse.draw2d.geometry.Rectangle;
-
-/**
- * @deprecated
- *
- */
-public class DataObjectContainerModel extends AbstractStructuredDataModel {
-
- public static final int SOURCE_DATA_OBJECT_CONTAINER = 1;
- public static final int TARGET_DATA_OBJECT_CIBTAUBER = 2;
-
- private String name;
- private Rectangle constraint;
- private int category = -1;
-
- public int getCategory() {
- return category;
- }
-
- public void setCategory(int category) {
- this.category = category;
- }
-
- public Rectangle getConstraint() {
- return constraint;
- }
-
- public void setConstraint(Rectangle constraint) {
- this.constraint = constraint;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-}
\ No newline at end of file
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/model/HiddenAreaModel.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.smooks.ui.gef.model;
-
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author Dart Peng
- *
- */
-public class HiddenAreaModel extends AbstractStructuredDataModel {
-
- @Override
- public List getChildren() {
- return Collections.EMPTY_LIST;
- }
-
-}
Deleted: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/NodeSelectionHandlesEditPolicyImpl.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,32 +0,0 @@
-package org.jboss.tools.smooks.ui.gef.policy;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.draw2d.IFigure;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy;
-import org.eclipse.gef.handles.MoveHandle;
-import org.eclipse.gef.handles.MoveHandleLocator;
-import org.jboss.tools.smooks.ui.gef.editparts.StructuredDataContentEditPart;
-
-public class NodeSelectionHandlesEditPolicyImpl extends SelectionHandlesEditPolicy {
-
- protected List createSelectionHandles() {
-
- List list = new ArrayList();
- EditPart editPart = getHost();
-
- if ( editPart instanceof GraphicalEditPart ) {
- GraphicalEditPart graphicalEditPart = (GraphicalEditPart)editPart;
- IFigure figure = (graphicalEditPart instanceof StructuredDataContentEditPart ) ?
- ((StructuredDataContentEditPart)graphicalEditPart).getSelectionFigure() : graphicalEditPart.getFigure();
-
- MoveHandleLocator loc = new MoveHandleLocator(figure);
- MoveHandle moveHandle = new MoveHandle(graphicalEditPart, loc);
- list.add(moveHandle);
- }
- return list;
- }
-}
\ No newline at end of file
Modified: branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-20 23:12:16 UTC (rev 11023)
+++ branches/jbosstools-3.0.0.Beta1/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/gef/policy/RootGraphicsXYLayoutEditPolicy.java 2008-10-21 03:41:10 UTC (rev 11024)
@@ -1,6 +1,5 @@
package org.jboss.tools.smooks.ui.gef.policy;
-import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
import org.eclipse.gef.GraphicalEditPart;
@@ -10,10 +9,8 @@
import org.eclipse.gef.editpolicies.XYLayoutEditPolicy;
import org.eclipse.gef.requests.ChangeBoundsRequest;
import org.eclipse.gef.requests.CreateRequest;
-import org.jboss.tools.smooks.ui.gef.commands.ChangeConstraintCommand;
import org.jboss.tools.smooks.ui.gef.commands.CommandMappingFactory;
import org.jboss.tools.smooks.ui.gef.commands.ICommandMappingFactory;
-import org.jboss.tools.smooks.ui.gef.model.IGraphicalModel;
@@ -55,15 +52,16 @@
@Override
protected Command createChangeConstraintCommand(EditPart child,
Object constraint) {
- Rectangle con = (Rectangle) constraint;
- Object model = child.getModel();
- ChangeConstraintCommand command = null;
- if (model instanceof IGraphicalModel) {
- command = new ChangeConstraintCommand();
- command.setConstraint(con);
- command.setGraphicalModel((IGraphicalModel) model);
- }
- return command;
+// Rectangle con = (Rectangle) constraint;
+// Object model = child.getModel();
+// ChangeConstraintCommand command = null;
+// if (model instanceof IGraphicalModel) {
+// command = new ChangeConstraintCommand();
+// command.setConstraint(con);
+// command.setGraphicalModel((IGraphicalModel) model);
+// }
+// return command;
+ return null;
}
@Override
16 years, 2 months
JBoss Tools SVN: r11023 - branches/jbosstools-3.0.0.Beta1/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-20 19:12:16 -0400 (Mon, 20 Oct 2008)
New Revision: 11023
Modified:
branches/jbosstools-3.0.0.Beta1/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2424 fixed
Modified: branches/jbosstools-3.0.0.Beta1/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- branches/jbosstools-3.0.0.Beta1/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-20 23:10:54 UTC (rev 11022)
+++ branches/jbosstools-3.0.0.Beta1/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-20 23:12:16 UTC (rev 11023)
@@ -123,7 +123,7 @@
do {
line = contentReader.readLine();
if(line!=null && !patternIsFound) {
- patternIsFound = line.matches(pattern);
+ patternIsFound = line.trim().matches(pattern);
}
} while (line != null && !patternIsFound);
return patternIsFound;
16 years, 2 months
JBoss Tools SVN: r11022 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-20 19:10:54 -0400 (Mon, 20 Oct 2008)
New Revision: 11022
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2424 fixed
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-20 22:45:41 UTC (rev 11021)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-20 23:10:54 UTC (rev 11022)
@@ -123,7 +123,7 @@
do {
line = contentReader.readLine();
if(line!=null && !patternIsFound) {
- patternIsFound = line.matches(pattern);
+ patternIsFound = line.trim().matches(pattern);
}
} while (line != null && !patternIsFound);
return patternIsFound;
16 years, 2 months
JBoss Tools SVN: r11021 - branches/jbosstools-3.0.0.Beta1/as.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-20 18:45:41 -0400 (Mon, 20 Oct 2008)
New Revision: 11021
Added:
branches/jbosstools-3.0.0.Beta1/as/as/
Log:
merging AS Tools
Copied: branches/jbosstools-3.0.0.Beta1/as/as (from rev 11020, trunk/as)
16 years, 2 months
JBoss Tools SVN: r11020 - branches/jbosstools-3.0.0.Beta1/archives.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-20 18:45:17 -0400 (Mon, 20 Oct 2008)
New Revision: 11020
Added:
branches/jbosstools-3.0.0.Beta1/archives/archives/
Log:
merging all
Copied: branches/jbosstools-3.0.0.Beta1/archives/archives (from rev 11019, trunk/archives)
16 years, 2 months
JBoss Tools SVN: r11019 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: dialogs and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-20 18:30:16 -0400 (Mon, 20 Oct 2008)
New Revision: 11019
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
Log:
JBIDE-2235
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-10-20 22:05:56 UTC (rev 11018)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.java 2008-10-20 22:30:16 UTC (rev 11019)
@@ -221,10 +221,11 @@
public static String EditorCPD_Value;
public static String EditorCPD_DefaultShellTitle;
public static String EditorCPD_DefaultDescription;
+ public static String EditorCPD_RestoreDefault;
- public static String Customize;
+ public static String Configure;
// misc
public static String ServerSaveFailed;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-10-20 22:05:56 UTC (rev 11018)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/Messages.properties 2008-10-20 22:30:16 UTC (rev 11019)
@@ -199,7 +199,8 @@
EditorCPD_Value=Current Value
EditorCPD_DefaultShellTitle=Edit Port
EditorCPD_DefaultDescription=This wizard allows you to edit which xpath is used to locate a port used by the tooling.\nThis will not change any server files, only what ports are used to interact with it.
-Customize=Customize...
+EditorCPD_RestoreDefault=Restore Default
+Configure=Configure...
# misc
ServerSaveFailed=Server save failed
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java 2008-10-20 22:05:56 UTC (rev 11018)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ChangePortDialog.java 2008-10-20 22:30:16 UTC (rev 11019)
@@ -34,7 +34,7 @@
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
public class ChangePortDialog extends TitleAreaDialog {
-
+ private static final int RESTORE_DEFAULT = 35;
public static class ChangePortDialogInfo {
public String port;
public String defaultValue;
@@ -71,6 +71,7 @@
: Messages.EditorCPD_DefaultDescription);
getShell().setText(info.shellTitle != null ? info.shellTitle
: Messages.EditorCPD_DefaultShellTitle);
+ selectionChanged();
return c;
}
@@ -118,7 +119,7 @@
String[] stuff = (String[]) list.toArray(new String[list.size()]);
listWidget.setItems(stuff);
for( int i = 0; i < stuff.length; i++ )
- if( stuff[i] == info.currentXPath)
+ if( stuff[i].equals(info.currentXPath))
listWidget.select(i);
}
@@ -223,4 +224,21 @@
public String getSelection() {
return selected;
}
+
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ createButton(parent, RESTORE_DEFAULT, Messages.EditorCPD_RestoreDefault, false);
+ }
+
+ protected void buttonPressed(int buttonId) {
+ super.buttonPressed(buttonId);
+ if( RESTORE_DEFAULT == buttonId) {
+ String[] items = listWidget.getItems();
+ for( int i = 0; i < items.length; i++ )
+ if( items[i].equals(info.defaultValue)) {
+ listWidget.select(i);
+ return;
+ }
+ }
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2008-10-20 22:05:56 UTC (rev 11018)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/PortSection.java 2008-10-20 22:30:16 UTC (rev 11019)
@@ -91,7 +91,7 @@
return new SetPortCommand(helper.getWorkingCopy(), helper, Messages.EditorChangeJNDICommandName,
IJBossServerConstants.JNDI_PORT, IJBossServerConstants.JNDI_PORT_DETECT,
IJBossServerConstants.JNDI_PORT_DETECT_XPATH, IJBossServerConstants.JNDI_PORT_DEFAULT_XPATH,
- text, detect, currentXPath, listener);
+ this);
}
protected ChangePortDialogInfo getDialogInfo() {
ChangePortDialogInfo info = new ChangePortDialogInfo();
@@ -114,7 +114,7 @@
return new SetPortCommand(helper.getWorkingCopy(), helper, Messages.EditorChangeWebCommandName,
IJBossServerConstants.WEB_PORT, IJBossServerConstants.WEB_PORT_DETECT,
IJBossServerConstants.WEB_PORT_DETECT_XPATH, IJBossServerConstants.WEB_PORT_DEFAULT_XPATH,
- text, detect, currentXPath, listener);
+ this);
}
protected ChangePortDialogInfo getDialogInfo() {
ChangePortDialogInfo info = new ChangePortDialogInfo();
@@ -187,12 +187,13 @@
label.setText(labelText);
detect.setText(Messages.EditorAutomaticallyDetectPort);
- link.setText("<a href=\"\">" + Messages.Customize + "</a>");
+ link.setText("<a href=\"\">" + Messages.Configure + "</a>");
return child;
}
protected void initialize() {
boolean shouldDetect = helper.getAttribute(detectXPathKey, true);
detect.setSelection(shouldDetect);
+ link.setEnabled(shouldDetect);
text.setEnabled(!shouldDetect);
text.setEditable(!shouldDetect);
currentXPath = helper.getAttribute(currentXPathKey, defaultXPath);
@@ -315,19 +316,21 @@
Button button;
Listener listener;
String xpath;
+ Link link;
public SetPortCommand(IServerWorkingCopy server, ServerAttributeHelper helper, String name,
String textAttribute, String overrideAttribute, String overridePathAttribute,
- String pathDefault, Text text, Button button, String xpath, Listener listener) {
+ String pathDefault, PortEditorExtension ext) { //Text text, Button button, String xpath, Listener listener) {
super(server, name);
this.helper = helper;
this.textAttribute = textAttribute;
this.overrideAttribute = overrideAttribute;
this.overridePathAttribute = overridePathAttribute;
this.defaultPath = pathDefault;
- this.text = text;
- this.button = button;
- this.listener = listener;
- this.xpath = xpath;
+ this.text = ext.text;
+ this.button = ext.detect;
+ this.listener = ext.listener;
+ this.xpath = ext.currentXPath;
+ this.link = ext.link;
}
public void execute() {
@@ -338,6 +341,7 @@
preOverride = helper.getAttribute(overrideAttribute, true);
helper.setAttribute(textAttribute, text.getText());
helper.setAttribute(overrideAttribute, button.getSelection());
+ link.setEnabled(button.getSelection());
helper.setAttribute(overridePathAttribute, xpath);
text.setEnabled(!button.getSelection());
@@ -353,8 +357,9 @@
// set new values
helper.setAttribute(textAttribute, preText);
helper.setAttribute(overrideAttribute, preOverride);
+ link.setEnabled(preOverride);
helper.setAttribute(overridePathAttribute, prePath);
-
+
// update ui
text.removeListener(SWT.Modify, listener);
button.removeListener(SWT.Selection, listener);
16 years, 2 months
JBoss Tools SVN: r11018 - in trunk/common/tests/org.jboss.tools.common.text.ext.test: src/org/jboss/tools/common/text/ext/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-20 18:05:56 -0400 (Mon, 20 Oct 2008)
New Revision: 11018
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2890 fixed, JUnit Test added
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-20 21:14:12 UTC (rev 11017)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-20 22:05:56 UTC (rev 11018)
@@ -4,10 +4,8 @@
<jsp:getProperty property="property1" name="b1"/>
<jsp:setProperty property="property2" name="b1"/>
<html>
- <head>
- <link rel="" >
- </head>
-
-<a href="classHyperlinkTests.jsp">test</a>
+<body>
+ <a href="classHyperlinkTests.jsp">${b1.property2}</a>
+</body>
+</html>
-
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp 2008-10-20 21:14:12 UTC (rev 11017)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspXmlFormatTests.jsp 2008-10-20 22:05:56 UTC (rev 11018)
@@ -15,7 +15,7 @@
</head>
<body>
<f:view>
-
+ <jsp:attribute name="locale">ru</jsp:attribute>
</f:view>
</body>
</html>
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml 2008-10-20 22:05:56 UTC (rev 11018)
@@ -0,0 +1,19 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:s="http://jboss.com/products/seam/taglib">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <title>s1</title>
+ <link href="stylesheet/style1.css" rel="stylesheet" type="text/css" />
+</head>
+
+<body>
+ <f:view>
+ <h:outputText value="test" styleClass="style-class1" />
+ </f:view>
+</body>
+</html>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/xhtmlStyleClassHiperlinkTests.xhtml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-20 21:14:12 UTC (rev 11017)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-20 22:05:56 UTC (rev 11018)
@@ -533,4 +533,28 @@
ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
assertEquals("<name>", selection.getText());
}
+
+ public static final String XHTML_STYLE_CLASS_NAME_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/xhtmlStyleClassHiperlinkTests.xhtml";
+
+
+ public void testFacletsStyleClassOpenOnJbide2890() throws BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(XHTML_STYLE_CLASS_NAME_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "style-class1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("style1.css".equals(fileName));
+ }
}
16 years, 2 months
JBoss Tools SVN: r11017 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-20 17:14:12 -0400 (Mon, 20 Oct 2008)
New Revision: 11017
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java
Log:
JBIDE-2214
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java 2008-10-20 19:55:38 UTC (rev 11016)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/descriptors/XPathPropertyLabelProvider.java 2008-10-20 21:14:12 UTC (rev 11017)
@@ -64,7 +64,7 @@
if( element instanceof XPathResultNode ) {
XPathResultNode element2 = (XPathResultNode)element;
if( columnIndex == 0 ) return Messages.DescriptorXPathMatch + element2.getIndex();
- if( columnIndex == 1 ) return element2.getText();
+ if( columnIndex == 1 ) return element2.getText().trim();
}
return null;
16 years, 2 months