public boolean isNamespaceAware(CMElementDeclaration ed) { return ed != null ? ed.getProperty("http://org.eclipse.wst/cm/properties/isNameSpaceAware") != null : false; //$NON-NLS-1$ }
/** */ public static boolean isWholeTagOmissible(CMElementDeclaration decl) { if (!(decl.supports(HTMLCMProperties.OMIT_TYPE))) return false; String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE); return omitType.equals(HTMLCMProperties.Values.OMIT_BOTH); }
public void visitCMElementDeclaration(CMElementDeclaration ed) { if (ed.getProperty("http://org.eclipse.wst/cm/properties/definitionInfo") != null) //$NON-NLS-1$ { super.visitCMElementDeclaration(ed); } }
private static CMNamedNodeMap getProhibitedAncestors(CMElementDeclaration dec) { if (!dec.supports(HTMLCMProperties.PROHIBITED_ANCESTORS)) return null; return (CMNamedNodeMap) dec.getProperty(HTMLCMProperties.PROHIBITED_ANCESTORS); }
/** */ public static boolean isCaseSensitive(CMElementDeclaration decl) { if (decl == null || (!decl.supports(HTMLCMProperties.SHOULD_IGNORE_CASE))) return false; return !((Boolean) decl.getProperty(HTMLCMProperties.SHOULD_IGNORE_CASE)).booleanValue(); }
/** */ public static boolean isSSI(CMElementDeclaration edec) { if (edec == null) return false; if (!edec.supports(HTMLCMProperties.IS_SSI)) return false; return ((Boolean) edec.getProperty(HTMLCMProperties.IS_SSI)).booleanValue(); }
/** */ protected boolean canInsertBreakAfter(CMElementDeclaration decl) { if (decl == null) return false; if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); if (hint == null) return false; return (hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END) || hint.equals(HTMLCMProperties.Values.BREAK_AFTER_START)); }
/** */ protected boolean canInsertBreakBefore(CMElementDeclaration decl) { if (decl == null) return false; if (!decl.supports(HTMLCMProperties.LINE_BREAK_HINT)) return false; String hint = (String) decl.getProperty(HTMLCMProperties.LINE_BREAK_HINT); if (hint == null) return false; return hint.equals(HTMLCMProperties.Values.BREAK_BEFORE_START_AND_AFTER_END); }
/** */ public static boolean isEndTagOmissible(CMElementDeclaration decl) { if (!(decl.supports(HTMLCMProperties.OMIT_TYPE))) return false; String omitType = (String) decl.getProperty(HTMLCMProperties.OMIT_TYPE); return !omitType.equals(HTMLCMProperties.Values.OMIT_NONE); }
/** * @param decl * @return true if decl is a JSP tag */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) { return false; } return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)) .booleanValue(); } }
/** * Test whether this is the JSP core tag. * * @param decl * @return true if decl is a jsp element declaration */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) { return false; } Boolean b = (Boolean) decl.getProperty(HTMLCMProperties.IS_JSP); return b.booleanValue(); }
protected String getFallbackNamepaceURI(CMElementDeclaration ed) { String fallbackNamepaceURI = null; CMDocument cmDocument = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$ if (cmDocument != null) { fallbackNamepaceURI = (String)cmDocument.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI"); //$NON-NLS-1$ } return fallbackNamepaceURI; }
/** */ public static boolean isJSP(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_JSP)) return false; return ((Boolean) decl.getProperty(HTMLCMProperties.IS_JSP)).booleanValue(); }
/** */ public static boolean isXHTML(CMElementDeclaration decl) { if (!decl.supports(HTMLCMProperties.IS_XHTML)) return false; return ((Boolean) decl.getProperty(HTMLCMProperties.IS_XHTML)).booleanValue(); }
private static Collection gatherInclusions(Collection ancestors) { Vector inclusions = new Vector(); Iterator iter = ancestors.iterator(); while (iter.hasNext()) { CMElementDeclaration decl = (CMElementDeclaration) iter.next(); if (decl.supports(HTMLCMProperties.INCLUSION)) { CMContent inclusion = (CMContent) decl.getProperty(HTMLCMProperties.INCLUSION); if (inclusion != null) inclusions.add(inclusion); } } return inclusions; }
public String getElementValueHelper(Element element) { String result = null; ModelQuery mq = ModelQueryUtil.getModelQuery(element.getOwnerDocument()); if ((result == null) && (mq != null)) { CMElementDeclaration ed = mq.getCMElementDeclaration(element); if ((ed != null) && !Boolean.TRUE.equals(ed.getProperty("isInferred"))) { //$NON-NLS-1$ result = decriptionBuilder.buildDescription(ed); } } return result != null ? result : ""; //$NON-NLS-1$ }
/** * */ protected String createContentSpecificationForCMElementDeclaration(CMElementDeclaration ed) { CMDocument document = (CMDocument)ed.getProperty("CMDocument"); //$NON-NLS-1$ String uri = document != null ? (String)document.getProperty("http://org.eclipse.wst/cm/properties/targetNamespaceURI") : null; //$NON-NLS-1$ String string = ed.getNodeName(); if (uri != null) { string = "[" + uri + "]" + string; //$NON-NLS-1$ //$NON-NLS-2$ } return string; }
protected CMElementDeclaration getSubstitution(CMElementDeclaration ed) { CMElementDeclaration result = ed; CMNodeList l = (CMNodeList) ed.getProperty("SubstitutionGroup"); //$NON-NLS-1$ if (l != null) { for (int i = 0; i < l.getLength(); i++) { CMNode candidate = l.item(i); if (!isAbstract(candidate) && (candidate instanceof CMElementDeclaration)) { result = (CMElementDeclaration) candidate; break; } } } return result; }
protected void contributeUnconstrainedAttributeActions(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd) { if (isUnconstrainedActionAllowed()) { if ((parentEd == null) || (parentEd.getProperty("isInferred") == Boolean.TRUE) || (modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT)) { //$NON-NLS-1$ contributeAction(menu, createAddAttributeAction(parentElement, null)); } } }
protected void contributeUnconstrainedAddElementAction(IMenuManager menu, Element parentElement, CMElementDeclaration parentEd, int index) { if (isUnconstrainedActionAllowed()) { if ((parentEd == null) || (parentEd.getProperty("isInferred") == Boolean.TRUE) || ((modelQuery.getEditMode() != ModelQuery.EDIT_MODE_CONSTRAINED_STRICT) && isElementAllowed(parentEd))) { //$NON-NLS-1$ contributeAction(menu, createAddElementAction(parentElement, null, index)); } } }