Package org.eclipse.ui.views.properties

Examples of org.eclipse.ui.views.properties.IPropertyDescriptor


        Field(Object element) {
            this.element = element;
        }

        public boolean canEdit() {
            IPropertyDescriptor pd = (IPropertyDescriptor) element;
            Map.Entry me = (Entry) pd.getId();
            if (me.getKey().equals("jcr:primaryType")) {
                return columnId==ColumnId.VALUE;
            }
            return true;
        }
View Full Code Here


            }
            return true;
        }
       
        public Object getValue() {
            IPropertyDescriptor pd = (IPropertyDescriptor) element;
            JcrNode jcrNode = getNode();
            Map.Entry me = (Entry) pd.getId();
           
            switch(columnId) {
            case NAME: {
                return String.valueOf(me.getKey());
            }
View Full Code Here

            }
            }
        }
       
        public String getPropertyName() {
            IPropertyDescriptor pd = (IPropertyDescriptor) element;
            Map.Entry me = (Entry) pd.getId();
            return String.valueOf(me.getKey());
        }
View Full Code Here

            view.refreshContent();
        }

        public int getPropertyType() {
            IPropertyDescriptor pd = (IPropertyDescriptor) element;
            Map.Entry me = (Entry) pd.getId();
            String value = String.valueOf(me.getValue());
            return PropertyTypeSupport.propertyTypeOfString(value);
        }
View Full Code Here

          ISelection sel = viewer.getSelection();
          if (sel instanceof IStructuredSelection) {
              IStructuredSelection iss = (IStructuredSelection)sel;
              Object elem = iss.getFirstElement();
              if (elem instanceof IPropertyDescriptor) {
                  IPropertyDescriptor pd = (IPropertyDescriptor)elem;
                  JcrNode jcrnode = (JcrNode)viewer.getInput();
                  jcrnode.deleteProperty(pd.getDisplayName());
                  refreshContent();
              }
          }
      }
    };
View Full Code Here

                    for(int i=0;;i++) {
                        Object element = viewer.getElementAt(i);
                        if (element==null) {
                            break;
                        }
                        final IPropertyDescriptor pd = (IPropertyDescriptor) element;
                        Map.Entry<String,Object> me = (Entry<String, Object>) pd.getId();
                        String key = me.getKey();
                        if (lastEditedNewPropertyName.equals(key)) {
                            // set the selection to this one
                            final int column;
                            if (lastEditedColumnId==ColumnId.NAME) {
View Full Code Here

                NewRow newRow = (NewRow)element;
                int propertyType = newRow.getType();
                String type = PropertyType.nameFromValue(propertyType);
                cell.setText(type);
            } else if (element instanceof IPropertyDescriptor) {
                IPropertyDescriptor pd = (IPropertyDescriptor)element;
                JcrNode jcrNode = (JcrNode)viewer.getInput();
                Map.Entry me = (Entry) pd.getId();
                final String propertyName = String.valueOf(me.getKey());
                int propertyType = jcrNode.getPropertyType(propertyName);
                if (propertyType<=-1 || propertyType==PropertyType.UNDEFINED) {
                    cell.setText("");
                } else {
                    final JcrProperty property = jcrNode.getProperty(propertyName);
                    String type = PropertyType.nameFromValue(propertyType);
                    if (property!=null && property.isMultiple()) {
                        type = type + "[]";
                    }
                    cell.setText(type);
                }
            } else {
                cell.setText("");
            }
            return;
        } else if (index==2) {
            updateValue(cell);
            return;
        } else {
            final Object element = cell.getElement();
            if (element instanceof NewRow) {
                NewRow newRow = (NewRow)element;
                cell.setText("");
            } else if (element instanceof IPropertyDescriptor) {
                IPropertyDescriptor pd = (IPropertyDescriptor)element;
                JcrNode jcrNode = (JcrNode)viewer.getInput();
                Map.Entry me = (Entry) pd.getId();
                PropertyDefinition prd = jcrNode.getPropertyDefinition(String.valueOf(me.getKey()));
                if (index==3) {
                    // protected
                    if (prd!=null) {
                        cell.setText(String.valueOf(prd.isProtected()));
View Full Code Here

            return true;
        } else if (element instanceof IPropertyDescriptor){
            if (cell.getColumnIndex()>2 && cell.getColumnIndex()!=5) {
                return false;
            }
            IPropertyDescriptor pd = (IPropertyDescriptor)element;
            JcrNode jcrNode = (JcrNode)viewer.getInput();
            Map.Entry me = (Entry) pd.getId();
            if (me.getKey().equals("jcr:primaryType")) {
                return cell.getColumnIndex()==2;
            } else {
                return true;
            }
View Full Code Here

        final Object element = cell.getElement();
        if (element instanceof NewRow) {
            NewRow newRow = (NewRow)element;
            cell.setText(String.valueOf(newRow.getValue()));
        } else if (element instanceof IPropertyDescriptor) {
            IPropertyDescriptor pd = (IPropertyDescriptor)element;
            JcrNode jcrNode = (JcrNode)viewer.getInput();
//            jcrNode.getProperties().getPropertyValue(pd);
            Map.Entry me = (Entry) pd.getId();
            final String rawValue = String.valueOf(me.getValue());
            int index = rawValue.indexOf("}");
            if (index!=-1) {
                cell.setText(rawValue.substring(index+1));
            } else {
View Full Code Here

        final Object element = cell.getElement();
        if (element instanceof NewRow) {
            NewRow newRow = (NewRow)element;
            cell.setText(String.valueOf(newRow.getName()));
        } else if (element instanceof IPropertyDescriptor) {
            IPropertyDescriptor pd = (IPropertyDescriptor)element;
            cell.setText(pd.getDisplayName());
        } else {
            cell.setText(String.valueOf(element));
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.views.properties.IPropertyDescriptor

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.