/** | |
* <copyright> | |
* | |
* Copyright (c) 2013 itemis and others. | |
* 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: | |
* itemis - Initial API and implementation | |
* | |
* </copyright> | |
*/ | |
package org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.edit.parts; | |
import java.util.Collections; | |
import java.util.List; | |
import org.eclipse.gef.GraphicalEditPart; | |
import org.eclipse.gef.Request; | |
import org.eclipse.gef.commands.Command; | |
import org.eclipse.gef.editpolicies.NonResizableEditPolicy; | |
import org.eclipse.gef.handles.MoveHandle; | |
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart; | |
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles; | |
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy; | |
import org.eclipse.gmf.runtime.notation.View; | |
import org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.edit.policies.ApplicationCanonicalEditPolicy; | |
import org.eclipse.sphinx.examples.hummingbird20.diagram.gmf.edit.policies.ApplicationItemSemanticEditPolicy; | |
/** | |
* @generated | |
*/ | |
public class ApplicationEditPart extends DiagramEditPart { | |
/** | |
* @generated | |
*/ | |
public final static String MODEL_ID = "Hummingbird20"; //$NON-NLS-1$ | |
/** | |
* @generated | |
*/ | |
public static final int VISUAL_ID = 1000; | |
/** | |
* @generated | |
*/ | |
public ApplicationEditPart(View view) { | |
super(view); | |
} | |
/** | |
* @generated | |
*/ | |
@Override | |
protected void createDefaultEditPolicies() { | |
super.createDefaultEditPolicies(); | |
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE, new ApplicationItemSemanticEditPolicy()); | |
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE, new ApplicationCanonicalEditPolicy()); | |
// removeEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.POPUPBAR_ROLE); | |
} | |
/** | |
* @generated | |
*/ | |
/* package-local */static class NodeLabelDragPolicy extends NonResizableEditPolicy { | |
/** | |
* @generated | |
*/ | |
@Override | |
@SuppressWarnings("rawtypes") | |
protected List createSelectionHandles() { | |
MoveHandle h = new MoveHandle((GraphicalEditPart) getHost()); | |
h.setBorder(null); | |
return Collections.singletonList(h); | |
} | |
/** | |
* @generated | |
*/ | |
@Override | |
public Command getCommand(Request request) { | |
return null; | |
} | |
/** | |
* @generated | |
*/ | |
@Override | |
public boolean understandsRequest(Request request) { | |
return false; | |
} | |
} | |
/** | |
* @generated | |
*/ | |
/* package-local */static class LinkLabelDragPolicy extends NonResizableLabelEditPolicy { | |
/** | |
* @generated | |
*/ | |
@Override | |
@SuppressWarnings("rawtypes") | |
protected List createSelectionHandles() { | |
MoveHandle mh = new MoveHandle((GraphicalEditPart) getHost()); | |
mh.setBorder(null); | |
return Collections.singletonList(mh); | |
} | |
} | |
} |