Examples of JsonTreeNode


Examples of org.sourceforge.jsonedit.core.outline.node.JsonTreeNode

   * Returns the styled text contained in the tree element.
   */
  public StyledString getStyledText(Object element) {
    StyledString styledString = new StyledString();
    if (element instanceof JsonTreeNode) {
      JsonTreeNode node = (JsonTreeNode) element;
      return node.getStyledString();
    }
    return styledString;
  }
View Full Code Here

Examples of org.sourceforge.jsonedit.core.outline.node.JsonTreeNode

    ISelection selection= event.getSelection();
   
    if (selection.isEmpty())
      fTextEditor.resetHighlightRange();
    else {
      JsonTreeNode jsonTreeNode = (JsonTreeNode) ((IStructuredSelection) selection).getFirstElement();
      if (jsonTreeNode.isTextSelection()) {
        jsonTreeNode.setTextSelection(false);
        return;
      }
     
      int start= jsonTreeNode.getStart();
      int length= jsonTreeNode.getLength();
      try {
        fTextEditor.selectAndReveal(start, length);
      } catch (IllegalArgumentException x) {
        fTextEditor.resetHighlightRange();
      }
View Full Code Here

Examples of org.sourceforge.jsonedit.core.outline.node.JsonTreeNode

    if (selection instanceof ITextSelection) {
      ITextSelection textSelection = (ITextSelection) selection;
      int start = textSelection.getOffset();
      int length = textSelection.getLength();
     
      JsonTreeNode element = fContentProvider.findNearestElement(start, length);
      if (element != null) {
        element.setTextSelection(true);
        getTreeViewer().reveal(element);
        TreeSelection treeSelection = new TreeSelection(new TreePath(new Object[]{element}));
        getTreeViewer().setSelection(treeSelection);
      }
    }
View Full Code Here

Examples of org.sourceforge.jsonedit.core.outline.node.JsonTreeNode

   * @param length
   * @return
   */
  private JsonTreeNode findNearestElement(JsonTreeNode parent, int start, int length) {
   
    JsonTreeNode previous = null;
    boolean found = false;
   
    if (parent.getChildren().size() == 0) {
      return parent;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.