Examples of ODOMElement


Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

    }

    // javadoc inherited
    public ODOMElement resolve(ODOMElement element) throws XPathException {
        // If we don't find a match then the default return is set to a NON-ROW
        ODOMElement resolved = NON_ROW;
        final Element parent = element.getParent();
        if (parent != null &&
                parentMatchList.contains(parent.getName())) {
            resolved = (ODOMElement) parent;
        }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

    public PrimaryPatternsSection(Composite parent,
                                  int style,
                                  DeviceEditorContext context) {
        super(parent, style);
        this.context = context;
        ODOMElement identificationRootElement =
                (ODOMElement) context.getDeviceRepositoryAccessorManager().
                getDeviceIdentificationDocument().getRootElement();

        try {
            context.addRootElement(identificationRootElement,
                    identificationRootElement.getName());
            MarkerGeneratingErrorReporter errorReporter =
                    context.getErrorReporter(identificationRootElement);

            LocationDetailsRegistry registry =
                    errorReporter.getLocationDetailsRegistry();
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

     */
    public boolean enable(ODOMActionDetails details) {
        boolean result = (details.getNumberOfElements() == 1);

        if (result) {
            ODOMElement element = details.getElement(0);

            result = (element.getParent() != null) &&
                (!element.getName().equals(
                    FormatType.EMPTY.getElementName()));
        }

        return result;
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

            String gridName = grandParent.getName();
            String colName = LayoutSchemaType.getGridColumnName(gridName);

            // Update the columns data first.
            List content = grandParent.getContent(ELEMENT_FILTER);
            ODOMElement colsElement = (ODOMElement) content.get(0);
            List colsContent = colsElement.getContent(ELEMENT_FILTER);
            for (int newCol = 0; newCol < numNewColumns; newCol++) {
                ODOMElement col =
                        (ODOMElement) FormatPrototype.factory.element(colName);
                colsContent.add(colPos + newCol, col);
            }

            // Add the new columns to each row.
            for (int row = 1; row <= rowCount; row++) {
                // Find each row element and its content.
                ODOMElement rowElement =
                        (ODOMElement) content.get(row);
                List rowContent = rowElement.getContent(ELEMENT_FILTER);
                for (int col = 0; col < numNewColumns; col++) {
                    ODOMElement empty = FormatPrototype.get(FormatType.EMPTY);
                    selectedElements.add(empty);
                    rowContent.add(colPos + col, empty);
                }
            }
        }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

                            // the context menu content
                            deviceLayoutSelection = DeviceLayoutSelection.NONE;

                            for (Iterator i = selection.iterator();
                                 i.hasNext();) {
                                final ODOMElement deviceLayout =
                                    (ODOMElement) i.next();

                                if (deviceLayout.getName().equals(
                                        LayoutSchemaType.CANVAS_LAYOUT.
                                        getName())) {
                                    if (deviceLayoutSelection ==
                                            DeviceLayoutSelection.NONE) {
                                        deviceLayoutSelection =
                                                DeviceLayoutSelection.CANVAS;
                                    } else if (deviceLayoutSelection !=
                                            DeviceLayoutSelection.CANVAS) {
                                        deviceLayoutSelection =
                                                DeviceLayoutSelection.MIXED;
                                    }
                                } else if (deviceLayout.getName().equals(
                                        LayoutSchemaType.MONTAGE_LAYOUT.
                                        getName())) {
                                    if (deviceLayoutSelection ==
                                            DeviceLayoutSelection.NONE) {
                                        deviceLayoutSelection =
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

     * the root FormatComposite as its only child.
     */
    private void
            initializeRootFormatComposite(final ODOMElement deviceLayout,
                                          final ScrolledComposite deviceLayoutComposite) {
        ODOMElement rootFormat = (ODOMElement) deviceLayout.getChildren().get(0);

        // Build a new FormatComposite for the given layout.
        final FormatComposite formatComposite = builder.build(deviceLayoutComposite,
                rootFormat, null);

View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

     * Initiates the actual graphical column deletion.
     * @param event the ODOM change event associated with the last cell
     *              removed from the column.
     */
    private void doColumnDeletion(ODOMChangeEvent event) {
        ODOMElement source = (ODOMElement) event.getSource();
        // Find the FC associated with the source's element. This is needed
        // to determine which column was removed.
        FormatComposite childFC = gridModifier.getChildFCForElement(source);
        int[] columnsToDelete = new int[]{childFC.getColumn()};
        gridModifier.deleteColumns(columnsToDelete);
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

     */
    public boolean enable(ODOMActionDetails details) {
        boolean result = (details.getNumberOfElements() == 1);

        if (result) {
            ODOMElement element = details.getElement(0);

            // Ignore any elements that don't have a grand parent, since these
            // must be the root element or immediate root element children
            // which are the layout and the device layouts, which can't be
            // wrapped
            result =
                (element.getParent() != null) &&
                (element.getParent().getParent() != null) &&
                !element.getName().equals(
                    FormatType.EMPTY.getElementName());
        }

        return result;
    }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

                    "containing ODOMObservable attributes when the " + //$NON-NLS-1$
                    "ODOMObservable is a: " + //$NON-NLS-1$
                    oo.getClass().getName());
        }

        ODOMElement element = (ODOMElement) oo;
        String elementName = null;
        if (config == ODOMLabelProviderConfiguration.ELEMENT_AND_ATTRIBUTES &&
                !element.getName().equals(ODOMElement.UNDEFINED_ELEMENT_NAME)) {
            elementName = EclipseCommonMessages.
                    getLocalizedPolicyName(oo.getName());
        }

        Element parent = element.getParent();
        if (parent == null) {
            // We already have the root element that we need for the
            // message key.
            parent = element;
        }

        String unformattedSummary =
                (String) unformattedSummaries.get(element.getName());

        if (unformattedSummary == null) {
            if (labelFormatProvider != null) {
                unformattedSummary =
                        labelFormatProvider.provideLabelFormat(element);

            }

            // If the unfomattedSummary is still null then use the default.
            if (unformattedSummary == null) {
                unformattedSummary = EditorMessages.getString(RESOURCE_PREFIX +
                        parent.getName() + ".summary"); //$NON-NLS-1$
            }
            if (unformattedSummary == null) {
                throw new
                        IllegalStateException("Could not find unformatted summary."); //$NON-NLS-1$
            } else {
                unformattedSummaries.put(element.getName(), unformattedSummary);
            }
        }

        List attributes = element.getAttributes();
        if (logger.isDebugEnabled()) {
            logger.debug("Element was: " + oo.getName()); //$NON-NLS-1$
            logger.debug("Element attributes were: " + attributes); //$NON-NLS-1$
        }
View Full Code Here

Examples of com.volantis.mcs.eclipse.common.odom.ODOMElement

                // Iterate over any nodes selected by the XPath
                for (Iterator i = nodes.iterator(); i.hasNext(); /**/) {
                    Object current = i.next();

                    if (current instanceof ODOMElement) {
                        ODOMElement element = (ODOMElement) current;
                        Attribute name = element.getAttribute(
                                DeviceRepositorySchemaConstants.
                                DEVICE_NAME_ATTRIBUTE);
                        String value = name.getValue();

                        // Check the device name against the regular expression
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.