Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323068 - outline selection moves in linked mode
Summary: outline selection moves in linked mode
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-18 12:51 EDT by Henrik Lindberg CLA
Modified: 2017-09-19 16:21 EDT (History)
1 user (show)

See Also:
jan: helios+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Henrik Lindberg CLA 2010-08-18 12:51:02 EDT
Currently, if outline nodes are added for attributes the outline does not behave as a user would expect.

If the outline view is linked to the editor, it works to click on entries in the outline and the editor shows what was clicked on. For regular objects it works fine, but when clicking on an attribute node, the correct place is selected in the text, but then focus/selection jumps to the containing node in the outline.

It is understandable that the selection needs to move in linked mode if the selected item does not have any visual representation, but if it has visual representation, the selected node should stay selected IMO.
(This is also somewhat related to bug 323065).

Here is how I create the node for the attribute "version" of a "unit":

public ContentOutlineNode createNode(BuildUnit unit, ContentOutlineNode outlineParentNode) {
    ContentOutlineNode result = super.createNode(unit, outlineParentNode);

    if(unit.getVersion() != null) {
      AbstractNode versionNode = BeeLangNodeUtils.getFirstFeatureNode(unit, "version");
      if(versionNode != null) {
        EObjectHandleImpl<EObject> handle = new EObjectHandleImpl<EObject>(unit, getResourceAccess());
        StyledString label = new StyledString("version");
        label.append(" : " + versionFormatManager.toString(unit.getVersion()), StyledString.DECORATIONS_STYLER);
        ContentOutlineNode n = new ContentOutlineNode(
          label, imageHelper.getImage(BeeLangLabelProvider.FEATURE), new Region(
            versionNode.getOffset(), versionNode.getLength()), handle, B3BuildPackage.Literals.BUILD_UNIT);
        result.getChildren().add(n);
      }
    }
...
return result;
}

It was suggested that I try result.addChildren(n) instead, but this has no effect.
Comment 1 Henrik Lindberg CLA 2010-08-19 10:26:05 EDT
This is related to bug 297473
Comment 2 Jan Koehnlein CLA 2010-08-20 11:25:37 EDT
Should be fixed with bug 322656.
Comment 3 Karsten Thoms CLA 2017-09-19 16:21:43 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.