Examples of IAttribute


Examples of com.dtrules.automapping.access.IAttribute

      try {
      MapType       mapType   = MapType.get(subtype);
      MapNodeObject parent    = (MapNodeObject) getParent();
      Label         labelObj  = parent.getSourceLabel();
     
      IAttribute a = labelObj.getAttribute(listname);
   
      if(a == null){
          a = JavaAttribute.newAttribute(
              labelObj,
              listname,
              null,
              null,
              Class.forName(subtype),
              MapType.get("list"),
              "list",
              mapType,
              subtype
              );
         
          labelObj.getAttributes().add(a);
      }
     
      MapNodeList mnl = new MapNodeList(a, parent);
     
      if(mapType.isPrimitive()){
          mnl.setSubType(a.getSubTypeText());
          mnl.setList((List<Object>)list);
      }else {
          mnl.setSubType(a.getSubTypeText());
          mnl.setList((List<Object>)list);
          if( list!=null ) for(Object obj2 : ((List)list)){
              loadObjects(mnl, currentGroup,(String) null, obj2);
          }
      }
View Full Code Here

Examples of fr.esrf.tangoatk.core.IAttribute

                else
                    return false;
            }
        });
       
        IAttribute tmpIAttribute = null;
        int tmpInvalidAttribute = 0;
        Enumeration<IAttribute> tmpEnumeration = aattributeList.elements();
        while (tmpEnumeration.hasMoreElements())
        {
            tmpIAttribute = (IAttribute) tmpEnumeration.nextElement();
            for (int i = 0; i < attributeNameList.length; i++)
            {
                if(tmpIAttribute.getName().equalsIgnoreCase(attributeNameList[i].trim()))
                {
                    tmpAttributePolledList.add(tmpIAttribute);  
                    if(!(tmpIAttribute instanceof INumberScalar)
                      && !(tmpIAttribute instanceof IStringScalar)
                      && !(tmpIAttribute instanceof IBooleanScalar))
                    {
                        tmpInvalidAttribute++;
                        if(displayErrorOnFormat)
                            ConnectionErrorDialog.showMessageDialog(this, null, "\n" + tmpIAttribute.getName() + "is not a scalar");
                    }                  
                    break;
                }
            }
        }
       
        if(tmpAttributePolledList.size() + tmpInvalidAttribute + m_attributeKOList.size() == attributeNameList.length)       
        {
            BindingTango.removeConnectionListener(this);
            boolean isPossValue = attributePossibleValueList.length == attributeNameList.length;
            Enumeration<IAttribute> enumeration = aattributeList.elements();
            while(enumeration.hasMoreElements() && isPossValue)
            {
                IAttribute attribute = (IAttribute)enumeration.nextElement();
                int tmpIndex = getIndex(attribute.getName());
                if(tmpIndex != -1)
                {
                    if(attribute instanceof INumberScalar || attribute instanceof IStringScalar)
                    {
                            if(isPossValue)
View Full Code Here

Examples of fr.soleil.salsa.persistence.converter.attributes.IAttribute

            String attribute = p.getAttribute("attribute");
            String fieldName = p.getAttribute("fieldName");
            String type = p.getAttribute("type");

            IProperty ip = null;
            IAttribute ia = null;

            if ("property".equals(nodeName)) {
                ip = new SimplePropertyConverter(fieldName, attribute);
            } else if ("simpleAttribute".equals(nodeName)) {
                ia = new SimpleAttributeConveter(fieldName, attribute);
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.IAttribute

                            {
                                // select the value
                                LdifAttrValLine line = ( LdifAttrValLine ) element;
                                for ( int a = 0; a < attributes.length; a++ )
                                {
                                    IAttribute attribute = attributes[a];
                                    if ( attribute.getDescription().equals( line.getUnfoldedAttributeDescription() ) )
                                    {
                                        IValue[] values = attribute.getValues();
                                        for ( int v = 0; v < values.length; v++ )
                                        {
                                            IValue value = values[v];
                                            if ( value.getStringValue().equals( line.getValueAsString() ) )
                                            {
                                                selectionList.add( value );
                                            }
                                        }
                                    }
                                }
                            }
                            else if ( element instanceof List )
                            {
                                // select attribute and all values
                                List list = ( List ) element;
                                if ( !list.isEmpty() && list.get( 0 ) instanceof LdifAttrValLine )
                                {
                                    LdifAttrValLine line = ( LdifAttrValLine ) list.get( 0 );
                                    for ( int a = 0; a < attributes.length; a++ )
                                    {
                                        IAttribute attribute = attributes[a];
                                        if ( attribute.getDescription().equals(
                                            line.getUnfoldedAttributeDescription() ) )
                                        {
                                            selectionList.add( attribute );
                                            selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                        }
                                    }
                                }
                            }
                            else if ( element instanceof LdifRecord )
                            {
                                for ( int a = 0; a < attributes.length; a++ )
                                {
                                    IAttribute attribute = attributes[a];
                                    selectionList.add( attribute );
                                    selectionList.addAll( Arrays.asList( attribute.getValues() ) );
                                }
                            }
                        }

                        IStructuredSelection selection = new StructuredSelection( selectionList );
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

                        entry =  entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
                    else if ( obj instanceof IAttribute )
                    {
                        IAttribute attribute = ( IAttribute ) obj;
                        IEntry entry = attribute.getEntry();
                        // The entry may be a clone, lookup original entry from entry cache.
                        // The result may be null, in that case the selection won't change.
                        entry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

     */
    public boolean select( Viewer viewer, Object parentElement, Object element )
    {
        if ( element instanceof IAttribute )
        {
            IAttribute attribute = ( IAttribute ) element;

            // check if one of the values goes through the quick filter
            boolean oneGoesThrough = false;
            IValue[] values = attribute.getValues();
            for ( int i = 0; i < values.length; i++ )
            {
                if ( goesThroughQuickFilter( values[i] ) )
                {
                    oneGoesThrough = true;
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

                    return ""; //$NON-NLS-1$
            }
        }
        else if ( obj != null && obj instanceof IAttribute )
        {
            IAttribute attribute = ( IAttribute ) obj;
            if ( index == EntryEditorWidgetTableMetadata.KEY_COLUMN_INDEX )
            {
                return NLS
                    .bind(
                        Messages.getString( "EntryEditorWidgetLabelProvider.AttributeLabel" ), attribute.getDescription(), attribute.getValueSize() ); //$NON-NLS-1$
            }
            else
            {
                return ""; //$NON-NLS-1$
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

    /**
     * {@inheritDoc}
     */
    public Font getFont( Object element )
    {
        IAttribute attribute = null;
        IValue value = null;
        if ( element instanceof IAttribute )
        {
            attribute = ( IAttribute ) element;
        }
        else if ( element instanceof IValue )
        {
            value = ( IValue ) element;
            attribute = value.getAttribute();
        }

        // inconsistent attributes and values
        if ( value != null )
        {
            if ( value.isEmpty() )
            {
                FontData[] fontData = Display.getDefault().getSystemFont().getFontData();
                FontData fontDataBoldItalic = new FontData( fontData[0].getName(), fontData[0].getHeight(), SWT.BOLD
                    | SWT.ITALIC );
                return BrowserCommonActivator.getDefault().getFont( new FontData[]
                    { fontDataBoldItalic } );
            }
        }
        if ( attribute != null && value == null )
        {
            if ( !attribute.isConsistent() )
            {
                FontData[] fontData = Display.getDefault().getSystemFont().getFontData();
                FontData fontDataBoldItalic = new FontData( fontData[0].getName(), fontData[0].getHeight(), SWT.BOLD
                    | SWT.ITALIC );
                return BrowserCommonActivator.getDefault().getFont( new FontData[]
                    { fontDataBoldItalic } );
            }
        }

        // attribute type
        if ( attribute != null )
        {
            if ( attribute.isObjectClassAttribute() )
            {
                FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                    .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OBJECTCLASS_FONT );
                return BrowserCommonActivator.getDefault().getFont( fontData );
            }
            else if ( attribute.isMustAttribute() )
            {
                FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                    .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_MUSTATTRIBUTE_FONT );
                return BrowserCommonActivator.getDefault().getFont( fontData );
            }
            else if ( attribute.isOperationalAttribute() )
            {
                FontData[] fontData = PreferenceConverter.getFontDataArray( BrowserCommonActivator.getDefault()
                    .getPreferenceStore(), BrowserCommonConstants.PREFERENCE_OPERATIONALATTRIBUTE_FONT );
                return BrowserCommonActivator.getDefault().getFont( fontData );
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

    /**
     * {@inheritDoc}
     */
    public Color getForeground( Object element )
    {
        IAttribute attribute = null;
        IValue value = null;
        if ( element instanceof IAttribute )
        {
            attribute = ( IAttribute ) element;
        }
        else if ( element instanceof IValue )
        {
            value = ( IValue ) element;
            attribute = value.getAttribute();
        }

        // inconsistent attributes and values
        if ( value != null )
        {
            if ( value.isEmpty() )
            {
                return BrowserCommonActivator.getDefault().getColor(
                    Display.getDefault().getSystemColor( SWT.COLOR_RED ).getRGB() );
            }
        }
        if ( attribute != null && value == null )
        {
            if ( !attribute.isConsistent() )
            {
                return BrowserCommonActivator.getDefault().getColor(
                    Display.getDefault().getSystemColor( SWT.COLOR_RED ).getRGB() );
            }
        }

        // attribute type
        if ( attribute != null )
        {
            if ( attribute.isObjectClassAttribute() )
            {
                RGB rgb = PreferenceConverter.getColor( BrowserCommonActivator.getDefault().getPreferenceStore(),
                    BrowserCommonConstants.PREFERENCE_OBJECTCLASS_COLOR );
                return BrowserCommonActivator.getDefault().getColor( rgb );
            }
            else if ( attribute.isMustAttribute() )
            {
                RGB rgb = PreferenceConverter.getColor( BrowserCommonActivator.getDefault().getPreferenceStore(),
                    BrowserCommonConstants.PREFERENCE_MUSTATTRIBUTE_COLOR );
                return BrowserCommonActivator.getDefault().getColor( rgb );
            }
            else if ( attribute.isOperationalAttribute() )
            {
                RGB rgb = PreferenceConverter.getColor( BrowserCommonActivator.getDefault().getPreferenceStore(),
                    BrowserCommonConstants.PREFERENCE_OPERATIONALATTRIBUTE_COLOR );
                return BrowserCommonActivator.getDefault().getColor( rgb );
            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.IAttribute

     */
    public Object[] getChildren( Object parentElement )
    {
        if ( parentElement instanceof IAttribute )
        {
            IAttribute attribute = ( IAttribute ) parentElement;
            IValue[] values = attribute.getValues();
            return values;
        }
        return null;
    }
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.