Package com.salesforce.ide.core.model

Examples of com.salesforce.ide.core.model.Component


        for (IRunTestFailureExt runTestFailure : runTestFailures) {
            monitorCheck(monitor);

            // get resource (file, usually) to associate a message/project/failure/warning and displayed in problems
            // view
            Component component =
                    projectPackageList.getComponentByNameType(runTestFailure.getName(), Constants.APEX_CLASS);
            if (component == null) {
                logger.warn("Unable to handle run test message - could not find component '" + runTestFailure.getName()
                        + "' in list.  Will attempt to find w/in project");
                try {
                    IFile file =
                            getComponentFileByNameType(projectPackageList.getProject(), runTestFailure.getName(),
                                new String[] { Constants.APEX_CLASS });

                    if (file != null) {
                        setRunTestFailureMarker(file, runTestFailure);
                    } else if (projectPackageList.getProject() != null) {
                        StringBuffer strBuff = new StringBuffer();
                        strBuff.append("Unable to get file resource for '").append(runTestFailure.getName())
                                .append("' for code coverage warning '").append(runTestFailure.getMessage())
                                .append("'. Assigning failure to project.");
                        logger.warn(strBuff.toString());
                        MarkerUtils.getInstance().applyRunTestFailureMarker(projectPackageList.getProject(),
                            runTestFailure.getMessage());
                    } else {
                        logger.warn("Unable to get file resource for '" + runTestFailure.getName()
                                + "' for run test failure " + runTestFailure.getMessage());
                    }
                } catch (CoreException e) {
                    String logMessage = Utils.generateCoreExceptionLog(e);
                    logger.warn("Unable to get file resource for '" + runTestFailure.getName() + "' for failure "
                            + runTestFailure.getMessage() + ": " + logMessage, e);
                } catch (FactoryException e) {
                    logger.error("Unable to get file resource for '" + runTestFailure.getName() + "' for failure "
                            + runTestFailure.getMessage(), e);
                }
                continue;
            }

            MarkerUtils.getInstance().applyDirty(component.getFileResource());
            setRunTestFailureMarker(component.getFileResource(), runTestFailure);
            applyWarningsToAssociatedComponents(projectPackageList, component);

            try {
                component.getFileResource().findMarkers(MarkerUtils.getInstance().MARKER_RUN_TEST_FAILURE, true,
                    IResource.DEPTH_INFINITE);
            } catch (CoreException e) {
                String logMessage = Utils.generateCoreExceptionLog(e);
                logger.warn("Unable apply run test marker on component resource: " + logMessage, e);
            }
View Full Code Here


            return null;
        }

        ComponentList componentList = new ComponentList();
        for (DeploymentComponent deploymentComponent : this) {
            Component component = deploymentComponent.getComponent();
            componentList.add(deploymentComponent.getComponent());

            if (includeMetadata && component.isMetadataComposite() && !component.isMetadataInstance()) {
                Component compositeComponent = getComponentByFilePath(component.getCompositeMetadataFilePath());
                if (compositeComponent != null) {
                    componentList.add(compositeComponent);
                }
            }
        }
View Full Code Here

        if (isEmpty() || Utils.isEmpty(filepath)) {
            return null;
        }

        for (DeploymentComponent deploymentComponent : this) {
            Component component = deploymentComponent.getComponent();
            if (!component.isCaseSensitive() && filepath.equalsIgnoreCase(component.getMetadataFilePath())) {
                return component;
            } else if (filepath.equals(component.getMetadataFilePath())) {
                return component;
            }
        }

        return null;
View Full Code Here

        if (isEmpty() || Utils.isEmpty(filepath)) {
            return null;
        }

        for (DeploymentComponent deploymentComponent : this) {
            Component component = deploymentComponent.getComponent();
            if (!component.isCaseSensitive() && filepath.equalsIgnoreCase(component.getMetadataFilePath())) {
                return deploymentComponent;
            } else if (filepath.equals(component.getMetadataFilePath())) {
                return deploymentComponent;
            }
        }

        return null;
