Examples of FileReference


Examples of com.yiistorm.references.FileReference

                    int start = textRange.getStartOffset();
                    int len = textRange.getLength();

                    //System.out.println("Temp pour int : " + (System.nanoTime() - startTime) / 1000000 + " ms");

                    PsiReference ref = new FileReference(file, uri, element,
                            new TextRange(start, start + len), YiiPsiReferenceProvider.project, protectedPathDir, protectedPathDir);
                    return new PsiReference[]{ref};
                }
            }
View Full Code Here

Examples of com.yiistorm.references.FileReference

                        String className = element.getText();
                        VirtualFile v = ARRelationReferenceProvider.getClassFile(className);
                        VirtualFile appDir = baseDir.findFileByRelativePath(viewPath);
                        VirtualFile protectedPathDir = (!protectedPath.equals("")) ? baseDir.findFileByRelativePath(protectedPath) : null;
                        if (appDir != null) {
                            PsiReference ref = new FileReference(v, str.substring(textRange.getStartOffset(), textRange.getEndOffset())
                                    , element,
                                    textRange, YiiPsiReferenceProvider.project, protectedPathDir, appDir);
                            return new PsiReference[]{ref};
                        }
                    }
View Full Code Here

Examples of com.yiistorm.references.FileReference

                    filepath = viewAbsolutePath + "/" + uri.replace("//", "");
                }
                VirtualFile file = baseDir.findFileByRelativePath(filepath);

                if (file != null && appDir != null) {
                    PsiReference ref = new FileReference(file, uri, element,
                            new TextRange(start, start + len), YiiPsiReferenceProvider.project, protectedPathDir, appDir);
                    return new PsiReference[]{ref};
                }
            }
            return PsiReference.EMPTY_ARRAY;
View Full Code Here

Examples of com.yiistorm.references.FileReference

                        String uri = str.substring(textRange.getStartOffset(), textRange.getEndOffset());
                        int start = textRange.getStartOffset();
                        int len = textRange.getLength();

                        if (widgetfile != null) {
                            PsiReference ref = new FileReference(widgetfile, uri, element,
                                    new TextRange(start, start + len), project, protectedPathDir, protectedPathDir);
                            return new PsiReference[]{ref};
                        }
                        return PsiReference.EMPTY_ARRAY;
                    }
View Full Code Here

Examples of com.yiistorm.references.FileReference

                    }

                    if (file != null) {

                        if (appDir != null) {
                            PsiReference ref = new FileReference(file, uri, element,
                                    textRange, YiiPsiReferenceProvider.project, protectedVirtual, appDir);
                            return new PsiReference[]{ref};
                        }
                    }
                }
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference

            return emptyList();
        }

        Annotation annotation = persistentProperty.findAnnotation(FileReference.class);

        FileReference fileReference = (FileReference) annotation;

        if (isEmpty(fileReference.baseDirectory())) {
            if (lightAdminConfiguration.getFileStorageDirectory() != null) {
                return emptyList();
            }
            return newArrayList(validationContext.missingBaseDirectoryInFileReferenceProblem(fieldMetadata.getName()));
        }

        final File directory = getFile(fileReference.baseDirectory());
        if (directory.exists() && directory.isDirectory()) {
            return emptyList();
        }

        return newArrayList(validationContext.missingBaseDirectoryInFileReferenceProblem(fieldMetadata.getName()));
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference

        this.fileStorageDirectory = fileStorageDirectory;
    }

    @Override
    public File persistentPropertyFileReference(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);
        String relativeFilePath = persistentPropertyFileRelativePath(entity, persistentProperty);

        if (propertyBaseDirectoryExists(fileReference)) {
            return getFile(fileReference.baseDirectory(), relativeFilePath);
        }

        return getFile(this.fileStorageDirectory, relativeFilePath);
    }
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference

        return getFile(this.fileStorageDirectory, relativeFilePath);
    }

    @Override
    public File persistentPropertyFileDirectory(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);

        if (propertyBaseDirectoryExists(fileReference)) {
            return getFile(fileReference.baseDirectory(), persistentPropertyFileDirectoryRelativePath(entity, persistentProperty));
        }
        return getFile(this.fileStorageDirectory, persistentPropertyFileDirectoryRelativePath(entity, persistentProperty));
    }
View Full Code Here

Examples of org.lightadmin.api.config.annotation.FileReference

        return Joiner.on(separator).join(persistentPropertyFileDirectoryRelativePath(entity, persistentProperty), FILE_NAME);
    }

    private boolean propertyValueFileExists(Object entity, PersistentProperty persistentProperty) {
        FileReference fileReference = fileReferenceAnnotation(persistentProperty);
        String propertyValue = propertyValueAsString(entity, persistentProperty);

        File fileDirectory = propertyBaseDirectoryExists(fileReference) ? getFile(fileReference.baseDirectory()) : this.fileStorageDirectory;

        File file = getFile(fileDirectory, propertyValue);

        return file.isFile() && file.exists();
    }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.FileReference

       
        example.setExampleModel(ref);

        // make a new FileReference for the example .html
        // as per issue 128, this will be in a new location
        FileReference file = factory.createFileReference();
        file.setPlugin(examplePlugin);
        file.setPackage(jc.getName());
        file.setName(jc.getName() + ".html");
        root.getReferences().add(file);
       
        example.setExampleLocation(file);

        target.getExamples().add(example);
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.