Package com.salesforce.ide.core.model

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


                // setContentEntityId
                Method setContentEntityIdMethod = containerMemberType.getMethod("setContentEntityId", String.class);
                setContentEntityIdMethod.invoke(containerMember, cmp.getId());

                Component metadata = getCorrespondingMetaComponentIfAny(cmp, cmps);
                if (metadata != null) {
                    try {
                        setMetadata(containerMember, metadata);
                    } catch (Exception e) {
                        logger.warn(
View Full Code Here


    ServiceException, ForceRemoteException, InterruptedException {
        return (isNameUniqueLocalCheck() && isNameUniqueRemoteCheck(monitor));
    }

    public boolean isNameUniqueLocalCheck() {
        final Component componentToCheck = getComponent();
        final String dirPath =
                (componentToCheck != null) ? (new StringBuffer(Constants.SOURCE_FOLDER_NAME).append(File.separator)
                        .append(componentToCheck.getDefaultFolder())).toString() : null;

                        final String fileName =
                                (componentToCheck != null) ? (new StringBuffer(componentToCheck.getName()).append(".")
                                        .append(componentToCheck.getFileExtension())).toString() : null;

                                        final String componentName_Absolute =
                                                (dirPath != null && fileName != null) ? (new StringBuffer(dirPath).append(fileName)).toString() : null;

                                                if (logger.isInfoEnabled()) {
                                                    logger.info("Ensure local uniqueness for '"
                                                            + (Utils.isEmpty(componentName_Absolute) ? "" : componentName_Absolute.toString()) + "'");
                                                }

                                                return (!componentToCheck.isCaseSensitive()) ? checkInFolder(dirPath, fileName) : true;
    }
View Full Code Here

            logger.warn("Remote unique name check aborted - project is not online enabled");
            return true;
        }

        StringBuffer strBuff = new StringBuffer();
        final Component component = getComponent();

        strBuff.append(component.getDefaultFolder()).append("/").append(component.getName()).append(".").append(
            component.getFileExtension());

        if (logger.isDebugEnabled()) {
            logger.debug("Ensure remote uniqueness for '" + strBuff.toString() + "'");
        }

        component.setFilePath(strBuff.toString());

        return checkIfComponentExistsOnServer(monitor, component);
    }
View Full Code Here

            @Override
            public void widgetSelected(SelectionEvent event) {
                final TreeItem treeItem = (TreeItem)event.item;
                if (treeItem.getData("local") == null || !(treeItem.getData("local") instanceof Component)) { return; }

                final Component localComponent = (Component)treeItem.getData("local");
                final Component remoteComponent = (Component)treeItem.getData("remote");
                final CompareConfiguration componentCompareConfiguration = new CompareConfiguration();
                componentCompareConfiguration.setLeftEditable(false);
                componentCompareConfiguration.setRightEditable(false);
                componentCompareConfiguration.setLeftLabel(UpgradeMessages
                        .getString("UpgradeWizard.Compare.LocalFile.title"));
View Full Code Here

            displayErrorMarker(failure);
        }
    }

    void displayErrorMarker(DeployMessage failure) {
        Component cmp = list.getComponentById(failure.getId());
        if (cmp != null) {
            MarkerUtils markerUtils = getMarkerUtils();
            if (failure.getLineNumber() > 0) { // Has line number
                if (failure.getColumnNumber() > 1) { // Has column number
                    markerUtils.applyCompileErrorMarker(cmp.getFileResource(), failure.getLineNumber(),
                        failure.getColumnNumber(), failure.getColumnNumber() + 1, failure.getProblem());
                } else {
                    markerUtils.applyCompileErrorMarker(cmp.getFileResource(), failure.getLineNumber(), 1, 1,
                        failure.getProblem());
                }
            } else {
                markerUtils.applyCompileErrorMarker(cmp.getFileResource(), failure.getProblem());
            }
        }
    }
View Full Code Here

        if (Utils.isEmpty(folderName)) {
            logger.error("Folder name is null");
            throw new IllegalArgumentException("Folder name cannot be null");
        }

        Component component = getComponentByFolderName(folderName);
        if (component == null) {
            logger.warn("Unable to determine object type for folder '" + folderName + "'");
            return null;
        }

        return component.getComponentType();
    }
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

        if (Utils.isEmpty(componentTypes)) {
            return null;
        }

        List<String> folderNames = new ArrayList<String>();
        Component component = null;
        for (String componentType : componentTypes) {
            component = getComponentFactory().getComponentByComponentType(componentType);
            if (component != null) {
                folderNames.add(component.getDefaultFolder());
            }
        }

        return folderNames;
    }
View Full Code Here

    public String getComponentFolderName(String componentType) throws FactoryException {
        if (Utils.isEmpty(componentType)) {
            return null;
        }

        Component component = getComponentFactory().getComponentByComponentType(componentType);
        if (component != null) {
            return component.getDefaultFolder();
        }

        return null;
    }
View Full Code Here

    public Component getComponentById(String id) {
        return getComponentById(id, null);
    }

    public Component getComponentById(String id, String componentType) {
        Component component = null;
        // if id is not found, get unknown type and set object type manually
        if (Utils.isEmpty(id)) {
            logger.warn("No id found for object type '" + componentType + "' - creating component from '"
                    + Constants.UNKNOWN_COMPONENT_TYPE + "' component");
            id = Constants.UNKNOWN_COMPONENT_TYPE;
            component = getComponentBean(id);
            if (Utils.isNotEmpty(componentType)) {
                component.setComponentType(componentType);
                component.setDisplayName(componentType);
            }
        } else {
            component = getComponentBean(id);
        }
        return component;
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.