Examples of IStructuredDocument


Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

   * setStructuredDocument method
   *
   * @param structuredDocument
   */
  public void setStructuredDocument(IStructuredDocument structuredDocument) {
    IStructuredDocument oldStructuredDocument = super.getStructuredDocument();
    if (structuredDocument == oldStructuredDocument)
      return; // nothing to do
    if (oldStructuredDocument != null)
      oldStructuredDocument.removeDocumentChangingListener(this);
    super.setStructuredDocument(structuredDocument);
    if (structuredDocument != null) {
      internalSetNewDocument(structuredDocument);
      structuredDocument.addDocumentChangingListener(this);
    }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

    setErrorMessage(null);
    boolean addProposal = false;

    if (node.getNodeType() == Node.ELEMENT_NODE) {
      // ////////////////////////////////////////////////////////////////////////////////////
      IStructuredDocument sDoc = (IStructuredDocument) context.getDocument();
      IStructuredDocumentRegion xmlEndTagOpen = sDoc.getRegionAtCharacterOffset(contentAssistRequest.getReplacementBeginPosition());
      // skip backward to "<", "</", or the (unclosed) start tag, null if not found
      String type = ""; //$NON-NLS-1$
      while ((xmlEndTagOpen != null) &&
          ((type = xmlEndTagOpen.getType()) != DOMRegionContext.XML_END_TAG_OPEN) &&
          (type != DOMRegionContext.XML_TAG_CLOSE) && !needsEndTag(xmlEndTagOpen, context) &&
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

        // TODO Is it possible to update colors when preferences changed...?
      Color colorVariable  = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_VAR);
      Color colorDirective = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_DIR);
      Color colorComment   = ClickPlugin.getDefault().getColorManager().get(ClickPlugin.PREF_COLOR_CMT);

        IStructuredDocument document = getDocument();

        for(Iterator ite = results.iterator(); ite.hasNext();){
            StyleRange styleRange = (StyleRange)ite.next();

            IStructuredDocumentRegion region = document.getRegionAtCharacterOffset(styleRange.start);
            String text = region.getText();
            int mStart = styleRange.start - region.getStartOffset();
            int mEnd = mStart + styleRange.length;
            for(IStructuredDocumentRegion chkRegion = region.getPrevious(); chkRegion != null; chkRegion = chkRegion.getPrevious()){
                String type = chkRegion.getType();
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

   
    IStructuredModel model = null;
   
    try {
      model = StructuredModelManager.getModelManager().getModelForRead(file);
      IStructuredDocument doc = model.getStructuredDocument();
      IStructuredDocumentRegion curNode = doc.getFirstStructuredDocumentRegion();
      while (null != (curNode = curNode.getNext()) && !monitor.isCanceled()) {
        if (curNode.getType() == DOMRegionContext.XML_TAG_NAME) {
          ITextRegionList list = curNode.getRegions();
          String text = curNode.getText();
          String tagName  = null;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

     * @return the metadata context for uri in the DOM model or null if none.
     */
    public static ITaglibDomainMetaDataModelContext getMetadataContext(
            final String uri, final IDOMModel model)
    {
        final IStructuredDocument doc = model.getDocument()
                .getStructuredDocument();

        final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
                .getContext(doc, -1);
        final IWorkspaceContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

        return status;
    }

    private static IFile getFile(IDOMDocument domDoc)
    {
        final IStructuredDocument sdoc = domDoc.getStructuredDocument();
        if (sdoc != null)
        {
            return ResolverUtil.getFileForDocument(sdoc);
        }
        return null;
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

    // connect to new viewer/undo manager
    fTextViewer = (StructuredTextViewer) viewer;
    IDocument doc = fTextViewer.getDocument();
    if (doc instanceof IStructuredDocument) {
      IStructuredDocument structuredDocument = (IStructuredDocument) doc;
      setDocument(structuredDocument);
    }
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

  /**
   */
  protected void replaceSource(IStructuredDocumentRegion flatNode, int offset, int length, String source) {
    if (flatNode == null)
      return;
    IStructuredDocument structuredDocument = flatNode.getParentDocument();
    if (structuredDocument == null)
      return;
    if (source == null)
      source = new String();
    int startOffset = flatNode.getStartOffset();
    if (structuredDocument.containsReadOnly(startOffset + offset, length))
      return;
    // We use 'structuredDocument' as the requester object just so this
    // and the other
    // format-related 'repalceText' (in replaceSource) can use the same
    // requester.
    // Otherwise, if requester is not identical,
    // the undo group gets "broken" into multiple pieces based
    // on the requesters being different. Technically, any unique, common
    // requester object would work.
    structuredDocument.replaceText(structuredDocument, startOffset + offset, length, source);
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

  /**
   */
  protected void replaceSource(IDOMModel model, int offset, int length, String source) {
    if (model == null)
      return;
    IStructuredDocument structuredDocument = model.getStructuredDocument();
    if (structuredDocument == null)
      return;
    if (source == null)
      source = new String();
    if (structuredDocument.containsReadOnly(offset, length))
      return;
    // We use 'structuredDocument' as the requester object just so this
    // and the other
    // format-related 'repalceText' (in replaceSource) can use the same
    // requester.
    // Otherwise, if requester is not identical,
    // the undo group gets "broken" into multiple pieces based
    // on the requesters being different. Technically, any unique, common
    // requester object would work.
    structuredDocument.replaceText(structuredDocument, offset, length, source);
  }
View Full Code Here

Examples of org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument

  protected void setWidth(HTMLFormatContraints contraints, Node node) {
    if (contraints == null)
      return;
    if (node == null)
      return;
    IStructuredDocument structuredDocument = ((IDOMNode) node).getStructuredDocument();
    if (structuredDocument == null)
      return; // error

    if (!splitLines())
      return;
    int lineWidth = getLineWidth();
    if (lineWidth < 0)
      return;

    int offset = ((IDOMNode) node).getStartOffset();
    int line = structuredDocument.getLineOfOffset(offset);
    int lineOffset = 0;
    try {
      lineOffset = structuredDocument.getLineOffset(line);
    }
    catch (BadLocationException ex) {
      return; // error
    }
    if (lineOffset > offset)
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.