Community
Participate
Working Groups
To reproduce: - Create a LED on a GMF logic diagram. - Use connector handle or palette tool to create a note attachment from the LED to an unspecified target. - Select Note. RESULT: Everything is created ok, but the note attachment is highlighted. I think the new note created should be highlighted so that you can immediately enter text. I think this would be the natural flow.
Do you know if there are any workarounds for this bug that I can use temporarily?
Found a workaround: In a custom ContainerNodeEditPolicy I overrided the following method: protected Command getConnectionAndEndCommands(CreateConnectionRequest request) { Command cmd = super.getConnectionAndEndCommands(request); if (cmd instanceof CompoundCommand) { CompoundCommand cc = (CompoundCommand) cmd; List commands = cc.getCommands(); for (Iterator iter = commands.iterator(); iter.hasNext();) { Command subCommand = (Command) iter.next(); if (subCommand instanceof EtoolsProxyCommand) { ICommand iCmd = ((EtoolsProxyCommand) subCommand).getICommand(); if (iCmd instanceof CreateViewAndOptionallyElementCommand) { CreateViewAndOptionallyElementCommand createView = (CreateViewAndOptionallyElementCommand) iCmd; PerformDirectEditOnEndCommand perform = new PerformDirectEditOnEndCommand(createView, (IGraphicalEditPart) getHost()); cc.add(perform); break; } } } } return cmd; } I also added this private class: private static class PerformDirectEditOnEndCommand extends Command { private final CreateViewAndOptionallyElementCommand other; private final IGraphicalEditPart part; public PerformDirectEditOnEndCommand(CreateViewAndOptionallyElementCommand other, IGraphicalEditPart part) { this.other = other; this.part = part; } public void execute() { View v = (View) other.getResult().getAdapter(View.class); if (part != null) { final IGraphicalEditPart node = (IGraphicalEditPart) part.findEditPart(null, ViewUtil.resolveSemanticElement(v)); if (node != null) { PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay().asyncExec(new Runnable() { public void run() { node.performRequest(new Request(RequestConstants.REQ_DIRECT_EDIT)); } }); } } } } This seems to work for me. (Sorry for the bad formatting)
I fixed this in the ConnectionCreationTool instead since this is where we have code already to perform direct edits. I modified ConnectionCreationTool so that all IPrimaryEditParts that have been created will be selected and priority will be given to the first shape created to be put into direct edit mode.
[target cleanup] 1.0 RC was the original target milestone for this bug
[GMF Restructure] Bug 319140 : product GMF and component Runtime Diagram was the original product and component for this bug