Package org.cfeclipse.cfml.parser.docitems

Examples of org.cfeclipse.cfml.parser.docitems.DocItem


   * editor
   */
  protected void jumpToItem() {
    // get a handle to the current editor and assign it to our temp action
    IEditorPart iep = getSite().getPage().getActiveEditor();
    DocItem selecteditem = getSelectedDocItem();

    if (selecteditem == null)
      return;

    ITextEditor editor = (ITextEditor) iep;
    // editor.setHighlightRange(selecteditem.getStartPosition(),selecteditem.getMatchingItem().getEndPosition(),true);
    editor.setHighlightRange(selecteditem.getStartPosition(), 0, true);
  }
View Full Code Here


  /**
   * filters the outline on the currenly selected element
   */
  protected void filterOnSelected() {
    DocItem selecteditem = getSelectedDocItem();

    if (selecteditem == null)
      return;

    filter = "//" + selecteditem.getName();
    reload();
  }
View Full Code Here

    });
  }
 
  public void reload() {
    if (filter.length() == 0) {
      DocItem di = getRootInput();
      reload(di);
    } else {
      reload(getItems(filter));
    }
  }
View Full Code Here

      reload(getItems(filter));
    }
  }

  private void updateTreeExpansion() {
    DocItem root = getRootInput();
    if (!getTreeViewer().getExpandedState(root) && root.hasChildren() && root.getFirstChild().getName().compareToIgnoreCase("cfcomponent") == 0) {
      getTreeViewer().setExpandedState(root.getFirstChild(), true);
      getTreeViewer().refresh(root, false);
    }
//    boolean wasModelEmpty= fIsModelEmpty;
//    fIsModelEmpty= fModel == null || fModel.getProjectNode() == null;
//    if (wasModelEmpty && !fIsModelEmpty) {
View Full Code Here

  private void fillContextMenu(IMenuManager mgr) {
    mgr.add(selectAction);
    mgr.add(new Separator());
    mgr.add(filterOnAction);
    DocItem di = getSelectedDocItem();
    if (di != null) {
      String sname = di.getName();
      if (filter.length() > 0) {
        mgr.add(removeFilters);
      }
      if (sname.equals("cfinclude") || sname.equals("cfmodule")) {
        mgr.add(openAction);
View Full Code Here

   * method to open the currently selected docitem if its a include or a
   * module item
   */
  private void openFile() {
    IEditorPart iep = getSite().getPage().getActiveEditor();
    DocItem selecteditem = getSelectedDocItem();
    if (selecteditem == null)
      return;

    String si = selecteditem.getName();
    if (si.equalsIgnoreCase("cfinclude") || si.equalsIgnoreCase("cfmodule")) {
      gfa.setActiveEditor(null, iep);
      gfa.run(null);
    }
  }
View Full Code Here

    // createControl)
    if (selection != null && selection instanceof ITextSelection) {
      IEditorPart curEditor = workbench.getSite().getWorkbenchWindow().getActivePage().getActiveEditor();
      if (curEditor != null && curEditor instanceof CFMLEditor) {
        CFMLEditor curDoc = (CFMLEditor) curEditor;
        DocItem tagItem = curDoc.getSelectionCursorListener().getSelectedTag();
        if (tagItem != null) {
          setSelectedDocItem(tagItem);
        }
      }
    }
View Full Code Here

        CFDocument elparso =  parser.parseDoc(circuitFile);
     
      //CFDocument parsedDoc = parser.getParseResult();
     
      if(elparso != null){
        DocItem rootItem = elparso.getDocumentRoot();
        //Find the CFScript Items
        CFNodeList circuitscripts = rootItem.selectNodes("//cfscript");
        if(circuitscripts != null){
          Iterator scriptIter = circuitscripts.iterator();
         
          while(scriptIter.hasNext()){
            CfmlTagItem tag = (CfmlTagItem)scriptIter.next();
            //Get the full contents,
            String tagContents = circuitFile.substring(tag.getStartPosition(), tag.getEndPosition());
            cleanCircuits.append(tagContents);
           
          }
        }
       
        //Now add all the cfset items
        CFNodeList circuitsets = rootItem.selectNodes("//cfset");
        if(circuitsets != null){
          Iterator setIter = circuitsets.iterator();
         
          while(setIter.hasNext()){
            CfmlTagItem tag = (CfmlTagItem)setIter.next();
View Full Code Here

     
      try{
        CFDocument swtichDoc =  parser.parseDoc(switchContents);
       
        if(swtichDoc != null){
          DocItem rootItem = swtichDoc.getDocumentRoot();
          CFNodeList switchItems = rootItem.selectNodes("//cfcase");
          Iterator switchIter = switchItems.iterator();
         
          while(switchIter.hasNext()){
            CfmlTagItem tag = (CfmlTagItem)switchIter.next();
            if(tag != null){
View Full Code Here

    //CFMLEditor curDoc = (CFMLEditor) this.fViewer.getDocument();
    //ICFDocument cfd = (ICFDocument) curDoc.getDocumentProvider().getDocument(curDoc.getEditorInput());
    TextSelection sel = (TextSelection) this.fViewer.getSelection();
    int startPos = sel.getOffset();
    ICFDocument cfd = (ICFDocument) this.fViewer.getDocument();
    DocItem cti = cfd.getTagAt(startPos, startPos, true);
    if(cti != null && this.selectedTag != null) {
      if(cti.getStartPosition() == this.selectedTag.getStartPosition()){       
        this.selectedTagWasSelected = true;
      } else {
        clearTagBeginEndMarkers();
        this.selectedTagWasSelected = false;       
      }
    } else {
      clearTagBeginEndMarkers();     
    }
    this.selectedTag = null;
    try {
      // cfcomponent returns ASTVarDeclaration -- syntax is null for whatever reason (ASTVar's from cfscript?!)
      if(cti != null
        && !cti.getName().equals("CfmlComment") && !cti.getName().equals("cfscript")
          && !cti.getName().startsWith("AST") && !cti.getName().equals("ScriptItem")) {
        if (cti instanceof CfmlTagItem) {
          if (cti.getName().equals("CfmlCustomTag") || ((TagItem) cti).hasClosingTag()) {
            markBeginEndTags((CfmlTagItem) cti);
          }
        }
    }
    } catch (Exception e) {
      System.err.println(cti.getName());
      e.printStackTrace();
    }     
    CFEPartitioner partitioner = (CFEPartitioner)cfd.getDocumentPartitioner();   
    CFEPartition part = partitioner.findClosestPartition(startPos);
    if(part == null) {
View Full Code Here

TOP

Related Classes of org.cfeclipse.cfml.parser.docitems.DocItem

Copyright © 2018 www.massapicom. 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.