Package com.volantis.mcs.interaction

Examples of com.volantis.mcs.interaction.Proxy


     */
    private void refreshRuleTable() {
        if (ruleTable.getInput() == null) {
            BaseProxy contentBase = (BaseProxy) context.getSelectedVariant().
                    getPropertyProxy(PolicyModel.CONTENT);
            Proxy concreteContent = contentBase.getConcreteProxy();
            if (concreteContent != null) {
                BeanProxy themeContent = (BeanProxy) concreteContent;
                BeanProxy styleSheet = (BeanProxy) themeContent.
                        getPropertyProxy(ThemeModel.STYLE_SHEET);
                Proxy rules = styleSheet.getPropertyProxy(ThemeModel.RULES);
                ruleTable.setInput(rules);
                rules.addListener(tableRefresher, true);
                rules.addDiagnosticListener(tableRefresher);
            }
        }
        ruleTable.refresh();
    }
View Full Code Here


     */
    public void updateFromProxy(BeanProxy proxy) {
        Iterator properties = getSupportedPropertyIdentifiers().iterator();
        while (properties.hasNext()) {
            PropertyIdentifier property = (PropertyIdentifier) properties.next();
            Proxy propertyProxy = proxy.getPropertyProxy(property);
            Object propertyValue;
            if (propertyProxy == null) {
                propertyValue = null;
            } else {
                propertyValue = propertyProxy.getModelObject();
            }

            PropertyAccessor accessor = (PropertyAccessor) accessors.get(property);
            if (accessor != null) {
                accessor.setPropertyValue(propertyValue);
View Full Code Here

    // Javadoc inherited
    public void setPolicyBuilder(PolicyBuilder newBuilder) {
        // Get the previously selected variant builder so that we can attempt
        // to reselect it after the change.
        PolicyEditorContext context = (PolicyEditorContext) getContext();
        Proxy previousSelectedProxy = context.getSelectedVariant();
        VariantBuilder previouslySelectedBuilder =
                previousSelectedProxy == null ?
                null : (VariantBuilder) previousSelectedProxy.getModelObject();

        Proxy policyProxy = getContext().getInteractionModel();
        policyProxy.setReadWriteState(ReadWriteState.READ_WRITE);
        // Because the merge process may have modified the existing model
        // directly before calling this method, we must force the proxy's
        // structure to be updated to ensure new variants are added and
        // appropriate change events are fired.
        policyProxy.setModelObject(newBuilder, true);
        try {
            context.getPolicyFileAccessor().updatePolicyProxyState(
                    policyProxy, context.getProject());
        } catch (PolicyFileAccessException pfae) {
            EclipseCommonPlugin.logError(BuilderPlugin.getDefault(),
View Full Code Here

        checkProjectNature(iEditorSite, iEditorInput);

        super.init(iEditorSite, iEditorInput);

        final Proxy proxy = getContext().getInteractionModel();

        if (proxy != null) {
            proxy.addDiagnosticListener(
                new DiagnosticListener() {
                    public void diagnosticsChanged(DiagnosticEvent event) {
                        alertsActionsSection.updateErrorStatus();
                    }
                }
View Full Code Here

     */
    private void createDiagnosticToolTipper() {
        new DiagnosticsToolTipper(new TableItemContainer(viewer.getTable()),
                new DiagnosticsToolTipper.ItemMapper() {
                    public Proxy dataFromItem(Item item) {
                        Proxy proxy = null;
                        if (item instanceof TableItem) {
                            Object proxyObject = item.getData();
                            if (proxyObject instanceof Proxy &&
                                    ((Proxy) proxyObject).getModelObject()
                                    instanceof PropertyValue) {
View Full Code Here

    // Javadoc inherited
    public void init(IEditorSite iEditorSite, IEditorInput iEditorInput)
            throws PartInitException {
        super.init(iEditorSite, iEditorInput);

        final Proxy proxy = getContext().getInteractionModel();

        if (proxy != null) {
            proxy.addDiagnosticListener(
                new DiagnosticListener() {
                    public void diagnosticsChanged(DiagnosticEvent event) {
                        alertsActionsSection.updateErrorStatus();
                    }
                }
View Full Code Here

    // Javadoc inherited
    public void setPolicyBuilder(PolicyBuilder newBuilder) {
        // Get the previously selected variant builder so that we can attempt
        // to reselect it after the change.
        PolicyEditorContext context = (PolicyEditorContext) getContext();
        Proxy previousSelectedProxy = context.getSelectedVariant();
        VariantBuilder previouslySelectedBuilder =
                previousSelectedProxy == null ?
                null : (VariantBuilder) previousSelectedProxy.getModelObject();

        Proxy policyProxy = getContext().getInteractionModel();
        policyProxy.setReadWriteState(ReadWriteState.READ_WRITE);
        // Because the merge process may have modified the existing model
        // directly before calling this method, we must force the proxy's
        // structure to be updated to ensure new variants are added and
        // appropriate change events are fired.
        policyProxy.setModelObject(newBuilder, true);
        try {
            context.getPolicyFileAccessor().updatePolicyProxyState(
                    policyProxy, context.getProject());
        } catch (PolicyFileAccessException pfae) {
            EclipseCommonPlugin.logError(BuilderPlugin.getDefault(),
View Full Code Here

     * @param composite The properties composite containing the changed value
     * @param property The identifier for the property
     */
    private void stylePropertyChanged(PropertiesComposite composite, PropertyIdentifier property) {
        if (styleProperties != null) {
            Proxy valueProxy = styleProperties.getPropertyProxy(property);
            PropertyValue newPropertyValue = (PropertyValue)
                    composite.getProperty(property);
            PropertyValue oldPropertyValue = (PropertyValue)
                    valueProxy.getModelObject();
            // Only set the value if it has changed - prevents changes that
            // don't alter the value (such as adding irrelevant whitespace)
            // from being seen as modifications leading to exceptions when
            // carrying out the set operation.
            if ((newPropertyValue == null) ? oldPropertyValue != null :
                    !newPropertyValue.equals(oldPropertyValue)) {
                Operation operation = valueProxy.prepareSetModelObjectOperation(newPropertyValue);
                context.executeOperation(operation);
            }
        }
    }
View Full Code Here

        treeViewer.setContentProvider(contentProvider);

        new DiagnosticsToolTipper(new TableItemContainer(table),
                new DiagnosticsToolTipper.ItemMapper() {
                    public Proxy dataFromItem(Item item) {
                        Proxy proxy = null;
                        if (item instanceof TableItem) {
                            Object tableTreeItem = item.getData("TableTreeItemID");
                            if (tableTreeItem instanceof Item) {
                                Object proxyObject = ((Item) tableTreeItem).getData();
                                if (proxyObject instanceof Proxy && ((Proxy) proxyObject).getModelObject() instanceof PropertyValue) {
                                    proxy = (Proxy) proxyObject;
                                }
                            }
                        }
                        return proxy;
                    }
                });

        table.setLayout(tableLayout);
        property.addControlListener(columnResizeListener);
        tree.addTreeListener(treeExpansionListener);
        tableLayout.layout(table, true);

        treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                Proxy proxy = (Proxy) selection.getFirstElement();
                if (proxy != null && proxy.getModelObject() instanceof PropertyValue) {
                    editorContext.getThemeEditor().setFocus(proxy.getPathFromRoot());
                    // Another slightly nasty hack - we can't set the focus to
                    // the appropriate point in the other tab without losing
                    // focus in this view, so we pull it back after setting the
                    // focus on the relevant control
                    getControl().setFocus();
View Full Code Here

        }       
    };

    private void setInput(Proxy newInput) {
        if (treeViewer.getInput() != null) {
            Proxy input = (Proxy) treeViewer.getInput();
            input.removeListener(modelChangeListener);
            input.removeDiagnosticListener(modelChangeListener);
        }
        treeViewer.setInput(newInput);

        if (newInput != null && newInput.getModelObject() instanceof VariantBuilder) {
            newInput.addListener(modelChangeListener, true);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.interaction.Proxy

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.