Package org.eclipse.ui.views.properties

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


          String name = PropertyDescriptors.getReadablePropertyName(descriptor);
          Function1 function = new Function1WithReturnType() {
            @Override
            public Object apply(Object object) {
              if (object instanceof IPropertySource) {
                IPropertySource property = (IPropertySource) object;
                return property.getPropertyValue(id);
              }
              return null;
            }

            @Override
View Full Code Here


    boolean usePropertySourceProviderIfItHasNicerRenderers = false;
    if (usePropertySourceProviderIfItHasNicerRenderers) {
      SortedMap<String, TableViewerColumn> headers = new TreeMap<String, TableViewerColumn>();
      for (Object object : list) {
        final IPropertySource propertySource = PropertySources.asPropertySource(object);
        IPropertyDescriptor[] descriptors = propertySource.getPropertyDescriptors();
        if (descriptors != null) {
          for (final IPropertyDescriptor descriptor : descriptors) {
            final Object id = descriptor.getId();
            String header = PropertyDescriptors.getReadablePropertyName(descriptor);
            TableViewerColumn col = headers.get(header);
            if (col == null) {
              col = createTableViewerColumn(header, bounds, column++);
              headers.put(header, col);

              IPropertySourceProvider propertySourceProvider = new IPropertySourceProvider() {
                @Override
                public IPropertySource getPropertySource(Object object) {
                  return PropertySources.asPropertySource(object);
                }

              };
              col.setLabelProvider(new PropertyColumnLabelProvider(propertySourceProvider, id));
            }
          }
        }
      }
    }
    else {
      SortedMap<String, Function1> headers = new TreeMap<String, Function1>();
      for (Object object : list) {
        final IPropertySource propertySource = PropertySources.asPropertySource(object);
        IPropertyDescriptor[] descriptors = propertySource.getPropertyDescriptors();
        if (descriptors != null) {
          for (final IPropertyDescriptor descriptor : descriptors) {
            final Object id = descriptor.getId();
            String name = PropertyDescriptors.getReadablePropertyName(descriptor);
            Function1 function = new Function1WithReturnType() {
              @Override
              public Object apply(Object object) {
                IPropertySource property = PropertySources.asPropertySource(object);
                if (property != null) {
                  return property.getPropertyValue(id);
                }
                return null;
              }

              @Override
View Full Code Here

  protected void appendAllProcessorSourceList(List<IPropertySource> list) {
    Node[] children = getChildren();
    for (Node node : children) {
      if (node instanceof ProcessorNode) {
        ProcessorNodeSupport processor = (ProcessorNodeSupport) node;
        IPropertySource source = processor.getPropertySource();
        if (source != null) {
          list.add(source);
        }
        processor.appendAllProcessorSourceList(list);
      }
View Full Code Here

    if (viewer != null) {
      List<?> propertySources = getPropertySources();
      List selected = new ArrayList();
      for (Object object : propertySources) {
        if (object instanceof IPropertySource) {
          IPropertySource source = (IPropertySource) object;
          Object value = source.getPropertyValue("id");
          if (value instanceof String
              && selectedIds.contains(value.toString())) {
            selected.add(object);
          }
        }
View Full Code Here

  public List<IPropertySource> getPropertySourceList() {
    List<IPropertySource> list = new ArrayList<IPropertySource>();
    List<Node> children = getChildrenList();
    for (Node node : children) {
      IPropertySource propertySource = null;
      if (node instanceof IPropertySourceProvider) {
        IPropertySourceProvider provider = (IPropertySourceProvider) node;
        propertySource = provider.getPropertySource(node);
        if (propertySource != null) {
          list.add(propertySource);
View Full Code Here

    if (viewer != null) {
      List<?> propertySources = getPropertySources();
      List selected = new ArrayList();
      for (Object object : propertySources) {
        if (object instanceof IPropertySource) {
          IPropertySource source = (IPropertySource) object;
          Object value = source.getPropertyValue("id");
          if (value instanceof String
              && selectedIds.contains(value.toString())) {
            selected.add(object);
          }
        }
View Full Code Here

    if (viewer != null) {
      List<?> propertySources = getPropertySources();
      List selected = new ArrayList();
      for (Object object : propertySources) {
        if (object instanceof IPropertySource) {
          IPropertySource source = (IPropertySource) object;
          Object value = source.getPropertyValue("id");
          if (value instanceof String
              && selectedIds.contains(value.toString())) {
            selected.add(object);
          }
        }
View Full Code Here

  @Override
  public void update(ViewerCell cell) {
    Object element = cell.getElement();
    if (element instanceof IPropertySource) {
      IPropertySource bean = (IPropertySource) element;
      String status = null;
      Object value = bean.getPropertyValue("State");
      if (value != null) {
        status = value.toString();
      }
      String image = null;
      if (status != null) {
View Full Code Here

    if (viewer != null) {
      List<?> propertySources = getPropertySources();
      List selected = new ArrayList();
      for (Object object : propertySources) {
        if (object instanceof IPropertySource) {
          IPropertySource source = (IPropertySource) object;
          Object value = source.getPropertyValue("id");
          if (value instanceof String && selectedIds.contains(value.toString())) {
            selected.add(object);
          }
        }
      }
View Full Code Here

        return super.createDialogArea(parent);
    }

    private void addElementProperties(Composite composite) {
        IPropertySource ps = (IPropertySource)node.getAdapter(IPropertySource.class);
        if (ps == null) {
            return;
        }
        IPropertyDescriptor[] desc = ps.getPropertyDescriptors();
        for (int i = 0; i < desc.length; i++) {
            if (desc[i] instanceof TextPropertyDescriptor) {
                TextPropertyDescriptor oneDesc = (TextPropertyDescriptor)desc[i];
                new Label(composite, SWT.NONE).
                        setText(MessageFormat.format(Messages.getString("guvnor.resource.property"), //$NON-NLS-1$
                                new Object[] { oneDesc.getDisplayName() }));
                String val = ps.getPropertyValue(oneDesc.getId()) != null?
                                (String)ps.getPropertyValue(oneDesc.getId()):""; //$NON-NLS-1$
                new Label(composite, SWT.NONE).setText(val);
            }
        }
    }
View Full Code Here

TOP

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

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.