Package com.volantis.mcs.eclipse.common

Examples of com.volantis.mcs.eclipse.common.PresentableItem


        PresentableItem[] items = new PresentableItem[elements.size()];
        for (int i = 0; i < elements.size(); i++) {
            String assetName = (String) elements.get(i);
            String resourceName = EclipseCommonMessages.getString(
                        "PolicyName." + assetName); //$NON-NLS-1$
            items[i] = new PresentableItem(assetName, resourceName);
        }
        assetTypeCombo = new ComboViewer(displayArea, SWT.READ_ONLY |
                SWT.DROP_DOWN, items);
        GridData comboData = new GridData(GridData.FILL_HORIZONTAL);
        assetTypeCombo.setLayoutData(comboData);
View Full Code Here


        PresentableItem[] items =
                (PresentableItem[]) COMPOSITION_TO_POLICY_TYPES.get(ptc);
        PresentableItem[] copiedItems = new PresentableItem[items.length];

        for (int i = 0; i < items.length; i++) {
            PresentableItem copy = new PresentableItem(items[i].realValue,
                    items[i].presentableValue);
            copiedItems[i] = copy;
        }

        return copiedItems;
View Full Code Here

        int count = 0;
        while (it.hasNext()) {
            String localizedName = (String) it.next();
            PolicyTypeComposition ptc = (PolicyTypeComposition)
                    LOCALIZED_COMPOSITIONS.get(localizedName);
            PresentableItem item = new PresentableItem(ptc, localizedName);
            items[count++] = item;
        }

        return items;
    }
View Full Code Here

    private void addPolicyTypeCombo() {
        createLabel(TYPE_LABEL);
        typeCombo = new ComboViewer(displayArea,
                                    SWT.READ_ONLY,
                                    new PresentableItem[] {
                                        new PresentableItem("", "")
                                    });

        typeCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        typeSelectionListener = new SelectionAdapter() {
            // javadoc inherited
View Full Code Here

        return result;
    }

    // javadoc inherited
    public PresentableItem[] getAttributePresentableItems(String attribute) {
        PresentableItem items [] = null;

        // First try the cache.
        if (presentableItemsMap != null) {
            items = (PresentableItem[]) presentableItemsMap.get(attribute);
        }

        if (items == null) {
            Object[] realValues = getAttributeValueSelection(attribute);

            if (realValues != null) {
                String[] presentableValues = null;

                presentableValues = createPresentableValues(
                        attribute, realValues);

                if (presentableValues != null) {
                    if (realValues.length != presentableValues.length) {
                        throw new IllegalStateException("Number of realValues " + //$NON-NLS-1$
                                "is " + realValues.length + //$NON-NLS-1$
                                ". Number of presentableValues is" + //$NON-NLS-1$
                                presentableValues.length + "."); //$NON-NLS-1$
                    }

                    items = new PresentableItem[realValues.length];
                    for (int i = 0; i < realValues.length; i++) {
                        items[i] = new PresentableItem(realValues[i],
                                presentableValues[i]);
                    }

                    if (presentableItemsMap == null) {
                        presentableItemsMap = new HashMap();
View Full Code Here

          for (int i = 0; i < elements.size(); i++) {
              String assetName = (String) elements.get(i);
              String resourceName =
                      EclipseCommonMessages.getString("PolicyName." +
                      assetName);
              items[i] = new PresentableItem(assetName, resourceName);
          }
         final ComboViewer comboViewer =
                new ComboViewer(getShell(), SWT.SIMPLE, items);
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
        comboViewer.setLayoutData(gridData);
View Full Code Here

TOP

Related Classes of com.volantis.mcs.eclipse.common.PresentableItem

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.