update on copy & paste [message #55412] |
Mon, 25 September 2006 14:40 |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.04768 seconds