Examples of IStructuredDocumentContext


Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

    @Override
    public DTELExpression getELExpression(final IModelContext genericContext)
    throws ViewHandlerException
    {
        final IStructuredDocumentContext context =
            (IStructuredDocumentContext) genericContext
            .getAdapter(IStructuredDocumentContext.class);

        if (context == null)
        {
            throw new ViewHandlerException(Cause.EL_NOT_FOUND);
        }

        ITextRegionContextResolver resolver =
            IStructuredDocumentContextResolverFactory.INSTANCE
            .getTextRegionResolver(context);

        String elText = null;

        if (resolver != null)
        {
            final String regionType = resolver.getRegionType();

            if (regionType != null && resolver.matchesRelative(new String[]
                                                                          { DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE }))
            {
                // if we are in the EL content, then get the current region
                // text
                if (DOMJSPRegionContexts.JSP_VBL_CONTENT.equals(regionType))
                {
                    elText = resolver.getRegionText();
                }
                // otherwise, we may be at the end of a content region but
                // at
                // the beginning of a closing brace so check to see if the
                // previous
                // region was a VBL_CONTENT
                else if (regionType.equals(DOMJSPRegionContexts.JSP_VBL_CLOSE))
                {
                    final IStructuredDocumentContext previousContext =
                        resolver.getPreviousContext();

                    final ITextRegionContextResolver prevResolver =
                        IStructuredDocumentContextResolverFactory.INSTANCE
                        .getTextRegionResolver(previousContext);

                    if (prevResolver != null)
                    {
                        if (DOMJSPRegionContexts.JSP_VBL_CONTENT
                                .equals(prevResolver.getRegionType()))
                        {
                            resolver = prevResolver;
                            elText = prevResolver.getRegionText();
                        }
                        else if (DOMJSPRegionContexts.JSP_VBL_OPEN
                                .equals(prevResolver.getRegionType()))
                        {
                            elText = ""; //$NON-NLS-1$
                        }
                    }
                }
            }
        }

        if (elText != null)
        {
            final IStructuredDocumentContext elContext =
                IStructuredDocumentContextFactory.INSTANCE.getContext(
                        context.getStructuredDocument(), resolver
                        .getStartOffset());
            return new DTELExpression(elContext, elText);
        }
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

*/
public class JSPDefaultSymbolFactory extends AbstractContextSymbolFactory
{
    protected ISymbol internalCreate(String symbolName,int scope,IAdaptable context,List problems, IAdditionalContextSymbolInfo additionInfo)
    {
        final IStructuredDocumentContext sContext =
            (IStructuredDocumentContext)
                context.getAdapter(IStructuredDocumentContext.class);
       
        final IDOMContextResolver domResolver =
            IStructuredDocumentContextResolverFactory.INSTANCE.getDOMContextResolver(sContext);
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

    @Override
    public List<Node> getViewDefnRoots(final IDocument container)
    {
        final List<Node> roots = new ArrayList<Node>();

        final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
                .getContext(container, -1);

        if (context != null)
        {
            final IDOMContextResolver resolver = IStructuredDocumentContextResolverFactory.INSTANCE
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

            final IAdaptable services = ((DTUIViewRoot) root).getServices();
            final Object serviceAdapter = services
                    .getAdapter(XMLViewObjectMappingService.class);
            if (serviceAdapter instanceof XMLViewObjectMappingService)
            {
                final IStructuredDocumentContext context = getContext(viewDefnObject);

                if (context != null)
                {
                    final String uri = getNamespace((Element) viewDefnObject,
                            context.getStructuredDocument());
                    final ElementData elementData = XMLViewObjectMappingService
                            .createElementData(uri, viewDefnObject
                                    .getLocalName(), context,
                                    Collections.EMPTY_MAP);
                    return ((XMLViewObjectMappingService) serviceAdapter)
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

    private IJavaProject getJavaProject(final IAdaptable context)
    {
        if (context != null)
        {
            final IStructuredDocumentContext sContext = (IStructuredDocumentContext) context
                    .getAdapter(IStructuredDocumentContext.class);
            if (sContext != null)
            {
                final IProject project = FileContextUtil
                        .getProject((IStructuredDocumentContext) context
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

    protected ISymbol internalCreate(final String symbolName, final int scope,
            final IAdaptable context, final List problems,
            final IAdditionalContextSymbolInfo additionalInfo)
    {
        final Node node = getNode(context);
        final IStructuredDocumentContext sContext = getContext(context);

        final String valueAttrName = additionalInfo
                .getValueExpressionAttributeName();
        if (node != null && valueAttrName != null)
        {
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

                // generic code
                final String elText = AppConfigValidationUtil
                        .extractELExpression(attr.getValue()).getElText();
                final IFile file = FileContextUtil
                        .deriveIFileFromContext(sContext);
                final IStructuredDocumentContext elContext = IStructuredDocumentContextFactory.INSTANCE
                        .getContext(sContext.getStructuredDocument(), attr);
                if (elText != null && file != null && elContext != null)
                {
                    final ValueType valueExpr = _factory
                            .getValueTypeFromEL(elText, elContext, file);
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

        return javaProject != null && (node instanceof Element) || (node instanceof Attr);
    }

    private Node getNode(final IAdaptable context)
    {
        final IStructuredDocumentContext sContext = getContext(context);
        if (sContext != null)
        {
            final IDOMContextResolver domResolver = IStructuredDocumentContextResolverFactory.INSTANCE
                    .getDOMContextResolver(sContext);
            if (domResolver != null)
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

        return null;
    }

    private IJavaProject getJavaProject(final IAdaptable context)
    {
        final IStructuredDocumentContext sContext = getContext(context);
       
        if (sContext != null)
        {
            final IProject project = FileContextUtil
            .getProject((IStructuredDocumentContext) sContext
                    .getAdapter(IStructuredDocumentContext.class));
            if (project != null)
            {
                return JavaCore.create(project);
            }
View Full Code Here

Examples of org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext

  public MDEnabledComboDialogField(int flags) {
    super(flags);
  }

  public void setElementContext(IDOMNode ancester, IDOMElement element) {
    IStructuredDocumentContext sdContext =IStructuredDocumentContextFactory.INSTANCE.getContext(element.getStructuredDocument(), element);
    IPropertyPageDescriptor ppd = (IPropertyPageDescriptor)getAttachedData("KEY_ATTR");//FIXME use constant //$NON-NLS-1$
    ppd.setStructuredDocumentContext(sdContext);
    IPossibleValues pvs = (IPossibleValues)ppd.getAdapter(IPossibleValues.class);
    IDefaultValue def = (IDefaultValue)ppd.getAdapter(IDefaultValue.class);
    if (def != null)
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.