Examples of EditPartViewer


Examples of org.eclipse.gef.EditPartViewer

    }
    if (part != null) {
      part.setModel(model);
      Widget widget = null;
      if (context != null) {
        EditPartViewer viewer = context.getViewer();
        if (viewer == null) {
          RootEditPart root = context.getRoot();
          if (root != null) {
            viewer = root.getViewer();
          }
        }
        if (viewer != null) {
          widget = viewer.getControl();
        }
      }
      if (widget == null) {
        widget = owner.getTree();
      }
View Full Code Here

Examples of org.eclipse.gef.EditPartViewer

public class GraphXYLayoutPolicy extends XYLayoutEditPolicy {

  @Override
  protected Command createAddCommand(EditPart child, Object constraint) {
    Activity activity = (Activity) child.getModel();
    EditPartViewer viewer = getHost().getViewer();
    AddCommand add = new AddCommand(activity.getDiagram().getTextEditor(), viewer);
    add.setParent((StructuredActivity) getHost().getModel());
    add.setChild(activity);
    return add;
  }
View Full Code Here

Examples of org.eclipse.gef.EditPartViewer

  }

  @Override
  protected Command getCreateCommand(CreateRequest request) {
    StructuredActivity parent = (StructuredActivity) getHost().getModel();
    EditPartViewer viewer = getHost().getViewer();
    CreateCommand command = new CreateCommand(parent.getDiagram().getTextEditor(), viewer);
    command.setParent(parent);
    Activity child = (Activity) request.getNewObject();
    Point location = request.getLocation();
    command.setBounds(putActivityAtLocation(child, location));
View Full Code Here

Examples of org.eclipse.gef.EditPartViewer

*/
public class StructuredActivityLayoutEditPolicy extends LayoutEditPolicy {

  protected Command createAddCommand(EditPart child) {
    Activity activity = (Activity) child.getModel();
    EditPartViewer viewer = getHost().getViewer();
    AddCommand add = new AddCommand(activity.getDiagram().getTextEditor(), viewer);
    add.setParent((StructuredActivity) getHost().getModel());
    add.setChild(activity);
    return add;
  }
View Full Code Here

Examples of org.eclipse.gef.EditPartViewer

   * @see LayoutEditPolicy#getCreateCommand(org.eclipse.gef.requests.CreateRequest)
   */
  @Override
  protected Command getCreateCommand(CreateRequest request) {
    StructuredActivity parent = (StructuredActivity) getHost().getModel();
    EditPartViewer viewer = getHost().getViewer();
    CreateCommand command = new CreateCommand(parent.getDiagram().getTextEditor(), viewer);
    command.setParent(parent);
    command.setChild((Activity) request.getNewObject());
    return command;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.