Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2007 Anyware Technologies All rights reserved. This program and the accompanying materials are 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: Anyware Technologies - initial API and implementation $Id: EEnumLiterals2EditPart.java,v 1.5 2009/04/27 10:04:00 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.parts;
 
 import  org.eclipse.gmf.runtime.diagram.ui.editparts.ListCompartmentEditPart;
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy;
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.ResizableCompartmentEditPolicy;
 import  org.eclipse.gmf.runtime.diagram.ui.figures.ResizableCompartmentFigure;
 import  org.eclipse.gmf.runtime.notation.View;

Generated:
 
 public class EEnumLiterals2EditPart extends ListCompartmentEditPart {

Generated:
 
 	public static final int VISUAL_ID = 5008;

Generated:
 
 	public EEnumLiterals2EditPart(View view) {
 		super(view);
 	}

Generated:
 
 	protected boolean hasModelChildrenChanged(Notification evt) {
 		return false;
 	}

Generated:
 
 	public String getCompartmentName() {
 	}

Generated:
NOT
 
 	public IFigure createFigure() {
 		ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
 		FlowLayout layout = new FlowLayout();
 		layout.setMajorSpacing(getMapMode().DPtoLP(0));
 		layout.setMinorSpacing(getMapMode().DPtoLP(0));
 		layout.setHorizontal(false);
 		result.getContentPane().setLayoutManager(layout);
 		result.setTitleVisibility(false);
 		return result;
 	}

Generated:
NOT
 
 	protected void createDefaultEditPolicies() {
 		super.createDefaultEditPolicies();
 		installEditPolicy(.new ResizableCompartmentEditPolicy());
 		installEditPolicy(EditPolicyRoles.SEMANTIC_ROLEnew EEnumLiterals2ItemSemanticEditPolicy());
 
 		// Use a custom Policy to create child elements and initialize their
 		// initial position
 		installEditPolicy(EditPolicyRoles.CREATION_ROLEnew CompartmentChildCreationEditPolicy());
 
 		installEditPolicy(EditPolicyRoles.DRAG_DROP_ROLEnew DragDropEditPolicy());
 		installEditPolicy(EditPolicyRoles.CANONICAL_ROLEnew EEnumLiterals2CanonicalEditPolicy());
 
 		// Add a policy used to reorder children
 	}

Generated:
	protected void setRatio(Double ratio) {
		// nothing to do -- parent layout does not accept Double constraints as
		// ratio
		// super.setRatio(ratio);
	}
	public boolean isSelectable() {
		// Bug 238814 : Compartment must not be selectable
		return false;
	}
New to GrepCode? Check out our FAQ X