org.eclipse.jst.jsf.facesconfig.ui_1.2.2.v201103292152

  .getPreferenceStore();
      labelFgColor = GEMPreferences.getColor(store, 
        "LineLabelFontColor");
    }
    return labelFgColor;
  }
  
  public void setLabelBackgroundColor(Color c)
  {
    labelBgColor = c;
    if (textLabel != null) {
      textLabel.setBackgroundColor(c);
    }
  }
  
  private Color getLabelBackgroundColor()
  {
    if (labelBgColor == null)
    {
      IPreferenceStore store = EditorPlugin.getDefault()
        .getPreferenceStore();
      labelBgColor = GEMPreferences.getColor(store, 
        "LineLabelColor");
    }
    return labelBgColor;
  }
  
  public Color getForegroundColor()
  {
    IPreferenceStore store = EditorPlugin.getDefault().getPreferenceStore();
    Color newFgColor = GEMPreferences.getColor(store, "LineColor");
    setForegroundColor(newFgColor);
    return newFgColor;
  }
  
  public void setForegroundColor(Color c)
  {
    if (textLabel != null) {
      textLabel.setBorderColor(c);
    }
    super.setForegroundColor(c);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.figure.PFLinkFigure
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.figure;

import java.util.Vector;
import org.eclipse.draw2d.ChopboxAnchor;
import org.eclipse.draw2d.ConnectionAnchor;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.FlowLayout;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LabelAnchor;
import org.eclipse.draw2d.MarginBorder;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jst.jsf.facesconfig.ui.EditorPlugin;
import org.eclipse.jst.jsf.facesconfig.ui.preference.GEMPreferences;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.Image;

public class PageflowNodeFigure
  extends Figure
{
  protected Vector connectionAnchors = new Vector(1);
  private NodeLabel label;
  private Color labelFgColor;
  private int textPlacement = 4;
  
  public PageflowNodeFigure()
  {
    setLayoutManager(new FlowLayout());
  }
  
  public ConnectionAnchor getSourceConnectionAnchorAt(Point p)
  {
    if (getSourceConnectionAnchors().size() == 0) {
      return null;
    }
    return (ConnectionAnchor)getSourceConnectionAnchors().get(0);
  }
  
  public ConnectionAnchor getSourceConnectionAnchor()
  {
    if (getSourceConnectionAnchors().size() == 0) {
      return null;
    }
    return (ConnectionAnchor)getSourceConnectionAnchors().get(0);
  }
  
  private Vector getSourceConnectionAnchors()
  {
    return connectionAnchors;
  }
  
  public ConnectionAnchor getTargetConnectionAnchorAt(Point p)
  {
    if (getTargetConnectionAnchors().size() == 0) {
      return null;
    }
    return (ConnectionAnchor)getTargetConnectionAnchors().get(0);
  }
  
  public ConnectionAnchor getTargetConnectionAnchor()
  {
    if (getTargetConnectionAnchors().size() == 0) {
      return null;
    }
    return (ConnectionAnchor)getTargetConnectionAnchors().get(0);
  }
  
  private Vector getTargetConnectionAnchors()
  {
    return connectionAnchors;
  }
  
  public void update()
  {
    initializeConnectionAnchors();
  }
  
  private void initializeConnectionAnchors()
  {
    connectionAnchors.removeAllElements();
    ChopboxAnchor inputConnectionAnchor = new LabelAnchor(label);
    connectionAnchors.addElement(inputConnectionAnchor);
  }
  
  private int getTextPlacement()
  {
    IPreferenceStore store = EditorPlugin.getDefault().getPreferenceStore();
    String s = store.getString("LabelPlacement");
    if ("Top".equals(s)) {
      textPlacement = 1;
    } else if ("Bottom".equals(s)) {
      textPlacement = 4;
    } else if ("Left".equals(s)) {
      textPlacement = 8;
    } else if ("Right".equals(s)) {
      textPlacement = 16;
    }
    return textPlacement;
  }
  
  private Color getLabelForegroundColor()
  {
    if (labelFgColor == null)
    {
      IPreferenceStore store = EditorPlugin.getDefault()
        .getPreferenceStore();
      labelFgColor = GEMPreferences.getColor(store, 
        "FigureLabelFontColor");
    }
    return labelFgColor;
  }
  
  private Font getLabelFont()
  {
    FontRegistry registry = JFaceResources.getFontRegistry();
    IPreferenceStore store = EditorPlugin.getDefault().getPreferenceStore();
    FontData fontData = PreferenceConverter.getFontData(store, 
      "FigureLabelFont");
    if (!registry.get(fontData.toString()).equals(registry.defaultFont())) {
      return registry.get(fontData.toString());
    }
    registry.put(fontData.toString(), new FontData[] { fontData });
    return registry.get(fontData.toString());
  }
  
  public void setImageText(Image image, String str)
  {
    if (image == null)
    {
      setText(str);
    }
    else if (str == null)
    {
      setImage(image);
    }
    else if (label == null)
    {
      label = new NodeLabel(str, image);
      label.setTextPlacement(getTextPlacement());
      label.setForegroundColor(getLabelForegroundColor());
      label.setFont(getLabelFont());
      add(label);
      initializeConnectionAnchors();
    }
    else
    {
      label.setIcon(image);
      label.setText(str);
    }
  }
  
  public void setImage(Image image)
  {
    if (image == null) {
      return;
    }
    if (label == null)
    {
      label = new NodeLabel(image);
      label.setTextPlacement(getTextPlacement());
      label.setForegroundColor(getLabelForegroundColor());
      label.setFont(getLabelFont());
      add(label);
      initializeConnectionAnchors();
    }
    else
    {
      label.setIcon(image);
    }
  }
  
  public void setText(String str)
  {
    if (str == null) {
      return;
    }
    if (label == null)
    {
      label = new NodeLabel(str);
      label.setTextPlacement(getTextPlacement());
      label.setForegroundColor(getLabelForegroundColor());
      label.setFont(getLabelFont());
      add(label);
      initializeConnectionAnchors();
    }
    else
    {
      label.setText(str);
    }
  }
  
  protected boolean useLocalCoordinates()
  {
    return true;
  }
  
  public Rectangle getImageBounds()
  {
    return label.getIconBounds();
  }
  
  public Rectangle getTextBounds()
  {
    return label.getTextBounds();
  }
  
  public Label getLabel()
  {
    return label;
  }
  
  public void setBackgroundColor(Color bg)
  {
    if (label != null) {
      label.setBackgroundColor(bg);
    }
  }
  
  public void setForegroundColor(Color fg)
  {
    labelFgColor = fg;
    if (label != null) {
      label.setForegroundColor(fg);
    }
  }
  
  public void setFont(Font f)
  {
    if (label != null) {
      label.setFont(f);
    }
    super.setFont(f);
  }
  
  public void setTextPlacement(int where)
  {
    textPlacement = where;
    if (label != null) {
      label.setTextPlacement(where);
    }
  }
  
  public void setToolTipText(String text)
  {
    Label toolTipLabel = null;
    if ((text != null) && (text.length() > 0))
    {
      toolTipLabel = new Label(text);
      toolTipLabel.setBorder(new MarginBorder(3));
    }
    super.setToolTip(toolTipLabel);
  }
  
  public String getToolTipText()
  {
    if (getToolTip() != null) {
      return ((Label)getToolTip()).getText();
    }
    return null;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.figure.PageflowNodeFigure
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.layout;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.eclipse.draw2d.geometry.Insets;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.graph.DirectedGraph;
import org.eclipse.draw2d.graph.DirectedGraphLayout;
import org.eclipse.draw2d.graph.Edge;
import org.eclipse.draw2d.graph.EdgeList;
import org.eclipse.draw2d.graph.Node;
import org.eclipse.draw2d.graph.NodeList;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.Pageflow;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowFactory;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowLink;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowLinkBendpoint;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowNode;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowPage;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.util.PageflowModelManager;

public class PageflowLayoutManager
{
  private static final int NODE_DEFAULT_WIDTH = 50;
  private static final int NODE_DEFAULT_HEIGHT = 50;
  private static final int X_SPACE = 50;
  private static final int Y_SPACE = 50;
  private static final int DEFAULT_PADDING = 30;
  private static PageflowLayoutManager manager;
  private Map copiedLinks = null;
  
  public static PageflowLayoutManager getInstance()
  {
    if (manager == null) {
      manager = new PageflowLayoutManager();
    }
    return manager;
  }
  
  public void layoutPageflow(Pageflow pageflow)
  {
    List selfLoopLinks = removeSelfLoopLinks(pageflow);
    
    List lstGraph = createGraphs(pageflow);
    for (Iterator iter = lstGraph.iterator(); iter.hasNext();)
    {
      DirectedGraph graph = (DirectedGraph)iter.next();
      new DirectedGraphLayout().visit(graph);
    }
    updatePageflow(lstGraph);
    if (selfLoopLinks != null) {
      addSelfLoopLinks(pageflow, selfLoopLinks);
    }
  }
  
  private List removeSelfLoopLinks(Pageflow pageflow)
  {
    List selfLoopLinks = new ArrayList();
    if (pageflow.getLinks() != null) {
      for (Iterator iter = pageflow.getLinks().iterator(); iter.hasNext();)
      {
        PageflowLink link = (PageflowLink)iter.next();
        if (link.getSource() == link.getTarget())
        {
          iter.remove();
          link.getBendPoints().clear();
          selfLoopLinks.add(link);
        }
      }
    }
    return selfLoopLinks;
  }
  
  private void addSelfLoopLinks(Pageflow pageflow, List selfLoopLinks)
  {
    if ((pageflow.getLinks() != null) && (selfLoopLinks != null) && 
      (selfLoopLinks.size() > 0))
    {
      EList links = pageflow.getLinks();
      for (Iterator iter = selfLoopLinks.iterator(); iter.hasNext();)
      {
        PageflowLink link = (PageflowLink)iter.next();
        updateSelfLoopLink(link);
        links.add(link);
      }
    }
  }
  
  public static void updateSelfLoopLink(PageflowLink selfLoopLink)
  {
    PageflowNode sourceNode = selfLoopLink.getSource();
    Rectangle rectNode = getPageflowNodeBounds(sourceNode);
    
    EList outLinks = sourceNode.getOutlinks();
    if ((outLinks != null) && (outLinks.size() > 0)) {
      for (Iterator iter = outLinks.iterator(); iter.hasNext();)
      {
        PageflowLink anotherSelfLoopLink = (PageflowLink)iter.next();
        if ((anotherSelfLoopLink != selfLoopLink) && 
          (anotherSelfLoopLink.getTarget() == sourceNode)) {
          rectNode = getFitnessRectangle(rectNode, 
            anotherSelfLoopLink);
        }
      }
    }
    PageflowFactory factory = PageflowModelManager.getFactory();
    PageflowLinkBendpoint bpTop = factory.createPFLinkBendpoint();
    PageflowLinkBendpoint bpLeftTop = factory.createPFLinkBendpoint();
    PageflowLinkBendpoint bpLeft = factory.createPFLinkBendpoint();
    
    bpTop.setD1Height(-height);
    bpTop.setD2Height(-height);
    
    bpLeftTop.setD1Width(-width);
    bpLeftTop.setD1Height(-height);
    bpLeftTop.setD2Width(-width);
    bpLeftTop.setD2Height(-height);
    
    bpLeft.setD1Width(-width);
    bpLeft.setD2Width(-width);
    
    selfLoopLink.getBendPoints().add(bpTop);
    selfLoopLink.getBendPoints().add(bpLeftTop);
    selfLoopLink.getBendPoints().add(bpLeft);
  }
  
  private static Rectangle getFitnessRectangle(Rectangle rectDefault, PageflowLink anotherSelfLoopLink)
  {
    EList bendPoints = anotherSelfLoopLink.getBendPoints();
    if ((bendPoints != null) && (bendPoints.size() > 0)) {
      for (Iterator iterBendPoint = bendPoints.iterator(); iterBendPoint
            .hasNext();)
      {
        PageflowLinkBendpoint bendPoint = 
          (PageflowLinkBendpoint)iterBendPoint.next();
        if ((bendPoint.getD1Width() == -width) && 
          (bendPoint.getD1Height() == -height))
        {
          rectDefault = new Rectangle(0, 0, width + 
            30, height + 
            30);
          break;
        }
      }
    }
    return rectDefault;
  }
  
  private static Rectangle getPageflowNodeBounds(PageflowNode pfNode)
  {
    return new Rectangle(0, 0, 64, 36);
  }
  
  private static Rectangle getPageflowNodeRectangle(PageflowNode pfNode)
  {
    Rectangle rectNode = null;
    
    Rectangle bounds = getPageflowNodeBounds(pfNode);
    
    rectNode = new Rectangle(pfNode.getX(), pfNode.getY(), width, 
      height);
    
    return rectNode;
  }
  
  private List createGraphs(Pageflow pageflow)
  {
    List lstGraph = null;
    if (pageflow != null)
    {
      DirectedGraph graph = null;
      HashMap nodesMap = new HashMap();
      
      NodeList nodes = new NodeList();
      EdgeList edges = new EdgeList();
      
      List pfNodes = pageflow.getNodes();
      if (pfNodes != null) {
        for (Iterator iter = pfNodes.iterator(); iter.hasNext();)
        {
          PageflowNode pfNode = (PageflowNode)iter.next();
          Node node = new Node(pfNode);
          Rectangle rectNode = null;
          rectNode = getPageflowNodeBounds(pfNode);
          if (rectNode != null)
          {
            width = (width * 2);
            height = (height * 2);
            node.setPadding(new Insets(height, width, 
              height, width));
          }
          else
          {
            width = 50;
            height = 50;
            node.setPadding(new Insets(30));
          }
          nodesMap.put(pfNode, node);
          nodes.add(node);
        }
      }
      List pfLinks = pageflow.getLinks();
      for (Iterator iter = pfLinks.iterator(); iter.hasNext();)
      {
        PageflowLink link = (PageflowLink)iter.next();
        PageflowNode source = link.getSource();
        PageflowNode target = link.getTarget();
        Node sourceNode = (Node)nodesMap.get(source);
        Node targetNode = (Node)nodesMap.get(target);
        if ((sourceNode != null) && (targetNode != null))
        {
          Edge edge = new Edge(sourceNode, targetNode);
          edges.add(edge);
        }
      }
      graph = new DirectedGraph();
      
      nodes = nodes;
      edges = edges;
      
      lstGraph = new ArrayList();
      lstGraph.add(graph);
    }
    return lstGraph;
  }
  
  private void updatePageflow(List lstGraph)
  {
    int topSubGraph = 0;
    for (Iterator iter = lstGraph.iterator(); iter.hasNext();)
    {
      int bottomSubGraph = 0;
      DirectedGraph graph = (DirectedGraph)iter.next();
      for (int i = 0; i < nodes.size(); i++)
      {
        Node node = nodes.getNode(i);
        if ((data instanceof PageflowNode))
        {
          PageflowNode pfNode = (PageflowNode)data;
          pfNode.setX(50 + y);
          
          pfNode.setY(50 + x + topSubGraph);
          if (50 + x + topSubGraph > bottomSubGraph) {
            bottomSubGraph = 50 + x + topSubGraph;
          }
        }
      }
      topSubGraph = bottomSubGraph + 50;
    }
  }
  
  public void updatePageflowLayout(Pageflow newPageflow, Pageflow oldPageflow)
  {
    List notUpdatedNodes = new ArrayList();
    
    copiedLinks = new HashMap();
    if (oldPageflow.getNodes().size() > 0) {
      for (Iterator iter = newPageflow.getNodes().iterator(); iter
            .hasNext();)
      {
        PageflowNode newNode = (PageflowNode)iter.next();
        if (!updatePageflowNode(newNode, oldPageflow)) {
          notUpdatedNodes.add(newNode);
        }
      }
    } else {
      notUpdatedNodes.addAll(newPageflow.getNodes());
    }
    if (oldPageflow.getLinks().size() > 0) {
      for (Iterator iter = newPageflow.getLinks().iterator(); iter
            .hasNext();)
      {
        PageflowLink newLink = (PageflowLink)iter.next();
        
        updatePFLink(newLink, oldPageflow);
      }
    }
    if (notUpdatedNodes.size() > 0) {
      resolveConflict(newPageflow, notUpdatedNodes);
    }
  }
  
  private boolean updatePageflowNode(PageflowNode newNode, Pageflow oldPageflow)
  {
    for (Iterator iter = oldPageflow.getNodes().iterator(); iter.hasNext();)
    {
      PageflowNode oldNode = (PageflowNode)iter.next();
      if (((oldNode instanceof PageflowPage)) && 
        ((newNode instanceof PageflowPage)) && 
        (((PageflowPage)oldNode).getPath().trim().equals(
        ((PageflowPage)newNode).getPath().trim())))
      {
        updatePageflowNode(newNode, oldNode);
        return true;
      }
    }
    return false;
  }
  
  private void updatePageflowNode(PageflowNode newNode, PageflowNode node)
  {
    newNode.setX(node.getX());
    newNode.setY(node.getY());
  }
  
  private void resolveConflict(Pageflow newPageflow, List notUpdatedNodes)
  {
    for (Iterator iter = notUpdatedNodes.iterator(); iter.hasNext();) {
      resolveConflict(newPageflow, (PageflowNode)iter.next());
    }
  }
  
  private void resolveConflict(Pageflow newPageflow, PageflowNode node)
  {
    Rectangle nodeRect = getPageflowNodeRectangle(node);
    boolean bModified = false;
    int i = 0;
    for (int size = newPageflow.getNodes().size(); i < size; i++)
    {
      PageflowNode fixedNode = (PageflowNode)newPageflow.getNodes().get(
        i);
      if (node != fixedNode)
      {
        Rectangle fixedNodeRect = getPageflowNodeRectangle(fixedNode);
        if (fixedNodeRect.intersects(nodeRect))
        {
          x += width + 50;
          y += height + 50;
          bModified = true;
        }
      }
    }
    if (bModified)
    {
      node.setX(x);
      node.setY(y);
    }
  }
  
  private void updatePFLink(PageflowLink newLink, Pageflow oldPageflow)
  {
    for (Iterator iter = oldPageflow.getLinks().iterator(); iter.hasNext();)
    {
      PageflowLink oldLink = (PageflowLink)iter.next();
      if (copiedLinks.get(oldLink) == null) {
        if (isSameLink(newLink, oldLink))
        {
          updatePFLink(newLink, oldLink);
          break;
        }
      }
    }
  }
  
  private boolean isSameLink(PageflowLink newLink, PageflowLink oldLink)
  {
    PageflowNode newSource = newLink.getSource();
    PageflowNode newTarget = newLink.getTarget();
    
    PageflowNode oldSource = oldLink.getSource();
    PageflowNode oldTarget = oldLink.getTarget();
    if (((newSource instanceof PageflowPage)) && 
      ((oldSource instanceof PageflowPage)) && 
      ((newTarget instanceof PageflowPage)) && 
      ((oldTarget instanceof PageflowPage)) && 
      (((PageflowPage)newSource).getPath().trim().equalsIgnoreCase(
      ((PageflowPage)oldSource).getPath().trim()))) {
      if (((PageflowPage)newTarget).getPath().trim().equalsIgnoreCase(
        ((PageflowPage)oldTarget).getPath().trim())) {
        if (((newLink.getOutcome() == null) && (oldLink.getOutcome() == null)) || (
          (newLink.getOutcome() != null) && 
          (oldLink.getOutcome() != null) && 
          (newLink.getOutcome().trim().equals(
          oldLink.getOutcome().trim())))) {
          return true;
        }
      }
    }
    return false;
  }
  
  private PageflowLink updatePFLink(PageflowLink newLink, PageflowLink link)
  {
    PageflowFactory factory = PageflowModelManager.getFactory();
    
    newLink.getBendPoints().clear();
    for (Iterator iter = link.getBendPoints().iterator(); iter.hasNext();)
    {
      PageflowLinkBendpoint bendPoint = 
        (PageflowLinkBendpoint)iter.next();
      PageflowLinkBendpoint newBendPoint = factory
        .createPFLinkBendpoint();
      newBendPoint.setD1Height(bendPoint.getD1Height());
      newBendPoint.setD1Width(bendPoint.getD1Width());
      newBendPoint.setD2Height(bendPoint.getD2Height());
      newBendPoint.setD2Width(bendPoint.getD2Width());
      newLink.getBendPoints().add(newBendPoint);
    }
    copiedLinks.put(link, link);
    return newLink;
  }
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.layout.PageflowLayoutManager
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.emf.common.util.EList;

public abstract interface Pageflow
  extends PageflowElement
{
  public abstract EList getNodes();
  
  public abstract EList getLinks();
  
  public abstract String getConfigfile();
  
  public abstract void setConfigfile(String paramString);
  
  public abstract void connect(PageflowNode paramPageflowNode1, PageflowNode paramPageflowNode2, PageflowLink paramPageflowLink);
  
  public abstract String getDefaultNodeName(Class paramClass);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.Pageflow
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.impl.ReferenceElement;

public abstract interface PageflowElement
  extends EObject
{
  public abstract ReferenceElement getFCElements();
  
  public abstract String getName();
  
  public abstract void setName(String paramString);
  
  public abstract String getComment();
  
  public abstract void setComment(String paramString);
  
  public abstract int getX();
  
  public abstract void setX(int paramInt);
  
  public abstract int getY();
  
  public abstract void setY(int paramInt);
  
  public abstract int getWidth();
  
  public abstract void setWidth(int paramInt);
  
  public abstract int getHeight();
  
  public abstract void setHeight(int paramInt);
  
  public abstract String getId();
  
  public abstract void setId(String paramString);
  
  public abstract String getReferenceLink();
  
  public abstract void setReferenceLink(String paramString);
  
  public abstract void notifyModelChanged(Notification paramNotification);
  
  public abstract void update();
  
  public abstract void dispose();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowElement
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.emf.ecore.EFactory;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.impl.PageflowFactoryImpl;

public abstract interface PageflowFactory
  extends EFactory
{
  public static final PageflowFactory eINSTANCE = new PageflowFactoryImpl();
  
  public abstract Pageflow createPageflow();
  
  public abstract PageflowLink createPFLink();
  
  public abstract PageflowPage createPFPage();
  
  public abstract PageflowLinkBendpoint createPFLinkBendpoint();
  
  public abstract PageflowPackage getPageflowPackage();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowFactory
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import java.util.Vector;
import org.eclipse.emf.common.util.EList;

public abstract interface PageflowLink
  extends PageflowElement
{
  public abstract Pageflow getPageflow();
  
  public abstract void setPageflow(Pageflow paramPageflow);
  
  public abstract PageflowNode getTarget();
  
  public abstract void setTargetPath(String paramString);
  
  public abstract void setSourcePath(String paramString);
  
  public abstract void setTarget(PageflowNode paramPageflowNode);
  
  public abstract PageflowNode getSource();
  
  public abstract void setSource(PageflowNode paramPageflowNode);
  
  public abstract String getSmallicon();
  
  public abstract void setSmallicon(String paramString);
  
  public abstract String getLargeicon();
  
  public abstract void setLargeicon(String paramString);
  
  public abstract String getFromaction();
  
  public abstract void setFromaction(String paramString);
  
  public abstract String getOutcome();
  
  public abstract void setOutcome(String paramString);
  
  public abstract boolean isRedirect();
  
  public abstract void setRedirect(boolean paramBoolean);
  
  public abstract EList getBendPoints();
  
  public abstract void insertBendpoint(int paramInt, PageflowLinkBendpoint paramPageflowLinkBendpoint);
  
  public abstract void removeBendpoint(int paramInt);
  
  public abstract void setBendpoint(int paramInt, PageflowLinkBendpoint paramPageflowLinkBendpoint);
  
  public abstract void setBendpoints(Vector paramVector);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowLink
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.emf.ecore.EObject;

public abstract interface PageflowLinkBendpoint
  extends EObject
{
  public abstract int getD1Width();
  
  public abstract void setD1Width(int paramInt);
  
  public abstract int getD1Height();
  
  public abstract void setD1Height(int paramInt);
  
  public abstract int getD2Width();
  
  public abstract void setD2Width(int paramInt);
  
  public abstract int getD2Height();
  
  public abstract void setD2Height(int paramInt);
  
  public abstract float getWeight();
  
  public abstract void setWeight(float paramFloat);
  
  public abstract PageflowLink getLink();
  
  public abstract void setLink(PageflowLink paramPageflowLink);
  
  public abstract Dimension getFirstRelativeDimension();
  
  public abstract Dimension getSecondRelativeDimension();
  
  public abstract void setRelativeDimensions(Dimension paramDimension1, Dimension paramDimension2);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowLinkBendpoint
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.emf.common.util.EList;

public abstract interface PageflowNode
  extends PageflowElement
{
  public abstract Pageflow getPageflow();
  
  public abstract void setPageflow(Pageflow paramPageflow);
  
  public abstract EList getOutlinks();
  
  public abstract EList getInlinks();
  
  public abstract PageflowLink findLinkTo(PageflowNode paramPageflowNode);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowNode
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.impl.PageflowPackageImpl;

public abstract interface PageflowPackage
  extends EPackage
{
  public static final String eNAME = "pageflow";
  public static final String eNS_URI = "http://www.sybase.com/suade/pageflow";
  public static final String eNS_PREFIX = "pageflow";
  public static final PageflowPackage eINSTANCE = ;
  public static final int PAGEFLOW_ELEMENT = 3;
  public static final int PAGEFLOW_ELEMENT__NAME = 0;
  public static final int PAGEFLOW_ELEMENT__COMMENT = 1;
  public static final int PAGEFLOW_ELEMENT__X = 2;
  public static final int PAGEFLOW_ELEMENT__Y = 3;
  public static final int PAGEFLOW_ELEMENT__WIDTH = 4;
  public static final int PAGEFLOW_ELEMENT__HEIGHT = 5;
  public static final int PAGEFLOW_ELEMENT__ID = 6;
  public static final int PAGEFLOW_ELEMENT__REFERENCE_LINK = 7;
  public static final int PAGEFLOW_ELEMENT_FEATURE_COUNT = 8;
  public static final int PAGEFLOW = 0;
  public static final int PAGEFLOW__NAME = 0;
  public static final int PAGEFLOW__COMMENT = 1;
  public static final int PAGEFLOW__X = 2;
  public static final int PAGEFLOW__Y = 3;
  public static final int PAGEFLOW__WIDTH = 4;
  public static final int PAGEFLOW__HEIGHT = 5;
  public static final int PAGEFLOW__ID = 6;
  public static final int PAGEFLOW__REFERENCE_LINK = 7;
  public static final int PAGEFLOW__NODES = 8;
  public static final int PAGEFLOW__LINKS = 9;
  public static final int PAGEFLOW__CONFIGFILE = 10;
  public static final int PAGEFLOW_FEATURE_COUNT = 11;
  public static final int PAGEFLOW_NODE = 1;
  public static final int PAGEFLOW_NODE__NAME = 0;
  public static final int PAGEFLOW_NODE__COMMENT = 1;
  public static final int PAGEFLOW_NODE__X = 2;
  public static final int PAGEFLOW_NODE__Y = 3;
  public static final int PAGEFLOW_NODE__WIDTH = 4;
  public static final int PAGEFLOW_NODE__HEIGHT = 5;
  public static final int PAGEFLOW_NODE__ID = 6;
  public static final int PAGEFLOW_NODE__REFERENCE_LINK = 7;
  public static final int PAGEFLOW_NODE__PAGEFLOW = 8;
  public static final int PAGEFLOW_NODE__OUTLINKS = 9;
  public static final int PAGEFLOW_NODE__INLINKS = 10;
  public static final int PAGEFLOW_NODE_FEATURE_COUNT = 11;
  public static final int PF_LINK = 2;
  public static final int PF_LINK__NAME = 0;
  public static final int PF_LINK__COMMENT = 1;
  public static final int PF_LINK__X = 2;
  public static final int PF_LINK__Y = 3;
  public static final int PF_LINK__WIDTH = 4;
  public static final int PF_LINK__HEIGHT = 5;
  public static final int PF_LINK__ID = 6;
  public static final int PF_LINK__REFERENCE_LINK = 7;
  public static final int PF_LINK__PAGEFLOW = 8;
  public static final int PF_LINK__TARGET = 9;
  public static final int PF_LINK__SOURCE = 10;
  public static final int PF_LINK__OUTCOME = 11;
  public static final int PF_LINK__REDIRECT = 12;
  public static final int PF_LINK__BEND_POINTS = 13;
  public static final int PF_LINK__SMALLICON = 14;
  public static final int PF_LINK__LARGEICON = 15;
  public static final int PF_LINK__FROMACTION = 16;
  public static final int PF_LINK_FEATURE_COUNT = 17;
  public static final int PF_PAGE = 5;
  public static final int PF_PAGE__NAME = 0;
  public static final int PF_PAGE__COMMENT = 1;
  public static final int PF_PAGE__X = 2;
  public static final int PF_PAGE__Y = 3;
  public static final int PF_PAGE__WIDTH = 4;
  public static final int PF_PAGE__HEIGHT = 5;
  public static final int PF_PAGE__ID = 6;
  public static final int PF_PAGE__PAGEFLOW = 8;
  public static final int PF_PAGE__OUTLINKS = 9;
  public static final int PF_PAGE__INLINKS = 10;
  public static final int PF_PAGE__PATH = 11;
  public static final int PF_PAGE__SMALLICON = 12;
  public static final int PF_PAGE__LARGEICON = 13;
  public static final int PF_PAGE_FEATURE_COUNT = 14;
  public static final int PF_LINK_BENDPOINT = 8;
  public static final int PF_LINK_BENDPOINT__D1_WIDTH = 0;
  public static final int PF_LINK_BENDPOINT__D1_HEIGHT = 1;
  public static final int PF_LINK_BENDPOINT__D2_WIDTH = 2;
  public static final int PF_LINK_BENDPOINT__D2_HEIGHT = 3;
  public static final int PF_LINK_BENDPOINT__WEIGHT = 4;
  public static final int PF_LINK_BENDPOINT__LINK = 5;
  public static final int PF_LINK_BENDPOINT_FEATURE_COUNT = 6;
  
  public abstract EClass getPageflow();
  
  public abstract EReference getPageflow_Nodes();
  
  public abstract EReference getPageflow_Links();
  
  public abstract EAttribute getPageflow_Configfile();
  
  public abstract EClass getPageflowNode();
  
  public abstract EReference getPageflowNode_Pageflow();
  
  public abstract EReference getPageflowNode_Outlinks();
  
  public abstract EReference getPageflowNode_Inlinks();
  
  public abstract EClass getPFLink();
  
  public abstract EReference getPFLink_Pageflow();
  
  public abstract EReference getPFLink_Target();
  
  public abstract EReference getPFLink_Source();
  
  public abstract EAttribute getPFLink_Outcome();
  
  public abstract EAttribute getPFLink_Fromaction();
  
  public abstract EAttribute getPFLink_Redirect();
  
  public abstract EReference getPFLink_BendPoints();
  
  public abstract EClass getPageflowElement();
  
  public abstract EAttribute getPageflowElement_Name();
  
  public abstract EAttribute getPageflowElement_Comment();
  
  public abstract EAttribute getPageflowElement_X();
  
  public abstract EAttribute getPageflowElement_Y();
  
  public abstract EAttribute getPageflowElement_Width();
  
  public abstract EAttribute getPageflowElement_Height();
  
  public abstract EAttribute getPageflowElement_Id();
  
  public abstract EClass getPFPage();
  
  public abstract EAttribute getPFPage_Path();
  
  public abstract EAttribute getPFPage_Smallicon();
  
  public abstract EAttribute getPFPage_Largeicon();
  
  public abstract EClass getPFLinkBendpoint();
  
  public abstract EAttribute getPFLinkBendpoint_D1Width();
  
  public abstract EAttribute getPFLinkBendpoint_D1Height();
  
  public abstract EAttribute getPFLinkBendpoint_D2Width();
  
  public abstract EAttribute getPFLinkBendpoint_D2Height();
  
  public abstract EAttribute getPFLinkBendpoint_Weight();
  
  public abstract EReference getPFLinkBendpoint_Link();
  
  public abstract PageflowFactory getPageflowFactory();
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowPackage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model;

public abstract interface PageflowPage
  extends PageflowNode
{
  public abstract String getPath();
  
  public abstract void setPath(String paramString);
  
  public abstract String getSmallicon();
  
  public abstract void setSmallicon(String paramString);
  
  public abstract String getLargeicon();
  
  public abstract void setLargeicon(String paramString);
}

/* Location:
 * Qualified Name:     org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowPage
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.impl;

import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.Assert;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.jst.jsf.facesconfig.emf.FacesConfigFactory;
import org.eclipse.jst.jsf.facesconfig.emf.FromActionType;
import org.eclipse.jst.jsf.facesconfig.emf.FromOutcomeType;
import org.eclipse.jst.jsf.facesconfig.emf.IconType;
import org.eclipse.jst.jsf.facesconfig.emf.LargeIconType;
import org.eclipse.jst.jsf.facesconfig.emf.NavigationCaseType;
import org.eclipse.jst.jsf.facesconfig.emf.RedirectType;
import org.eclipse.jst.jsf.facesconfig.emf.SmallIconType;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowElement;
import org.eclipse.jst.jsf.facesconfig.ui.pageflow.synchronization.TransformUtil;

public class LinkReferenceElement
  extends ReferenceElement
{
  public void add(EObject object)
  {
    Assert.isTrue(object instanceof NavigationCaseType);
    clear();
    super.add(object);
  }
  
  public LinkReferenceElement(PageflowElement pageflowElement)
  {
    super(pageflowElement);
  }
  
  public LinkReferenceElement(PageflowElement pageflowElement, EObject facesConfigObject)
  {
    super(pageflowElement, facesConfigObject);
  }
  
  public void update()
  {
    for (Iterator nodes = getData().iterator(); nodes.hasNext();)
    {
      Object next = nodes.next();
      if (!TransformUtil.isValidFacesConfigElement((EObject)next)) {
        nodes.remove();
      }
    }
  }
  
  public Object get(int eFeature)
  {
    Object result = null;
    switch (eFeature)
    {
    case 1: 
      break;
    case 11: 
      if (!isEmpty())
      {
        FromOutcomeType outcome = 
          ((NavigationCaseType)getData().get(0)).getFromOutcome();
        if (outcome != null) {
          result = outcome.getTextContent();
        }
      }
      break;
    case 0: 
      break;
    case 12: 
      result = new Boolean(false);
      if (!isEmpty())
      {
        RedirectType outcome = ((NavigationCaseType)getData().get(0))
          .getRedirect();
        if (outcome != null) {
          result = new Boolean(true);
        }
      }
      break;
    case 16: 
      if (!isEmpty())
      {
        FromActionType fromActionType = 
          ((NavigationCaseType)getData().get(0)).getFromAction();
        if (fromActionType != null) {
          result = fromActionType.getTextContent();
        }
      }
      break;
    case 14: 
      if (!isEmpty())
      {
        List icons = ((NavigationCaseType)getData().get(0)).getIcon();
        if (icons.size() > 0) {
          result = ((IconType)icons.get(0)).getSmallIcon() != null ? 
            ((IconType)icons.get(0)).getSmallIcon().getTextContent() : 
            null;
        }
      }
      break;
    case 15: 
      if (!isEmpty())
      {
        List icons = ((NavigationCaseType)getData().get(0)).getIcon();
        if (icons.size() > 0) {
          result = ((IconType)icons.get(0)).getLargeIcon() != null ? 
            ((IconType)icons.get(0)).getLargeIcon().getTextContent() : 
            null;
        }
      }
      break;
    }
    return result;
  }
  
  public void set(EStructuralFeature eFeature, Object newVal)
  {
    switch (eFeature.getFeatureID())
    {
    case 1: 
      break;
    case 11: 
      FromOutcomeType oldOutcome = null;
      FromOutcomeType newOutcome = null;
      String newValue = (String)newVal;
      if (!isEmpty())
      {
        oldOutcome = 
          ((NavigationCaseType)getData().get(0)).getFromOutcome();
        if ((newValue == null) || (newValue.length() == 0))
        {
          ((NavigationCaseType)getData().get(0)).setFromOutcome(null);
        }
        else if (oldOutcome == null)
        {
          newOutcome = 
            FacesConfigFactory.eINSTANCE.createFromOutcomeType();
          newOutcome.setTextContent(newValue);
          ((NavigationCaseType)getData().get(0))
            .setFromOutcome(newOutcome);
        }
        else
        {
          oldOutcome.setTextContent(newValue);
        }
      }
      break;
    case 0: 
      break;
    case 12: 
      RedirectType redirect = null;
      RedirectType oldRedirect = null;
      boolean newRedirect = ((Boolean)newVal).booleanValue();
      if (!isEmpty())
      {
        oldRedirect = 
          ((NavigationCaseType)getData().get(0)).getRedirect();
        if (!newRedirect) {
          redirect = null;
        } else if (oldRedirect == null) {
          redirect = 
            FacesConfigFactory.eINSTANCE.createRedirectType();
        }
        ((NavigationCaseType)getData().get(0)).setRedirect(redirect);
      }
      break;
    case 16: 
      String newFromaction = (String)newVal;
      if (!isEmpty())
      {
        FromActionType oldFromActionType = ((NavigationCaseType)getData().get(0))
          .getFromAction();
        if ((newFromaction == null) || (newFromaction.length() == 0))
        {
          ((NavigationCaseType)getData().get(0)).setFromAction(null);
        }
        else if (oldFromActionType == null)
        {
          FromActionType newFromActionType = FacesConfigFactory.eINSTANCE
            .createFromActionType();
          newFromActionType.setTextContent(newFromaction);
          ((NavigationCaseType)getData().get(0))
            .setFromAction(newFromActionType);
        }
        else
        {
          oldFromActionType.setTextContent(newFromaction);
        }
      }
      break;
    case 14: 
      SmallIconType oldSmallicon = null;
      SmallIconType newSmallIconType = null;
      IconType icon = null;
      String newValue = (String)newVal;
      if (!isEmpty())
      {
        List ico
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd