public Expression getEnablementExpression() throws CoreException { if (fEnablementExpression == null) { IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; if (enablement != null) { fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); } } return fEnablementExpression; }
/** * Converts the children of the given configuration element and adds them * to the given composite expression. * <p> * Note this is an internal method and should not be called by clients. * </p> * @param converter the converter used to do the actual conversion * @param element the configuration element for which the children * are to be processed * @param expression the composite expression representing the result * of the conversion * * @throws CoreException if the conversion failed * * @nooverride This method is not intended to be re-implemented or extended by clients. * @noreference This method is not intended to be referenced by clients. */ protected void processChildren(ExpressionConverter converter, IConfigurationElement element, CompositeExpression expression) throws CoreException { converter.processChildren(element, expression); }
/* package */ void processChildren(Element element, CompositeExpression result) throws CoreException { Node child = element.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { Expression exp= perform((Element)child); if (exp == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, child.getNodeName()), null)); result.add(exp); } child = child.getNextSibling(); } } }
/** * Returns the expression {@link Expression} declared in the * <code>enabledWhen</code> element. * * @param configElement * the configuration element * @param id * the id of the codemining provider. * @return the expression {@link Expression} declared in the enabledWhen * element. * @throws CoreException * when enabledWhen expression is not valid. */ private static Expression createEnabledWhen(IConfigurationElement configElement, String id) throws CoreException { final IConfigurationElement[] children = configElement.getChildren(ENABLED_WHEN_ATTR); if (children.length > 0) { IConfigurationElement[] subChildren = children[0].getChildren(); if (subChildren.length != 1) { throw new CoreException(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, "One <enabledWhen> element is accepted. Disabling " + id)); //$NON-NLS-1$ } final ElementHandler elementHandler = ElementHandler.getDefault(); final ExpressionConverter converter = ExpressionConverter.getDefault(); return elementHandler.create(converter, subChildren[0]); } throw new CoreException(new Status(IStatus.ERROR, TextEditorPlugin.PLUGIN_ID, "<enabledWhen> element is required. Disabling " + id)); //$NON-NLS-1$ }
/* package */ void processChildren(IConfigurationElement element, CompositeExpression result) throws CoreException { IConfigurationElement[] children= element.getChildren(); if (children != null) { for (IConfigurationElement configElement : children) { Expression child= perform(configElement); if (child == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, getDebugPath(configElement)), null)); result.add(child); } } }
/* package */ void processChildren(Element element, CompositeExpression result) throws CoreException { Node child = element.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { Expression exp= perform((Element)child); if (exp == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, child.getNodeName()), null)); result.add(exp); } child = child.getNextSibling(); } } }
/** * Create an AND-type core expression from an IConfigurationElement of * arbitrary name. The children elements are combined using boolean AND * semantics to evaluate the expression. * * @param element * An IConfigurationElement of arbitrary name. */ public CustomAndExpression(IConfigurationElement element) { Assert.isNotNull(element); IConfigurationElement[] children = element.getChildren(); if (children.length > 0) { fExpressions = new ArrayList(); } for (int i = 0; i < children.length; i++) { try { fExpressions.add(ElementHandler.getDefault().create( ExpressionConverter.getDefault(), children[i])); } catch (CoreException ce) { NavigatorPlugin.log(IStatus.ERROR, 0, ce.getMessage(), ce); } } }
/* package */ void processChildren(IConfigurationElement element, CompositeExpression result) throws CoreException { IConfigurationElement[] children= element.getChildren(); if (children != null) { for (int i= 0; i < children.length; i++) { Expression child= perform(children[i]); if (child == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, getDebugPath(children[i])), null)); result.add(child); } } }
public Expression getEnablementExpression() throws CoreException { if (fEnablementExpression == null) { IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; if (enablement != null) { fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); } } return fEnablementExpression; }
/* package */ void processChildren(Element element, CompositeExpression result) throws CoreException { Node child = element.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { Expression exp= perform((Element)child); if (exp == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, child.getNodeName()), null)); result.add(exp); } child = child.getNextSibling(); } } }
ExpressionConverter.getDefault(), children[0]);
/* package */ void processChildren(IConfigurationElement element, CompositeExpression result) throws CoreException { IConfigurationElement[] children= element.getChildren(); if (children != null) { for (int i= 0; i < children.length; i++) { Expression child= perform(children[i]); if (child == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, getDebugPath(children[i])), null)); result.add(child); } } }
/** * Converts the children of the given configuration element and adds them * to the given composite expression. * <p> * Note this is an internal method and should not be called by clients. * </p> * @param converter the converter used to do the actual conversion * @param element the configuration element for which the children * are to be processed * @param expression the composite expression representing the result * of the conversion * * @throws CoreException if the conversion failed * * @nooverride This method is not intended to be re-implemented or extended by clients. * @noreference This method is not intended to be referenced by clients. */ protected void processChildren(ExpressionConverter converter, IConfigurationElement element, CompositeExpression expression) throws CoreException { converter.processChildren(element, expression); }
public Expression getEnablementExpression() throws CoreException { if (fEnablementExpression == null) { IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; if (enablement != null) { fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); } } return fEnablementExpression; }
/* package */ void processChildren(Element element, CompositeExpression result) throws CoreException { Node child = element.getFirstChild(); while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { Expression exp= perform((Element)child); if (exp == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, child.getNodeName()), null)); result.add(exp); } child = child.getNextSibling(); } } }
try { enablement = ElementHandler.getDefault().create( ExpressionConverter.getDefault(), children[0]); } catch (CoreException e) { NavigatorPlugin.log(IStatus.ERROR, 0, e.getMessage(), e);
/* package */ void processChildren(IConfigurationElement element, CompositeExpression result) throws CoreException { IConfigurationElement[] children= element.getChildren(); if (children != null) { for (int i= 0; i < children.length; i++) { Expression child= perform(children[i]); if (child == null) throw new CoreException(new Status(IStatus.ERROR, ExpressionPlugin.getPluginId(), IStatus.ERROR, Messages.format( ExpressionMessages.Expression_unknown_element, getDebugPath(children[i])), null)); result.add(child); } } }
/** * Converts the children of the given configuration element and adds them * to the given composite expression. * <p> * Note this is an internal method and should not be called by clients. * </p> * @param converter the converter used to do the actual conversion * @param element the configuration element for which the children * are to be processed * @param expression the composite expression representing the result * of the conversion * * @throws CoreException if the conversion failed * * @nooverride This method is not intended to be re-implemented or extended by clients. * @noreference This method is not intended to be referenced by clients. */ protected void processChildren(ExpressionConverter converter, IConfigurationElement element, CompositeExpression expression) throws CoreException { converter.processChildren(element, expression); }
public Expression getEnablementExpression() throws CoreException { if (fEnablementExpression == null) { IConfigurationElement[] elements = fConfig.getChildren(ExpressionTagNames.ENABLEMENT); IConfigurationElement enablement = elements.length > 0 ? elements[0] : null; if (enablement != null) { fEnablementExpression = ExpressionConverter.getDefault().perform(enablement); } } return fEnablementExpression; }
while (child != null) { if (child.getNodeType() == Node.ELEMENT_NODE) { return new NotExpression(converter.perform((Element)child));