JBoss Tools SVN: r8410 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-28 13:30:26 -0400 (Wed, 28 May 2008)
New Revision: 8410
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-05-28 16:02:26 UTC (rev 8409)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-05-28 17:30:26 UTC (rev 8410)
@@ -132,6 +132,14 @@
int start = 0;
+ if (exc != null) {
+ g.setBackgroundColor(exceptionBackgroundColor);
+ g.setForegroundColor(exceptionForegroundColor);
+ } else {
+ g.setBackgroundColor(lightGrayColor);
+ }
+
+ g.fillRectangle(0, 0, r.width, r.height);
g.setBackgroundColor(whiteColor);
@@ -140,13 +148,14 @@
if (icon != null)
g.drawImage(icon, start + 4, 2);
-
- if (exc != null /*&& group.isConfirmed()*/) {
- g.setBackgroundColor(exceptionBackgroundColor);
- g.setForegroundColor(exceptionForegroundColor);
- } else {
- g.setBackgroundColor(lightGrayColor);
+ if(exc != null){
+ g.setFont(exceptionFont);
+ if(exc.getName() != null)
+ g.drawString(exc.getName(), 27, 3);
+ else
+ g.drawString("Exception", 27, 3);
}
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-05-28 16:02:26 UTC (rev 8409)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-05-28 17:30:26 UTC (rev 8410)
@@ -10,7 +10,9 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor.figures;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.jboss.tools.common.gef.figures.xpl.BaseNodeFigure;
import org.jboss.tools.common.model.ui.ModelUIImages;
@@ -54,6 +56,8 @@
public static final Color exceptionBackgroundColor = new Color(null, 0xff, 0xe3, 0xe7);
public static final Color exceptionForegroundColor = new Color(null, 0x99, 0x07, 0x02);
+
+ public static final Font exceptionFont = new Font(null, "default", 8, SWT.BOLD);
public static final Image errorIcon = ModelUIImages
.getImage("error_co.gif");
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-28 16:02:26 UTC (rev 8409)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-28 17:30:26 UTC (rev 8410)
@@ -143,6 +143,7 @@
if (group != null) {
// setIcon(group.getImage());
setPath(group.getName());
+ init(group.getOutputLinks().size());
}
setOpaque(false);
16 years
JBoss Tools SVN: r8409 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages: resources and 8 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-28 12:02:26 -0400 (Wed, 28 May 2008)
New Revision: 8409
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/exception.gif
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/shortcut.gif
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/transition.gif
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/view.gif
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/exception.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/exception.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/shortcut.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/shortcut.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/transition.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/transition.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/view.gif
===================================================================
(Binary files differ)
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/resources/org/jboss/tools/seam/ui/pages/editor/icons/view.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years
JBoss Tools SVN: r8408 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor: edit and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2008-05-28 12:01:26 -0400 (Wed, 28 May 2008)
New Revision: 8408
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1189
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-05-28 14:47:27 UTC (rev 8407)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/PagesEditor.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -113,6 +113,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModelListener;
import org.jboss.tools.seam.ui.pages.editor.edit.GraphicalPartFactory;
+import org.jboss.tools.seam.ui.pages.editor.edit.xpl.PagesConnectionRouter;
import org.jboss.tools.seam.ui.pages.editor.palette.PagesPaletteViewerPreferences;
public class PagesEditor extends GEFEditor implements PagesModelListener{
@@ -420,10 +421,10 @@
// (TransferDropTargetListener) new JSFTemplateTransferDropTargetListener(
// getGraphicalViewer()));
-// ((ConnectionLayer) ((ScalableFreeformRootEditPart) getGraphicalViewer()
-// .getRootEditPart())
-// .getLayer(ScalableFreeformRootEditPart.CONNECTION_LAYER))
-// .setConnectionRouter(new JSFConnectionRouter());
+ ((ConnectionLayer) ((ScalableFreeformRootEditPart) getGraphicalViewer()
+ .getRootEditPart())
+ .getLayer(ScalableFreeformRootEditPart.CONNECTION_LAYER))
+ .setConnectionRouter(new PagesConnectionRouter());
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE,
Boolean.TRUE);
getGraphicalViewer().setProperty(SnapToGrid.PROPERTY_GRID_ENABLED,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 14:47:27 UTC (rev 8407)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -116,10 +116,23 @@
private PagesModel getFakeModel(){
PagesModel model = PagesFactory.eINSTANCE.createPagesModel();
+
+ Link link = PagesFactory.eINSTANCE.createLink();
+
+ link.setName("page1");
+
+ PgException ex = PagesFactory.eINSTANCE.createPgException();
+ ex.setName("Exception");
+ ex.setLocation(new Point(10,100));
+ ex.setSize(new Dimension(300,21));
+ ex.getOutputLinks().add(link);
+ model.getChildren().add(ex);
+
Page page = PagesFactory.eINSTANCE.createPage();
page.setName("page1");
- page.setLocation(new Point(10,10));
+ page.setLocation(new Point(500,150));
page.setSize(new Dimension(100,100));
+ page.getInputLinks().add(link);
model.getChildren().add(page);
return model;
}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/ExceptionEditPart.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -0,0 +1,243 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor.edit;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.*;
+
+import org.eclipse.draw2d.ConnectionAnchor;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.jboss.tools.common.model.ui.dnd.DnDUtil;
+import org.eclipse.gef.*;
+import org.eclipse.gef.requests.DropRequest;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+
+import org.jboss.tools.common.meta.action.XAction;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
+import org.jboss.tools.seam.ui.pages.editor.figures.ExceptionFigure;
+import org.jboss.tools.seam.ui.pages.editor.figures.PageFigure;
+
+public class ExceptionEditPart extends PagesEditPart implements PropertyChangeListener, EditPartListener, Adapter {
+ private ExceptionFigure fig = null;
+
+ private boolean single = true;
+
+ public boolean isSingle() {
+ return single;
+ }
+
+ public void doControlUp() {
+ }
+
+ public void doControlDown() {
+ }
+
+ public void doMouseHover(boolean cf) {
+ }
+
+ public void childAdded(EditPart child, int index) {
+ }
+
+ public void partActivated(EditPart editpart) {
+ }
+
+ public void partDeactivated(EditPart editpart) {
+ }
+
+ public void removingChild(EditPart child, int index) {
+ }
+
+ public void selectedStateChanged(EditPart editpart) {
+ if (this.getSelected() == EditPart.SELECTED_PRIMARY) {
+ ((PagesDiagramEditPart) ExceptionEditPart.this.getParent())
+ .setToFront(this);
+
+ }
+ }
+
+ public boolean isGroupListenerEnable() {
+ return true;
+ }
+
+
+
+ private void refreshTargetLink(Link link) {
+ if (link == null)
+ return;
+ ExceptionEditPart gep = (ExceptionEditPart) getViewer().getEditPartRegistry()
+ .get(link.getToElement());
+ if (gep == null)
+ return;
+ gep.refreshTargetConnections();
+ }
+
+
+ protected AccessibleEditPart createAccessible() {
+ return new AccessibleGraphicalEditPart() {
+
+ public void getName(AccessibleEvent e) {
+ e.result = "EditPart";
+ }
+
+ public void getValue(AccessibleControlEvent e) {
+ }
+
+ };
+ }
+
+ protected List getModelTargetConnections() {
+ return getExceptionModel().getInputLinks();
+ }
+
+ protected List getModelSourceConnections() {
+ return getExceptionModel().getOutputLinks();
+ }
+
+ protected void createEditPolicies() {
+ super.createEditPolicies();
+ installEditPolicy(EditPolicy.NODE_ROLE, null);
+ installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, null);
+ //installEditPolicy(EditPolicy.COMPONENT_ROLE, new PageEditPolicy());
+ //installEditPolicy(EditPolicy.LAYOUT_ROLE, new JSFFlowEditPolicy());
+ //installEditPolicy(EditPolicy.CONNECTION_ENDPOINTS_ROLE,
+ // new PageEditPolicy());
+ }
+
+ /**
+ * Returns a newly created Figure to represent this.
+ *
+ * @return Figure of this.
+ */
+
+ protected IFigure createFigure() {
+ fig = new ExceptionFigure(getExceptionModel());
+ ((ExceptionFigure) fig).setEditPart(this);
+ return fig;
+ }
+
+ /**
+ * Returns the model of this as a LED.
+ *
+ * @return Model of this as an LED.
+ */
+ public PgException getExceptionModel() {
+ return (PgException) getModel();
+ }
+
+ Dimension size;
+
+
+
+ protected void refreshVisuals() {
+ Point loc = getExceptionModel().getLocation();
+ size = new Dimension(150, 21);
+ loc.x -= loc.x % 8;
+ loc.y -= loc.y % 8;
+
+ Rectangle r = new Rectangle(loc, size);
+
+ ((GraphicalEditPart) getParent()).setLayoutConstraint(this,
+ getFigure(), r);
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(
+ ConnectionEditPart connEditPart) {
+ ConnectionAnchor anc = getNodeFigure().getConnectionAnchor("1_IN");
+ return anc;
+ }
+
+ public ConnectionAnchor getTargetConnectionAnchor(Request request) {
+ Point pt = new Point(((DropRequest) request).getLocation());
+ return getNodeFigure().getTargetConnectionAnchorAt(pt);
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(
+ ConnectionEditPart connEditPart) {
+ if (single) {
+ Link link = (Link) connEditPart.getModel();
+ int index = getExceptionModel().getOutputLinks().indexOf(link);
+ return getNodeFigure().getConnectionAnchor((index + 1) + "_OUT");
+ } else
+ return super.getSourceConnectionAnchor(connEditPart);
+ }
+
+ public ConnectionAnchor getSourceConnectionAnchor(Request request) {
+ if (single) {
+ Point pt = new Point(((DropRequest) request).getLocation());
+ return getNodeFigure().getSourceConnectionAnchorAt(pt);
+ } else
+ return super.getSourceConnectionAnchor(request);
+ }
+
+ protected List getModelChildren() {
+ return getExceptionModel().getChildren();
+ }
+
+ protected void refreshChildren() {
+ super.refreshChildren();
+ for (int i = 0; i < getChildren().size(); i++) {
+ ((ExceptionEditPart) getChildren().get(i)).refresh();
+
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.EditPart#activate()
+ */
+ public void activate() {
+ if (isActive())
+ return;
+ ((Notifier) getModel()).eAdapters().add(this);
+ super.activate();
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#notifyChanged(org.eclipse.emf.common.notify.Notification)
+ */
+ public void notifyChanged(Notification notification) {
+ refresh();
+ refreshVisuals();
+ }
+ /**
+ * )
+ *
+ * @see org.eclipse.emf.common.notify.Adapter#getTarget()
+ */
+ public Notifier getTarget() {
+
+ return null;
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#isAdapterForType(java.lang.Object)
+ */
+ public boolean isAdapterForType(Object type) {
+ return false;
+ }
+
+ /**
+ * @see org.eclipse.emf.common.notify.Adapter#setTarget(org.eclipse.emf.common.notify.Notifier)
+ */
+ public void setTarget(Notifier newTarget) {
+ }
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java 2008-05-28 14:47:27 UTC (rev 8407)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/edit/GraphicalPartFactory.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -15,6 +15,7 @@
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
public class GraphicalPartFactory implements EditPartFactory {
@@ -27,6 +28,8 @@
child = new PagesDiagramEditPart();
else if (model instanceof Page)
child = new PageEditPart();
+ else if (model instanceof PgException)
+ child = new ExceptionEditPart();
else if (model instanceof Link)
child = new LinkEditPart();
Added: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/ExceptionFigure.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.pages.editor.figures;
+
+import org.eclipse.draw2d.Graphics;
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.LineBorder;
+import org.eclipse.draw2d.MouseEvent;
+import org.eclipse.draw2d.XYLayout;
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.draw2d.geometry.Insets;
+import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gef.handles.HandleBounds;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.jboss.tools.common.gef.GEFGraphicalViewer;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
+import org.jboss.tools.seam.ui.pages.editor.edit.ExceptionEditPart;
+import org.jboss.tools.seam.ui.pages.editor.figures.xpl.FixedConnectionAnchor;
+
+public class ExceptionFigure extends NodeFigure implements HandleBounds {
+ private static final Dimension SIZE = new Dimension(56, 100);
+
+ private Image icon = null;
+
+ public PgException exc;
+
+ ExceptionEditPart editPart;
+
+ public void setEditPart(ExceptionEditPart part) {
+ editPart = part;
+ }
+
+ public void setConstraint(IFigure child, Object constraint) {
+ super.setConstraint(child, constraint);
+ }
+
+ public void setIcon(Image i) {
+ //icon = PrintIconHelper.getPrintImage(i);
+ }
+
+
+ public void init(int number) {
+ FixedConnectionAnchor c;
+ if (number == 0)
+ number = 1;
+ for (int i = 0; i < number; i++) {
+ c = new FixedConnectionAnchor(this);
+ c.offsetV = 32 + LINK_HEIGHT * i;
+ c.leftToRight = false;
+ connectionAnchors.put((i + 1) + "_OUT", c);
+ outputConnectionAnchors.addElement(c);
+ }
+ }
+
+ public void addConnectionAnchor(int number) {
+ FixedConnectionAnchor c;
+ if (number == 1)
+ return;
+ c = new FixedConnectionAnchor(this);
+ c.offsetV = 32 + LINK_HEIGHT * (number - 1);
+ // c.offsetH = -1;
+ c.leftToRight = false;
+ connectionAnchors.put(number + "_OUT", c);
+ outputConnectionAnchors.addElement(c);
+ }
+
+ public void removeConnectionAnchor() {
+ if (outputConnectionAnchors.size() == 1)
+ return;
+ outputConnectionAnchors.remove(outputConnectionAnchors.size() - 1);
+ }
+
+ public void removeAllConnectionAnchor() {
+ outputConnectionAnchors.removeAllElements();
+ }
+
+ public ExceptionFigure(PgException group) {
+ this.exc = group;
+
+ setOpaque(false);
+ setLayoutManager(new XYLayout());
+
+ setBorder(new GroupBorder(blackColor));
+
+ if (group != null) {
+ FixedConnectionAnchor c;
+ c = new FixedConnectionAnchor(this);
+ c.offsetV = 10;
+ //c.offsetH = -1;
+ connectionAnchors.put("1_IN", c);
+ inputConnectionAnchors.addElement(c);
+
+ c = new FixedConnectionAnchor(this);
+ c.offsetV = 10;
+ c.leftToRight = false;
+ connectionAnchors.put("1_OUT", c);
+ outputConnectionAnchors.addElement(c);
+ }
+ }
+
+ /**
+ * @see org.eclipse.gef.handles.HandleBounds#getHandleBounds()
+ */
+ public Rectangle getHandleBounds() {
+ return getBounds().getCropped(new Insets(0, 0, 0, 0));
+ }
+
+ /**
+ * @see org.eclipse.draw2d.Figure#getPreferredSize(int, int)
+ */
+ public Dimension getPreferredSize(int wHint, int hHint) {
+ return SIZE;
+ }
+
+ int width, height;
+
+ /**
+ * @see org.eclipse.draw2d.Figure#paintFigure(Graphics)
+ */
+ protected void paintFigure(Graphics g) {
+ Rectangle r = getBounds().getCopy();
+ g.translate(r.getLocation());
+
+ int start = 0;
+
+
+ g.setBackgroundColor(whiteColor);
+
+ g.fillRectangle(start + 1, 1, 22, 19);
+
+ if (icon != null)
+ g.drawImage(icon, start + 4, 2);
+
+
+ if (exc != null /*&& group.isConfirmed()*/) {
+ g.setBackgroundColor(exceptionBackgroundColor);
+ g.setForegroundColor(exceptionForegroundColor);
+ } else {
+ g.setBackgroundColor(lightGrayColor);
+ }
+
+ }
+
+ class GroupBorder extends LineBorder {
+ public GroupBorder(Color color) {
+ super(color);
+ }
+
+ public void paint(IFigure figure, Graphics graphics, Insets insets) {
+ Rectangle r = getPaintRectangle(figure, insets).getCopy();
+ graphics.translate(r.getLocation());
+ int width = r.width - 1;
+ int height = r.height - 1;
+
+ if (exc != null)
+ graphics.setForegroundColor(blackColor);
+ else
+ graphics.setForegroundColor(darkGrayColor);
+
+ graphics.drawLine(1, 0, width-1, 0);
+ graphics.drawLine(0, 1, 0, height - 1);
+ graphics.drawLine(1, height, width-1, height);
+ graphics.drawLine(width, 1, width, height - 1);
+ graphics.drawLine(23 , 0, 23, height);
+
+
+ }
+
+ public void mouseDoubleClicked(MouseEvent me) {
+ }
+
+ public void mousePressed(MouseEvent me) {
+ if (me.button == 3) {
+ ((GEFGraphicalViewer) editPart.getViewer()).setNoDeselect();
+ editPart.getViewer().select(editPart);
+ }
+ }
+
+
+}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-05-28 14:47:27 UTC (rev 8407)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/NodeFigure.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -50,6 +50,10 @@
public static final Color borderColor = new Color(null, 0x86, 0x7d, 0x51);
public final static Color ghostFillColor = new Color(null, 31, 31, 31);
+
+ public static final Color exceptionBackgroundColor = new Color(null, 0xff, 0xe3, 0xe7);
+
+ public static final Color exceptionForegroundColor = new Color(null, 0x99, 0x07, 0x02);
public static final Image errorIcon = ModelUIImages
.getImage("error_co.gif");
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-28 14:47:27 UTC (rev 8407)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/figures/PageFigure.java 2008-05-28 16:01:26 UTC (rev 8408)
@@ -142,7 +142,7 @@
if (group != null) {
// setIcon(group.getImage());
-// setPath(group.getVisiblePath());
+ setPath(group.getName());
}
setOpaque(false);
16 years
JBoss Tools SVN: r8407 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-28 10:47:27 -0400 (Wed, 28 May 2008)
New Revision: 8407
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 14:42:10 UTC (rev 8406)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 14:47:27 UTC (rev 8407)
@@ -96,7 +96,7 @@
try {
f.autolayout();
gui = new PagesEditor(input);
- PagesModel model = createModel(); //getFakeModel();
+ model = createModel(); //getFakeModel();
gui.setPagesModel(model);
gui.init((IEditorSite)getSite(), (IEditorInput)input);
@@ -154,7 +154,10 @@
if(shape != null && shape.length >= 4) {
exc.setSize(new Dimension(shape[2],shape[3]));
}
+ //TODO pass is[i] to exc
model.getChildren().add(exc);
+ //maybe we need other map for exceptions?
+ elements.put(is[i], exc);
} else {
//TODO
}
16 years
JBoss Tools SVN: r8406 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml: src/org/jboss/tools/seam/pages/xml/model/helpers and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-28 10:42:10 -0400 (Wed, 28 May 2008)
New Revision: 8406
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesProcessStructureHelper.java
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2008-05-28 14:41:56 UTC (rev 8405)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/META-INF/MANIFEST.MF 2008-05-28 14:42:10 UTC (rev 8406)
@@ -9,6 +9,7 @@
Bundle-Localization: plugin
Provide-Package: org.jboss.tools.seam.pages.xml,
org.jboss.tools.seam.pages.xml.model,
+ org.jboss.tools.seam.pages.xml.model.helpers,
org.jboss.tools.seam.pages.xml.model.impl
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui.ide,
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesProcessStructureHelper.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesProcessStructureHelper.java 2008-05-28 14:41:56 UTC (rev 8405)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/helpers/SeamPagesProcessStructureHelper.java 2008-05-28 14:42:10 UTC (rev 8406)
@@ -6,8 +6,12 @@
import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
public class SeamPagesProcessStructureHelper extends WebProcessStructureHelper implements SeamPagesConstants {
- SeamPagesProcessStructureHelper instance = new SeamPagesProcessStructureHelper();
+ public static SeamPagesProcessStructureHelper instance = new SeamPagesProcessStructureHelper();
+ public static SeamPagesProcessStructureHelper getInstance() {
+ return instance;
+ }
+
public XModelObject getParentProcess(XModelObject element) {
XModelObject p = element;
while(p != null && p.getFileType() == XModelObject.NONE &&
16 years
JBoss Tools SVN: r8405 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-28 10:41:56 -0400 (Wed, 28 May 2008)
New Revision: 8405
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 13:43:29 UTC (rev 8404)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/SeamPagesGuiEditor.java 2008-05-28 14:41:56 UTC (rev 8405)
@@ -10,6 +10,9 @@
******************************************************************************/
package org.jboss.tools.seam.ui.pages.editor;
+import java.util.HashMap;
+import java.util.Map;
+
import org.jboss.tools.common.editor.AbstractSectionEditor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.draw2d.geometry.Dimension;
@@ -23,22 +26,27 @@
import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
import org.jboss.tools.jst.web.model.WebProcess;
import org.jboss.tools.seam.pages.xml.model.SeamPagesConstants;
+import org.jboss.tools.seam.pages.xml.model.helpers.SeamPagesProcessStructureHelper;
+import org.jboss.tools.seam.pages.xml.model.impl.SeamPagesProcessImpl;
import org.jboss.tools.seam.ui.pages.SeamUiPagesPlugin;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Link;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.Page;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesElement;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesFactory;
import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesModel;
+import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PgException;
public class SeamPagesGuiEditor extends AbstractSectionEditor {
private PagesEditor gui = null;
private IModelObjectEditorInput input;
private boolean isInitialized = false;
private XModelObject installedProcess = null;
-// private JSFModel model;
+ private PagesModel model;
public void dispose() {
-// if(model == null) return;
+ if(model == null) return;
// model.dispose();
-// model = null;
+ model = null;
gui.dispose();
disposeGui();
gui = null;
@@ -88,10 +96,8 @@
try {
f.autolayout();
gui = new PagesEditor(input);
- PagesModel model = getFakeModel();
+ PagesModel model = createModel(); //getFakeModel();
gui.setPagesModel(model);
-// model = new JSFModel(f.getParent());
-// model.updateLinks();
gui.init((IEditorSite)getSite(), (IEditorInput)input);
gui.createPartControl(guiControl);
@@ -118,6 +124,75 @@
return model;
}
+ private PagesModel createModel() {
+ PagesModel model = PagesFactory.eINSTANCE.createPagesModel();
+ Map<XModelObject, PagesElement> elements = new HashMap<XModelObject, PagesElement>();
+ SeamPagesProcessStructureHelper h = SeamPagesProcessStructureHelper.getInstance();
+ XModelObject[] is = h.getItems(installedProcess);
+ for (int i = 0; i < is.length; i++) {
+ String type = is[i].getAttributeValue(SeamPagesConstants.ATTR_TYPE);
+ if(SeamPagesConstants.TYPE_PAGE.equals(type)) {
+ Page page = PagesFactory.eINSTANCE.createPage();
+ page.setName(h.getPageTitle(is[i]));
+ int[] shape = h.asIntArray(is[i], "shape");
+ if(shape != null && shape.length >= 2) {
+ page.setLocation(new Point(shape[0],shape[1]));
+ }
+ if(shape != null && shape.length >= 4) {
+ page.setSize(new Dimension(shape[2],shape[3]));
+ }
+ //TODO pass is[i] to page
+ model.getChildren().add(page);
+ elements.put(is[i], page);
+ } else if(SeamPagesConstants.TYPE_EXCEPTION.equals(type)) {
+ PgException exc = PagesFactory.eINSTANCE.createPgException();
+ exc.setName(h.getPageTitle(is[i]));
+ int[] shape = h.asIntArray(is[i], "shape");
+ if(shape != null && shape.length >= 2) {
+ exc.setLocation(new Point(shape[0],shape[1]));
+ }
+ if(shape != null && shape.length >= 4) {
+ exc.setSize(new Dimension(shape[2],shape[3]));
+ }
+ model.getChildren().add(exc);
+ } else {
+ //TODO
+ }
+ }
+
+ for (int i = 0; i < is.length; i++) {
+ String type = is[i].getAttributeValue(SeamPagesConstants.ATTR_TYPE);
+ if(SeamPagesConstants.TYPE_PAGE.equals(type)
+ || SeamPagesConstants.TYPE_EXCEPTION.equals(type)) {
+ PagesElement from = elements.get(is[i]);
+ if(from == null) {
+ //TODO report failure
+ continue;
+ }
+ XModelObject[] os = h.getOutputs(is[i]);
+ for (int j = 0; j < os.length; j++) {
+ XModelObject t = h.getItemOutputTarget(os[j]);
+ if(t == null) {
+ //TODO report failure
+ continue;
+ }
+ PagesElement to = elements.get(t);
+ if(to == null) {
+ //TODO report failure
+ continue;
+ }
+ Link link = PagesFactory.eINSTANCE.createLink();
+ link.setFromElement(from);
+ link.setToElement(to);
+ link.setName(h.getItemOutputPresentation(os[j]));
+ link.setShortcut(h.isShortcut(os[j]));
+ }
+ }
+ }
+
+ return model;
+ }
+
public Object getAdapter(Class adapter) {
if(adapter == ActionRegistry.class || adapter == org.eclipse.gef.editparts.ZoomManager.class){
if(getGUI() != null)
16 years
JBoss Tools SVN: r8404 - in trunk: seam/docs/reference/en/modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tromanovich
Date: 2008-05-28 09:43:29 -0400 (Wed, 28 May 2008)
New Revision: 8404
Modified:
trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml
trunk/jsf/docs/userguide/en/modules/editors.xml
trunk/jsf/docs/userguide/en/modules/palette.xml
trunk/seam/docs/reference/en/modules/creating_new_seam.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-337 - RF version in tools and studio guides
RichFaces links ("http://www.jboss.org/jbossrichfaces") were added to the SeamDevTools, Visual Web Tools and GSG.
Modified: trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml 2008-05-28 13:32:58 UTC (rev 8403)
+++ trunk/jsf/docs/userguide/en/modules/Visual_Web_Tools.xml 2008-05-28 13:43:29 UTC (rev 8404)
@@ -132,7 +132,7 @@
<row>
<entry>RichFaces Support</entry>
- <entry>Tight integration between JBDS and RichFaces frameworks. Easy managing RichFaces
+ <entry>Tight integration between JBDS and <ulink url="http://www.jboss.org/jbossrichfaces">RichFaces</ulink> frameworks. Easy managing RichFaces
components in any web application. Support for RichFaces and Ajax4jsf libraries in JBoss
Tools Palette. Rendering RichFaces components in Visual Page Editor.</entry>
<entry>
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2008-05-28 13:32:58 UTC (rev 8403)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2008-05-28 13:43:29 UTC (rev 8404)
@@ -550,7 +550,7 @@
<section id="ContentAssistForRF">
<title>RichFaces components</title>
- <para>JBDS indeed provides code completion for RichFaces framework components. All
+ <para>JBDS indeed provides code completion for <ulink url="http://www.jboss.org/jbossrichfaces">RichFaces</ulink> framework components. All
you have to do is to install RichFaces libraries into your project. See <ulink
url="http://labs.jboss.com/file-access/default/members/jbossrichfaces/freezone..."
>here</ulink> how to install it.</para>
Modified: trunk/jsf/docs/userguide/en/modules/palette.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/palette.xml 2008-05-28 13:32:58 UTC (rev 8403)
+++ trunk/jsf/docs/userguide/en/modules/palette.xml 2008-05-28 13:43:29 UTC (rev 8404)
@@ -570,7 +570,7 @@
<property>RichFaces</property>
</emphasis> component framework. RichFaces and Ajax4jsf in JBoss Tools Palette always
exist, this palette is not dynamic and is not changed from file to file. JBoss Tools
- Palette supports only the last version of the RichFaces components.
+ Palette supports only the last version of the <ulink url="http://www.jboss.org/jbossrichfaces">RichFaces</ulink> components.
<tip>
<title>Tip:</title>
<para>If you'd like to know the last version of RichFaces component
Modified: trunk/seam/docs/reference/en/modules/creating_new_seam.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-05-28 13:32:58 UTC (rev 8403)
+++ trunk/seam/docs/reference/en/modules/creating_new_seam.xml 2008-05-28 13:43:29 UTC (rev 8404)
@@ -280,7 +280,7 @@
</figure>
<para>In the Component Libraries section of the wizard you can also add <property>Component
- Libraries</property> (e.g. Richfaces). Just click on <emphasis>
+ Libraries</property> (e.g. <ulink url="http://www.jboss.org/jbossrichfaces">Richfaces</ulink>). Just click on <emphasis>
<property>New</property>
</emphasis> button. Appeared dialog will ask you to type the Library name, supported
version and add necessary jar's. Press <emphasis>
16 years
JBoss Tools SVN: r8403 - in trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages: impl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-28 09:32:58 -0400 (Wed, 28 May 2008)
New Revision: 8403
Removed:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Exception.java
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/ExceptionImpl.java
Log:
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Exception.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Exception.java 2008-05-28 12:38:59 UTC (rev 8402)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/Exception.java 2008-05-28 13:32:58 UTC (rev 8403)
@@ -1,12 +0,0 @@
-package org.jboss.tools.seam.ui.pages.editor.ecore.pages;
-
-/**
- * @author daniel
- *
- * Exception model interface
- *
- * @model
- */
-public interface Exception extends PagesElement{
-
-}
Deleted: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/ExceptionImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/ExceptionImpl.java 2008-05-28 12:38:59 UTC (rev 8402)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/src/org/jboss/tools/seam/ui/pages/editor/ecore/pages/impl/ExceptionImpl.java 2008-05-28 13:32:58 UTC (rev 8403)
@@ -1,42 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id$
- */
-package org.jboss.tools.seam.ui.pages.editor.ecore.pages.impl;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.jboss.tools.seam.ui.pages.editor.ecore.pages.PagesPackage;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Exception</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * </p>
- *
- * @generated
- */
-public class ExceptionImpl extends PagesElementImpl implements org.jboss.tools.seam.ui.pages.editor.ecore.pages.Exception {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ExceptionImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return PagesPackage.Literals.EXCEPTION;
- }
-
-} //ExceptionImpl
16 years
JBoss Tools SVN: r8402 - in trunk: struts/docs/struts_tools_ref_guide/en/modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: tromanovich
Date: 2008-05-28 08:38:59 -0400 (Wed, 28 May 2008)
New Revision: 8402
Modified:
trunk/seam/docs/reference/en/modules/seam_editors.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-224 - Special text paragraphs framing
Some notes were added
Modified: trunk/seam/docs/reference/en/modules/seam_editors.xml
===================================================================
--- trunk/seam/docs/reference/en/modules/seam_editors.xml 2008-05-28 12:35:07 UTC (rev 8401)
+++ trunk/seam/docs/reference/en/modules/seam_editors.xml 2008-05-28 12:38:59 UTC (rev 8402)
@@ -103,8 +103,11 @@
</mediaobject>
</figure>
- <para>Notice that <property>components.xml</property> and other xml files can be viewed and edited directly in the Project Explorer and Properties sheet without opening the components.xml editor.</para>
-
+ <note>
+ <title>Note:</title>
+
+ <para>You can view and edit <property>components.xml</property> and other xml files directly in the Project Explorer and Properties sheet without opening the components.xml editor.</para>
+ </note>
<figure>
<title>component.xml Editor</title>
<mediaobject>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml 2008-05-28 12:35:07 UTC (rev 8401)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/code_generation.xml 2008-05-28 12:38:59 UTC (rev 8402)
@@ -52,7 +52,7 @@
<tip>
<title>Tip:</title>
- <para>please be careful not to override your existing files.</para>
+ <para>Please be careful not to override your existing files.</para>
</tip>
<para>When generation is complete, a result window will appear letting you know how
16 years
JBoss Tools SVN: r8401 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml: src/org/jboss/tools/seam/pages/xml/model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-05-28 08:35:07 -0400 (Wed, 28 May 2008)
New Revision: 8401
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java
Log:
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-05-28 12:15:58 UTC (rev 8400)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-05-28 12:35:07 UTC (rev 8401)
@@ -143,26 +143,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="New" group="1"
- kind="list" name="CreateActions">
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Param..." kind="action" name="AddParam">
- <EntityData EntityName="SeamPageParam12">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="value" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add In..." kind="action" name="AddIn">
- <EntityData EntityName="SeamPageIn">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="scope" Mandatory="no"/>
- <AttributeData AttributeName="value"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
+ <XActionItemReference entity="SeamPage12" name="CreateActions" path="CreateActions"/>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
<XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
@@ -195,14 +176,9 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItem displayName="New" group="1" kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem kind="list" name="VerifyActions">
- <XActionItem kind="list" name="StaticActions"/>
- </XActionItem>
+ <XActionItemReference entity="SeamPage12" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="SeamPage12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPage12" name="VerifyActions" path="VerifyActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -306,17 +282,7 @@
<XActionItem HIDE="always" HandlerClassName="%SaveFile%"
ICON="action.save" displayName="Save" kind="action" name="Save"/>
</XActionItem>
- <XActionItem ICON="action.empty" displayName="New" group="1"
- kind="list" name="CreateActions">
- <XActionItem HandlerClassName="%Create%" ICON="action.empty"
- PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Param..." kind="action" name="AddParam">
- <EntityData EntityName="SeamPageParam20">
- <AttributeData AttributeName="name"/>
- <AttributeData AttributeName="value" Mandatory="no"/>
- </EntityData>
- </XActionItem>
- </XActionItem>
+ <XActionItemReference entity="SeamPage20" name="CreateActions" path="CreateActions"/>
<XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
<XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
@@ -349,14 +315,9 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItem displayName="New" group="1" kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem kind="list" name="VerifyActions">
- <XActionItem kind="list" name="StaticActions"/>
- </XActionItem>
+ <XActionItemReference entity="SeamPage12" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="SeamPage12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPage12" name="VerifyActions" path="VerifyActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -512,14 +473,9 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItem displayName="New" kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HIDE="always" HandlerClassName="%Properties%"
- ICON="action.empty" displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem kind="list" name="VerifyActions">
- <XActionItem kind="list" name="StaticActions"/>
- </XActionItem>
+ <XActionItemReference entity="FileSeamPages12" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="FileSeamPages12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="FileSeamPages12" name="VerifyActions" path="VerifyActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -665,14 +621,9 @@
<XEntityRenderer/>
<XModelAttributes/>
<XActionItem kind="list">
- <XActionItem displayName="New" kind="list" name="CreateActions"/>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HIDE="always" HandlerClassName="%Properties%"
- ICON="action.empty" displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
- <XActionItem kind="list" name="VerifyActions">
- <XActionItem kind="list" name="StaticActions"/>
- </XActionItem>
+ <XActionItemReference entity="FileSeamPages20" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="FileSeamPages20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="FileSeamPages20" name="VerifyActions" path="VerifyActions"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -759,10 +710,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions">
+ <XActionItem displayName="New" group="1" kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Param..." kind="action" name="AddParam">
+ displayName="Param..." kind="action" name="AddParam">
<EntityData EntityName="SeamPageParam12">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="value" Mandatory="no"/>
@@ -770,7 +721,7 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add In..." kind="action" name="AddIn">
+ displayName="In..." kind="action" name="AddIn">
<EntityData EntityName="SeamPageIn">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
@@ -779,7 +730,15 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Navigation..." kind="action" name="AddNavigation">
+ displayName="Action..." kind="action" name="AddAction">
+ <EntityData EntityName="SeamPageAction">
+ <AttributeData AttributeName="execute"/>
+ <AttributeData AttributeName="if" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Navigation..." kind="action" name="AddNavigation">
<EntityData EntityName="SeamPageNavigation12">
<AttributeData AttributeName="from action" Mandatory="no"/>
<AttributeData AttributeName="evaluate" Mandatory="no"/>
@@ -789,7 +748,7 @@
HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddRuleHandler"
ICON="action.empty"
PROPERTIES="validator.add=true;entity=SeamPageNavigationRule12;renderEntity=SeamPageRender;redirectEntity=SeamPageRedirect12"
- WizardClassName="%Default%" displayName="Add Navigation Rule..."
+ WizardClassName="%Default%" displayName="Navigation Rule..."
kind="action" name="AddRule">
<EntityData EntityName="AddSeamPageRule">
<AttributeData AttributeName="kind" Mandatory="no"/>
@@ -856,10 +815,10 @@
</XModelAttribute>
</XModelAttributes>
<XActionItem kind="list">
- <XActionItem kind="list" name="CreateActions">
+ <XActionItem displayName="New" group="1" kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Param..." kind="action" name="AddParam">
+ displayName="Param..." kind="action" name="AddParam">
<EntityData EntityName="SeamPageParam20">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="value" Mandatory="no"/>
@@ -867,7 +826,7 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add In..." kind="action" name="AddIn">
+ displayName="In..." kind="action" name="AddIn">
<EntityData EntityName="SeamPageIn">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
@@ -876,7 +835,15 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Add Navigation..." kind="action" name="AddNavigation">
+ displayName="Action..." kind="action" name="AddAction">
+ <EntityData EntityName="SeamPageAction">
+ <AttributeData AttributeName="execute"/>
+ <AttributeData AttributeName="if" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Navigation..." kind="action" name="AddNavigation">
<EntityData EntityName="SeamPageNavigation20">
<AttributeData AttributeName="from action" Mandatory="no"/>
<AttributeData AttributeName="evaluate" Mandatory="no"/>
@@ -886,7 +853,7 @@
HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddRuleHandler"
ICON="action.empty"
PROPERTIES="validator.add=true;entity=SeamPageNavigationRule20;renderEntity=SeamPageRender;redirectEntity=SeamPageRedirect20"
- WizardClassName="%Default%" displayName="Add Navigation Rule..."
+ WizardClassName="%Default%" displayName="Navigation Rule..."
kind="action" name="AddRule">
<EntityData EntityName="AddSeamPageRule">
<AttributeData AttributeName="kind" Mandatory="no"/>
@@ -2476,7 +2443,7 @@
displayName="Add Message..." kind="action" name="AddMessage">
<EntityData EntityName="SeamPageMessage">
<AttributeData AttributeName="message"/>
- <AttributeData AttributeName="severety" Mandatory="no"/>
+ <AttributeData AttributeName="severity" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java 2008-05-28 12:15:58 UTC (rev 8400)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java 2008-05-28 12:35:07 UTC (rev 8401)
@@ -31,57 +31,40 @@
public String getEntityName(String ext, String body) {
if(body == null) return null;
- if(body.indexOf(PUBLIC_ID_12) >= 0) {
- if(body.indexOf("<page") > 0 && body.indexOf("<pages") < 0) return ENT_FILE_SEAM_PAGE_12;
- return ENT_FILE_SEAM_PAGES_12;
- }
- if(!isPagesSchema(body)) {
- return null;
- }
-
- int i = body.indexOf("xsi:schemaLocation"); //$NON-NLS-1$
- if(i < 0) return null;
- int j = body.indexOf("\"", i); //$NON-NLS-1$
- if(j < 0) return null;
- int k = body.indexOf("\"", j + 1); //$NON-NLS-1$
- if(k < 0) return null;
- String schemaLocation = body.substring(j + 1, k);
- boolean isSinglePage = isSinglePage(body);
-
- int i20 = schemaLocation.indexOf("2.0"); //$NON-NLS-1$
- if(i20 >= 0) {
- if(isSinglePage) return ENT_FILE_SEAM_PAGE_20;
- if(isMultiPage(body)) return ENT_FILE_SEAM_PAGES_20;
- }
-
- return null;
+ Parser p = new Parser(body);
+ if(!p.recognized) {
+ return null;
+ } else if(p.is12) {
+ return p.isSingle ? ENT_FILE_SEAM_PAGE_12 : ENT_FILE_SEAM_PAGES_12;
+ } else {
+ return p.isSingle ? ENT_FILE_SEAM_PAGE_20 : ENT_FILE_SEAM_PAGES_20;
+ }
}
-
- private boolean isPagesSchema(String body) {
- int i = body.indexOf("<pages"); //$NON-NLS-1$
- if(i < 0) return false;
- int j = body.indexOf(">", i); //$NON-NLS-1$
- if(j < 0) return false;
- String s = body.substring(i, j);
- return s.indexOf("\"http://jboss.com/products/seam/pages\"") > 0; //$NON-NLS-1$
- }
-
- private boolean isMultiPage(String body) {
- int i = body.indexOf("<pages"); //$NON-NLS-1$
- if(i < 0) return false;
- int j = body.indexOf(">", i); //$NON-NLS-1$
- if(j < 0) return false;
- String s = body.substring(i, j);
- return s.indexOf("\"http://jboss.com/products/seam/pages\"") > 0; //$NON-NLS-1$
- }
- private boolean isSinglePage(String body) {
- int i = body.indexOf("<page"); //$NON-NLS-1$
- int is = body.indexOf("<pages"); //$NON-NLS-1$
- if(i < 0 || is >= 0) return false;
- int j = body.indexOf(">", i); //$NON-NLS-1$
- if(j < 0) return false;
- String s = body.substring(i, j);
- return s.indexOf("\"http://jboss.com/products/seam/pages\"") > 0; //$NON-NLS-1$
+ class Parser {
+ boolean recognized = false;
+ boolean is12 = false;
+ boolean isSingle = false;
+
+ Parser(String body) {
+ int i = body.indexOf("<page"); //$NON-NLS-1$
+ if(i < 0) return;
+ int i2 = body.indexOf("<pages"); //$NON-NLS-1$
+ if(i2 < 0) {
+ isSingle = true;
+ }
+ if(body.indexOf(PUBLIC_ID_12) >= 0) {
+ is12 = true;
+ } else {
+ int j = body.indexOf(">", i); //$NON-NLS-1$
+ if(j < 0) return;
+ String s = body.substring(i, j);
+ if(s.indexOf("\"http://jboss.com/products/seam/pages\"") < 0) { //$NON-NLS-1$
+ return;
+ }
+ }
+ recognized = true;
+ }
}
+
}
16 years