View Full Code Here

                continue;
            }

            // get resource (file, usually) to associate a message/project/failure/warning and displayed in problems
            // view
            Component component =
                    projectPackageList.getApexCodeComponent(codeCoverageWarning.getName(),
                        codeCoverageWarning.getMessage());

            if (component == null) {
                logger.warn("Unable to handle code coverage warning - could not find component '"
                        + codeCoverageWarning.getName() + "' in list.  Will attempt to find w/in project");
                try {
                    IFile file =
                            getComponentFileByNameType(project, codeCoverageWarning.getName(), new String[] {
                                    Constants.APEX_CLASS, Constants.APEX_TRIGGER });
                    if (file != null) {
                        applyCodeCoverageWarningMarker(file, codeCoverageWarning.getMessage());
                    } else if (project != null) {
                        StringBuffer strBuff = new StringBuffer("Unable to get file resource for '");
                        strBuff.append(codeCoverageWarning.getName()).append("' for code coverage warning '")
                                .append(codeCoverageWarning.getMessage()).append("'. Assigning warning to project.");
                        logger.warn(strBuff.toString());
                        applyCodeCoverageWarningMarker(project, codeCoverageWarning.getMessage());
                    } else {
                        logger.warn("Unable to get file resource for '" + codeCoverageWarning.getName()
                                + "' for code coverage warning " + codeCoverageWarning.getMessage());
                    }
                } catch (Exception e) {
                    logger.error("Unable to get file resource for '" + codeCoverageWarning.getName()
                            + "' for code coverage warning " + codeCoverageWarning.getMessage(), e);
                }
                continue;
            }
            applyCodeCoverageWarningMarker(component.getFileResource(), codeCoverageWarning.getMessage());
        }

        monitorWork(monitor);
    }
View Full Code Here

        // get local components
        monitorWorkCheck(monitor, "Retrieving local project contents...");
        monitorCheck(monitor);
        ProjectPackageList localProjectPackageList = null;

        Component component = null;
        try {
            component = getComponentFactory().getComponentFromFile(file, true);
        } catch (FactoryException e) {
            logger.warn("Unable to check in sync for file '" + file.getName()
                    + "' - unable to create component from file");
            return true;
        }

        if (component.isPackageManifest()) {
            logger.warn("Component is a package manifest - skipping as sync file resource");
            // REVIEWME: what if the user wants to sync a package manifest?
            return true;
        }
View Full Code Here

        }

        for (DeploymentComponent deploymentComponent : deploymentComponents) {
            if (deploymentComponent.isDeploy()) {
                deploySelectedComponents.add(deploymentComponent);
                Component component = deploymentComponent.getComponent();
                if (includeMetadata && component.isMetadataComposite() && !component.isMetadataInstance()) {
                    DeploymentComponent compositeDeploymentComponent =
                            deploymentComponents.getByFilePath(component.getCompositeMetadataFilePath());
                    if (compositeDeploymentComponent != null) {
                        deploySelectedComponents.add(compositeDeploymentComponent);
                    }
                }
            }
View Full Code Here

        apexTrigger.setOperations(new ArrayList<String>(operations));
        apexTrigger.intiNewBody(apexTrigger.getNewBodyFromTemplateString());
        componentList.add(apexTrigger);

        // prepare metadata body and component
        Component metadataComponent = componentFactory.getCompositeComponentFromComponent(component);
        saveMetadata(metadataComponent);
    }
View Full Code Here

    public void loadAdditionalComponentAttributes() throws FactoryException, JAXBException {
        // load code body and add to component list
        componentList.add(component);

        // prepare metadata body and component
        Component metadataComponent = componentFactory.getCompositeComponentFromComponent(component);
        saveMetadata(metadataComponent);
    }
View Full Code Here

        return deployMessage.getFileName();
    }

    private String getDisplayName(ICodeCoverageResultExt codeCoverageResult) {
        String componentName = getDisplayName(codeCoverageResult.getNamespace(), codeCoverageResult.getName());
        Component component = null;
        try {
            component =
                    projectService.getComponentFactory().getComponentByComponentType(
                        apexPrefixCheck(codeCoverageResult.getType()));
        } catch (FactoryException e) {
            logger.error("Unable to locate corresponding component based on CodeCoverageResult type '"
                    + codeCoverageResult.getType() + "' ", e);
        }
        return componentName
                + (Utils.isNotEmpty(component) ? " (" + component.getComponentType() + ")" : " ("
                        + codeCoverageResult.getType() + ")");
    }
View Full Code Here

TOP

Related Classes of com.salesforce.ide.core.model.Component

Copyright © 2018 www.massapicom. 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.