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: EcoreTextNonResizableEditPolicy.java,v 1.3 2009/02/02 08:39:06 jlescot Exp $ /
 
 
 package org.eclipse.emf.ecoretools.diagram.edit.policies;
 
 import java.util.List;
 
 import  org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableEditPolicyEx;
 import  org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx;
 import  org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;

Generated:
 
 public class EcoreTextNonResizableEditPolicy extends NonResizableEditPolicyEx {

Generated:
 

Generated:
 

Generated:
 

Generated:
 
 	protected void showPrimarySelection() {
 		if (getHostFigure() instanceof WrappingLabel) {
 			((WrappingLabel) getHostFigure()).setSelected(true);
 			((WrappingLabel) getHostFigure()).setFocus(true);
 		} else {
 		}
 	}

Generated:
 
 	protected void showSelection() {
 		if (getHostFigure() instanceof WrappingLabel) {
 			((WrappingLabel) getHostFigure()).setSelected(true);
 			((WrappingLabel) getHostFigure()).setFocus(false);
 		} else {
 		}
 	}

Generated:
 
 	protected void hideSelection() {
 		if (getHostFigure() instanceof WrappingLabel) {
 			((WrappingLabel) getHostFigure()).setSelected(false);
 			((WrappingLabel) getHostFigure()).setFocus(false);
 		} else {
 			if ( != null) {
 			}
 		}
 	}

Generated:
	protected void showFocus() {
		if (getHostFigure() instanceof WrappingLabel) {
			((WrappingLabel) getHostFigure()).setFocus(true);
else {
		}
	}

Generated:
	protected void hideFocus() {
		if (getHostFigure() instanceof WrappingLabel) {
			((WrappingLabel) getHostFigure()).setFocus(false);
else {
			if ( != null) {
			}
		}
	}

Generated:
		Rectangle bounds;
		if (getHostFigure() instanceof Label) {
			bounds = ((LabelgetHostFigure()).getTextBounds();
else {
		}
		return bounds;
	}

Generated:
		if (getHostFigure() instanceof Label) {
			Label feedbackFigure = new Label();
			feedbackFigure.setOpaque(true);
			return feedbackFigure;
else {
			RectangleFigure feedbackFigure = new RectangleFigure();
			feedbackFigure.setFill(false);
			return feedbackFigure;
		}
	}

Generated:
		return new Figure() {
			protected void paintFigure(Graphics graphics) {
				graphics.drawFocus(getBounds().getResized(-1, -1));
			}
		};
	}

Generated:
	protected void updateLabel(Label target) {
		Label source = (LabelgetHostFigure();
		target.setText(source.getText());
		target.setFont(source.getFont());
	}

Generated:
	protected void refreshSelectionFeedback() {
		if ( != null) {
			if ( instanceof Label) {
else {
			}
		}
	}

Generated:
	protected void refreshFocusFeedback() {
		if ( != null) {
		}
	}

Generated:
	public void refreshFeedback() {
	}

Generated:
		if ( == null) {
				public void figureMoved(IFigure source) {
				}
			};
		}
	}

Generated:
		MoveHandle moveHandle = new MoveHandle((GraphicalEditPartgetHost());
		moveHandle.setBorder(null);
		moveHandle.setDragTracker(new DragEditPartsTrackerEx(getHost()));
		return Collections.singletonList(moveHandle);
	}
New to GrepCode? Check out our FAQ X