Examples of Snippet


Examples of org.apache.lucene.search.postingshighlight.Snippet

        //if there's at least one highlighted snippet, we return all the highlighted ones
        //otherwise we return the first non highlighted one if available
        if (filteredSnippets.size() == 0) {
            if (snippets.size() > 0) {
                Snippet snippet = snippets.get(0);
                //if we did discrete per value highlighting using whole break iterator (as number_of_fragments was 0)
                //we need to obtain the first sentence of the first value
                if (numberOfFragments == 0) {
                    BreakIterator bi = BreakIterator.getSentenceInstance(Locale.ROOT);
                    String text = snippet.getText();
                    bi.setText(text);
                    int next = bi.next();
                    if (next != BreakIterator.DONE) {
                        String newText = text.substring(0, next).trim();
                        snippet = new Snippet(newText, snippet.getScore(), snippet.isHighlighted());
                    }
                }
                filteredSnippets.add(snippet);
            }
        }
View Full Code Here

Examples of org.cfeclipse.snipex.Snippet

        } else if(inputElement instanceof SnipEx || inputElement instanceof Library) {
          Library lib = ((Library)inputElement);
          Iterator it = lib.getSnippets().iterator();
         
          while( it.hasNext() ) {
            Snippet snip = (Snippet)it.next();
            if( snip.isTemplate() ) {
              allFiles.add(snip);
            }
          }
         
        }
View Full Code Here

Examples of org.cfeclipse.snipex.Snippet

     
    } else {
      if(element instanceof SnipEx || element instanceof Library) {
        return CFPluginImages.get(CFPluginImages.ICON_PACKAGE_SNIPEX);
      } else if(element instanceof Snippet) {
        Snippet snip = (Snippet)element;
        if(snip.isTemplate()) {
          return CFPluginImages.get(CFPluginImages.ICON_TEMPLATE_SNIP);
        } else {
          return CFPluginImages.get(CFPluginImages.ICON_SNIP);
        }
      }
View Full Code Here

Examples of org.cfeclipse.snipex.Snippet

            Library lib = (Library)element;
            text.setText(lib.getName());
            preview.setText(lib.getDescription());
           
          } else if(element instanceof Snippet) {
            Snippet snip = (Snippet)element;
            text.setText(snip.getDescription());
            preview.setText(snip.getStartText()+snip.getEndText());
           
          }
        }
      }
    });
View Full Code Here

Examples of org.cfeclipse.snipex.Snippet

      IFile activeFile = null;
      if (iep.getEditorInput() instanceof IFileEditorInput) {
        activeFile = ((IFileEditorInput) iep.getEditorInput()).getFile();
      }
     
      Snippet snip = (Snippet)element;
      startBlock = SnipVarParser.parse(snip.getStartText(),activeFile,this.getViewSite().getShell());
      endBlock = SnipVarParser.parse(snip.getEndText(),activeFile,this.getViewSite().getShell());
    }
   
   
    if (startBlock != null && endBlock != null) {
        tmpAction.setEnclosingStrings(startBlock,endBlock);
View Full Code Here

Examples of org.cfeclipse.snippet.snipex.Snippet

            Library lib = (Library)element;
            //text.setText(lib.getName());
            preview.setText(lib.getDescription());
           
          } else if(element instanceof Snippet) {
            Snippet snip = (Snippet)element;
            text.setText(snip.getDescription());
            preview.setText(snip.getStartText()+snip.getEndText());
           
          }
        }
      }
    });
View Full Code Here

Examples of org.cfeclipse.snippet.snipex.Snippet

      IFile activeFile = null;
      if (iep.getEditorInput() instanceof IFileEditorInput) {
        activeFile = ((IFileEditorInput) iep.getEditorInput()).getFile();
      }
     
      Snippet snip = (Snippet)element;
      startBlock = SnipVarParser.parse(snip.getStartText(),activeFile,this.getViewSite().getShell());
      endBlock = SnipVarParser.parse(snip.getEndText(),activeFile,this.getViewSite().getShell());
    }
   
   
    if (startBlock != null && endBlock != null) {
        tmpAction.setEnclosingStrings(startBlock,endBlock);
View Full Code Here

Examples of org.cfeclipse.snippet.snipex.Snippet

//        if(lib.getDescription().matches(searchString) || lib.getName().matches(searchString)) {         
//          return true;
//        }
       
      } else {
        Snippet snip = (Snippet) element;
        if(snip.getDescription().matches(searchString) || snip.getName().matches(searchString)) {         
          return true;
        }
      }

      return false;
View Full Code Here

Examples of org.cfeclipse.snippet.snipex.Snippet

     
    } else {
      if(element instanceof SnipEx || element instanceof Library) {
        return CFPluginImages.get(CFPluginImages.ICON_PACKAGE_SNIPEX);
      } else if(element instanceof Snippet) {
        Snippet snip = (Snippet)element;
        if(snip.isTemplate()) {
          return CFPluginImages.get(CFPluginImages.ICON_TEMPLATE_SNIP);
        } else {
          return CFPluginImages.get(CFPluginImages.ICON_SNIP);
        }
      }
View Full Code Here

Examples of org.snippr.business.entities.Snippet

        }
    }

    @Override
    public void prepareForCreate() {
        snippet = new Snippet();
    }
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.