Examples of DeviceRepositoryAccessorManager


Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

                                try {
                                    boolean isAdminProject = file.getProject().
                                            hasNature(
                                                    DeviceEditorContext.MCS_ADMIN_NATURE_ID);

                                    DeviceRepositoryAccessorManager dram =
                                            new DeviceRepositoryAccessorManager(
                                                    file.getLocation().toOSString(),
                                                    transformerMetaFactory,
                                                    new DeviceODOMElementFactory(),
                                                    isAdminProject);

                                    // If the device repository to be edited is the project
                                    // device repository then give the dram to the
                                    // ProjectDeviceRepositoryProvider for this project so that it
                                    // can see updates immeadiately even before the first save.
                                    if (dram.getDeviceRepositoryName()
                                            .equals(MCSProjectNature.
                                                    getDeviceRepositoryName(
                                                    file.getProject()))) {
                                        ProjectDeviceRepositoryProvider
                                                .getSingleton().
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

        if (ok) {
            File orig = new File(archiveAccessor.getArchiveFileName());
            try {
                IOUtils.copyFiles(orig, new File(backupName));
                DeviceRepositoryAccessorManager dram =
                        new DeviceRepositoryAccessorManager(archiveAccessor,
                                new ODOMFactory());
                dram.writeRepository();
            } catch (IOException e) {
                EclipseCommonPlugin.handleError(ABPlugin.getDefault(), e);
            } catch (RepositoryException e) {
                EclipseCommonPlugin.handleError(ABPlugin.getDefault(), e);
            }
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

     * @param deviceName the name of the device
     */
    public void selectDevice(String deviceName) {
        DeviceEditorContext context =
                (DeviceEditorContext) getODOMEditorContext();
        DeviceRepositoryAccessorManager dram =
                context.getDeviceRepositoryAccessorManager();
        Element device = dram.getHierarchyDeviceElement(deviceName);
        List selection = new ArrayList();
        selection.add(device);
        setSelection(new ODOMElementSelection(selection));
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the Text field that displays the policies localized name
     */
    private void updateNameControl() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();
        // get the policies localized name
        String localizedName = dram.getLocalizedPolicyName(getPolicyName());
        // only update the control if required
        if (!localizedName.equals(nameField.getText())) {
            // remove the controls listener
            nameField.removeModifyListener(nameFieldListener);
            try {
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Set the properties localized name to the text that is in the nameField
     * control
     */
    private void updateNameProperty() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();
        // get the name of the policy that is being edited
        String policy = getPolicyName();
        // obtain the localized name from the control
        String localizedName = nameField.getText();
        if (!localizedName.equals(
                    dram.getLocalizedPolicyName(policy))) {
            ObservableProperties properties = dram.getProperties();
            // remove the listener that is registered
            properties.removePropertyChangeListener(propertyChangeListener);
            try {
                // update the properties
                dram.setLocalizedPolicyName(policy, localizedName);
            } finally {
                // re-register the property change listener
                properties.addPropertyChangeListener(propertyChangeListener);
            }

View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the helpTextArea control so that it displays the text as
     * specified in the devices properties file.
     */
    private void updateHelpControl() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();
        // get the policies localized name
        String helpText = dram.getPolicyDescription(getPolicyName());
        // only update the control if required
        if (!helpText.equals(helpTextArea.getText())) {
            // remove the controls listener
            helpTextArea.removeModifyListener(helpTextAreaListener);
            try {
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the policies description in the properties file to reflect
     * the value in the help text area.
     */
    private void updateHelpProperty() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();
        // get the name of the policy that is being edited
        String policy = getPolicyName();
        // obtain the help text in the control
        String helpText = helpTextArea.getText();
        if (!helpText.equals(
                    dram.getPolicyDescription(policy))) {
            ObservableProperties properties = dram.getProperties();
            // remove the listener that is registered
            properties.removePropertyChangeListener(propertyChangeListener);
            try {
                // update the properties
                dram.setPolicyDescription(policy, helpText);
            } finally {
                // re-register the property change listener
                properties.addPropertyChangeListener(propertyChangeListener);
            }

View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the composition label so that it displays the composition of
     * the currently selected policy definition.
     */
    private void updateCompositionLabel() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();

        Element typeElement = dram.getTypeDefinitionElement(getPolicyName());

        PolicyTypeComposition composition =
                    PolicyTypeComposition.getComposition(typeElement);
        String localizedComposition =
                    DevicesMessages.getLocalizedCompositionName(composition);
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the policy type combo to reflect the currently selected policy
     * definition elements type.
     */
    private void updatePolicyTypeCombo() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();

        Element typeElement = dram.getTypeDefinitionElement(getPolicyName());
        PolicyType type = PolicyType.getType(typeElement);
        if (!typeCombo.getValue().equals(type)) {
            typeCombo.removeSelectionListener(typeSelectionListener);
            try {
                // update the types in the compo
View Full Code Here

Examples of com.volantis.mcs.eclipse.core.DeviceRepositoryAccessorManager

    /**
     * Updates the selected policy definition so that it's type is
     * as specified in the type combo
     */
    private void updatePolicyTypeValue() {
        DeviceRepositoryAccessorManager dram =
                    context.getDeviceRepositoryAccessorManager();

        Element typeElement = dram.getTypeDefinitionElement(getPolicyName());

        PolicyTypeComposition composition =
                    PolicyTypeComposition.getComposition(typeElement);

        PolicyType policyType = (PolicyType) typeCombo.getValue();
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.