Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » update on copy & paste
update on copy & paste [message #55412] Mon, 25 September 2006 14:40
Eclipse UserFriend
Originally posted by: vcciubot.uwaterloo.ca

Hi all,

I've managed to get pasting into compartments to work.
The main issue I had was that copy & paste worked just with the top level
diagram.


In summary, the gmf copy & paste implementation can be easily modified to
work with compartments but for some reason it doesn't allow it.

Hope this helps other folks.

cheers
Vlad


The following in the NotationClipboardOperationHelper class have to be
overridden (fork the class because some methods are private):

static EObject getSemanticPasteTarget(View view) {
Diagram diagram = getContainingDiagram(view);
if (diagram != null) {
return diagram.getElement();
}
return null;
}

should become smth like

static EObject getSemanticPasteTarget(View view) {

View parent = (View) view.eContainer();

return parent.getElement();

}


and

private boolean shouldAllowPaste(
PasteChildOperation overriddenChildPasteOperation) {
EObject eObject = overriddenChildPasteOperation.getEObject();
EObject parentEObject = overriddenChildPasteOperation
.getParentEObject();
if ((parentEObject instanceof Diagram) && (eObject instanceof View)) {

.....
}

should be modified to allow pasting into Nodes, too.
Previous Topic:Node with multiple Connection
Next Topic:Problem markers
Goto Forum:
  


Current Time: Sun Jun 08 12:38:28 EDT 2025

Powered by FUDForum. Page generated in 0.02941 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top