Examples of IProperty


Examples of com.intellij.lang.properties.IProperty

    final List<IProperty> properties = PropertiesImplUtil.findPropertiesByKey(project, name);

    String value = null;

    // 1. default.properties from struts2-core.jar
    final IProperty strutsDefaultProperty = ContainerUtil.find(properties, new Condition<IProperty>() {
      public boolean value(final IProperty property) {
        final VirtualFile virtualFile = property.getPropertiesFile().getVirtualFile();
        return virtualFile != null &&
               virtualFile.getFileSystem() instanceof JarFileSystem &&
               StringUtil.endsWith(virtualFile.getPath(), STRUTS_DEFAULT_PROPERTIES) &&
               ModuleUtilCore.moduleContainsFile(module, virtualFile, true);
      }
    });
    if (strutsDefaultProperty != null) {
      value = strutsDefaultProperty.getValue();
    }

    // 2. <constant> from StrutsModel
    final Condition<Constant> constantNameCondition = new Condition<Constant>() {
      public boolean value(final Constant constant) {
        return Comparing.equal(constant.getName().getStringValue(), name);
      }
    };

    final List<DomFileElement<StrutsRoot>> domFileElements = new ArrayList<DomFileElement<StrutsRoot>>();
    collectStrutsXmls(domFileElements, strutsModel, "struts-default.xml", true);
    collectStrutsXmls(domFileElements, strutsModel, "struts-plugin.xml", true);
    collectStrutsXmls(domFileElements, strutsModel, "struts.xml", false);
    for (final DomFileElement<StrutsRoot> domFileElement : domFileElements) {
      final Constant constant = ContainerUtil.find(domFileElement.getRootElement().getConstants(),
                                                   constantNameCondition);
      final String strutsXmlValue = constant != null ? constant.getValue().getStringValue() : null;
      if (strutsXmlValue != null) {
        value = strutsXmlValue;
      }
    }

    // 3. struts.properties in current module
    final IProperty strutsProperty = ContainerUtil.find(properties, new Condition<IProperty>() {
      public boolean value(final IProperty property) {
        final VirtualFile virtualFile = property.getPropertiesFile().getVirtualFile();
        return virtualFile != null &&
               Comparing.equal(virtualFile.getName(), STRUTS_PROPERTIES_FILENAME) &&
               ModuleUtilCore.moduleContainsFile(module, virtualFile, false);
      }
    });
    if (strutsProperty != null) {
      value = strutsProperty.getValue();
    }

    // 4. web.xml
    final WebFacet webFacet = WebUtil.getWebFacet(context);
    if (webFacet == null) {
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

     */
    public void testUnpersistingMissingOperation()
    {
        Query query = new Query();
        Collection availableProperties = query.getAvailableProperties();
        IProperty existingProperty = (IProperty)availableProperties.iterator().next();

        Query.addCriteria(query, existingProperty.getDescriptor(), "missingOperation", null);
        assertEquals("Criteria using missing operation should be skipped.",
            0, query.getCriteriaCount());
    }
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

        return buf.toString();
    }

    private String serializeToString(ICriteria aCriteria)
    {
        IProperty property = aCriteria.getProperty();
        IComparisonOperation operation = aCriteria.getComparisonOperation();
        String value = aCriteria.getValue();

        StringBuffer buf = new StringBuffer();

        buf.append(property.getDescriptor()).append(':');
        buf.append(operation.getDescriptor()).append(':');
        buf.append(escapeValue(value));

        return buf.toString();
    }
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

    }

    static void addCriteria(Query aQuery, String propertyDescriptor,
        String operationDescriptor, String value)
    {
        IProperty property = aQuery.getPropertyByDescriptor(propertyDescriptor);
        if (property != null)
        {
            IComparisonOperation operation =
                property.getComparsonOperationByDescriptor(operationDescriptor);

            if (operation != null)
            {
                ICriteria criteria = aQuery.addCriteria();
                criteria.setProperty(property);
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

    private void setCriteria(ICriteria aCriteria)
    {
        criteria = aCriteria;

        IProperty property = criteria.getProperty();
        IComparisonOperation operation = criteria.getComparisonOperation();

        if (property != null)
        {
            if (!getSelectedProperty().equals(property))
            {
                cbProperty.setSelectedItem(property);
                valueEditor.setType(property.getType());
            } else
            {
                propertySelected(property);
            }
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

        cbOperation.addItemListener(new OperationSelectionListener());
    }

    private void propertySelected(IProperty property)
    {
        IProperty criteriaProperty = criteria.getProperty();
        boolean differentProperty = criteriaProperty == null || !criteriaProperty.equals(property);

        if (differentProperty) criteria.setProperty(property);
        fillComparisonOperations(property);
        if (differentProperty)
        {
            String currentValue = criteria.getValue();
            if (StringUtils.isEmpty(currentValue) ||
                (criteriaProperty == null || INCOMPATIBLE.contains(criteriaProperty.getClass())) ||
                (INCOMPATIBLE.contains(property.getClass())) ||
                property.validateValue(criteria.getComparisonOperation(), currentValue) != null)
            {
                criteria.setValue(property.getDefaultValue());
            }
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

     * Adds new criteria and corresponding row to the table.
     */
    void addEmptyCriteria()
    {
        // We want Article Text to be the first because it is the most obvious and helps the user understand the dialog box.
        IProperty firstProperty = ArticleTextProperty.INSTANCE;
        IComparisonOperation firstOperation =
            (IComparisonOperation)firstProperty.getComparsonOperations().iterator().next();
        String defaultValue = firstProperty.getDefaultValue();

        ICriteria criteria = query.addCriteria();
        criteria.setProperty(firstProperty);
        criteria.setComparisonOperation(firstOperation);
        criteria.setValue(defaultValue);
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

        ICriteria criteria = query.addCriteria();

        assertNotNull("Criteria is bad.", SmartFeedDialog.validateSearchFeedData(query, true, 1));

        IProperty someProperty = (IProperty)query.getAvailableProperties().toArray()[0];
        IComparisonOperation someOperation = (IComparisonOperation)someProperty.getComparsonOperations().toArray()[0];
        criteria.setProperty(someProperty);
        criteria.setComparisonOperation(someOperation);
        criteria.setValue("1");

        assertEquals("Query is ok.", null, SmartFeedDialog.validateSearchFeedData(query, true, 1));
View Full Code Here

Examples of com.salas.bb.domain.query.IProperty

    private static SearchFeed searchFeed(int n)
    {
        // Create Query
        Query q = new Query();
        Collection props = q.getAvailableProperties();
        IProperty p = (IProperty)props.iterator().next();
        IComparisonOperation op = (IComparisonOperation)p.getComparsonOperations().iterator().next();
        ICriteria c = q.addCriteria();
        c.setProperty(p);
        c.setComparisonOperation(op);
        c.setValue(Integer.toString(n));
View Full Code Here

Examples of edu.pitt.dbmi.nlp.noble.ontology.IProperty

   */
  public boolean evaluate(Object obj){
    if(obj instanceof IInstance){
      IInstance inst = (IInstance) obj;
      // see if this instance has a value that fits this restriction
      IProperty prop = getProperty();
     
      // is property satisfied
      boolean satisfied = isPropertySatisfied(prop, inst);
     
      // check if there is evidence to contradict inverse property
      // then the instance becomes inconsistent again
      if(satisfied && isPropertySatisfied(prop.getInverseProperty(), inst)){
        satisfied = false;
      }
      return satisfied;
    }else{
      return super.evaluate(obj);
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.